Step 4. Local Adaptive Thresholding: The Adaptive Threshold module is used in uneven lighting conditions when you need to segment a lighter foreground object from its background. In many lighting situations shadows or dimming of light cause thresholding problems as traditional thresholding considers the entire image brightness. Adaptive Thresholding will perform binary thresholding (i.e. it creates a black and white image) by analyzing each pixel with respect to its local neighborhood. This localization allows each pixel to be considered in a more adaptive environment.

A threshold T(x,y) is a value such that

…………….Eq. 1

Step 6. Morphology Operations: Mathematical morphology as a tool for extracting image components that are useful in the representation and description of region shape, such as boundaries, skeletons etc. Morphological reconstruction turns out to be particularly effective, detect or remove objects touching the image border, and filter out spurious high or low points. Based on the morphological reconstruction, opening-by-reconstruction operation and closing-by-reconstruction operation is utilized to smooth image and eliminate the noise. The opening-by-reconstruction is erosion followed by a morphological reconstruction while closing-by-reconstruction is a dilation followed by a morphological reconstruction. Compared to simple opening and closing, reconstruction-based opening and closing can restore the original shapes of the objects after erosion or dilation.

(a) Morphological Opening – ???(f)(x)

Opening – The opening of A by B is obtained by the erosion of A by B, followed by dilation of the resulting image by B:

…………….Eq.2

The opening is also given

…………………….Eq.3

by which means that it is the locus of translations of the structuring element B inside the image A. In the case of the square of side 10, and a disc of radius 2 as the structuring element, the opening is a square of side 10 with rounded corners, where the corner radius is 2.

(b) Morphological Closing – ???(f)(x)

Closing – The closing of A by B is obtained by the dilation of A by B, followed by erosion of the resulting structure by B:

……………Eq.4

…………….Eq.5

Opening is anti-extensive, i.e.,, whereas the closing is extensive-

i.e.

Step 5. Apply Watershed: watershed transform itself, applied on another level, will help us to merge the fragmented regions. Indeed, if we look at the boundaries produced by the segmentation, they do not have the same weight. Those which are inside the almost homogeneous regions are weaker. In order to compare these boundaries, we need to introduce neighborhood relations between them. The watershed transform presents some advantages: • The watershed lines always correspond to the most significant edges. So this technique is not affected by lower-contrast edges, due to noise, that could produce local minima and, thus, erroneous results, in energy minimization methods. • Even if there are no strong edges, the watershed transform always detects a contour in the area. This contour will be located on the pixels with higher contrast.

Step 6. Apply Mask: Masks can be used to solve the over-segmentation problem whose goal is to detect the presence of homogeneous regions from the image by a set of morphological simplifications. The watershed transform is often applied to this problem. Segmentation using the watershed transform works better if you can identify, or mask, foreground objects and background locations.

Step 7: Combine the block: After dividing the image into blocks, We apply connected component function called “bwconncomp” to each block and need to store the PixelIdxList field of the structure produced from function “bwconncomp” for each block.the function bwconncomp returns a structure with 4 fields :- Connectivity: connectivity of the connected components (can be defined with an input variable)- ImageSize: size of the image- NumObjects: number of connected objects found in the image- PixelIdxList: a cell array which contains the linear indices of the objects (the indices of the kth object are in PixelIdxList{k}).To access to an object of a specific block, and find it in the whole image, you “just” have to add the x and y offset that define the position of the block in the whole image. Note that computing certain groups of measurements takes about the same amount of time as computing just one of them because regionprops takes advantage of intermediate computations used in both computations. Therefore, it is fastest to compute all of the desired measurements in a single call to regionprops.Peak Signal to Noise Ratio is based on color texture based image segmentation by using the following equation. It is the ratio between the maximum possible power of a signal and the power of corrupting noise that affects the fidelity of its image. To compare the proposed technique with existing technique, first PSNR parameter has use. We are measuring PSNR in decibel.

Image No.

PSNR of

Existing Technique (Sec.)

PSNR of Proposed

Technique (Sec.)

1

46.73

66.75

2

49.92

71.32

3

43.78

62.54

4

46.84

66.91

5

36.84

52.65

6

46.03

65.75

7

42.29

60.41

8

40.92

58.45

9

43.39

61.98

10

42.86

61.23