Skip to content

possible unnecessary copy in aruco · charuco.cpp · detectCharucoDiamond #2781

@esopalumpa

Description

@esopalumpa

in charuco.cpp in the aruco module there seems to be an unnecessary explicit copy of an image.

void detectCharucoDiamond(InputArray _image, InputArrayOfArrays _markerCorners,…

    // convert input image to grey
    Mat grey;
    if(_image.type() == CV_8UC3)
        cvtColor(_image, grey, COLOR_BGR2GRAY);
    else
	    _image.copyTo(grey);

If the image already is a grayscale-image it is explicitly copied. grey = _image.getMat(); should do.

EDIT:
same in _selectAndRefineChessboardCorners()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions