Ask Your Question

John vdK's profile - activity

2013-01-02 17:25:32 -0600 answered a question find max with sub accuracy

If I understand you well, you are trying to fit some arbitrary basis function to your data and want to find a (possibly local) maximum of that function.

A blunt and computationally expensive way of doing that is to select an environment of the maximum you are interested in, compute the 2D fourier transform, possibly remove some high frequencies from that to your taste, and transform back at higher resolution (scale your transform appropriately). Then, you can find the maximum of the regridded smoothed function, which may or may not have anything to do with your original data.

There are many choices of basis functions possible. Use a priori knowledge of the sampled data as much as you can to choose your basis.

2013-01-01 16:51:31 -0600 asked a question cv.Remap (dst.size() == mapx.size()) assertion question

Hello,

I am trying

============8<------------------

src = cv.CloneImage(R)
dst = cv.CloneImage(R)

print 'src', src, 'dest', dst, '\nmapx', map_x_32, 'mapy', map_y_32, 
cv.Remap(src, dst, map_x_32, map_y_32)

============8<------------------

and get

============8<------------------

error                                     Traceback (most recent call last)
<ipython-input-13-361117180010> in <module>()
     22 
     23 print 'src', src, 'dest', dst, '\nmapx', map_x_32, 'mapy', map_y_32,
---> 24 cv.Remap(src, dst, map_x_32, map_y_32)
     25 

error: src.type() == dst.type() && dst.size() == mapx.size()

 src <iplimage(nChannels=1 width=640 height=480 widthStep=640 )> dest <iplimage(nChannels=1 width=640 height=480 widthStep=640 )> 
mapxy <cvmat(type=42424005 32FC1 rows=640 cols=480 step=1920 )> mapa <cvmat(type=42424005 32FC1 rows=640 cols=480 step=1920 )>

============8<------------------

I do not understand what (dst.size() == mapx.size()) is testing (especially since the mapx object will be very different when using convertmaps output), or why the assertion should fail. Could somebody help me out?

Regards,

John.