How to cut numbers from an image dynamically?

I got to this stage: picture of img

where can I find the numbers in the above image, but I need to cut them out, so I can keep the order, etc., but with an increase in the number of intervals and position of the number?

so I think you need to find a white PX to continue until it finds a solid black col, and then use the dots to take a simple shot, any help would be great.

+4
source share
2 answers

A simple solution would be the following:

  • Find the first top horizontal line containing white pixels.
  • From this line, find the first horizontal line containing only black pixels

- .

:

  • , .
  • , .

- .

.

, , .

- VB.net, :

Sub FindTopBorder(image As MyImage) As Integer
  For y = 0 to image.Height - 1
    For x = 0 to image.Width - 1
      Dim pixel = image.GetPixel(x, y)
      If ('Check if pixel is white here with RGB or Color') Then
        Return y
      End If
    Next
  Next
  ' Just in case there are no white pixels or use an exception instead
  Return -1
End Sub
+3

All Articles