Page 1 of 1

Count regions that have similar color

Posted: 2016-01-27T11:39:11-07:00
by kaliber
Hello, I want to be able to detect the white regions in an image.
Here is an example.

Image

Precondition:
- SVG or Raster image
- Only two colors (mainly): black and white
- The regions are well defined: there are no tiny regions (eg. 1x1px regions)

Image

Postcondition:
- the numer of blank regions (11)


Thanks in advantage

Re: Count regions that has similar color

Posted: 2016-01-27T11:49:31-07:00
by fmw42
-connected components is what you want. See http://magick.imagemagick.org/script/co ... onents.php

Re: Count regions that have similar color

Posted: 2016-01-28T10:04:19-07:00
by kaliber
Thanks. Very useful :)