Mat::Mat(const IplImage* img, bool copyData) with copyData=true doesn't work and never worked (Bug #777)


Added by Andres Hurtis about 14 years ago. Updated about 14 years ago.


Status:Done Start date:
Priority:Low Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:core
Target version:-
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

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 \""<&lt;file_name<<"\""<&lt;std::endl;
else {
cv::Mat img = cv::Mat(pimg, true);
std::cout<<"cols="<&lt;img.cols<<", rows="<&lt;img.rows<&lt;std::endl;
std::cout<<"width="<&lt;img.size().width<<", height="<&lt;img.size().height<&lt;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

Revision 72e49dc7
Added by Andrey Kamaev almost 12 years ago

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

Also available in: Atom PDF