I think you better show us at least of a couple of an example snapshot (a text representation is enough, like 50 text rows each one containing 24 0/1 digits), together with how you represent the 24x50 values inside the code, to le us know how handle it. E.g. a 24x50 char array? Or an array of 50 unsigned longs (as a bit mapped with mask 0x00FFFFFF aka with the first 24 bits)?
And are all the boxes rectangular (including squares), right? Because if you detect leading edges only, I think there's no clue to tell if it's rectangular or triangle as an example.
PS: looks like a 2D Hough Transform... Or AI shape recognition... ![]()