Commit 10cb9a0c authored by Roman Donchenko's avatar Roman Donchenko Committed by OpenCV Buildbot

Merge pull request #1342 from nevion:master

parents 1840fd5f affab4f1
...@@ -92,20 +92,10 @@ namespace cv{ ...@@ -92,20 +92,10 @@ namespace cv{
} }
void operator()(int r, int c, int l){ void operator()(int r, int c, int l){
int *row = &statsv.at<int>(l, 0); int *row = &statsv.at<int>(l, 0);
if(c > row[CC_STAT_WIDTH]){ row[CC_STAT_LEFT] = MIN(row[CC_STAT_LEFT], c);
row[CC_STAT_WIDTH] = c; row[CC_STAT_WIDTH] = MAX(row[CC_STAT_WIDTH], c);
}else{ row[CC_STAT_TOP] = MIN(row[CC_STAT_TOP], r);
if(c < row[CC_STAT_LEFT]){ row[CC_STAT_HEIGHT] = MAX(row[CC_STAT_HEIGHT], r);
row[CC_STAT_LEFT] = c;
}
}
if(r > row[CC_STAT_HEIGHT]){
row[CC_STAT_HEIGHT] = r;
}else{
if(r < row[CC_STAT_TOP]){
row[CC_STAT_TOP] = r;
}
}
row[CC_STAT_AREA]++; row[CC_STAT_AREA]++;
Point2ui64 &integral = integrals[l]; Point2ui64 &integral = integrals[l];
integral.x += c; integral.x += c;
...@@ -114,9 +104,7 @@ namespace cv{ ...@@ -114,9 +104,7 @@ namespace cv{
void finish(){ void finish(){
for(int l = 0; l < statsv.rows; ++l){ for(int l = 0; l < statsv.rows; ++l){
int *row = &statsv.at<int>(l, 0); int *row = &statsv.at<int>(l, 0);
row[CC_STAT_LEFT] = std::min(row[CC_STAT_LEFT], row[CC_STAT_WIDTH]);
row[CC_STAT_WIDTH] = row[CC_STAT_WIDTH] - row[CC_STAT_LEFT] + 1; row[CC_STAT_WIDTH] = row[CC_STAT_WIDTH] - row[CC_STAT_LEFT] + 1;
row[CC_STAT_TOP] = std::min(row[CC_STAT_TOP], row[CC_STAT_HEIGHT]);
row[CC_STAT_HEIGHT] = row[CC_STAT_HEIGHT] - row[CC_STAT_TOP] + 1; row[CC_STAT_HEIGHT] = row[CC_STAT_HEIGHT] - row[CC_STAT_TOP] + 1;
Point2ui64 &integral = integrals[l]; Point2ui64 &integral = integrals[l];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment