How do you plot gray values in a picture?
显示 更早的评论
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!
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Convert Image Type 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!