cv::findContours: Check if type of output data structure is right to store contours (vector<vector<Point>>).

This commit is contained in:
Artur Wieczorek 2014-04-27 19:22:29 +02:00
parent d93161812b
commit 59250e8288

View File

@ -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;