Ask Your Question
0

Video On Label OpenCV Qt :: hide cvNamedWindows

asked 2012-10-05 12:22:33 -0600

hrey gravatar image

updated 2012-10-05 12:27:54 -0600

friends, how idea to hide or remove cvNamedWindow on openCV
i want to show video on label, but i must insert code cvNamedWindows and waitkey

but this will show windows "X"...

i want show only windows "T" not window "X" if i remove cvNamedWindow --> video on label at windows "T" not show..

thanks, sorry. i just little english

image description

edit retag flag offensive close merge delete

Comments

In the future, post the code itself, not an image of it.

karlphillip gravatar imagekarlphillip ( 2012-10-05 13:06:05 -0600 )edit

ok, sir sorry, i don't know thanks

hrey gravatar imagehrey ( 2012-10-05 13:22:48 -0600 )edit

2 answers

Sort by ยป oldest newest most voted
0

answered 2012-10-05 12:56:48 -0600

karlphillip gravatar image

updated 2012-10-05 13:02:26 -0600

It's simple: don't call cvNamedWindow(), cvShowImage() and cvDestroyWindow().

In other words, remove all those lines from your code, but leave the call to cvWaitKey(33). This function makes the loop sleep for 33ms before the next frame is retrieved.

edit flag offensive delete link more

Comments

sir, if i remova cvNamedWindow(), cvShowImage() and cvDestroyWindow().<br/> and then. leave the call to cvWaitKey(33) my program, not show video on label.. and program will stop and will normal if frame image finish.

please any solution for me

hrey gravatar imagehrey ( 2012-10-05 13:24:15 -0600 )edit
1

answered 2012-10-05 20:29:07 -0600

mmmmm...

I am not an expert GUI programmer, but I think that this is not the best way to get what you want. You are hanging forever on the callback Dialog::on_showVIDEO_clicked() which probably will leave your GUI unresponsive.

IMHO, you should move the contents of that callback to a thread, remove the calls to cvNamedWindow(), cvShowImage() and cvDestroyWindow() and change the call to cvWaitKey(33) for a usleep(33). Then inside Dialog::on_showVIDEO_clicked(), start/stop the thread as needed.

It might seem like a lot of work, but I think it is the way to go.

edit flag offensive delete link more

Comments

not work sir, i remove cvNamedWIndow, cvShow, cvDestroy and i used usleep(33) application still crash,

hrey gravatar imagehrey ( 2012-10-06 23:28:23 -0600 )edit

Question Tools

Stats

Asked: 2012-10-05 12:22:33 -0600

Seen: 2,534 times

Last updated: Oct 05 '12