Simple manual character segmentation from images

samir khanal
1 min readOct 3, 2018

--

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:

  1. Start from origin
  2. 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

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

samir khanal
samir khanal

Written by samir khanal

AI Enthusiasts, Software Developer

No responses yet

Write a response