当前位置:网站首页>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 .
边栏推荐
- MySQL practice 45 lectures
- yandex robots txt
- Digital twin technology creates visual application of smart mine
- 7. < tag string and API trade-offs> supplement: Sword finger offer 05. replace spaces
- SSLError
- SimpleDateFormat线程不安全和DateTimeFormatter线程安全
- 使用深度学习训练图像时,图像太大进行切块训练预测
- sql 查询list时两次的数据不一致,自动加上了limit
- 科研论文写作方法:在方法部分添加分析和讨论说明自己的贡献和不同
- Struct模块到底有多实用?一个知识点立马学习
猜你喜欢

GET与POST区别

repackag failed: Unable to find main class

BigDecimal 进行四舍五入 四舍六入和保留两位小数

Long和Integer如何进行比较,为什么报错

Flask Development & get/post request

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

mysql的日期与时间函数,varchar与date相互转换

How about ink cloud?

测试开发---自动化测试中的UI测试

ByteBuffer.position 抛出异常 IllegalArgumentException
随机推荐
Redis' bloom filter
There is no crossover in the time period within 24 hours
项目中问题合集
深度学习热力图可视化的方式
block yandex bot
Digital twin technology creates visual application of smart mine
oracle查看锁表语句、解锁方法
科研论文写作方法:在方法部分添加分析和讨论说明自己的贡献和不同
New arrow function in ES6
How practical is the struct module? Learn a knowledge point immediately
自定义Json返回数据
正则表达式
latex和word之间相互转换
多线程进阶:synchronized底层原理,锁优化、锁升级的过程
Response<T>类
JVM篇 笔记4:内存模型
MySQL uses list as a parameter to query
【SLAM】LVI-SAM解析——综述
24小时内的时间段无交叉
Mysql处理遗留数据样例