Tracking colored balls from phone camera

1 次查看(过去 30 天)
Hello,
I want to track multiple colored balls with my phone camera (each ball has a different color).
I have edited this script : openExample('vision/MotionBasedMultiObjectTrackingExample')
in such a way that it works live with my phone instead of using pre recored videos and this works quite well. However I have a few problems with which I would like to get some help.
  • When two balls are close together they are seen as one object
  • I would like to distinguish different colored balls
  • I already tried several of the standard online scripts. However these fail to cope with changing light in the background. and this is something this script does very well

回答(1 个)

Shashank Gupta
Shashank Gupta 2019-12-10
Hi Dominique,
The first problem which you mentioned about the script which is combining two different color and seeing them as one object arising because the script when create an object during the foreground segmentation convert the image to Binary image and use that masked image to create a bounding box or extract an object from the image, thus it lost the color property of image.
Instead you can first threshold out different color ranges from the image after the foreground segmentation and use them to extract or distinguish different colored balls. In case if you are not familiar with how to approach this, May be this LINK will give you a good head start.
I hope this helps.

类别

Help CenterFile Exchange 中查找有关 Tracking and Motion Estimation 的更多信息

产品


版本

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by