how to plot mouse movment without missing any point

조회 수: 1 (최근 30일)
chhaya gohel
chhaya gohel 2015년 1월 29일
댓글: chhaya gohel 2015년 1월 30일
Hii every one I need help In my project I am ploting mouse movment on x and y axes. But in that some points misses..
This is how I am using plot..
p = get(h_axes,'CurrentPoint');
x = p(1,1);
y = p(1,2);
x_pen = [x_pen x];
y_pen = [y_pen y];
plot( h_axes,[x_pen(end-1) x],[y_pen(end-1) y]','b.-', ...
'MarkerEdgeColor','k', 'MarkerFaceColor','b', ...
'MarkerSize',10, 'Tag','TRAJECTORIA' );
I am devloping pen like tool which in which I want to plots mouse tracing continously but some points misses,,.. Is there any way to solve this..
  댓글 수: 2
per isakson
per isakson 2015년 1월 29일
편집: per isakson 2015년 1월 29일
  • Is this code inside a loop?
  • Which Matlab release?
  • Is&nbsp hold on ?
  • Only the two most recent points are displayed. Is that by intent?
chhaya gohel
chhaya gohel 2015년 1월 30일
sir i am capturing mouse movment from mouse button down to next up event.
so this code is in WindowButtonMotionFcn@movment where movment is my function for capturing and plotting co-ordinates..
hold is on
and not just two but all the points of mouse movment is going to be plot.. but the problem is some points misses during this plot ..

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

답변 (1개)

Image Analyst
Image Analyst 2015년 1월 30일
If you have the Image Processing Toolbox, how about using imfreehand()? Demos attached.
  댓글 수: 1
chhaya gohel
chhaya gohel 2015년 1월 30일
thank you sir.. now with this code i can add the points with interpolation..
but my problem is still there..
sir actully i am capturing mouse movment and same time plotting it..
so when x and y co ordinate Reaptes it will be taken as a junction point. So I need to get the points without missing any of them..
Suppose
X -> 1.2 1.3 1.5 1.6
y->1.4,1.6,1.7,1.8
here in x 1.4 and in y 1.5 in missing so I will not get continouse
plotting and that’s why I am not getting reaptes points even if I draw in such way that points get reapted..
so is there any way to add this points without distrbing the existing point..
i can not add points dynamically , it is very time consuming anf the size of x and y changes with my free hand drawing so how to solve it

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by