Ask Your Question

Jay Schamus's profile - activity

2015-03-18 11:23:55 -0600 received badge  Nice Question (source)
2015-03-18 09:51:41 -0600 commented question Errors in Xobjdetect

I'm not registered in the DevZone, so someone will have to do that for me.

2015-03-18 08:42:50 -0600 received badge  Student (source)
2015-03-18 08:37:10 -0600 asked a question 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.

2015-02-24 11:07:24 -0600 asked a question Xobjdetect

I'm interested in using the contrib module Xobjdetect. The problem is that I'm not sure how to actually use it. Does anyone know of any example code using this? In particular, I'm interested in training and detection using ACF.