I have custom build opencv 4.0.1 with Cuda 9.2 and QT 5.9.6 for my project based on image processing. In the application there is a need of user input where the user clicks on some points of a picture which shown by opencv namedWindow function. The opencv function setMouseCallback works properly without any problem. But the cursor on the window is the default arrow shape and the user need some custom cursor shape like crosshair cursor.
I have already tried with Qcursor methods but none of them was working on the opencv 'namedWindow'.
namedWindow("Original_1",WINDOW_FREERATIO);
imshow("Original_1", frame1_1); //show the frame in "MyVideo" window
I consider namedWindow
and imshow
as convinience classes, that allows fast results. There are less suited for full blown applications with lots of settings. Also they are not seamlessly integrated in the Qt framework.
I suggest, that you take the following track. Firstly, you should convert cv::Mat to an QImage.
Secondly, you can create a simple QDialog
with a frame displaying the QImage
. Then you can call setCursor
on this QImage
object.