GUI to automatically measure distance between 2 curves

2 views (last 30 days)
Hi, newbie to Matlab - I am doing a project to measure the sedimentation layers of earth (working on cross-cut image of the layers - look like layers of cake). I need to be able to create a GUI to draw two curve lines on the image and then when clicking on any two points (one on each curve) it would automatically calculate the distance between the two. I am not completely sure if this is feasible in Matlab - can anyone point me to the right functions/tools that I should use to do this in a GUI? Thanks!

Answers (1)

Friedrich
Friedrich on 8 Aug 2011
Hi,
you have two curves f_1, f_2, a user given point (x,y) and you want the distance between the curves at that point? If so do,
norm(f_1(x,y) - f_2(x,y))
  2 Comments
Nathan D
Nathan D on 8 Aug 2011
Hi I apologize - I was not specific enough with my question - just made a revision. I am looking for ways to do this in a GUI. Thanks.
Friedrich
Friedrich on 8 Aug 2011
So the user should click into the image and you like to get the (x,y) coords of his click. After that you like to calculate the distance to some curves. How to capture a click and get the coords of the click can be obtained in the window_motion_test function located in C:\Program Files\MATLAB\R20***\help\techdoc\ref\examples. One you have the coords you can calculate the function values and the distance.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!