From: vp153 Date: Mon, 5 Apr 2010 17:51:44 +0000 (+0000) Subject: fixed other 2 bugs in documentation and cvReleaseMat() X-Git-Url: https://rtime.felk.cvut.cz/gitweb/opencv.git/commitdiff_plain/10325737959a2ea4eb1d7f711381a5fd87a6aab4 fixed other 2 bugs in documentation and cvReleaseMat() git-svn-id: https://code.ros.org/svn/opencv/trunk@2992 73c94f0f-984f-4a5f-82bc-2d8db8d8ee08 --- diff --git a/opencv/doc/cv_feature_detection.tex b/opencv/doc/cv_feature_detection.tex index 4b72f981..a6c9d629 100644 --- a/opencv/doc/cv_feature_detection.tex +++ b/opencv/doc/cv_feature_detection.tex @@ -845,9 +845,9 @@ int main(int argc, char** argv) return -1; cvtColor(img, gray, CV_BGR2GRAY); // smooth it, otherwise a lot of false circles may be detected - GaussianBlur( gray, gray, 9, 9, 2, 2 ); + GaussianBlur( gray, gray, Size(9, 9), 2, 2 ); vector circles; - houghCircles(gray, circles, CV_HOUGH_GRADIENT, + HoughCircles(gray, circles, CV_HOUGH_GRADIENT, 2, gray->rows/4, 200, 100 ); for( size_t i = 0; i < circles.size(); i++ ) { diff --git a/opencv/src/cxcore/cxarray.cpp b/opencv/src/cxcore/cxarray.cpp index db215598..7d0ef676 100644 --- a/opencv/src/cxcore/cxarray.cpp +++ b/opencv/src/cxcore/cxarray.cpp @@ -175,6 +175,12 @@ cvInitMatHeader( CvMat* arr, int rows, int cols, } +#undef CV_IS_MAT_HDR_Z +#define CV_IS_MAT_HDR_Z(mat) \ + ((mat) != NULL && \ + (((const CvMat*)(mat))->type & CV_MAGIC_MASK) == CV_MAT_MAGIC_VAL && \ + ((const CvMat*)(mat))->cols >= 0 && ((const CvMat*)(mat))->rows >= 0) + // Deallocates the CvMat structure and underlying data CV_IMPL void cvReleaseMat( CvMat** array ) @@ -186,7 +192,7 @@ cvReleaseMat( CvMat** array ) { CvMat* arr = *array; - if( !CV_IS_MAT_HDR(arr) && !CV_IS_MATND_HDR(arr) ) + if( !CV_IS_MAT_HDR_Z(arr) && !CV_IS_MATND_HDR(arr) ) CV_Error( CV_StsBadFlag, "" ); *array = 0;