Set up the "video canvas" and stream the camera to it.
Score: -
See: DrawImage.
See:
Thresholding creates a binary image (each pixel is black or white) based on some threshold value:
- if a pixel is above a threshold, then it is set to white
- otherwise (pixel is below a threshold), it is set to black
Note: you should probably make the threshold different for R, G, and B based on lighting, camera, etc.
Red:
Green:
Blue: