Error in Xobjdetect (Bug #4245)


Added by Jay Schamus almost 10 years ago. Updated over 9 years ago.


Status:New Start date:2015-03-18
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:contrib/xobjdetect
Target version:-
Affected version:branch 'master' (3.0-dev) Operating System:Any
Difficulty: HW Platform:Any
Pull request:

Description

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 something like:

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 ) <--- Add this
sum += (int)channel.at<float>(cell_row, cell_col);
}

if( col / 4 < acf_channel.cols && row / 4 < acf_channel.rows )     <---  Add this
acf_channel(row / 4, col / 4) = sum;

History

Updated by Ilya Lavrenov almost 10 years ago

Hi Jay,
Could you create a merge-request with proposed changes?

Updated by Vadim Pisarevsky almost 10 years ago

  • Category set to contrib/xobjdetect

Updated by Maksim Shabunin over 9 years ago

Issue has been transferred to GitHub: https://github.com/Itseez/opencv_contrib/issues/315

Also available in: Atom PDF