How to get continues x and y cordinate of pen like tool

조회 수: 1 (최근 30일)
chhaya gohel
chhaya gohel 2014년 12월 24일
댓글: Image Analyst 2014년 12월 27일
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
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...?
chhaya gohel
chhaya gohel 2014년 12월 27일
sir pen.m is my source code in which i am storing x and y co-ordinates in Strokes.csv file but because of fast movement of mouse i am not getting continuous points between pen_down to pen_up events. what i want is continuous plotting of points form one pen_down event to next pen_up event. in my code pen.m user can write pressing mouse button and when its writing done he/she can release mouse button. now i want continuous plotting of all the points of mouse moment from down to up. i attached file of code.

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

채택된 답변

Image Analyst
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
chhaya gohel
chhaya gohel 2014년 12월 27일
thank you sir , but sir what i want is explained below:
sir pen.m is my source code in which i am storing x and y co-ordinates in Strokes.csv file but because of fast movement of mouse i am not getting continuous points between pen_down to pen_up events. what i want is continuous plotting of points form one pen_down event to next pen_up event. in my code pen.m user can write pressing mouse button and when its writing done he/she can release mouse button. now i want continuous plotting of all the points of mouse moment from down to up. i attached file of code.
Image Analyst
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개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by