当前位置:网站首页>图像增强——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链接有附。
边栏推荐
- Digital twin solutions inject new momentum into the construction of chemical parks
- Making RPM packages with nfpm
- Reading sdwebimage source code Notes
- 自定义Json返回数据
- Struct模块到底有多实用?一个知识点立马学习
- How about ink cloud?
- After ruoyi generates the code corresponding to the database, what should I do to make the following image look like
- SSLError
- 这种动态规划你见过吗——状态机动态规划之股票问题(中)
- Framework step by step easy-to-use process
猜你喜欢

First acquaintance with C language (2)

数据库日期类型全部为0

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

【CVPR2022】Multi-Scale High-Resolution Vision Transformer for Semantic Segmentation

Google browser cannot open localhost:3000. If you open localhost, you will jump to the test address

IDEA使用dev-tool实现热部署

【ARXIV2205】EdgeViTs: Competing Light-weight CNNs on Mobile Devices with Vision Transformers

CentOS7安装MySQL5.7

Scanf function of input and output function in C language

类和对象【中】
随机推荐
导出excel,生成多个sheet页,并命名
Class class added in ES6
The most detailed installation of windows10 virtual machine, install virtual machine by hand, and solve the problem that the Hyper-V option cannot be found in the home version window
Performance test classification
IDEA使用dev-tool实现热部署
【MySQL】MySQL时区问题、数据库时间相差8小时问题解决
Video twins: the starting point of informatization upgrading of smart Parks
【CVPR2022 oral】Balanced Multimodal Learning via On-the-fly Gradient Modulation
MySQL date and time function, varchar and date are mutually converted
Implementation of simple upload function in PHP development
[internal mental skill] - creation and destruction of function stack frame (C implementation)
SSLError
Why is MD5 irreversible, but it may also be decrypted by MD5 free decryption website
数据库日期类型全部为0
接口幂等性问题
Reading notes of SMT practical guide 1
FreeRTOS personal notes - task notification
Autoreleasepool problem summary
I've been in an outsourcing company for two years, and I feel like I'm going to die
How practical is the struct module? Learn a knowledge point immediately