OpenCV和Matplotlib的配色方案

it2026-06-10  1

OpenCV和Matplotlib的配色方案:


OpenCV的Colormap:

左边的颜色代表的值小,右边的颜色代表的值大。 实例:

dst = cv2.applyColorMap( src, colormap[, dst] ) dst = cv2.applyColorMap( src, userColor[, dst] )

Matplotlib的Colormap:

也是左边的颜色代表的值小,右边的颜色代表的值大。

应用

可以使用这些配色方案绘制深度图。搞深度估计的论文里非常常见的。(下图是monodepth2做出的深度图) 虽然深度是一维数据,但是使用彩色的colormap画出的伪彩图可以使图片的对比度更高,稍微好看点。

Reference

https://docs.opencv.org/master/d3/d50/group__imgproc__colormap.html https://matplotlib.org/tutorials/colors/colormaps.html https://www.cnblogs.com/aiguona/p/9936638.html

最新回复(0)