connected-components:area-threshold
Posted: 2016-10-05T11:39:51-07:00
I'm having trouble with connected components and minimum area-threshold being observed. When I use 4 connected pixels, it reports an extra, smaller area in bold below. When I use all 8 pixels, it shows what I believe are the correct areas.
Here is the image:
Here's how I ran connected-components with 4 neighbors:
Objects (id: bounding-box centroid area mean-color):
0: 810x414+0+0 374.6,161.6 191189 srgb(0,0,0)
717: 290x213+519+201 663.5,307.0 61770 srgb(255,255,255)
347: 284x185+226+108 367.5,200.0 52477 srgb(255,255,255)
725: 180x166+36+215 125.5,297.5 29880 srgb(255,255,255)
300: 4x7+138+95 139.2,98.0 24 srgb(255,255,255) <--- this shouldn't be here
Here's how I ran connected-components with 8 neighbors:
Objects (id: bounding-box centroid area mean-color):
0: 810x414+0+0 374.6,161.6 191213 srgb(0,0,0)
521: 290x213+519+201 663.5,307.0 61770 srgb(255,255,255)
289: 284x185+226+108 367.5,200.0 52477 srgb(255,255,255)
529: 180x166+36+215 125.5,297.5 29880 srgb(255,255,255)
Version: ImageMagick 7.0.3-2 Q16 x86_64 2016-10-02 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules OpenMP
Delegates (built-in): bzlib cairo djvu fftw fontconfig fpx freetype gslib jng jpeg lcms ltdl lzma pangocairo png ps tiff webp wmf x xml zlib
Linux mpv 3.10.0-327.28.3.el7.x86_64 #1 SMP Thu Aug 18 19:05:49 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
How I created the input gif:
Also, for some reason I couldn't figure out, when I tried to feed a tiff to connected-components, it found many, many more areas rather than the gif.
My actual goal is to identify and locate the white box on the bottom right of the image which is one of the objects found.
Please let me know what I'm doing wrong (most likely), or if it's some sort of bug (much less likely).
Thanks!
PS. Is the wish-list up to date at http://www.imagemagick.org/script/support.php
Here is the image:
Here's how I ran connected-components with 4 neighbors:
Code: Select all
magick Popaque2.gif -define connected-components:area-threshold=7700 -define connected-components:verbose=true -connected-components 4 null:
0: 810x414+0+0 374.6,161.6 191189 srgb(0,0,0)
717: 290x213+519+201 663.5,307.0 61770 srgb(255,255,255)
347: 284x185+226+108 367.5,200.0 52477 srgb(255,255,255)
725: 180x166+36+215 125.5,297.5 29880 srgb(255,255,255)
300: 4x7+138+95 139.2,98.0 24 srgb(255,255,255) <--- this shouldn't be here
Here's how I ran connected-components with 8 neighbors:
Code: Select all
magick Popaque2.gif -define connected-components:area-threshold=7700 -define connected-components:verbose=true -connected-components 8 null:
0: 810x414+0+0 374.6,161.6 191213 srgb(0,0,0)
521: 290x213+519+201 663.5,307.0 61770 srgb(255,255,255)
289: 284x185+226+108 367.5,200.0 52477 srgb(255,255,255)
529: 180x166+36+215 125.5,297.5 29880 srgb(255,255,255)
Code: Select all
magick --version
Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules OpenMP
Delegates (built-in): bzlib cairo djvu fftw fontconfig fpx freetype gslib jng jpeg lcms ltdl lzma pangocairo png ps tiff webp wmf x xml zlib
Code: Select all
uname -a
How I created the input gif:
Code: Select all
magick Popaque2.tiff -fuzz 3% -fill black +opaque white -fill white +opaque black Popaque2.gif
My actual goal is to identify and locate the white box on the bottom right of the image which is one of the objects found.
Please let me know what I'm doing wrong (most likely), or if it's some sort of bug (much less likely).
Thanks!
PS. Is the wish-list up to date at http://www.imagemagick.org/script/support.php