Sizing a block
The PC turns each camera frame grey, blurs it, and keeps only the white block on the black belt. OpenCV finds the block’s outline, and its area decides the size: under 17,000 square pixels it is small, under 28,000 medium, and anything larger is large.
A single frame can be wrong while a hand passes or the block still moves. So the program sends a size only when eleven frames in a row agree, and at most once every five seconds.