executing cv::resize on the same image fails (Bug #1098)


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


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

0%

Category:imgproc, video
Target version:-
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

Executing cv::resize on the same image fails, the resulting image contains nothing (something gray with the correct desired size).

Expected result should be one of the following:
- do it right.
- inform an error (at least in debug builds).

----------------------------------------------------------
Please use this test program:

#include <cv.h>
#include <highgui.h>
#include <iostream>

int main() {
const char *file_name = "baboon.jpg";

cv::Mat img = cv::imread(file_name);
if(!img.data)
std::cerr<<"can't open file \""<&lt;file_name<<"\""<&lt;std::endl;
else {
cvNamedWindow( "before", 1 );
cvShowImage( "before", &IplImage(img) );
cv::resize(img, img, cv::Size(), 0.5, 0.5);
cvNamedWindow( "after", 1 );
cvShowImage( "after", &IplImage(img) );
while(cvWaitKey(50)==-1);
cvDestroyAllWindows();
}
return 0;
}

----------------------------------------------------------
Regards,

Andres Hurtis
www.visiondepatentes.com.ar


Associated revisions

Revision 2b8d8685
Added by Andrey Pavlenko over 11 years ago

Merge pull request #1098 from SeninAndrew:ximea_camera_bw_fix

History

Updated by Vadim Pisarevsky almost 14 years ago

In SVN trunk cv::resize supports in-place operations (after migration from Mat to InputArray/OutputArray in the API calls)

  • Status changed from Open to Done
  • (deleted custom field) set to fixed

Also available in: Atom PDF