% MSRCR Method For Image Processing
% Test for Digital Image Processing
% By Gu Jinjin 2012/10/16-17
% Refer to Retinex processing for automatic image enhancemen
% And thank videoandimage08's help for sharing me some Info
% ------
clc;clear all;
% 读取图像灰度值
I = imread('test.jpg');
IR = I(:,:,1);
IG = I(:,:,2);
IB = I(:,:,3);
% 转换为 double 类型
IR_double = double(IR);
IG_double = double(IG);
IB_double = double(IB);
% Set Gaussian Parameters
sigma1 = 5;
sigma2 = 20;
sigma3 = 240;
% 矩阵化网格向量
[x,y] = meshgrid((-(size(IR,2)-1)/2):(size(IR,2)/2),(-(size(IR,1)-1)/2):(size(IR,1)/2));
% 计算高斯环境函数 Fk
gauss1 = exp(-(x.^2+y.^2)/(sigma1*sigma1));
% 归格化 Fk = k*Fk
Gauss1 = gauss1/sum(gauss1(:));
gauss2 = exp(-(x.^2+y.^2)/(sigma2*sigma2));
Gauss2 = gauss2/sum(gauss2(:));
gauss3 = exp(-(x.^2+y.^2)/(sigma3*sigma3));
Gauss3 = gauss3/sum(gauss3(:));
% 计算MSR,MSRCR
for i &#
数字图像处理-图像增强: MSRCR Method For Image Processing
最新推荐文章于 2024-06-19 18:45:35 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)