Page 1 of 1

Using magick.net in C# to find tables

Posted: 2019-01-08T06:29:21-07:00
by jayantrajwani
I am trying to extract tables from an image and am looking for a generic solution to be able to extract multiple tables from an image without repetition.
Below is a command to do something similar.
How do i convert the following command to get a list of Images as output in C#.
Hope you can help.

Code: Select all

IFS=" "
OLDIFS=$IFS
IFS=$'\n'
bboxArr=(`convert image.png -alpha off -type bilevel \
-define connected-components:verbose=true \
-define connected-components:area-threshold=500 \
-connected-components 4 \
null: | grep "gray(0)" | awk '{print $2}'`)
num=${#bboxArr[*]}
IFS=$OLDIFS
for ((i=0; i<num; i++)); do
convert image.png -crop ${bboxArr[$i]} +repage image$i.png

Re: Using magick.net in C# to find tables

Posted: 2019-01-08T13:30:29-07:00
by dlemstra
I though you already figured this out because you closed this issue: https://github.com/dlemstra/Magick.NET/issues/367. You should the `ConnectedComponents` of `MagickImage` for this. Maybe you could give it a try yourself first this time?

Re: Using magick.net in C# to find tables

Posted: 2019-01-09T03:02:18-07:00
by jayantrajwani
I tried it figured out how to do it with AForge. I'll still give it a try with magick.net
Meanwhile if you could suggest some solution it'd be great.
Regards