Tracing line in a graph

조회 수: 6 (최근 30일)
Ilham Hardy
Ilham Hardy 2015년 8월 9일
댓글: Ilham Hardy 2015년 8월 10일
Dear all,
I have question on how to 'trace' a line in a graph. This is my first attempt to do 'image-processing' in Matlab, so pardon me if my explanation is a bit lenghty.
Let me start from the beginning,
  • I have a graph (in paper) that i need to convert to data for further processing.The graph contains several lines (two line groups), each line need to be read (converted to data) as rigorously as possible (so less to none interpolation operation).
  • What i did is scanned the graph, and traced each line group as closely as possible with two colors (blue and green in MS Paint), then i read the file in Matlab (bitmap). By applying some threshold in RGB channel, i get the blue and green line. (no problem here)
  • The green line is a single continous line. The blue lines contain several 'open curves' and also several 'closed curve'. Each line of the blue lines has different label, so i need to further defines the blue line.
  • I am able to trace the 'open curve' blue lines by creating difference mask. If the difference is above certain threshold then it belongs to another line..
  • The question how can i trace the 'closed curve' blue lines? When i implement the same approach for the 'open curve', i only get the bottom half of the curve (logical, because the difference threshold).
  • I tried to trace it with more 'brute'-way, i masked the white-part (background) to NaN and i do while loop in x-axis, find the top and bottom of y-axis for each x-axis (script skip to the next x when several nan encountered). The idea is to loop forward and backward (when the last x is processed, say lower half of the curve is traced, do backward processing for top half until the starting point is reached). However the 'closed line' is not really closed . There are several gaps in the line . When there is gap, the do-while part of the script tend to pick points of other closely located closed-curve line.
To support my explanation, i attach the picture of the graph (blue lines, halfly traced). I don't think i can put the data and the script here though..
PS: I only have Matlab, no additional toolboxes. :)
Thanks, ILham
  댓글 수: 2
Star Strider
Star Strider 2015년 8월 10일
@Ilham — Perhaps if you asked, and if the paper was relatively recent and contact information provided, the authors would provide you with the data for that figure.
Nothing ventured, nothing gained.
Ilham Hardy
Ilham Hardy 2015년 8월 10일
Hi StarStrider,
It is actually something from the manufacturer, and they tend not to give away a detailed information (data) to avoid revealing their real efficiencies to their con-colleagues.

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

답변 (1개)

Image Analyst
Image Analyst 2015년 8월 9일
Do you have to use image analysis? Why not just digitize it manually using something like this: http://www.mathworks.com/matlabcentral/fileexchange/36904-matlab-script-for-digitizing-a-published-graph
  댓글 수: 1
Ilham Hardy
Ilham Hardy 2015년 8월 10일
Dear IA,
That was actually my first attempt to convert (digitize) the graph, by manually selecting several points on top of the lines. However the results (surf) is not as smooth as i required. Ergo the image analysis digitizing option was selected.
I am kind of half-way there though, I only need to figure out how to read the closed-curve lines. :)
Regards, Ilham

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

카테고리

Help CenterFile Exchange에서 Just for fun에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by