How can I make a gray-scale image with a continuously changing intensity pattern?
Ältere Kommentare anzeigen
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!
Akzeptierte Antwort
Weitere Antworten (1)
Image Analyst
am 1 Feb. 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 Kommentar
ysung
am 2 Feb. 2013
Kategorien
Mehr zu Color and Styling finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!