필터 지우기
필터 지우기

How To Generate A Gray Level Exponential Decay Image Using Matlab.

조회 수: 1 (최근 30일)
Pranjal Pathak
Pranjal Pathak 2012년 9월 29일
Hi,
Can anyone help me in generating a gray level exponential decay image(suppose decaying with time) using matlab? The limit can be set according to your preference.
Thanks!
  댓글 수: 1
Ryan
Ryan 2012년 9월 29일
do you mean an image that is a gradient that follows an exponential decay?

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

답변 (1개)

Image Analyst
Image Analyst 2012년 9월 29일
Is this a homework? Does it want you to take some gray scale image, then have several steps of time where each step you multiply the image by exp(-stepNumber * decayFactor)? Easy enough to do. You'll get a floating point image as the result, so make sure you use [0 255] when displaying it so you'll see the effect.
imshow(decayedImage, [0 255]);
Otherwise all you'll see will be all white because the values will be > 1 and it expects floating point images to be in the range 0-1, unless you override it with a specified range like I did. Just put the above line in a loop over stepNumber where you increase that and the image gets darker. Here's a little snippet of code that you might want to put in your for loop near the bottom of it:
promptMessage = sprintf('Do you want to Continue processing,\nor Cancel to abort processing?');
titleBarCaption = 'Continue?';
button = questdlg(promptMessage, titleBarCaption, 'Continue', 'Cancel', 'Continue');
if strcmp(button, 'Cancel')
break;
end
Well that's a lot of hints - more than enough to let you make a little demo. Write back with your code if you run into any problems.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by