diff --git a/modules/aruco/src/charuco.cpp b/modules/aruco/src/charuco.cpp index 61a1a81a247..691c7febb4d 100644 --- a/modules/aruco/src/charuco.cpp +++ b/modules/aruco/src/charuco.cpp @@ -348,7 +348,7 @@ static int _selectAndRefineChessboardCorners(InputArray _allCorners, InputArray if(_image.type() == CV_8UC3) cvtColor(_image, grey, COLOR_BGR2GRAY); else - _image.copyTo(grey); + grey = _image.getMat(); const Ptr params = DetectorParameters::create(); // use default params for corner refinement @@ -766,7 +766,7 @@ void detectCharucoDiamond(InputArray _image, InputArrayOfArrays _markerCorners, if(_image.type() == CV_8UC3) cvtColor(_image, grey, COLOR_BGR2GRAY); else - _image.copyTo(grey); + grey = _image.getMat(); // for each of the detected markers, try to find a diamond for(unsigned int i = 0; i < _markerIds.total(); i++) {