009 Opencv自带颜色表操作

void QuickDemo::color_style_demo(Mat& image)
{
	int colormap[] = {
		COLORMAP_AUTUMN,
		COLORMAP_BONE,
		COLORMAP_JET,
		COLORMAP_WINTER,
		COLORMAP_RAINBOW,
		COLORMAP_OCEAN,
		COLORMAP_SUMMER,
		COLORMAP_SPRING,
		COLORMAP_COOL,
		COLORMAP_PINK,
		COLORMAP_HOT,
		COLORMAP_PARULA,
		COLORMAP_MAGMA,
		COLORMAP_INFERNO,
		COLORMAP_PLASMA,
		COLORMAP_VIRIDIS,
		COLORMAP_CIVIDIS,
		COLORMAP_TWILIGHT,
		COLORMAP_TWILIGHT_SHIFTED
	};
	Mat dst;
	int index = 0;
	while (true)
	{
		int c = waitKey(1000);
		if (c == 27)
		{
			break;		//退出
		}
		applyColorMap(image, dst, colormap[index % 19]);
		index++;
		namedWindow("颜色风格", WINDOW_FREERATIO);
		imshow("颜色风格", dst);
	}
}

查阅:

https://blog.csdn.net/juzicode00/article/details/120985400

https://www.likecs.com/show-204504350.html

你可能感兴趣的:(OpenCV4,C++,学习笔记,opencv,计算机视觉,人工智能)