If the win_size value is greater than or equal to 16,
OpenCV Error: Assertion failed ((icvCalcOpticalFlowLK_8u32fR(uchar*)srcA->data.ptr,
(uchar*)srcB->data.ptr,srcA->step,cvGetMatSize(srcA),winSize,
velx->data.fl,very->data.fl,velx->step))>=0)incvCalcOpticalFlowLK,
file C:\builds\2_4_PackSlave-win32-vc12-shared\opencv\modules\legacy\src\optflowlk.cpp,
line 596
I get this kind of error.
Probably
C:\builds\2_4_PackSlave-win32-vc12hared\opencv\modules\legacy\src\optflowlk.cpp
It seems that the maximum window size value has been determined in line 596 of , so I should rewrite it, but I am sorry that I could not find the folder C:\builds
in the first place.
Please help me;;
I looked into various things and solved it.
Apparently, it would be better to use PyrLK to calculate the sparse optical flow.
Thank you for your reply.
If you look at the optflowlk.cpp:icvCalcOpticalFlowLK_8u32fR() in question, you will see:
static CvStatus CV_STDCALL
icvCalcOpticalFlowLK_8u32fR(uchar*imgA,
uchar*imgB,
int imgStep,
CvSize imgSize,
CvSize winSize,
float*velocityX,
float*velocityY, intvelStep)
:
int winWidth = winSize.width;
int winHeight=winSize.height;
:
if(imageHeight<winHeight)
return CV_BADSIZE_ERR;
if(imageWidth<winWidth)
return CV_BADSIZE_ERR;
if(winHeight>=16)
return CV_BADSIZE_ERR;
if(winWidth>=16)
return CV_BADSIZE_ERR;
if(!(winHeight & 1))
return CV_BADSIZE_ERR;
if(!(winWidth & 1))
return CV_BADSIZE_ERR;
If there is a problem with the Window size, an error will be returned (assertion failed):
The reason why we limit the Window size to less than 16 pixcel (odd value of ) seems to be for some reason.If you change this limitation and rebuild OpenCV, it will only return meaningless results, even if it is not an error.
918 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
573 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
620 Uncaught (inpromise) Error on Electron: An object could not be cloned
613 GDB gets version error when attempting to debug with the Presense SDK (IDE)
© 2024 OneMinuteCode. All rights reserved.