图像归一化normalization

烈酒焚心 提交于 2019-12-08 02:32:39

一、图像归一化的好处:

1、转换成标准模式,防止仿射变换的影响。

2、减小几何变换的影响。

3、加快梯度下降求最优解的速度。

二、图像归一化的方法

1、线性函数转换,表达式如下:
y=(x-MinValue)/(MaxValue-MinValue)
说明:x、y分别为转换前、后的值,MaxValue、MinValue分别为样本的最大值和最小值。
2、对数函数转换,表达式如下:
y=log10(x)
说明:以10为底的对数函数转换。
3、反余切函数转换,表达式如下:

y=atan(x)*2/PI

三、线性函数转换代码(matlab)

%% 图像归一化
clc
clear
close all
image = imread('E:\裂纹\a\3\53.bmp');
image = rgb2gray(image);
figure
imshow(image);

image = double(image);
image_minGray = min(min(image));
image_maxGray = max(max(image));
image_distance = image_maxGray-image_minGray;
min_Gray = 0;
max_Gray = 255;
image_normalization = (image-image_minGray)/image_distance;  %归一化,图像的灰度值限制到(0~1)之间
figure 
imshow(image_normalization)

image_255 = max_Gray*image_normalization +min_Gray;  
figure 
imshow(uint8(image_255))

%% 方法二直接调用matlab函数mat2gray
image_norm = mat2gray(image);
figure
imshow(image_norm)
原图
归一化后的图

原图

归一化后的图片


易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!