How Shot Detection Works

cbdmaul edited this page Sep 29, 2016 · 6 revisions

The webcam feed is provided using OpenCV and processed using a custom algorithm. Webcam discovery is proved by Sarxos' webcam-capture.

  1. The most recent frame is read from the webcam
  2. The brightness is threshold using a moving average of 1/3 of the FPS (333ms)
  3. The pixels that are brighter than this threshold are collected into a bright pixel list
  4. The bright pixels are clustered
  5. Clusters of 6 or more pixels are checked to verify a high density (Closely resembling circles)
  6. The surrounding edge pixels are compared to the previous frame to determine the net change in color