# Intensity Transformation using Fuzzy sets

I'm doing a project on intensity transformation using fuzzy sets. In the book Digital Image Processing by Rafael C. Gonzalez. The author says this

Consider the general problem of contrast enhancement, one of the principal applications of intensity transformations.We can state the process of enhancing the contrast of a gray-scale image using the following rules:

• IF a pixel is dark, THEN make it darker.
• IF a pixel is gray, THEN make it gray.
• IF a pixel is bright, THEN make it brighter.

and equation

$$v_0 = \frac{\mu_\text{dark}(z0) \times v_d + \mu_\text{gray} (z0) \times v_g + \mu_\text{bright} (z0) \times v_b}{ \mu_\text{dark}(z0) + \mu_\text{gray} (z0) + \mu_\text{bright} (z0)}\tag{3.8-22}$$

but how do we calculate the $\mu_\text{dark}$, $\mu_\text{gray}$ and $\mu_\text{bright}$ values?

these are supposed to be the membership functions and how do we deduce the membership function values and calculate the new pixel values?

• Do you use MATLAB? Have you tried Fuzzy Logic Toolbox? I suggest you to watch parts of this tutorial video which was shared by MATLAB on its own youtube channel. Membership function in your question is chosen as triangular function scaled between 0 and 255 as pixel values. According to membership function you will automatically have $\mu_\text{dark}$, $\mu_\text{gray}$ and $\mu_\text{bright}$ when you input a pixel value $z_0$. – kdrtkl Feb 21 '17 at 20:14
• I'm trying to code it in java. – Harry Coder Feb 25 '17 at 1:56