ReshapeMatND() docs is wrong (Bug #3557)


Added by pei guo about 11 years ago. Updated almost 11 years ago.


Status:Done Start date:2014-02-17
Priority:Normal Due date:
Assignee:pei guo % Done:

100%

Category:documentation
Target version:2.4.9
Affected version:2.4.8 (latest release) Operating System:Windows
Difficulty:Easy HW Platform:x86
Pull request:

Description

Please see this:
[[http://docs.opencv.org/modules/core/doc/old_basic_structures.html#reshapematnd]]

the function is :
C: CvArr* cvReshapeMatND(const CvArr* arr, int sizeof_header, CvArr* header, int new_cn, int new_dims, int* new_sizes)
while the sample uses:
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);

Apparently the parameter sizeof_header is not given... Add a sizeof(IplImage) is OK...


Associated revisions

Revision 713aa5c5
Added by Vadim Pisarevsky about 10 years ago

Merge pull request #3557 from ilya-lavrenov:sse_add_weighted

History

Updated by Alexander Karsakov about 11 years ago

Hello pei guo.

For this function defined macro which in case sizeof_header is missed uses sizeof(*(header)).

#define cvReshapeND( arr, header, new_cn, new_dims, new_sizes ) cvReshapeMatND( (arr), sizeof(*(header)), (header), (new_cn), (new_dims), (new_sizes))

I think this is a slight inaccuracy in the documentation. Since our resources are limited please consider creating pull request which improves documentation for this function.

You can read more details on how to contribute to OpenCV here:
http://code.opencv.org/projects/opencv/wiki/How_to_contribute
Thanks

  • Status changed from New to Open
  • Assignee set to pei guo
  • Target version set to 2.4.9

Updated by Alexander Karsakov about 11 years ago

  • Category set to documentation

Updated by Steven Puttemans almost 11 years ago

Looking for pull requests to complete, seems this one was fixed and merged.
I will put it on done!

  • % Done changed from 0 to 100
  • Status changed from Open to Done

Also available in: Atom PDF