How to get continues x and y cordinate of pen like tool
1 次查看(过去 30 天)
显示 更早的评论
hii i devloped one pen like tool by which user can write with mouse or touch pad. in my gui i am using WindowButtonUpFcn WindowButtonDown WindowButtonMotionFcn. i m storing x and y co ordintes but some points misses during the write up. can any one help me? i want to get continues x and y points
2 个评论
Geoff Hayes
2014-12-24
You may need to post done of your code so that we can get an idea of what you are doing. Or describe which points are missing - all those near the end of the write up or...?
采纳的回答
Image Analyst
2014-12-24
You could also use imfreehand to do that. Like you said, sometimes there are gaps - it just depends on how fast you move the mouse. Move it fast and there will be a large distance between the points that it recorded.
I suggest using John D'Errico's interparc function http://www.mathworks.com/matlabcentral/fileexchange/34874-interparc to get points uniformly spaced along the curve you drew.
2 个评论
Image Analyst
2014-12-27
The second line in the help is wrong
% pen.m is a GUI ready to use
Of course, it doesn't run and throws an error when I try to draw in the figure.
Anyway what you said does not alter my answer. You need to interpolate points and you can use interp1() or interparc().
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!