当前位置:网站首页>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 .
边栏推荐
- Lamda gets the current number of cycles, atomicinteger
- 论文写作用词
- Framework step by step easy-to-use process
- ResNet结构对比
- New methods and features of ES6 built-in objects
- 解决Oracle使用in语句不能超过1000问题
- PC端-bug记录
- Multi module packaging: package: XXX does not exist
- VMware Workstation 与 Device/Credential Guard 不兼容。禁用 Device/Credential Guard
- ES6 new variable modifiers let and const, new basic data type symbol
猜你喜欢
随机推荐
oracle查看锁表语句、解锁方法
lamda 获取当前循环数,AtomicInteger
C language: some self realization of string functions
Mysql处理遗留数据样例
导出excel,生成多个sheet页,并命名
蒙特卡罗方法求解圆周率π并用turtle画点,以及完成进度条问题
visio如何快速生成相同的图案,生成图像矩阵
Tomato timing dimming table lamp touch chip-dlt8t10s-jericho
科研论文写作方法:在方法部分添加分析和讨论说明自己的贡献和不同
2022 summer practice (PowerDesigner tutorial learning record) (first week)
Mabtis(一)框架的基本使用
测试开发---自动化测试中的UI测试
Flask Development & get/post request
项目中问题合集
框架一步一步方便使用的流程
图像增强——MSRCR
Framework step by step easy-to-use process
mybaties foreach多选查询,index循环,取消and/or标签
蒸馏模型图
GET与POST区别









