Updated by Alexander Shishkov almost 13 years ago
as known when i hover the mouse over the image i opened in opencv window the cursor becomes a litle cross.
but when i use mousecalback with the eg. left button down kept down
the cross remains even if the mouse is away from the opencv window.
its not about thecross of course.but its about the funtions someone puts eg inside butondown and mouse mouve. so if the buton is down and kept down inside the picture ,it keeps calling the mouse mouve and button down functions even outside the window!!!!!!!!!
i used this mousecallback funtion
<pre><code class="cpp">
void mouseHandler(int event, int x, int y, int flags, void *param)
{
switch(event) {
/* left button down */
case CV_EVENT_LBUTTONDOWN:
fprintf(stdout, "Left button down (%d, %d).\n", x, y);
break;
/* right button down */
case CV_EVENT_RBUTTONDOWN:
break;
/* mouse move */
case CV_EVENT_MOUSEMOVE:
break;
}
</code></pre>
and when i move the mouse while i hold the button down ,starting from a place inside the image, if i continue to get it out of the image,or window,it keeps giving me coordinates outside the window.if i take it to the left it gives for x,large numbers 65000 or so.
but when i use mousecalback with the eg. left button down kept down
the cross remains even if the mouse is away from the opencv window.
its not about thecross of course.but its about the funtions someone puts eg inside butondown and mouse mouve. so if the buton is down and kept down inside the picture ,it keeps calling the mouse mouve and button down functions even outside the window!!!!!!!!!
i used this mousecallback funtion
<pre><code class="cpp">
void mouseHandler(int event, int x, int y, int flags, void *param)
{
switch(event) {
/* left button down */
case CV_EVENT_LBUTTONDOWN:
fprintf(stdout, "Left button down (%d, %d).\n", x, y);
break;
/* right button down */
case CV_EVENT_RBUTTONDOWN:
break;
/* mouse move */
case CV_EVENT_MOUSEMOVE:
break;
}
</code></pre>
and when i move the mouse while i hold the button down ,starting from a place inside the image, if i continue to get it out of the image,or window,it keeps giving me coordinates outside the window.if i take it to the left it gives for x,large numbers 65000 or so.