Generate data from a image plot with colour code as reference.
2 次查看(过去 30 天)
显示 更早的评论
Hello, I am a naive user of Matlab, Please find the image attached. The image represents a Cp profile over a body. I would like to generate the data from this image. The grey line is my area of interest. My desire output is to generate Cp value (taken from the colour bar)at very point of that line with reference to y-axis.
3 个评论
采纳的回答
jonas
2018-10-25
I'd approach this by the following steps.
load image with axes and everything:
I = imread('FileName.png');
imshow(I)
Get start and end-points of the line as user input
[xi,yi] = getpts
y = min(yi):max(yi);
x = xi(1).*ones(size(y))
Get colors of each point
z = I(y,x,:)
Now you have the colors stored in z, you need to connect these colors to the colormap. Since the colorbar is defined in discrete steps, I would repeat the above procedure for the colorbar, asking the user to input a single coordinate for each color. Then you will have a type of conversion sheet so that you can connnect the colors of your line to the values from the colorbar. That's about it.
1 个评论
Mahdi Bashiri
2021-5-26
Could you help me how can I get the data of a generated plot by Matlab without saving the file itself?
So, I need to use imread command. As an example imread(sin(x))?
Thanks for the help in advance.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Blue 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!