Simple manual character segmentation from images
Segmentation is the process of partitioning an image into different regions or multiple segments. These segments are the collection of pixels. Images are segmented to locate objects or features of interest to be meaningful for image analysis.
The manual segmentation is commonly carried out in three stages:
- Segmentation of text into lines.
- Segmentation of line into words.
- Segmentation of words into characters.
For Segmentation of binarized image, the following steps are followed:
- Start from origin
- Scan horizontally (line segmentation)
if _noOfBlackPixel >= thresholdValue:
set previous pixel line as topBoundary
continue scanning horizontally until a line with _noOfBlackPixel<thresholdValue is detected and set it as bottomBoundary
3. Then from left end of image to the right end, do Vertical scanning from topBoundary to bottomBoundary (Character Segmentation)
if _noOfBlackPixel >= thresholdValue
draw a mark line on previous vertical line
draw upper and lower bounding lines also continue scanning vertically until a pixel-line with _noOfBlackPixel < thresholdValue is detected and draw a mark line on that pixel-line.
4. Repeat step 3 until right end is reached
5. Repeat step 2 until end pixel is reached