Necessarily - I'm a beginner. Have a job that includes programming, and I teach myself when I go. Needless to say as a teacher, I often make mistakes and carefully.
Where am I now: I created the "Graph" class, it (surprisingly enough) makes graphs. But now I want to make it so that when I click the mouse I change the schedule. But I cannot force the mouse handler to be a member function of the class.
cv::setMouseCallback(windowName, onMouse, 0); // Set mouse handler to be onMouse
Does not work with
cv::setMouseCallback(windowName, Graph::onMouse, 0);
This gives me a lack of options. Accordingly , I cannot make it a member function. After executing the above answer, it compiles, but my this pointer is nullified. Ugh.
OnMouse looks like this:
void onMouse(int event, int x, int y,int, void*) { if (event == CV_EVENT_LBUTTONDOWN) { cvMoveWindow("Window", 500, 500);
I do not need to move the window, I want to change the graph itself, which is stored as the variable cv :: Mat in the Graph object. And I can’t figure out how to do this.
Any help would be appreciated, and I really hope that it was not just gibberish.
c ++ opencv mouseevent
Russbear
source share