Image 滤波后的Matlab图像归一化
我有下面的代码,我正在尝试在过滤后规范化我的图像,但问题是,一旦它到达第5行,它将everyting更改为0,并返回黑色图像。有什么想法吗Image 滤波后的Matlab图像归一化,image,matlab,image-processing,normalization,Image,Matlab,Image Processing,Normalization,我有下面的代码,我正在尝试在过滤后规范化我的图像,但问题是,一旦它到达第5行,它将everyting更改为0,并返回黑色图像。有什么想法吗 for i=1:10 temp_imag = imag_test1{i}(:,:); t_max = max(max(temp_imag)); t_min = min(min(temp_imag)); temp_imag = (temp_imag-t_min).*double(((new_max-new_m
for i=1:10
temp_imag = imag_test1{i}(:,:);
t_max = max(max(temp_imag));
t_min = min(min(temp_imag));
temp_imag = (temp_imag-t_min).*double(((new_max-new_min)/(t_max-t_min)))+double(new_min);
imag_test1{i}(:,:) = temp_imag;
end
您不知道哪些值
new_max
和new_min
get,但无论如何,如果在第5行之后每隔一行(temp_imag=(temp_imag-t_min)。*double((new_max-new_min)/(t_max-t_min))+double(new_min);
)一切都变为零,有几种可能性:
imga_test{i}
(1你不知道哪些值new_max
和new_min
get,但无论如何,如果在第5行之后每隔一行(temp_imag=(temp_imag-t_min)。*double((new_max-new_min)/(t_max-t_min))+double(new_min);
)一切都变为零,有几种可能性:
imga_test{i}
(1我会尝试呈现预v.s.后处理图像:
figure();
for i=1:10
temp_imag = imag_test1{i}(:,:);
subplot( 1, 2, 1 ); imshow( temp_imag, [] ); title( 'pre' );
t_max = max(max(temp_imag));
t_min = min(min(temp_imag));
temp_imag = (temp_imag-t_min).*double(((new_max-new_min)/(t_max-t_min)))+double(new_min);
subplot( 1, 2, 2 ); imshow( temp_imag, [] ); title( 'post' );
imag_test1{i}(:,:) = temp_imag;
end
我会尝试呈现预v.s.后处理图像:
figure();
for i=1:10
temp_imag = imag_test1{i}(:,:);
subplot( 1, 2, 1 ); imshow( temp_imag, [] ); title( 'pre' );
t_max = max(max(temp_imag));
t_min = min(min(temp_imag));
temp_imag = (temp_imag-t_min).*double(((new_max-new_min)/(t_max-t_min)))+double(new_min);
subplot( 1, 2, 2 ); imshow( temp_imag, [] ); title( 'post' );
imag_test1{i}(:,:) = temp_imag;
end