How can I make a gray-scale image with a continuously changing intensity pattern?
Afficher commentaires plus anciens
Hi. I am trying to figure out how to make a gray-scale image with a continuously changing intensity pattern. For example, if I run the code below, I get a staircase-like discrete pattern along the horizontal direction because of the limited number of colormap values (?). I wonder if I can make it displayed more smoothly.
x = [1:10000]; figure(1), imagesc(x), colormap gray
Thank you!
Réponse acceptée
Plus de réponses (1)
Image Analyst
le 1 Fév 2013
If you don't specify the number of steps in the colormap, it defaults to 64 which give rise to the step-like appearance. You can specify how many steps to give the colormap, up to a max of 256. So do this, to give a smoother appearance:
colormap(gray(256));
1 commentaire
ysung
le 2 Fév 2013
Catégories
En savoir plus sur Color and Styling dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!