Thursday, November 7, 2013

Image Segmentation Based Approaches

Overview of Image Segmentation Methods

Image segmentation is the process of dividing a picture into multiple groups of pixels, which share certain characteristics. In terms of our project this is a portion intended to remove unwanted objects from our image, not unlike image preprocessing. There are various methods which were used in this project, some of them yielding results and others yielding not much in the way of results.

After these segmentation methods, we can use image postprocessing to identify whether or not our image contains a hand.

Edge detection

From algorithm that we used in the past, we try edge detection with Sobel method which is used to the noisy image. We first extract the image to R G and B matrices and put the edgedetection on each of the matrix since we do not want to lose any information of the image and the result is quite promising. However, the result cannot be easily manipulate such that the hand is extracted from the background since the edge of the hands are not showing all the way to the rim of image. This makes hard time for our algorithm to count the hands since we want to obtain solid single object in black and white. We tried to dilate the image but too much dilation cause the image to lose the information of finger showing so we decided that this method might not work best.


Gray Level Thresholding

Overall Results

The original method of image segmentation through the use of a gray threshold level. The image would be converted to grayscale via averaging the red, blue, and green values in the image and corresponding that to a "gray" level. From there the gray image would be converted to black and white; if the value exceeded the threshold it would be set to white, if it did not exceed threshold it would be black. Early attempts had various issues, and even now some issues remain unaddressable. 

Automated Threshold Detection

One of the fundamental issues encountered initially was that of deciding a threshold value appropriate for the image in hand. It was deemed that the initial guess-and-check method was not efficient and was not in the spirit of the EECS 451. The solution lied inside the gray-histogram.

A gray histogram shows the distribution of gray levels within a image. Considering that a image only as 8 bits to represent all gray levels, it is noted that there are only 256 'bins' for gray levels.

It was assumed that the background would be the bulk of the image, and it would have a gray-level distribution distinct and notably different from the hand color.



Our ideal case

Gray Level Histogram of Image to the left. Can you tell which bin corresponds to the white background?

 

 

The final result of our thresholding, nearly perfect even without postprocessing.

 

Complications

This method was not without its shortcomings. Because it uses a average to calculate gray level, it is not a unique value. In rare cases the entire image's grayscale version would be roughly the same color. Moreover if the background is not of uniform color, or the image preprocessing is poor, it becomes increasingly difficult to identify the peaks associated with the background.

Particularly poor was the image in the yellow background.

Our most problematic image, poorly lit, bad background color



The grayscale lighting adjusted version of above image.
Its visible what the background corresponds to, but where does it stop and end? Moreover it does not necessarily correspond to JUST the background.


This is insufficient for our biometrics, even after postprocessing.

RGB Skin Filtering

Since image consists of RGB matrices and we are specifically focus on hands, we can determine the range of the values of each matrix to distinguish skin from the ambient background. However selecting the threshold value is troublesome since each hands are not showing the same values of pixels due to lighting condition and other effects. We decided to adapt this method by using the average value of each layer and set that to threshold for that specific layer. This idea works quite decent compared to guess and check threshold method mentioned.


YCbCr Skin Filtering

It is the same with RGB method but instead use Y Cb Cr matrices since it works better for skin detection.

Region Growing

Overall Results

Region growing is a region-based image segmentation method starting form the selection of initial seed points and grow that seed points till they reach the threshold of the change in gradient of image. We tried with region growing and the results are promising for the clear image with only one seed point. The problem with this method is quite long calculation time. In addition, with noisy image, we have to be more specific on selecting the seeding points of interest. When the image is not clear, we definitely need more than one starting points which could take longer time. Later, this method might be useful for noisy image since we could specify the points of interest and specifically pick the areas of interest but the calculation time will be longer. The figures below show the one point region growing with the clear image and the noisy image respectively.

Texture Based Segmentation 

Overall Results

The process of segmenting a image based on 'textures'. Using the matlab function entropyfilt we are able to measure the "entropy" or randomness of a given region of the image, for each 9x9 pixel area. A threshold must then be set on the entropy values, such that it can assign black to amounts greater than the entropy threshold, or lower than it.


The output of the entropy filter, where each gray level corresponds to a normalized entropy value.


Black-White output of the entropy filter.

The final result, after image postprocessing.




Final Algorithm

We use RGB ad YCbCr skin filtering combined together for our final algorithm due to its accuracy to detect hands and fast computation time.


 

No comments:

Post a Comment