Ask Your Question
1

is it possible to create frameless namedWindow

asked 2016-03-17 11:32:15 -0600

Katzenbernhard gravatar image

I am working on an embedded System with a Debian-based Linux, OpwnCV 3.0 at the Moment. The System has a 320x240 LC Display.

I want to show an OpenCV Mat fullscreen, without any border or title bar.

Is this possible with namedWindow ? or are there alternative ways to to show a cv::Mat ?

Best regards

Bernhard

edit retag flag offensive close merge delete

Comments

1

this is probably not doable from plain opencv (too many abstraction layers between you and the window creation) , but, what kind of gui are you using ? it probably needs diving deeper into that.

berak gravatar imageberak ( 2016-03-17 11:50:38 -0600 )edit

berak is right. namedWindow/imshow are basic functions, they are not intended to create a nice GUI.

To display images in fullscreen, I think the best way is to create an OpenGL (GLUT) wrapper; create a fullscreen window, a polygon which fills this window and use your image as texture.

Another solution would be to use Qt. Create a fullscreen window with a QGraphicsWidget of a QLabel, transform your Mat to QImage and display it.

kbarni gravatar imagekbarni ( 2016-03-17 17:06:37 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2016-03-18 17:53:18 -0600

namedWindow( "test", WINDOW_NORMAL );
setWindowProperty("test",WND_PROP_FULLSCREEN,WINDOW_FULLSCREEN);

i can't test it on Linux but it works pretty well on Windows.

you can test the code below on your system

#include "opencv2/highgui.hpp"

using namespace cv;

int main( int argc, char** argv )
{
  Mat image(200,200,CV_8UC3,Scalar(150,150,150));

  namedWindow( "background window", WINDOW_NORMAL );
  setWindowProperty("background window",WND_PROP_FULLSCREEN,WINDOW_FULLSCREEN);
  imshow( "background window", image ); // you will not see the title

  image.setTo(Scalar(0,0,200));
  imshow( "Second Window", image ); // this is normal window over background window
  waitKey(0);

  return 0;
}
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-03-17 11:32:15 -0600

Seen: 8,464 times

Last updated: Mar 18 '16