Ask Your Question

Revision history [back]

problem related to cvCalcOpticalFlowBM can some1 help please?

Dear all, I am new to this opencv functions and I am now trying to calculate the motion shift between two frames. In my programe, I used the block matching opencv function as:

   cvCalcOpticalFlowBM(img1, img2, block, shift, maxRange, false, flowXBM,flowYBM);

During the implementation, I set the parameters to const int BlockSize = 16; const int ShiftSize = 3; maxRange.width= 3; maxRange.height= 3;

My first question is, can some one tell me how should I choose these parameter? As I made use of the block matching method before but I never came across this 'maxRange', so what is it used for?

My second question is, due to the output matrixs flowXBM and flowYBM are not as the same size as the input images, how can I reconstruct those two motion matrix which posses the same size as the input frame?

Thank you very much for the help!