Change getpts to circle cursor.

1 回表示 (過去 30 日間)
Tom Wills
Tom Wills 2020 年 10 月 6 日
回答済み: Kiran Felix Robert 2020 年 10 月 9 日
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.

回答 (1 件)

Kiran Felix Robert
Kiran Felix Robert 2020 年 10 月 9 日
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

Community Treasure Hunt

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

Start Hunting!

Translated by