cv::findContours image parameter not defined as const (Bug #853)
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
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, ...);