Mat::Mat(const IplImage* img, bool copyData) with copyData=true doesn't work and never worked (Bug #777)
Description
Mat::Mat(const IplImage* img, bool copyData) with copyData=true doesn't work and never worked, as you can see in older versions. The code is very simple, so with just debugging it once you will find it.
Please use this test program:
-------------------------------------
#include <cv.h>
#include <highgui.h>
#include <iostream>
int main()
{
const char *file_name = "baboon.jpg";
IplImage *pimg = cvLoadImage(file_name, 1);
if(!pimg)
std::cerr<<"can't open file \""<<file_name<<"\""<<std::endl;
else
{
cv::Mat img = cv::Mat(pimg, true);
std::cout<<"cols="<<img.cols<<", rows="<<img.rows<<std::endl;
std::cout<<"width="<<img.size().width<<", height="<<img.size().height<<std::endl;
cvReleaseImage(&pimg);
}
return 0;
}
-------------------------------------
I tried it with 2.1, but as I can see in the 2.2 version the code is the same.
Regards,
Andres Hurtis
www.visiondepatentes.com.ar
Associated revisions
Merge pull request #777 from taka-no-me:ocl_win_hang
History
Updated by Vadim Pisarevsky about 14 years ago
thanks for the test sample! the code works perfectly with 2.2 on MacOSX. Please, try out 2.2. If the problem persists, please, reopen the ticket and provide more information about our configuration (OS, compiler)
- Status changed from Open to Done
- (deleted custom field) set to worksforme