Colour Segmentation
  • Introduction
  • WHAT IS BEHIND?
    • Fuzzy Logic-based methods
      • Amante-Fonseca
      • Chamorro-Martínez
      • Liu-Wang
      • Shamir
  • USAGE
    • Segmentator object
    • Segmentation using Fuzzy Logic-based methods
  • Examples
    • Examples of Fuzzy Logic-based methods
Powered by GitBook
On this page
  • The background framework: Fuzzy logic and fuzzy sets
  • Colours as fuzzy sets

Was this helpful?

  1. WHAT IS BEHIND?

Fuzzy Logic-based methods

The classification of a colour is not a simple task, mainly because it is a subjective process. On this page we present the four main methods for colour segmentation based on fuzzy sets.

PreviousIntroductionNextAmante-Fonseca

Last updated 3 years ago

Was this helpful?

The background framework: Fuzzy logic and fuzzy sets

Traditionally, logic has been based on binary statements, with no need for further specification. However, many everyday situations require a greater degree of detail; for example, determining whether a person is tall or short, whether a process is efficient or not, or, specifically, whether a colour is red, orange or yellow. Because of the subjectivity of these processes, fuzzy logic is a good framework for modelling uncertainty.

Given a collection XXX, the fuzzy set FXF_XFX​ associated to XXX is the collection of pairs FX={(x,μX(x)) ∣ x∈X}F_X = \left\{\left.(x,\mu_X(x))\,\right|\, x\in X\right\}FX​={(x,μX​(x))∣x∈X}, where μX:X→[0,1]\mu_X: X\to [0,1]μX​:X→[0,1] is the membership function. For brevity, since the fuzzy set is uniquely determined by its membership function, we denote the fuzzy set by μX\mu_XμX​. Of all the membership functions in the literature, the most important are:

  • Triangular functions. They are defined by a lower limit aaa, an upper limit bbb and a value mmm which satisfies a<m<ba<m<ba<m<b. Its expression is given by:

μX(x)={0,if x≤a or x≥b,x−am−a,if a<x≤m,b−xb−m,if m<x≤b.\mu_X(x) = \begin{cases} 0, & \text{if $x\leq a$ or $x\geq b$,} \\ \dfrac{x-a}{m-a}, & \text{if $a<x\leq m$,} \\ \dfrac{b-x}{b-m}, & \text{if $m<x\leq b$.} \\ \end{cases}μX​(x)=⎩⎨⎧​0,m−ax−a​,b−mb−x​,​if x≤a or x≥b,if a<x≤m,if m<x≤b.​

  • Trapezoidal functions. They are defined by a lower limit aaaand an upper limit bbb, and a lower support limit mmm and an upper support limit nnn. The three parameters satisfy a<m<n<ba<m<n<ba<m<n<b. Its expression is given by:

μX(x)={0,if x<a or x>d,x−am−a,if a≤x≤m,1,if m≤x≤n,b−xb−n,if m<x≤b.\mu_X(x) = \begin{cases} 0, & \text{if $x< a$ or $x>d$,} \\ \dfrac{x-a}{m-a}, & \text{if $a\leq x\leq m$,} \\ 1, & \text{if $m\leq x\leq n$,} \\ \dfrac{b-x}{b-n}, & \text{if $m<x\leq b$.} \\ \end{cases}μX​(x)=⎩⎨⎧​0,m−ax−a​,1,b−nb−x​,​if x<a or x>d,if a≤x≤m,if m≤x≤n,if m<x≤b.​
  • Gaussian functions. They are defined by a central value mmm and a standard deviation k>0k>0k>0. When kkk goes smaller, the narrower the bell is. Its expression is given by:

μX(x)=exp⁡{−(x−m)22⋅k2}\mu_X (x) = \exp\left\{-\dfrac{(x-m)^2}{2\cdot k^2}\right\}μX​(x)=exp{−2⋅k2(x−m)2​}

Colours as fuzzy sets

As shown, color grading is a very subjective process. Therefore, the concepts of fuzzy sets will be applied for segmentation.

The difference between each of the methods is the colour palette they define, and their membership functions. The overall process can be summarised in the following diagram.

Due to the separation of the chromatic component, the implemented methods are based on the colour space. The H component concentrates the pure colour, while the S and V components represent, respectively, the saturation and the level of white present in that colour. In this module, each color will represent a fuzzy set, so that using its associated membership function over the H channel the degree of chromaticism can be studied. Currently, there are four methods based on fuzzy sets:

, using fuzzy trapezoidal membership functions.

, using fuzzy trapezoidal membership functions.

, using fuzzy trapezoidal membership functions.

, using fuzzy triangular membership functions.

The method for determining whether a colour is chromatic or not from its S and V components is defined in .

HSV
Amante-Fonseca
Chamorro-Martínez
Liu-Wang
Shamir
Amante-Fonseca
Graphical representation of the triangular membership function.
Graphical representation of the trapezoidal membership function.
Graphical representation of the Gaussian membership function.