当前位置:网站首页>Image enhancement - msrcr
Image enhancement - msrcr
2022-07-28 05:31:00 【qq_ forty-six million one hundred and sixty-five thousand eight】
Original article :A multiscale retinex for bridging the gap between color images and the human observation of scenes.
Code handling
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;
endJust the porter of the original author . The original author's github Link attached .
边栏推荐
- C language characters and strings
- How about ink cloud?
- JMeter related knowledge sorting
- Export excel, generate multiple sheet pages, and name them
- IDEA配置 service(Run Dashboard) 服务,多模块同时启动
- [singleton mode] thread safety of lazy mode
- CentOS7安装MySQL5.7
- VMware Workstation 与 Device/Credential Guard 不兼容。禁用 Device/Credential Guard
- visio如何精确控制图形的大小和位置及角度
- 多系统架构设计思考
猜你喜欢

Digital twin technology creates visual application of smart mine

After ruoyi generates the code corresponding to the database, what should I do to make the following image look like

MySQL practice 45 lectures

论文写作用词

ByteBuffer. Position throws exception illegalargumentexception

Edge calculation kubeedge+edgemash

类和对象【中】

Framework step by step easy-to-use process

Scanf function of input and output function in C language

regular expression
随机推荐
数据库面试
ssm项目快速搭建项目配置文件
Share several methods of managing flag bits in C program
子父线程交互
Dell remote control card uses ipmitools to set IPMI
BeanUtils.copyProperties无法复制不同List集合问题解决 Lists.transform函数
【SLAM】LVI-SAM解析——综述
[computer level 3 information security] overview of information security assurance
C language: addition and deletion of linked list in structure
JVM篇 笔记3:类加载与字节码技术
How should programmers keep warm when winter is coming
SSM project quick build project configuration file
关于swagger中的localDateTime
MySQL date and time function, varchar and date are mutually converted
IO流的使用
Mysql处理遗留数据样例
Thinking on multi system architecture design
New arrow function in ES6
List < long >, list < integer > convert each other
New modularity in ES6