Skip to main content

A package for line and word segmentation of handwritten scanned text

Project description

HandySeg package

1. Line Segmentation from Handwritten Text

Overview

Seam Carving and Horizontal Projection Profiles (HPP) are used to segment lines of handwritten text from an image. Initially, HPP is used to detect lines, ensuring the seam's path between lines does not shift outside the boundary, maintaining alignment based on low energy.

Horizontal projection profile of handwritten text image
Figure A: Horizontal projection profile of handwritten text image

Handwritten part of scanned image (from IAM dataset), crossed out lines
Figure B: Handwritten text image with crossed out lines

Energy calculation is performed, and an algorithm is applied to find the low path energies between lines, ensuring paths do not extend beyond the identified rows. This maintains the integrity of the seam's path.

Marked the lowest energy paths between each two lines
Figure C: The lowest path energies between each two lines

Segmented handwritten line text
Figure D: Segmented handwritten line text

2. Word Segmentation from Segmented Lines

Overview

First, a Close Morphological operation is applied to the segmented line using a kernel size dependent on both the width and length of the segmented line.

Segmented handwritten text with Closing Morphological operation
Figure E: The binary image after applying the Closing Morphological operation

Next, contours of the preprocessed segmented line image are found.

Drawn a rectangle around each word
Figure F: Drawn a rectangle around each word

Segmented word
Figure G: Segmented word

Limitations

Line Segmentation:

  • Does not work well on images with objects other than handwritten text.
  • Not effective for lines with a large width.

Word Segmentation:

  • Ineffective for words with excessive space between characters.
  • Not suitable for words with minimal space between them.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

HandySeg-0.5.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

HandySeg-0.5.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file HandySeg-0.5.0.tar.gz.

File metadata

  • Download URL: HandySeg-0.5.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.10

File hashes

Hashes for HandySeg-0.5.0.tar.gz
Algorithm Hash digest
SHA256 02024cd4121c23b4200a6ffc933b3dcb807bc9020dc3b304ae622becee2c0bbc
MD5 b24f22bb6ecf624baa95ba09fed38330
BLAKE2b-256 a3e0625e42ebbfb34504870fe1a4d37fb0c623ec2d1e4adb0548fb0815b2dad1

See more details on using hashes here.

File details

Details for the file HandySeg-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: HandySeg-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.10

File hashes

Hashes for HandySeg-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 207abf38f4ffca57a14a4ccef57432141e276653a8fce09e32ac6abe630a9d45
MD5 cedfb64c09485975a10e2b66f1a9dbc5
BLAKE2b-256 c818f0e2783f6ef94771f7dc34336bf7972a88448eebcd81a87c3372fa378183

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page