Convert long to float32 matrix for precise math operations

Mar 23, 2013 at 11:47am

Convert long to float32 matrix for precise math operations

Hi! How to convert any matrix to float32 when the dimensions are changing? For example output from cv.jit.blobs.bounds.
Thanks for any help

#67282
Mar 23, 2013 at 11:50am
– Pasted Max Patch, click to expand. –

for example treat this patch as a source of long matrix. how to convert it to float32?

#242089
Mar 23, 2013 at 12:18pm

why don’t you use float32 directly ?
anyway, you can push your matrix in another one to convert it implicitely.

– Pasted Max Patch, click to expand. –
#242090
Mar 23, 2013 at 12:20pm

thats so easy ;)

#242091
Mar 23, 2013 at 12:23pm

hey hey, i didnt see that, you pass the dim atribute. in my case the source of matrix is cv.jit.blobs.bounds and i am trying to found way to adapt float32 matrix without changing type and using matrixinfo for getting input dim..

#242092
Mar 23, 2013 at 12:27pm

matrixinfo just gives .. infos.

I don’t really understand what you are trying to do

#242093
Mar 23, 2013 at 12:32pm

i am getting the coordinates of blobs and would like to scale it from 0..320, 0..240 to -1..1, -1..1
something like this, but in more elegant way.

– Pasted Max Patch, click to expand. –
#242094
Mar 23, 2013 at 12:34pm

ok nevermind, cv.jit.blobs.centroids outputs flot32 :))

#242095
Mar 23, 2013 at 12:35pm

omg!

anyway, check the parameter adapt in jit.matrix

#242096
Mar 23, 2013 at 12:35pm

it is changing type also..

#242097

You must be logged in to reply to this topic.