Ask Your Question
0

Best way to show many windows without overlap?

asked 2013-05-22 17:48:03 -0600

yes123 gravatar image

updated 2013-05-22 17:51:23 -0600

I have a list of image:

vector<string> images;
images.push_back("image0001.png"); 
//> And more

I want to read any of them and show them. The problem is that opencv overlap them when I do imshow("myname",image). I would avoid to have to manually move them.

I was trying something with moveWindow but with bad results. Is there any better function to order all opened windows?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2020-03-09 03:45:38 -0600

nirman longjam gravatar image

Although my answer is late, call moveWindow() after each imshow() call.

I am using Java SE8 with OpenCV 4.2. This method works for me. Screenshot of an example in action.

image description

@yes123 Here is a Java+OpenCV code snippet for the display part:

 ... 

//display image. Using OpenCV HighGui class methods.
String inputWindowName = "This window shows input image";
String outputWindowName = "This window shows output image";

HighGui displayWindow = new HighGui();

displayWindow.imshow(inputWindowName, img1);

displayWindow.imshow(outputWindowName, img2);
displayWindow.moveWindow(outputWindowName, img1.cols()+40, 0);

displayWindow.waitKey(7000);
displayWindow.waitKey(1);
edit flag offensive delete link more
0

answered 2013-05-22 21:02:20 -0600

mistycheney gravatar image

You need to create a new window for each image by doing namedWindow, then moveWindow. Does that not achieve what you want?

edit flag offensive delete link more

Comments

Could you post a real example ? Because I tried moveWindow but the position was not good

yes123 gravatar imageyes123 ( 2013-05-23 02:58:59 -0600 )edit

Question Tools

Stats

Asked: 2013-05-22 17:48:03 -0600

Seen: 1,322 times

Last updated: Mar 09 '20