Borrar filtros
Borrar filtros

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

1 visualización (últimos 30 días)
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 comentario
Ryan
Ryan el 29 de Sept. de 2012
do you mean an image that is a gradient that follows an exponential decay?

Iniciar sesión para comentar.

Respuestas (1)

Image Analyst
Image Analyst el 29 de Sept. de 2012
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.

Categorías

Más información sobre Images en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by