From 51cb6998ea1661b58a7ca267d6e0d6511ec63f6d Mon Sep 17 00:00:00 2001 From: yash Date: Mon, 24 Feb 2014 18:28:55 +0530 Subject: [PATCH] made the example consistent with the fuction definition and improved doc made the example consistent with the fuction definition and improved doc --- modules/core/doc/old_basic_structures.rst | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/core/doc/old_basic_structures.rst b/modules/core/doc/old_basic_structures.rst index c8de17adae..1d5880a624 100644 --- a/modules/core/doc/old_basic_structures.rst +++ b/modules/core/doc/old_basic_structures.rst @@ -1436,7 +1436,7 @@ description rewritten using IplImage* color_img = cvCreateImage(cvSize(320,240), IPL_DEPTH_8U, 3); IplImage gray_img_hdr, *gray_img; - gray_img = (IplImage*)cvReshapeND(color_img, &gray_img_hdr, 1, 0, 0); + gray_img = (IplImage*)cvReshapeMatND(color_img, sizeof(gray_img_hdr), &gray_img_hdr, 1, 0, 0); ... @@ -1444,6 +1444,18 @@ description rewritten using int size[] = { 2, 2, 2 }; CvMatND* mat = cvCreateMatND(3, size, CV_32F); CvMat row_header, *row; + row = (CvMat*)cvReshapeMatND(mat, sizeof(row_header), &row_header, 0, 1, 0); + +.. + +In C, the header file for this function includes a convenient macro ``cvReshapeND`` that does away with the ``sizeof_header`` parameter. So, the lines containing the call to ``cvReshapeMatND`` in the examples may be replaced as follow: + +:: + + gray_img = (IplImage*)cvReshapeND(color_img, &gray_img_hdr, 1, 0, 0); + + ... + row = (CvMat*)cvReshapeND(mat, &row_header, 0, 1, 0); ..