Incorrect window size and drawing functions for small windows. (Bug #2200)
Description
Building in Windows x64 VS2010. Issue is possibly related to
http://code.opencv.org/issues/2189
but also affects the perceived cursor position.
1void drawCircle( int event, int x, int y, int ignoreMe, void* mat_)
2{
3 if(event == CV_EVENT_LBUTTONDOWN){
4 Mat img = *((Mat*) mat_);
5 circle(img, Point(x,y), 3, Scalar(255,255,255), -1);
6 imshow("Window Test", img);
7 }
8}
9
10int main( int argc, const char** argv )
11{
12 Mat smallImg = Mat::zeros(90,90,CV_32F);
13 imshow("Window Test", smallImg);
14 setMouseCallback("Window Test",drawCircle,&smallImg);
15
16 while (cvWaitKey(4) == -1) {}
17
18 return 0;
19}
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.
History
Updated by Daniil Osokin over 12 years ago
Which version of OpenCV do you use?
- Assignee changed from Vadim Pisarevsky to Chris Miller
Updated by Daniil Osokin over 12 years ago
- Assignee deleted (
Chris Miller)
Updated by Andrey Kamaev over 12 years ago
- Description changed from Building in Windows x64 VS2010. Issue is possibly related to http://code.o... to Building in Windows x64 VS2010. Issue is possibly related to http://code.o... More
Updated by Andrey Kamaev over 12 years ago
- Category changed from highgui-images to highgui-gui
Updated by Maksim Shabunin over 9 years ago
Issue has been transferred to GitHub: https://github.com/Itseez/opencv/issues/4402