Convert HSV to grayscale in OpenCV
问题 I'm newbie in OpenCV. I'm learning Segmentation by Watershed algorithm and i have a problem. I have to convert image color to image grayscale for using Watershed. When I use color space BGR, no problem but with space HSV, i'm not sure that the code belows is correct. Mat im = imread("./Image/118035.jpg", CV_LOAD_IMAGE_COLOR); Mat imHSV; cvtColor(im, imHSV, CV_BGR2HSV); imshow("HSV", imHSV); cvtColor(imHSV, imHSV, CV_BGR2GRAY); imshow("HSV to gray", imHSV); imshow("BGR", im); cvtColor(im, im,