cv::findContours image parameter not defined as const (Bug #853)


Added by Stephen McKeague about 14 years ago. Updated almost 13 years ago.


Status:Cancelled Start date:
Priority:Normal Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:imgproc, video
Target version:2.4.0
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

the first parameter of cv::findContours is meant to be
void findContours( const Mat& image, ...

however in version 2.2 image must be a non-const Mat, otherwise code won't compile


Associated revisions

Revision 389be676
Added by Roman Donchenko almost 12 years ago

Merge pull request #853 from icylord:2.4

History

Updated by Marina Kolpakova almost 13 years ago

In last versions of opencv this function's signature changed to

1void cv::findContours(InputOutputArray image, OutputArrayOfArrays contours, int mode, int method, Point offset=Point())

For more information please see in opencv official documentation cv::findContours

  • Status changed from Open to Cancelled
  • Target version set to 2.4.0

Updated by Ilya Lysenkov almost 13 years ago

So the image parameter is still non-const and the question remains. However, it is not a bug, it is a documented feature (see the documentation link). The function does modify image. It has been done for the sake of efficiency. If you want to call it on a const Mat then you should create a deep copy of your const Mat:

Mat imageCopy = image.clone();
findContours(imageCopy, ...);

Also available in: Atom PDF