Page 1 of 1

About connected-components

Posted: 2015-12-16T05:56:40-07:00
by adil@alfasoft.ro
Can someone explain me why I get "convert.exe: too many objects" and how can be handle it this error.
It seems that does not matter the value of " -define connected-components:area-threshold ".
By the way, this value represent the minimum number of pixels of rectangle ( width x height ) or what?
I do not found many information about that.

Here is the image. https://www.dropbox.com/s/02erfct6buplxtc/ll.jpg?dl=0

Thank you.

Re: About connected-components

Posted: 2015-12-16T08:17:30-07:00
by magick
Type 'convert -version'. Does it return Q8? If so, you are limited to 256 unique objects. With the Q16 version of ImageMagick you are limited to 65536 unique objects. We have the Q16 version and connected component labeling completed without complaint, it contains 46570 unique objects.

Re: About connected-components

Posted: 2015-12-16T10:35:20-07:00
by fmw42
It is always best to provide your IM version and platform when asking questions on this forum. It saves a lot of back and forth questions. See viewtopic.php?f=1&t=9620. It is the very top listed post on the User's page.

Re: About connected-components

Posted: 2015-12-17T02:31:29-07:00
by adil@alfasoft.ro
Thank you very much.
Yes, Magic has right, I use 6.9.0.1 Windows Q8.
I don't understand why Q8 use only 256 and Q16 65K (except a simple 1 byte or 2 bytes representation). For most images Q8 is enough, but the limitation at only 256 connected components is too low.

Re: About connected-components

Posted: 2015-12-17T08:23:30-07:00
by magick
Connected components labels are stored as an index in the image colormap index. Q8 is limited to 256 colors (1-byte) where Q16 is limited to 65536 colors (2-bytes).

Re: About connected-components

Posted: 2015-12-17T10:43:45-07:00
by fmw42
All channels of Q8 compile IM are limited to 8-bits per channel. In Q16 compile of IM all channels are limited to 16-bits per channel when the image is written. Thus Q8 can only store 256 values in any channel, whereas Q16 can store 65535 values per channel.