how to display the output?

조회 수: 6 (최근 30일)
Neethu
Neethu 2014년 12월 5일
답변: Neethu 2014년 12월 5일
Hai, As a part of my project i want to calculate the dct of given image and compute the inverse dct to get back the original image. And the invrese transformed image undergo some attacks like awgn and the histogram equalization etc. But i couldn't display the output properly getting a white image in the figure...how can I get the original image in figure.code is below.
I=imread('pout.tif');
k=dct2(I);
L=idct2(k);
attack=histeq(L);
figure;imshow(attack)
channel=awgn(L,40);
figure;imshow(channel);

답변 (2개)

Guillaume
Guillaume 2014년 12월 5일
What is the type of your image? And what is the range of intensities in that image.
Possibly your image is of type double while the intensities are in the range 0-255. In which case if you call imshow with just the image you'll get a mostly white image as imshow assumes an intensity range of 0-1 for double images.
If that is the case, either pass the intensity range to imshow (or [] to use min-max of your image), or divide your image by the max intensity:
imshow(attack, []); %or
imshow(attack/255);
  댓글 수: 1
Neethu
Neethu 2014년 12월 5일
thank you.Now i can display the output figure..But when channel=awgn(L,0); in above code coludnt produce the noise affected specially the random out put?what is the reason?

댓글을 달려면 로그인하십시오.


Neethu
Neethu 2014년 12월 5일
clc close all clear all
I=imread('cameraman.tif'); k=dct2(I); L=idct2(k);
channel=awgn(L,0); figure;imshow(channel,[]);
while running this code didnt get the noise affected version of image (L)..how to get the noise affected image?

카테고리

Help CenterFile Exchange에서 Histograms에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by