GUI to view values in image using OpenCV in ubuntu12.04

拈花ヽ惹草 提交于 2019-12-23 05:17:49

问题


Is it possible to simultaneously display an image and the pixel,coordinate values based on the mouse pointer positions?

I am asking an OpenCV equivalent of imview function in MATLAB.


回答1:


You don't need Qt to do that. Just use default OpenCV function imshow to show image and SetMouseCallback to set callback on mouse click.




回答2:


It can be done using mouse call back events. You can find a good example in \opencv\samples\cpp\grabcut.cpp




回答3:


I had a few problems trying to do this with OpenCV alone using an old code I wrote a while back. At this point I'm not sure if I missed something or if it's a bug in OpenCV. I'll investigate this further.

But I shared a short, self contained, correct (compilable), example at my repository, check cvImage. It's written in C++ with Qt and OpenCV. It's a Qt application that loads an image with OpenCV and displays the RGB values as the title of the Qt window.

Move the mouse around and place the cursor on top of the pixel that you are interested at to see it's RGB value.




回答4:


Opencv with Qt support will do that.



来源:https://stackoverflow.com/questions/14912717/gui-to-view-values-in-image-using-opencv-in-ubuntu12-04

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!