implementation algorithm

asked 2013-07-04 12:22:10 -0500

lty52 gravatar image

updated 2013-07-05 05:00:04 -0500

Dear all,

I have a question for cvFlip function in C. I implemented horizontal cvFlip function algorithm. But, the problem is that the speed is slower than using dll file from opencv. I just implemented same algorithm and did not use function call.

Could any one explain this? The implementation is

for( ii = 0; ii < ROIWidth3; ii++ ) for( kk = 0; kk < 2; kk++ ) 
tab[ii2 + kk] = (int)((ROIWidth3 - ii - 1)2 + kk);
for( ; ll < ROIHeight3; ll++, imageArray3+= ROIWidth32, imageArray3_1+= ROIWidth32) { 
for( ii = 0; ii < (int)(ROIWidth3 + 1); ii++ ) { jj = tab[ii]; temp3 = imageArray3[ii], temp31 = imageArray3[jj]; imageArray3_1[ii] = temp31; imageArray3_1[jj] = temp3; } }

imageArray3_1 -= ROIHeight3ROIWidth3; 
imageArray3 -= ROIHeight3ROIWidth3;

Sincerely, Taiyoon Lee

edit retag flag offensive close merge delete

Comments

3

Re-format and rephrase your question.

SR gravatar imageSR ( 2013-07-04 17:03:38 -0500 )edit

Could you please explain why you would code your own cvFlip function, if it is provided by OpenCV? All OpenCV functions are highly optimized for use with TBB and other parallel processing tools. This is probably the reason why you don't get the same performance.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-07-05 05:30:34 -0500 )edit