Generate data from a image plot with colour code as reference.

조회 수: 3 (최근 30일)
Kushal Kumar
Kushal Kumar 2018년 10월 25일
댓글: Mahdi Bashiri 2021년 5월 26일
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
Kushal Kumar
Kushal Kumar 2018년 10월 25일
편집: Kushal Kumar 2018년 10월 25일
Jonas, Thank you for replying,
May I know how can I specify the line as user input over an image like this? the image kept here is just an reference plot so that I can understand the concept and way to generate the data.
I have different set of the data for which I need use similar procedure to obtain the values.
jonas
jonas 2018년 10월 25일
Okay, I'll just make an answer explaining how I'd approach this.

댓글을 달려면 로그인하십시오.

채택된 답변

jonas
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
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 CenterFile Exchange에서 Blue에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by