先来追本溯源
void cv::cvtColor ( InputArray src, OutpuArray dst, int code, int dstCn=0);
src | input image: 8-bit unsigned, 16-bit unsigned, or single-precision floating-point. |
dst | output image of the same size and depth as src. |
code | color space conversion code |
再来看个实例
Mat src = imread(“D:/opencv/sky.jpg”);
cvtColor(src, dst, COLOR_BGR2GRAY);
所以,感觉应该是先用imread读取oc字符串代表的图片到src,然后再使用cvtColor函数
Mat dst;
Mat src = imread(oc);
cvtColor(src, dst,CV_BGR2GRAY);
imshow("Window窗口", dst);
thanks
另外你知道怎么用opencv实现图片美颜效果吗,ios