OpenCV: how to force the image window to appear on top of other windows?

后端 未结 7 1506
迷失自我
迷失自我 2020-12-10 12:09

Using cvShowImage, one can easily show an image in OpenCV. However, how do you tell OpenCV to show the window on top of every other window?

I run a ful

7条回答
  •  抹茶落季
    2020-12-10 12:43

    My solution for OSX was to modify my OpenCV code (version 2.4.8), specifically the file windows_cocoa.mm in the highgui/src directory.

    If you want to just bring the new window to the front without making it active, add the following line just before the end of the function cvNamedWindow() in windows_cocoa.mm:

    [window orderFrontRegardless];
    

    To force the new window to always be made active, add the following line instead:

    [application activateIgnoringOtherApps:YES];
    

    It's probably not the best idea for all windows but works in my situation. I got tired of always having to bring them to the front by clicking on them to make them active.

提交回复
热议问题