ColorMaps in opencv
来源:互联网 发布:免费费用报销软件 编辑:程序博客网 时间:2024/06/03 22:39
http://docs.opencv.org/2.4/modules/contrib/doc/facerec/colormaps.html#applycolormap
http://www.learnopencv.com/applycolormap-for-pseudocoloring-in-opencv-c-python/
在给定的图像上应用GNU Octave / MATLAB等效的色彩映射。
void applyColorMap
(InputArray src, OutputArray dst, int colormap)- src – The source image, grayscale or colored does not matter.
- dst – The result is the colormapped source image. Note:
Mat::create()
is called on dst. - colormap – The colormap to apply, see the list of available colormaps below.
目前实现了以下GNU Octave / MATLAB等效的色彩映射:
人类的感知不是用来观察灰度图像的细微变化的。 人眼对于观察颜色之间的变化更为敏感,因此您经常需要重新着色灰度图像,以获得关于它们的线索。 OpenCV现在配有各种色彩映射,以增强计算机视觉应用程序中的可视化。
在OpenCV 2.4中,您只需要applyColorMap()来在给定的图像上应用色彩映射。 以下示例代码从命令行读取图像的路径,在其上应用Jet色彩映射并显示结果:
#include <opencv2/contrib/contrib.hpp>#include <opencv2/core/core.hpp>#include <opencv2/highgui/highgui.hpp>using namespace cv;int main(int argc, const char *argv[]) { // Get the path to the image, if it was given // if no arguments were given. string filename; if (argc > 1) { filename = string(argv[1]); } // The following lines show how to apply a colormap on a given image // and show it with cv::imshow example with an image. An exception is // thrown if the path to the image is invalid. if(!filename.empty()) { Mat img0 = imread(filename); // Throw an exception, if the image can't be read: if(img0.empty()) { CV_Error(CV_StsBadArg, "Sample image is empty. Please adjust your path, so it points to a valid input image!"); } // Holds the colormap version of the image: Mat cm_img0; // Apply the colormap: applyColorMap(img0, cm_img0, COLORMAP_JET); // Show the result: imshow("cm_img0", cm_img0); waitKey(0); } return 0;}
Class
阅读全文
0 0
- ColorMaps in opencv
- opencv in bsd
- Basic OCR in OpenCV
- Basic OCR in OpenCV
- Basic OCR in OpenCV
- Matrix multiplication in OpenCV
- Integral images in OpenCV
- boxFilter in opencv
- Microsoft Paint in OpenCV
- Install openCV in Linux
- 【OpenCV】in-place操作
- Colour Conversion in OpenCV
- compile opencv in centos
- tracking in opencv
- Deep Learning in OpenCV
- install opencv in docker
- 配置opencv Java in myeclipse in windows
- Writing AVI files in OpenCV
- AUC指标
- JAVA Finalizable对象为啥会爆内存溢出
- 如何选择优化器 optimizer
- 《算法导论》第22章 基本的图算法 个人笔记
- 判断是否是有效的cron表达式
- ColorMaps in opencv
- mac os 常用工具
- hibernate-1
- Spring Security之Builder sharedObjects
- C/C++位域(位段)示例总结
- 赌你半天都想不出的Bug
- 全面理解Java内存模型(JMM)及volatile关键字
- PAT 甲级 1022. Digital Library(map,读取标准输入)
- ExpandableListView使用(二)-ExpandableListView+CheckBox实现组选列表