GUI to automatically measure distance between 2 curves
2 views (last 30 days)
Show older comments
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!
0 Comments
Answers (1)
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
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.
See Also
Categories
Find more on Display and Exploration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!