Hello, I want to be able to detect the white regions in an image.
Here is an example.
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)
Postcondition:
- the numer of blank regions (11)
Thanks in advantage
Count regions that have similar color
Count regions that have similar color
Last edited by kaliber on 2016-01-27T12:14:01-07:00, edited 1 time in total.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Count regions that has similar color
-connected components is what you want. See http://magick.imagemagick.org/script/co ... onents.php
Re: Count regions that have similar color
Thanks. Very useful