gpt4 book ai didi

opencv - openCV的colormap转换是线性的吗?

转载 作者:太空宇宙 更新时间:2023-11-03 21:46:10 25 4
gpt4 key购买 nike

我有一个灰度图像(即 1 个 channel )。我正在使用 opencv 函数 applyColorMap() 来改进可视化。例如,如果我有下面的代码

applyColorMap(imgGray, imgOut, COLORMAP_RAINBOW);

有人知道颜色映射转换是否是线性的吗?

enter image description here

image description
(来源:opencv.org)

最佳答案

opencv 函数使用的颜色映射:applyColorMap 在它们之间具有线性关系。它们基于 GNU Octave / Matlab颜色图

Graphics functions that use pseudocolor - mesh, surf, pcolor, and others - map a color matrix, c, whose values are in the range [cmin, cmax], to an array of indices, k, in the range [1, m]. The values of cmin and cmax are either min(min(c)) and max(max(c)), or are specified by caxis. The mapping is linear, with cmin mapping to index 1 and cmax mapping to index m. The indices are then used with the colormap to determine the color associated with each matrix element. reference

关于opencv - openCV的colormap转换是线性的吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26005408/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com