Skip to content

Image Pipeline

Mayank Mittal edited this page Dec 19, 2017 · 2 revisions

Maintainers: Akash Kumar Singh

IMAGE PIPELINE

PRE-PROCESSING

We use OpenCV-2.4.9 library for doing all of our image processing tasks.

Pre-processing process filters out any noise that might occur due to changes in water and lighting conditions. It essentially includes all the image enhancement techniques such as contrast correction, white balancing, noise reduction etc.

This contains all the filters which are applied to improve the quality of underwater images and noise reduction techniques for reducing the colored noise, then thresholding it. We need to extract every part of the image that is important w.r.t to the task, i.e. the highlighted picture of the targets, is brought to the foreground and the rest goes into the background.

Since the underwater images are degraded so the image enhancement techniques are applied to make the target clearly visible, colors distinguishable, and a little color uniformity for easy thresholding.

CLAHE algorithm for color correction

Ordinary histogram equalization uses the same transformation derived from the image histogram to transform all pixels. This works well when the distribution of pixel values is similar throughout the image. However, when the image contains regions that are significantly lighter or darker than most of the image, the contrast in those regions will not be sufficiently enhanced.

Adaptive histogram equalization (AHE) is a computer image processing technique used to improve contrast in images. It differs from ordinary histogram equalization in the respect that the adaptive method computes several histograms, each corresponding to a distinct section of the image, and uses them to redistribute the lightness values of the image. It is therefore suitable for improving the local contrast and enhancing the definitions of edges in each region of an image.

However, AHE has a tendency to over-amplify noise in relatively homogeneous regions of an image. A variant of adaptive histogram equalization called contrast limited adaptive histogram equalization (CLAHE) prevents this by limiting the amplification.

Then the bilateral filter is applied to remove the colored noise preserving the edges.

White balance for removing color casts

White balancing is an important processing step that aims to enhance the image appearance by discarding unwanted color casts, due to the various illuminant.

After this bilateral filter is again applied to remove the noise.

To reduce the noise in the thresholded image, Image Morphology is used. Image Morphology is often done on binary images that result from thresholding. The dilation() function is applied which computes a local maximum over the area of the kernel. In general, whereas dilation expands region A, erosion() reduces region A. Moreover, dilation will tend to smooth concavities and erosion will tend to smooth away protrusions. So, a combination of erosion and dilation operations are used to reduce the noise according to the specific tasks.

The findContours() function is used to find the contours in the image through which we will get all the relevant information about our targets like its center, contour area, contour center, etc.

After this, task-specific algorithms are applied to get the information about the task like coordinates, contour area and center of contour.