Updated by Andrey Kamaev over 12 years ago
Building in Windows x64 VS2010. Issue is possibly related to
http://code.opencv.org/issues/2189
but also affects the perceived cursor position.
<pre><code class="cpp"> <pre>
void drawCircle( int event, int x, int y, int ignoreMe, void* mat_)
{
if(event == CV_EVENT_LBUTTONDOWN){
Mat img = *((Mat*) mat_);
circle(img, Point(x,y), 3, Scalar(255,255,255), -1);
imshow("Window Test", img);
}
}
int main( int argc, const char** argv )
{
Mat smallImg = Mat::zeros(90,90,CV_32F);
imshow("Window Test", smallImg);
setMouseCallback("Window Test",drawCircle,&smallImg);
while (cvWaitKey(4) == -1) {}
return 0;
}
</code></pre> </pre>
As in the OSX bug, this produces a window that is too wide for the image. If you try and draw circles at the cursor position they are placed incorrectly and the error increases as you move to the right.
My screenshooter doesn't capture the cursor but in the attached image I attempted to create 3 circles by clicking on the extreme left, the middle, and the extreme right of the black image.
!bug.png!
http://code.opencv.org/issues/2189
but also affects the perceived cursor position.
<pre><code class="cpp"> <pre>
void drawCircle( int event, int x, int y, int ignoreMe, void* mat_)
{
if(event == CV_EVENT_LBUTTONDOWN){
Mat img = *((Mat*) mat_);
circle(img, Point(x,y), 3, Scalar(255,255,255), -1);
imshow("Window Test", img);
}
}
int main( int argc, const char** argv )
{
Mat smallImg = Mat::zeros(90,90,CV_32F);
imshow("Window Test", smallImg);
setMouseCallback("Window Test",drawCircle,&smallImg);
while (cvWaitKey(4) == -1) {}
return 0;
}
</code></pre> </pre>
As in the OSX bug, this produces a window that is too wide for the image. If you try and draw circles at the cursor position they are placed incorrectly and the error increases as you move to the right.
My screenshooter doesn't capture the cursor but in the attached image I attempted to create 3 circles by clicking on the extreme left, the middle, and the extreme right of the black image.
!bug.png!