Skip to content

Effects of applying various image feature extraction and processing algorithms


In this tutorial you will see the effects of applying various image feature extraction and processing algorithms.


Project structure

You will see the effects of applying various image feture extraction and processing algorithms for the following topics or algorithms:

Point operators:

Group operators:

The code of my library is organised as it is depicted below:


Point operators

  • Brightness operator
    q(x,y) = contrast*p(x,y) + bright
    brightnessForGrayImage(imageData, contrast, bright)
    Located in: ife/basic/operators.py

    Brightness


    Results for bright=50

    In this case it is interesting to look into histograms:

    Generally, when you change brightness, unchanged histogram is shifted left or right. In the second case it seems to be changed. It's not precise. If you look closer you will notice that shape is exactly the same, but scaled down. This is because values from red box:

    shifted rigth by 50 exceded upper limit of 255 and took value equall to 255. Other words, all values below 205 stays untouched and values from interval [206, 255] takes value 255. This explains why in the second case you can observe high bar at value 255.

    Contrast


    Results for contrast=2

    Look at histogram in this case:
    Results for contrast=2


    Results for contrast=0.5

    Look at histogram in this case:
    Results for contrast=0.5
  • Histogram normalization
    histogramNormalizationForGrayImage(imageData, outputLevelMin=0, outputLevelMax=255)
    Located in: ife/basic/operators.py



    Histogram normalization should stretch histogram in full range, by default from 0 to 255:

    In case of the first image it seems that normalisation doesn't take any effect - it is not stretched in full range as you can obsrve in second case. It's not true. If you look carefully into histogram, you will notice that there is a small bar at 255:

    which means that in original image there are some pixels of the value 255. If value 255 is reached, you can't stretch histogram to this end (because it is in this end right now).
  • Treshold
    tresholdForGrayImage(imageData, treshold)
    treshold2ForGrayImage(imageData, tresholdMin, tresholdMax)
    Located in: ife/basic/operators.py


    Treshold for treshold=128

    Left: Treshold for tresholdMin=25 and tresholdMax=75. Right: Treshold for tresholdMin=100 and tresholdMax=150.

  • Histogram equalisation
    histogramEqualisationForGrayImage(imageData)
    Located in: ife/basic/operators.py




Group operators

  • Gaussian averaging operator (blur Gaussian)
    blurGaussianForGrayImage(imageData, windowSize, sigma)
    Located in: ife/basic/filters.py


    Left: Blur for windowSize=9 and sigma=0.5. Middle: Blur for windowSize=9 and sigma=2. Right: Blur for windowSize=9 and sigma=5.


    Left: Blur for windowSize=9 and sigma=0.5. Middle: Blur for windowSize=9 and sigma=2. Right: Blur for windowSize=9 and sigma=5.

  • Mode filter
    filterModeForGrayImage(imageData, windowSize, numberOfIterations = 1)
    Located in: ife/basic/filters.py


    Left: Mode filter for windowSize=9. Right: Mode filter for windowSize=9.