Using magick.net in C# to find tables

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
jayantrajwani
Posts: 2
Joined: 2019-01-08T05:59:06-07:00
Authentication code: 1152

Using magick.net in C# to find tables

Post 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
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

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

Post 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?
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
jayantrajwani
Posts: 2
Joined: 2019-01-08T05:59:06-07:00
Authentication code: 1152

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

Post 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
Post Reply