which imshow is true?
이전 댓글 표시
Hello. I have an image that i add some noise to it. finally i want to show it with imshow.i use two syntax but i dont know which one is right? here is my code:
% 2nd way b
clear all;
close all;
clc;
I=im2double(imread ('cameraman.tif'));
size_I=size(I);
%%adding noises
%adding quantization noise
thresh = multithresh(I,7);
valuesMax = [thresh max(I(:))];
[quant8_I_max,~] = imquantize(I,thresh,valuesMax);
%speckle noise
SI=imnoise(I,'speckle',0.2);
% adding salt and pepper noise or shot noise
Shot_noise = imnoise(I, "salt & pepper", 0.20);
%adding background noise
mean=0.5953;
BG = poissrnd(mean, size_I);
BGR=I+BG;
BGR=BGR./max(BGR);
% total noise
noisy_image=I+quant8_I_max+SI+Shot_noise+BGR;
figure
imshow(I);
title('Original Image')
figure
subplot(121)
imshow(noisy_image,[])
title("noisy image show with []");
subplot(122)
imshow(noisy_image)
title("noisy image show without []");
댓글 수: 1
Stephen23
2021년 12월 21일
Do you want to scale the image to its maximum and minimum values, or not? Only you know what your intent is.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Image Arithmetic에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
