1 | initial version |
Hi, check the type of your image (CurrentMat). If it is a single channel image, the rectangle will be drawn in gray. Then you can use cv::cvtColor() function to convert the image into a RGB image.
cv::cvtColor(CurrentMat, CurrentMat_RGB, CV_GRAY2RGB);
2 | No.2 Revision |
Hi, check the type of your image (CurrentMat). If it is a single channel image, the rectangle will be drawn in gray. Then you can use cv::cvtColor() function to convert the image into a RGB image and draw the rectangle in this image.
cv::Mat CurrentMat_RGB;
cv::cvtColor(CurrentMat, CurrentMat_RGB,