I have done this "type" of feature extraction before. Normally how I have seen it done (and I was somewhat the inventor of this process at a company I worked for in the past) was:
1D Blob detection:
- Move through each row pixel by pixel from left to right (or from right to left)
- if you move from a black pixel to a pixel right of it where you transition into your definition of white (as set by a threshold), then mark that point
- from a black to white transition, you now concentrate your search for a white to black transition
- when white to black is found, pair the black to white transition boundary and white to black transition boundary into (what I call) a "1D blob" and store in a list of 1D Blobs
2D Blob correlation:
- After you now have your list of 1D Blobs, you need to correlate the 1D Blobs into 2D blobs by looking for ones that are adjacent
You CAN define a boundary many different ways:
- Binary decision of whether a pixel is above or below threshold value (easiest, and fastest)
- bottom, mid, or top point of transition, where the transition could be slow from black-to-white / white-to-black or fast (this is called transient response), also known as the slope that you are looking for
In your case it LOOKS as if your images are truly binary (black and white without gray shades), so binary thresholding will work just fine.