Errors in Xobjdetect
Just wanted to let people know that I've found a couple of errors in this contrib module.
1) In acffeature.cpp the function "void computeChannels(InputArray image, vector<mat>& channels)" has an error where it looks like they recently switched from using atan2() to cartToPolar(). The code as written handles angles from -180 to 180 degrees, but cartToPolar() outputs angles 0 to 360 degrees. The code needs to be changed to:
if( angle == 360 )
angle = 0;
else if( angle >= 180 )
angle -= 180;
2) Also in acffeature.cpp, the "void ACFFeatureEvaluatorImpl::setChannels(InputArrayOfArrays channels)" function will often overrun the right or bottom channel Mat. The code needs to be changed to:
for( int cell_row = row; cell_row < row + 4; ++cell_row )
for( int cell_col = col; cell_col < col + 4; ++cell_col )
{
if( cell_col < channel.cols && cell_row < channel.rows )
sum += (int)channel.at<float>(cell_row, cell_col);
}
if( col / 4 < acf_channel.cols && row / 4 < acf_channel.rows )
acf_channel(row / 4, col / 4) = sum;
After making these changes the code now seems to be stable.
Could you file the bugs and fixes here: http://code.opencv.org/projects/openc... ?
the 1st is a known issue: http://code.opencv.org/issues/4007#no...
I'm not registered in the DevZone, so someone will have to do that for me.
just sign on with any email.