mirror of
https://github.com/opencv/opencv.git
synced 2025-07-30 17:37:05 +08:00
Merge pull request #12371 from alalek:issue_12366
This commit is contained in:
commit
fc71316690
@ -1123,7 +1123,6 @@ cvFindNextContour( CvContourScanner scanner )
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
_CvContourInfo *par_info = 0;
|
_CvContourInfo *par_info = 0;
|
||||||
_CvContourInfo *l_cinfo = 0;
|
|
||||||
CvSeq *seq = 0;
|
CvSeq *seq = 0;
|
||||||
int is_hole = 0;
|
int is_hole = 0;
|
||||||
CvPoint origin;
|
CvPoint origin;
|
||||||
@ -1215,6 +1214,7 @@ cvFindNextContour( CvContourScanner scanner )
|
|||||||
seq->flags |= is_hole ? CV_SEQ_FLAG_HOLE : 0;
|
seq->flags |= is_hole ? CV_SEQ_FLAG_HOLE : 0;
|
||||||
|
|
||||||
/* initialize header */
|
/* initialize header */
|
||||||
|
_CvContourInfo *l_cinfo = 0;
|
||||||
if( mode <= 1 )
|
if( mode <= 1 )
|
||||||
{
|
{
|
||||||
l_cinfo = &(scanner->cinfo_temp);
|
l_cinfo = &(scanner->cinfo_temp);
|
||||||
@ -1225,10 +1225,8 @@ cvFindNextContour( CvContourScanner scanner )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
union { _CvContourInfo* ci; CvSetElem* se; } v;
|
cvSetAdd(scanner->cinfo_set, 0, (CvSetElem**)&l_cinfo);
|
||||||
v.ci = l_cinfo;
|
CV_Assert(l_cinfo);
|
||||||
cvSetAdd( scanner->cinfo_set, 0, &v.se );
|
|
||||||
l_cinfo = v.ci;
|
|
||||||
int lval;
|
int lval;
|
||||||
|
|
||||||
if( img_i )
|
if( img_i )
|
||||||
@ -1298,16 +1296,16 @@ cvFindNextContour( CvContourScanner scanner )
|
|||||||
scanner->img = (schar *) img;
|
scanner->img = (schar *) img;
|
||||||
scanner->nbd = nbd;
|
scanner->nbd = nbd;
|
||||||
return l_cinfo->contour;
|
return l_cinfo->contour;
|
||||||
|
}
|
||||||
resume_scan:
|
resume_scan:
|
||||||
|
{
|
||||||
prev = p;
|
prev = p;
|
||||||
/* update lnbd */
|
/* update lnbd */
|
||||||
if( prev & -2 )
|
if( prev & -2 )
|
||||||
{
|
{
|
||||||
lnbd.x = x;
|
lnbd.x = x;
|
||||||
}
|
}
|
||||||
} /* end of prev != p */
|
}
|
||||||
} /* end of loop on x */
|
} /* end of loop on x */
|
||||||
|
|
||||||
lnbd.x = 0;
|
lnbd.x = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user