From 6d282ddf720901ab128b934d683cf812fa31d17c Mon Sep 17 00:00:00 2001 From: Maksim Shabunin Date: Tue, 2 Dec 2014 15:15:10 +0300 Subject: [PATCH] Documentation: removed mention of Mat(IplImage*) constructor --- .../mat_the_basic_image_container.markdown | 6 ------ modules/core/include/opencv2/core/mat.hpp | 18 ++++++------------ 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/doc/tutorials/core/mat_the_basic_image_container/mat_the_basic_image_container.markdown b/doc/tutorials/core/mat_the_basic_image_container/mat_the_basic_image_container.markdown index e31d252781..c8de768fe9 100644 --- a/doc/tutorials/core/mat_the_basic_image_container/mat_the_basic_image_container.markdown +++ b/doc/tutorials/core/mat_the_basic_image_container/mat_the_basic_image_container.markdown @@ -180,12 +180,6 @@ object in multiple ways: dimension, then pass a pointer containing the size for each dimension and the rest remains the same. -- Create a header for an already existing IplImage pointer: - @code{.cpp} - IplImage* img = cvLoadImage("greatwave.png", 1); - Mat mtx(img); // convert IplImage* -> Mat - @endcode - - @ref cv::Mat::create function: @code M.create(4,4, CV_8UC(2)); diff --git a/modules/core/include/opencv2/core/mat.hpp b/modules/core/include/opencv2/core/mat.hpp index 2e4abf4030..7bddc0b358 100644 --- a/modules/core/include/opencv2/core/mat.hpp +++ b/modules/core/include/opencv2/core/mat.hpp @@ -634,18 +634,12 @@ sub-matrices. Mat M = Mat(3, 3, CV_64F, m).inv(); @endcode . -Partial yet very common cases of this *user-allocated data* case are conversions from CvMat and -IplImage to Mat. For this purpose, there are special constructors taking pointers to CvMat or -IplImage and the optional flag indicating whether to copy the data or not. Backward conversion from -Mat to CvMat or IplImage is provided via cast operators Mat::operator CvMat() const and -Mat::operator IplImage(). The operators do NOT copy the data. -@code - IplImage* img = cvLoadImage("greatwave.jpg", 1); - Mat mtx(img); // convert IplImage* -> Mat - CvMat oldmat = mtx; // convert Mat -> CvMat - CV_Assert(oldmat.cols == img->width && oldmat.rows == img->height && - oldmat.data.ptr == (uchar*)img->imageData && oldmat.step == img->widthStep); -@endcode + Partial yet very common cases of this *user-allocated data* case are conversions from CvMat and + IplImage to Mat. For this purpose, there is function cv::cvarrToMat taking pointers to CvMat or + IplImage and the optional flag indicating whether to copy the data or not. + @dontinclude samples/cpp/image.cpp + @skip Ptr iplimg + @until is converted, while the data is shared - Use MATLAB-style array initializers, zeros(), ones(), eye(), for example: @code -- GitLab