Image Processing Class #3 — Point Operation | by Pitchaya Thipkham | Towards Data Science

This article is for sum up the lesson that I have learned in medical image processing class (EGBE443).
This article is about basic image processing. If you are new in this field, you can read my first post by clicking the link below. :)
towardsdatascience.com
Sometimes, pictures taken from the camera may provide poor quality. They were the result of the terrible light at that moment. So, A basic way in image processing to enhance image quality is the point operation.
Point Operation
Auto-contrast Adjustment
Modified Auto-Contrast
Histogram Equalization
Histogram Specification
Point Operation is the modification of the pixel value without changing in the size, geometry and local structure of the image. The new pixel value depends only on the previous value. They are mapped by a function f(a)
if the function f() not depend on the coordinate, it is called “global” or “homogeneous” operation. Another one is called “nonhomogeneous” point operation if it depends on the coordinate. Nonhomogeneous point operation is used to compensate for uneven lighting during image acquisition.
The common examples of homogeneous operation include:
Modifying contrast and brightness
Limiting the Result by Clamping
Inverting Image
Threshold Operation
The implement of the point operation affects on the histogram. Raising the brightness shift the histogram to right and increasing the contrast of the image expand the histogram. These point operations map the intensity by the mapping function contained the constant which is image content such as the highest intensity and the lowest intensity.
Auto-contrast modification is the method to map the lowest intensity and highest intensity which found in the image to the minimum and maximum intensity of the full intensity range respectively (in case of 8 bits gray-scale image, the full range is 0–255). The mapping function of Auto-contrast adjustment is defined as
From the equation, a min, a max, a low and a high are minimum value intensity, maximum value intensity in the range, lowest intensity and highest intensity respectively. In case of 8-bit image, a min=0 and a max=255 so the mapping function is defined as
The highest intensity and the lowest intensity may be the noise of the image, We exclude these noise by saturating intensity of the image using quantile. And it can be calculated from the equation below.
And the mapping equation is defined as
This task performs in order to make the difference of two images easier to compare and to use in print publication. The principle is mapping image histogram to an approximate uniform distribution. The mapping function is defined as:
Where H(a) is the cumulative histogram of pixel value a, K is maximum intensity value and MN is the lastest cumulative intensity.
You can apply it to your python code using OpenCV module
equ = cv2.equalizeHist(img)
And here is the result of histogram equalization process.
This task is similar to histogram equalization but the aim of this process is mapping distribution function of histogram to the reference distribution. To be independent of image size, the image intensity needs to be normalized into range 0–1. Normalized histogram is interpreted as a probability density function (pdf) of random process. Where p(i) is probability for the pixel value i and h(i) is the summation of all intensity value. So the summation of all probability function is equal 1.
H(i) defined as cumulative histogram and the statistical counterpart of H(i) is discrete distribution function P(). This is also called cumulative distribution function (cdf).
Principle of histogram specification
As shown in the figure, we need to map the pdf of image A to the reference image R. We obtain the new pixel value a’ as
So, the mapping function is defined as
Make sure that pdf of reference image R is invertible (have exiting value for b =[0,1]).
However, there is not only point operation which is the method to modify image but there is another method and it was called ‘Filter’. I will introduce you more information in the next chapter. See you soon!
Now, the next chapter is published. You can click the link below to read it. :D