Ask Your Question

JimboStlawrence's profile - activity

2021-03-02 02:08:39 -0600 received badge  Notable Question (source)
2019-12-20 08:09:39 -0600 received badge  Popular Question (source)
2017-02-24 15:40:02 -0600 answered a question namedWindow fails to display graphics if minimised immediately on creation

Hi, it'd take me forever to redo something like that from scratch i.e. a 'small example'.

I use Visual Studio 2015 / Windows 10.

I fixed the issue, well not exactly a fix, but I simply do an "cv::imshow("drawing", img);" of the Mat immediately after creating the window. The user therefore doesn't have time to minimise it before it's had its first image...

Best,

Jimbo

2017-02-19 14:27:07 -0600 received badge  Student (source)
2017-02-19 11:17:32 -0600 asked a question namedWindow fails to display graphics if minimised immediately on creation

Since upgrading to OpenCV 3.2 from 2.4.3 (I believe it was around that), a window created using OpenCV fails to display any graphics if minimised immediately after creation, even if it is brought back up. The standard white cross still appears in the window as the mouse is moved across it, but no graphics can be displayed. If the window is left alone after creation and the first graphics are drawn, all is well; the window can be minimised, graphics drawn etc. and the window brought back up without issue.

Not sure where/how to report this issue.

2017-02-18 14:39:13 -0600 asked a question Detecting Mouse wheel delta at the same time as a CTRL key

Hi,

Thanks to LBerger for his/her reply to my query last night (can't post the link).

I can't reply/send thanks for another day because of "new-user rules".

The above worked, but I've now hit a new issue. I can happily detect mouse_move and ctrl/shift/alt keys combinations, but not together with the mouse_wheel delta.

Normally, one might use something like:

 if ( event == EVENT_MOUSEMOVE && flags == EVENT_FLAG_ALTKEY)

but this doesn't work with MOUSEWHEEL

 if (event == cv::EVENT_MOUSEWHEEL && flags == cv::EVENT_FLAG_CTRLKEY)

I think this might be something to do with MOUSEWHEEL using the flags variable. Is there any other way to do this, as I'd like to use the MOUSEWHEELto do more than one thing depending on which key combination is pressed at the same time as rolling the mousewheel...

Best,

Jimbo

2017-02-17 19:58:16 -0600 asked a question mouse wheel delta

Hi,

I've been using OpenCV 2.x for a few years and have now installed and integrated version 3.2. I'd like to be able to detect and determine the mousewheel direction. I'm not a professional C++ programmer but getting by. Currently, I have callbacks that take care of mouse buttons, CTRL, SHIFT etc. :

 void CallBackFunc(int event, int x, int y, int flags, void* userdata)
 {
    if ( event == cv::EVENT_LBUTTONDOWN) // 
    {
        mouse_click2 = 17;
        mouse_x = x;
        mouse_y = y;
    }

    if ( event == cv::EVENT_LBUTTONUP) // 
    {
        mouse_click2 = 18;
        mouse_x = x;
        mouse_y = y;
    }
 }

etc.....

How do I implement mouse wheel? I read in the documentation that I should use CV_GET_WHEEL_DELTA but no idea how to do this...

I know that:

 if (event == cv::EVENT_MOUSEWHEEL)
 {
   code...
 }

works i.e. it detects a movement of the wheel, but not sure how to measure the direction, or magnitude.

Any code examples would be greatly appreciated!

Thank you in advance.

Jimbo