clc; clear all; img_in = imread('ILSVRC2017_test_00000237.jpg'); m = size(img_in,1); n = size(img_in,2); img_lab = rgb2lab(img_in); img_L_mean = mean(mean(img_lab(:,:,1))); img_a_mean = mean(mean(img_lab(:,:,2))); img_b_mean = mean(mean(img_lab(:,:,3))); %高斯滤波 img_R = img_in(:,:,1); img_G = img_in(:,:,2); img_B = img_in(:,:,3); w = fspecial('gaussian',[7 7]); img_R_blur = imfilter(img_R,w); img_G_blur = imfilter(img_G,w); img_B_blur = imfilter(img_B,w); img_blur = cat(3,img_R_blur,img_G_blur,img_B_blur); figure('Name','滤波'); imshow(img_blur); img_lab_blur = rgb2lab(img_blur); %计算显著图 Sd = zeros(m,n); for i = 1:m for j = 1:n Sd(i,j) = sqrt((img_L_mean - img_lab_blur(i,j,1))^2 + (img_a_mean - img_lab_blur(i,j,2))^2 + (img_b_mean - img_lab_blur(i,j,3))^2); end end %归一化 Sd_normalized = figure_normalize(Sd); imwrite(Sd_normalized,'FT_saliency.jpg'); figure; imshow(Sd_normalized); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function Out_image = figure_normalize(In_image) o_max_image = max(max(In_image)); o_min_image = min(min(In_image)); Out_image = double(In_image - o_min_image)/double(o_max_image - o_min_image); end解释该代码中的matlab函数或变量 'figure_normalize'。
时间: 2023-06-14 08:04:20 浏览: 172
arima_test.zip_ARIMA代码_arima.test_arima预测_stationary test_平稳性检验
5星 · 资源好评率100%
'figure_normalize' 是一个自定义函数,用于将输入的图像进行归一化处理,使其像素值范围在 [0,1] 之间。该函数输入一个二维矩阵,输出归一化后的矩阵。其中,'o_max_image' 和 'o_min_image' 分别表示输入矩阵的最大值和最小值。函数的实现过程是将输入矩阵中的每个像素值减去最小值,然后除以最大值与最小值之差,得到归一化后的像素值。
阅读全文