当前位置:网站首页>图像增强——MSRCR
图像增强——MSRCR
2022-07-28 05:17:00 【qq_46165876】
原文章:A multiscale retinex for bridging the gap between color images and the human observation of scenes.
代码搬运
clear;
close all;
img_in = im2double(imread('D:\Image enhancement\image 10\10.bmp'));
scales = [2 120 240];
alpha = 500;
d = 1.5;
img_out = MSRCR(img_in,scales,[],alpha,d);
imwrite(img_out,'D:\Image enhancement\image 10\MSRCR.jpg');
str_scales = ['scale=[',num2str(scales(1)),',',num2str(scales(2)),',',num2str(scales(3)),']'];
str_alpha = ['alpha=',num2str(alpha)];
str_d = ['contrast=',num2str(d)];
function img_out = MSRCR( img_in, sigma, w, alpha, d )
e = 0.004;
img_in = img_in + e;
if ~exist('sigma','var') || isempty(sigma)
sigma = [2 90 180];
end
if ~exist('w','var') || isempty(w)
w = [1 1 1]/3;
end
if ~exist('alpha','var') || isempty(alpha)
alpha = 128;
end
if ~exist('d','var') || isempty(d)
d = 1.2;
end
% multi-scale Retinex, color restore
scale = max(size(sigma,1),size(sigma,2));
S = log(img_in);
R = cell(scale,1);
for is = 1 : scale
R{is} = S - imgaussfilt(S,sigma(is));
end
R_sum = w(1)*R{1};
for is = 2 : scale
R_sum = R_sum + w(is)*R{is};
end
% dynamics of the colors
C = log(alpha*img_in) - repmat(log(sum(img_in,3)),[1,1,3]);
Rcr = C.*R_sum;
meani = mean(Rcr(:));
vari = var(Rcr(:));
mini = meani - d*vari;
maxi = meani + d*vari;
range = maxi - mini;
img_out = (Rcr - mini)/range;
end只是原作者的搬运工。原作者的github链接有附。
边栏推荐
- Google browser cannot open localhost:3000. If you open localhost, you will jump to the test address
- Mysql数据库索引(innodb引擎)
- Thinking on multi system architecture design
- 7. < tag string and API trade-offs> supplement: Sword finger offer 05. replace spaces
- ES6 new variable modifiers let and const, new basic data type symbol
- repackag failed: Unable to find main class
- mysql 为查询结果增加序号
- 分享几种管理C程序中标志位的方法
- Confused, I'm going to start running in the direction of [test]
- CPU and memory usage are too high. How to modify RTSP round robin detection parameters to reduce server consumption?
猜你喜欢

Personal summary of restful interface use

JUC笔记

The research group passed the thesis defense successfully

VMware Workstation 与 Device/Credential Guard 不兼容。禁用 Device/Credential Guard

restFul接口使用个人总结

Scope, execution process and life cycle of bean

MySQL basic query

Why is MD5 irreversible, but it may also be decrypted by MD5 free decryption website

ES6 new variable modifiers let and const, new basic data type symbol

Edge calculation kubeedge+edgemash
随机推荐
7.<tag-字符串和API的取舍>补充: 剑指 Offer 05. 替换空格
Implementation of simple upload function in PHP development
【SLAM】LVI-SAM解析——综述
BeanUtils.copyProperties无法复制不同List集合问题解决 Lists.transform函数
Oracle用sql查询某张表的字段信息(字段类型、长度等)
Framework step by step easy-to-use process
Non functional test
CentOS7安装MySQL5.7
Long和Integer如何进行比较,为什么报错
在ruoyi生成的对应数据库的代码 之后我该怎么做才能做出下边图片的样子
YUV to uiimage
DELL远程控制卡 使用ipmitools设置ipmi
C language: addition and deletion of linked list in structure
Classes and objects [medium]
Thinking on multi system architecture design
21 day SQL punch in summary
【ARXIV2204】Vision Transformers for Single Image Dehazing
From the basic concept of micro services to core components - explain and analyze through an example
How practical is the struct module? Learn a knowledge point immediately
Advanced assignment method of ES6 -- Deconstruction assignment