MATLAB Answers

Change getpts to circle cursor.

2 views (last 30 days)
Tom Wills
Tom Wills on 6 Oct 2020
I am looking to change the cursor to a circle when using the getpts function. I am manualy digitizing a video frame by frame of a ball traveling across the frame.

  0 Comments

Sign in to comment.

Answers (1)

Kiran Felix Robert
Kiran Felix Robert on 9 Oct 2020
Hi Tom,
You can use the drawpoint function from the Image Processing Toolbox, ROI-Based Processing to have a circular marker on the image. The following code snippet gives you an example for a still image, you can loop it for every frame
I = imread('cameraman.tif');
imshow(I);
ptsx = []; % Final vector for x position
ptsy = []; % Final Vector for y position
for i = 1:4 % To save 4 points
roi = drawpoint('Color','r','SelectedColor','none');
ptx = roi.Position(1);
pty = roi.Position(2);
ptsx = [ptsx ptx];
ptsy = [ptsy pty];
end
Kiran Felix Robert

  0 Comments

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!