]> rtime.felk.cvut.cz Git - opencv.git/commitdiff
fixed other 2 bugs in documentation and cvReleaseMat()
authorvp153 <vp153@73c94f0f-984f-4a5f-82bc-2d8db8d8ee08>
Mon, 5 Apr 2010 17:51:44 +0000 (17:51 +0000)
committervp153 <vp153@73c94f0f-984f-4a5f-82bc-2d8db8d8ee08>
Mon, 5 Apr 2010 17:51:44 +0000 (17:51 +0000)
git-svn-id: https://code.ros.org/svn/opencv/trunk@2992 73c94f0f-984f-4a5f-82bc-2d8db8d8ee08

opencv/doc/cv_feature_detection.tex
opencv/src/cxcore/cxarray.cpp

index 4b72f981539c6416bae2847d62ba8ad54410a859..a6c9d6293a52ad1cab53e2fbc1bfe0f0d419d29d 100644 (file)
@@ -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<Vec3f> 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++ )
     {
index db21559843a4bd667caef7fa066da1c6f50ae5fd..7d0ef6762da12478c150ce3b4f63bce0abb83ecf 100644 (file)
@@ -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;