3
$\begingroup$

There is an image from roulette spin video, and I have a code to track the ball position on the image

enter image description here

(*Mask is a visible ball track on the rim*)

enter image description here

Module[{ball,c},

ball=FillingTransform@DeleteSmallComponents[Binarize[ImageSubtract[img,Mask],.42],100];

c = Flatten[ComponentMeasurements[ball,{"Centroid","BoundingDiskRadius"}][[All,2]],1];

Show[img, Graphics[{Thickness[.01], Magenta, Circle @@ c}]]]

it works :)

enter image description here

But I want to track the ball position in the video instead of image.

there is a list of images

frames = Import["C:\\Users\\vito\\Desktop\\frame.avi", {"ImageList"}];

how can I change my code to get a desired result?

Thank you in advance to any one who may be able to give me some ideas

$\endgroup$
  • 2
    $\begingroup$ Why not just run your code on each frame of the video? $\endgroup$ – C. E. Jan 9 at 20:02
  • $\begingroup$ Perhaps ImageFeatureTrack could help. $\endgroup$ – Chip Hurst Jan 9 at 20:51

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.