Forums > Jitter

Convert long to float32 matrix for precise math operations

March 23, 2013 | 11:47 am

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


March 23, 2013 | 11:50 am
– Pasted Max Patch, click to expand. –

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


March 23, 2013 | 12:18 pm

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. –

March 23, 2013 | 12:20 pm

thats so easy ;)


March 23, 2013 | 12:23 pm

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..


March 23, 2013 | 12:27 pm

matrixinfo just gives .. infos.

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


March 23, 2013 | 12:32 pm

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. –

March 23, 2013 | 12:34 pm

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


March 23, 2013 | 12:35 pm

omg!

anyway, check the parameter adapt in jit.matrix


March 23, 2013 | 12:35 pm

it is changing type also..


Viewing 10 posts - 1 through 10 (of 10 total)