Ask Your Question

Revision history [back]

Beginner problem: window size from previous run

Hey everybody,

I just started to learn OpenCV and encountered the following problem.

1) I ran my code which loads and shows an image. 2) Then I manually changed the size of the window. 3) When I run my code again, the window will still have the distorted size.

This is the code that I use:

char* imgData; IplImage *img = cvLoadImage("jpgTest.jpg");

// show source image cvNamedWindow("Image",0); cvShowImage("Image",img);

cvWaitKey(); cvReleaseImage(&img); cvDestroyWindow("Image:");

I am very thankful to any help and explanation and also comments on how to improve the code. Thank you very much!

click to hide/show revision 2
use tags for numbered list and code

Beginner problem: window size from previous run

Hey everybody,

I just started to learn OpenCV and encountered the following problem.

1)

  1. I ran my code which loads and shows an image. 2) image.
  2. Then I manually changed the size of the window.
  3. 3)
  4. When I run my code again, the window will still have the distorted size.

This is the code that I use:

char* imgData;
IplImage *img = cvLoadImage("jpgTest.jpg"); 

// show source image cvNamedWindow("Image",0); cvShowImage("Image",img);

cvShowImage("Image",img);

cvWaitKey(); cvReleaseImage(&img); cvDestroyWindow("Image:");

cvDestroyWindow("Image:");

I am very thankful to any help and explanation and also comments on how to improve the code. Thank you very much!