aruco: fix subpixel coordinates in interpolateCornersCharuco#3024
Conversation
d2b4669 to
1b53fa7
Compare
|
I could just take corners & ids and discard the actual image, that would make this pull a little less complex. |
1b53fa7 to
942dbf3
Compare
942dbf3 to
b56097f
Compare
|
one should probably note that
it would help, if you could mention what the disagreement actually is. also, did you check, whether this affects the |
|
In the test |
The two possible paths of
interpolateCornersCharuco,_interpolateCornersCharucoApproxCaliband_interpolateCornersCharucoLocalHom, assume that the top-left corner of the top-left pixel of an image has the coordinate (0,0) whereas forcornerSubpixthat is the center of that pixel and the top-left corner is actually (-0.5, -0.5). To check this I rendered a ChArUco board in a way that has the board corners (not the marker corners) exactly at integer pixel coordinates. Both_interpolateCornersCharucoApproxCaliband_interpolateCornersCharucoLocalHomreturn exactly these coordinates already, however,cornerSubpixthen optimizes that towards the top-left.In the test
interpolateCornersCharucois once called with thecameraMatrixparameter, once without, so both paths (_interpolateCornersCharucoApproxCaliband_interpolateCornersCharucoLocalHom) are tested.This seems to be an incarnation of undocumented subpixel coodinates, see opencv/opencv#10130
The test also needs the data contributed here: opencv/opencv_extra#900
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.