当前位置:网站首页>OpenCV中CLAHE用于16位图像增强显示
OpenCV中CLAHE用于16位图像增强显示
2022-06-12 09:59:00 【zhoukehu91】
OpenCV中CLAHE用于16位图像增强显示
作者目前使用的OpenCV版本为4.1.0,限制对比度自适应直方图均衡化算法(Contrast Limited Adaptive Histogram Equalization, CLAOpenCV中CLAHE用于16位图像增强显示HE)在该版本中已经支持16位图像处理。作者将其应用于16位图像转8位图像的处理(用于16位红外或可见光图像的增强显示等场合)并且取得了不错的效果,将代码分享出来。
cv::Mat src(HEIGHT,WIDTH,CV_16UC1);
//... load image data to .src
cv::Mat tmp;
cv::Ptr<cv::CLAHE> clahe = createCLAHE(20.0,cv::Size(8,8));
clahe->apply(src,tmp);
double minVal,maxVal;
minMaxIdx(tmp,&minVal,&maxVal);
double scaleVal = (maxVal - minVal) > 1.0 ? (maxVal - minVal) : 1.0; //避免除0
tmp -= minVal; //归一化到[0-255]
tmp.convertTo(dst,CV_8UC1,255.0/scaleVal,0.0);//归一化到[0-255]
边栏推荐
- First NFT platform in dfinity Ecology: impossible thoughts
- Shen Min, CIO of science and technology innovator Digital China Group: the best practice model is failing, and open source accelerates Distributed Innovation
- Papaya Mobile: cross border marketing has entered the era of "information flow", allowing independent station sellers to share opportunities to go to sea
- Auto. JS learning note 9: basic methods such as using the script engine, starting the script file with the specified path, and closing
- Auto.js学习笔记4:autojs打包后,大部分华为等大牌子手机无法安装?利用模拟器远程在autoPro里签名打包可以解决该问题。
- 电阻的作用有哪些?(超全)
- Enumerate all USB device codes
- Pandorabox uses firewall rules to define non internet time
- 电脑启动快捷键一览表
- SAP Hana error message sys_ XSA authentication failed SQLSTATE - 28000
猜你喜欢
随机推荐
《保护我们的数字遗产:DNA数据存储》白皮书发布
There is always a negative line (upper shadow line) that will stop the advance of many armies, and there is always a positive line (lower shadow line) that will stop the rampant bombing of the air for
Mysql5.7 partition table
Auto.js学习笔记5:autojs的UI界面基础篇1
Auto. JS learning notes 5:ui interface foundation of autojs Chapter 1
gnu-efi开发环境设置
抽象类和接口
Autojs learning notes 6:text (txt) Findone() will report an error when switching apps. Finally, solve the implementation effect and switch any app until the script finds the control with the specified
C 语言仅凭自学能到什么高度?
Explanation of the principle of MySQL's leftmost matching principle
GNU EFI development environment settings
SAP HANA 错误消息 SYS_XSA authentication failed SQLSTATE - 28000
链式哈希表
Why is cross-border e-commerce so popular? Papaya mobile takes you to find out
基于 Ceph 对象存储的实战兵法
002: what are the characteristics of the data lake
Create simple windowing programs using Visual Studio 2017
存储研发工程师招聘
Clickhouse column basic data type description
六月集训(第12天) —— 链表









