当前位置:网站首页>图像增强——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链接有附。
边栏推荐
- PC side bug record
- 7.<tag-字符串和API的取舍>补充: 剑指 Offer 05. 替换空格
- SMD component size metric English system corresponding description
- YUV to uiimage
- New modularity in ES6
- SSLError
- repackag failed: Unable to find main class
- C language: addition and deletion of linked list in structure
- How should programmers keep warm when winter is coming
- Video twins: the starting point of informatization upgrading of smart Parks
猜你喜欢
![[slam] lvi-sam analysis - Overview](/img/66/f15f6f574807b9a783e9321c71d422.png)
[slam] lvi-sam analysis - Overview

mysql 为查询结果增加序号

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

【计算机三级信息安全】信息安全保障概述

数据库日期类型全部为0

IDEA使用dev-tool实现热部署

PC side bug record

restFul接口使用个人总结

Scanf function of input and output function in C language

Digital twin technology creates visual application of smart mine
随机推荐
mybaties foreach多选查询,index循环,取消and/or标签
Internal implementation principle of yymodel
How about ink cloud?
导出excel,生成多个sheet页,并命名
21 day SQL punch in summary
repackag failed: Unable to find main class
分享几种管理C程序中标志位的方法
多系统架构设计思考
IDEA配置 service(Run Dashboard) 服务,多模块同时启动
2022 summer practice (first week)
BeanUtils.copyProperties无法复制不同List集合问题解决 Lists.transform函数
Oracle创建表、删除表、修改表(添加字段、修改字段、删除字段)语句总结
Thinking on multi system architecture design
Classes and objects [medium]
架构设计思考之一(SSO设计)
I interviewed a 38 year old programmer and refused to work overtime
About MySQL group_ What concat has to say
Dell remote control card uses ipmitools to set IPMI
C language classic 100 question exercise (1~21)
Framework step by step easy-to-use process