fixed floodfill with mask parameter when no mask is passed

This commit is contained in:
Vadim Pisarevsky 2011-07-28 14:10:17 +00:00
parent d2080a117e
commit 0c096b3dc2

View File

@ -1132,7 +1132,7 @@ int cv::floodFill( InputOutputArray _image, InputOutputArray _mask,
{
CvConnectedComp ccomp;
CvMat c_image = _image.getMat(), c_mask = _mask.getMat();
cvFloodFill(&c_image, seedPoint, newVal, loDiff, upDiff, &ccomp, flags, &c_mask);
cvFloodFill(&c_image, seedPoint, newVal, loDiff, upDiff, &ccomp, flags, c_mask.data.ptr ? &c_mask : 0);
if( rect )
*rect = ccomp.rect;
return cvRound(ccomp.area);