Commit 59250e82 authored by Artur Wieczorek's avatar Artur Wieczorek

cv::findContours: Check if type of output data structure is right to store…

cv::findContours: Check if type of output data structure is right to store contours (vector<vector<Point>>).
parent d9316181
......@@ -1703,6 +1703,10 @@ cvFindContours( void* img, CvMemStorage* storage,
void cv::findContours( InputOutputArray _image, OutputArrayOfArrays _contours,
OutputArray _hierarchy, int mode, int method, Point offset )
{
// Sanity check: output must be of type vector<vector<Point>>
CV_Assert( _contours.kind() == _InputArray::STD_VECTOR_VECTOR &&
_contours.channels() == 2 && _contours.depth() == CV_32S );
Mat image = _image.getMat();
MemStorage storage(cvCreateMemStorage());
CvMat _cimage = image;
......
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