How do you plot gray values in a picture?
Afficher commentaires plus anciens
Hi,
For a project we have to answer the following question:
Generate the Shepp‐Logan head phantom image P using the MATLAB command P =
phantom(‘Shepp-Logan’,n) with for n the value 256, indicating the number
of columns and rows. Convert the image to double and show it on the screen (use
im2double and imshow). Apply if necessary display scaling in order to improve
the visualization of the ellipses, measure the gray values of the different ellipses and
plot these values in a black and white picture of the phantom (ginput or
impixelinfo).
What we have so far for our code in MatLab is:
n = 256;
P = phantom('Shepp-Logan',n);
Pphoto = im2double(P);
width = 15;
length = 0.1;
BetterPphoto = Pphoto.*width + length;
figure(1), imshow(BetterPphoto); %see added picture for the figure
InfoBetterPphoto = impixelinfo;
The gray values we got from impixelinfo are: 0.10, 0.40, 0.20, 0.75, 0.55 and 15.10
We're having trouble with the last part of the question: measure the gray values of the different ellipses and plot these values in a black and white picture of the phantom. How do we plot these gray values in the black and white picture of the phantom?

Black and white phantom.

Figure 1
Thanks in advance for your help!
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Basic Display dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!