@@ -811,11 +811,11 @@ static void _getSingleMarkerObjectPoints(float markerLength, OutputArray _objPoi
811811
812812 _objPoints.create (4 , 1 , CV_32FC3);
813813 Mat objPoints = _objPoints.getMat ();
814- // set coordinate system in the middle of the marker, with Z pointing out
815- objPoints.ptr < Vec3f >(0 )[0 ] = Vec3f (-markerLength / 2 .f , markerLength / 2 .f , 0 );
816- objPoints.ptr < Vec3f >(0 )[1 ] = Vec3f (markerLength / 2 . f , markerLength / 2 .f , 0 );
817- objPoints.ptr < Vec3f >(0 )[2 ] = Vec3f (markerLength / 2 . f , - markerLength / 2 . f , 0 );
818- objPoints.ptr < Vec3f >(0 )[3 ] = Vec3f (-markerLength / 2 .f , - markerLength / 2 . f , 0 );
814+ // set coordinate system in the top-left corner of the marker, with Z pointing out
815+ objPoints.ptr < Vec3f >(0 )[0 ] = Vec3f (0 .f , 0 .f , 0 );
816+ objPoints.ptr < Vec3f >(0 )[1 ] = Vec3f (markerLength, 0 .f , 0 );
817+ objPoints.ptr < Vec3f >(0 )[2 ] = Vec3f (markerLength, markerLength, 0 );
818+ objPoints.ptr < Vec3f >(0 )[3 ] = Vec3f (0 .f , markerLength, 0 );
819819}
820820
821821
@@ -1783,24 +1783,6 @@ void drawDetectedMarkers(InputOutputArray _image, InputArrayOfArrays _corners,
17831783}
17841784
17851785
1786-
1787- /* *
1788- */
1789- void drawAxis (InputOutputArray _image, InputArray _cameraMatrix, InputArray _distCoeffs, InputArray _rvec,
1790- InputArray _tvec, float length, int thickness)
1791- {
1792- vector<Point3f> axis;
1793- axis.push_back (Point3f (0 .f , 0 .f , 0 .f ));
1794- axis.push_back (Point3f (length, 0 .f , 0 .f ));
1795- axis.push_back (Point3f (0 .f , length, 0 .f ));
1796- axis.push_back (Point3f (0 .f , 0 .f , -length));
1797- vector<Point2f> axis_to_img;
1798- projectPoints (axis, _rvec, _tvec, _cameraMatrix, _distCoeffs, axis_to_img);
1799- line (_image, Point2i (axis_to_img[0 ]), Point2i (axis_to_img[1 ]), Scalar (255 ,0 ,0 ), thickness);
1800- line (_image, Point2i (axis_to_img[0 ]), Point2i (axis_to_img[2 ]), Scalar (0 ,255 ,0 ), thickness);
1801- line (_image, Point2i (axis_to_img[0 ]), Point2i (axis_to_img[3 ]), Scalar (0 ,0 ,255 ), thickness);
1802- }
1803-
18041786/* *
18051787 */
18061788void drawMarker (const Ptr<Dictionary> &dictionary, int id, int sidePixels, OutputArray _img, int borderBits) {
0 commit comments