Ask Your Question
0

resizeWindow do nothing

asked 2013-04-09 06:49:18 -0600

shani gravatar image

I tried some variations but it seem that resizeWindow don't do anything. I give simple code example,the result is that the 2 windows are in the same size , eventough it supposed to be in different sizes.

Mat m = imread("somePath",CV_LOAD_IMAGE_COLOR); 
namedWindow("aa",CV_WINDOW_NORMAL);
namedWindow("bb",CV_WINDOW_NORMAL);
imshow("aa",m);
imshow("bb",m);
resizeWindow("aa",100,100);
resizeWindow("bb",50,50);
waitKey(0);

I work with eclipse-cdt on ubunto 12.04 with opencv 2.4.3.

  • I tried to debug it,getting into the the function but I don't succeed to add highGui modoul as external source, i get compile error of some h file missing.
edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted
0

answered 2013-04-09 07:03:42 -0600

Is your image multiple of 50x50 ? otherwise I suggests using CV_WINDOW_FREERATIO, see the doc here, but it seems only working with the QT backend.

edit flag offensive delete link more

Comments

I can see a differnce between between with CV_WINDOW_FREERATIO and without but the 2 windows still in the same size.

shani gravatar imageshani ( 2013-04-14 03:19:26 -0600 )edit
0

answered 2014-03-19 23:06:51 -0600

mhtrinh gravatar image

updated 2014-03-19 23:07:37 -0600

I have the save problem with :

  • OpenCV git master (3.0.0-dev)
  • OpenSuse 12.3

I believe I have Qt backend. Here is my OpenCV build :

cmake -D CMAKE_BUILD_TYPE=RELEASE -D WITH_QT=ON -D WITH_OPENGL=ON -D CMAKE_INSTALL_PREFIX=/usr/local ../
[...]
--   GUI: 
--     QT 4.x:                      YES (ver 4.8.4 EDITION = OpenSource)
--     QT OpenGL support:           YES (/usr/lib64/libQtOpenGL.so)
--     OpenGL support:              YES (/usr/lib64/libGLU.so /usr/lib64/libGL.so /usr/lib64/libSM.so /usr/lib64/libICE.so /usr/lib64/libX11.so /usr/lib64/libXext.so)
--     VTK support:                 NO
[...]

My code :

namedWindow( "Normal", CV_WINDOW_NORMAL ); 
imshow( "Normal", image );               

namedWindow( "FreeRatio", CV_WINDOW_FREERATIO | CV_GUI_NORMAL); 
imshow( "FreeRatio", image );               
resizeWindow("FreeRatio",image.cols,image.rows);

The resizeWindow have no effect ! Both window have the same size. In the freeratio window, my image is deformed as the default window size ratio is different from my image (but it means that it does understand the Qt flag CV_WINDOW_FREERATIO)

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-04-09 06:49:18 -0600

Seen: 2,468 times

Last updated: Mar 19 '14