Ball Trajectory Detection( speed and direction) with 100ms reaction time

HI , I am new to OpenMV.

I would like to build the following for the child. There is no exsiting example on youtube. Any suggestion to me?

Trash Classification Related Content

  1. Trash Bin Setup: There are three trash bins: red (hazardous waste), blue (recyclable materials), and green (kitchen waste).
  2. Color Representation: The red ball represents hazardous waste, the blue ball represents recyclable materials, and the green ball represents kitchen waste.
  3. Single CAM Use: Only one CAM will be used.
  4. Bin Covers: The lids of all trash bins can be opened and closed. (The mechanical electronic drive part will be completed by me.)
  5. Ball Size: The diameter of the balls is 15 cm.

Game Settings

  1. Child Participation: Children will use the red ball to represent hazardous waste, the blue ball for recyclable materials, and the green ball for kitchen waste.
  2. Throwing Distance: The throwing distance for children is 3 to 5 meters, with a requirement for fast reaction speed, such as 0.1 seconds. It will provide electronic signal output to open the corresponding trash bin, or it may not require opening any bin (e.g., three I/O ports).
  3. Reaction Speed: Due to the relatively short distance, there is a strict requirement for reaction speed, possibly requiring a response in 3 to 4 frames.
  4. Trajectory Detection: It is necessary to detect the trajectory of the trash being thrown, not just simple color detection.
  5. Closed Trash Bins: All trash bins are closed.
  6. Red Ball Reaction: When a child throws a red ball, the visual recognition system detects that the red ball is within the range of the red trash bin, causing the lid to open, and the red ball drops into the red trash bin. It cannot enter other bins.
  7. No Response for Non-Red Bins: If the child throws a red ball and it reaches the range of a non-red trash bin, the red trash bin must not respond. Other colored bins should also not respond.
  8. Same Logic for Other Colored Balls: The same logic applies to other colored balls.

Hi Wilson,

This is technically possible with the OpenMV Camera. However, there’s a few things about the setup which will make your life challenging.

  1. Camera Angle - is the camera mounted next to the bins looking at the child? If so, this means that it can see a lot of stuff in the background. So, it will be somewhat challenging to isolate the ball in the child’s hands from what they are wearing and etc.

  2. Reaction speed. You’ll need to detect and open the bin extremely fast. The mechanical components for the bin will need to be quite aggressive. Given you are mentioning a child in this setup I would ask you to consider the safety of what you are about to build as to meet your requirements the hardware to drive these lids could be dangerous.

Anyway, as for detecting and tracking a ball… color tracking will do a good job of finding a blob here and tracking the colored object. You’ll want a very matte ball so that light reflections on it don’t change its color. You can then split the image into 3 columns to detect which bin the child is tossing the ball into.

You’ll find our new genx320 camera is exceptionally good at the tracking part of this application and will perfectly find the ball and track it through the image very quickly. However, it cannot measure color.

Generally, color tracking is going to struggle unless you can control the environment. For the best results, the camera would be mounted on the ceiling and pointed down. Then the problem becomes very simple as you just look for different colors and track the angle they are traveling between frames. The floor should contrast with the color of the balls.