void color_style(Mat& image);
Opencv_10_自带颜色表操作:
void ColorInvert::color_style(Mat& image)
{
int colormap[] = {
COLORMAP_AUTUMN,
COLORMAP_BONE ,
COLORMAP_JET ,
COLORMAP_WINTER,
COLORMAP_RAINBOW ,
COLORMAP_OCEAN,
COLORMAP_SUMMER ,
COLORMAP_SPRING ,
COLORMAP_COOL ,
COLORMAP_HSV ,
COLORMAP_PINK ,
COLORMAP_HOT ,
COLORMAP_PARULA,
};
Mat dst;
int index = 0;
while (true)
{
int c = waitKey(1000);
if (c == 27)
{
break;
}
applyColorMap(image, dst, colormap[index%11]);
index++;
imshow("颜色风格", dst);
}
}