:: AForge.NET Framework :: Articles :: Forums ::

remove blobs or characters touching column lines

Forum to discuss Image Processing Lab (IPLab) application, its features, etc.

remove blobs or characters touching column lines

Postby abcddef » Wed Sep 17, 2014 5:05 am

I was working on image processing of tabular data. Thanks to Aforge.Net for msot part.
In order to remove grid lines of tabular data, I am trying this approach:
1) Identify the maximum size of rectangular box that contains data (a field in the table).
2) Use FillHoles to remove all data.
This would retain all lines, except data. But nothing is perfect in practical world. So, I have images where characters touch lines of the table in some cases and they dont get removed with this approach.
3) Then I used Invert.
4) Applied HorizontalRunLengthSmoothing with 8 to 10 maxgap so that I can create white blobs of those characters (except for few like 1).
Now, I want to remove those blobs to that are touching the lines (lines are not necessarily 1 pxiel wide... they are as wide as 4 pixels in some cases and they are not perfect lines.. they can be broken as well).

I tried HitNMiss to remove lines and retain blobs so that I can use BlobCounter to get blobs (which otherwise is not possible as blobs/chars are touching lines).
I then measure ech blob and predict the actual size (before HitNMiss) and apply CanvasFill to remove them from original inverted image (from step3).
The final image is then merged with actual image to remove lines.

But the process is not working well for all images as the lines cannot be consistent.

The better option is to retain lines are remove blobs from inverted image. But I am not able to find a means to do that.
Can any one suggest.
Also, even if my approach is wrong, please let me know better approach to remove lines without losing characters that are touching those lines.

Thanks for all the APIs
Posts: 1
Joined: Wed Sep 17, 2014 4:49 am

Return to IPLab