Sie sind auf Seite 1von 17

we are implementing the algorithm to these challenging vision applications foreground/background segmentation, body configuration estimation, and scene

region labeling . And differentiating both foreground and background by using the mask and then recognize the exact objects from the image.

Reading the image Segmentation K-Means Algorithm Masking Spread density function Finding the curve points Finding the probability Density function Area Computation Finding the Amplitude Intensity and its average Applying the boundary conditions Extracting the co-ordinates Finding the Edges and Angles by Curvature Gradient flow

Gray scale image else color image is converted into Gray scale by using the Below formula img = (img(:,:,1)+img(:,:,2)+img(:,:,3))/3;

In segmentation we have to find the back ground and the fore ground

Taking the pixels values and iterating the loop for all the values and then we will get the histogram. Applying K-Means Algorithm to the Histogram. A histogram is "a representation of a frequency distribution by means of rectangles whose widths represent class intervals and whose areas are proportional to the corresponding frequencies."

0
0 0 0

0
0 0 0

0
0 0 1

0
0 0 1

0
0 0 1

0
0 0 1

0
0 0 1

0
0 0 1

0
0 0 0

0
0 0 0

0
0 0 0

0
0 0 0

1
1 1 1

1
1 1 1

1
1 1 0

1
1 1 0

1
1 1 1

1
1 1 1

0
0 0 0

0
0 0 0

We use Spread density function to find the distance between each every pixel. This Density Function is used to differentiate the difference between fore ground and back ground image pixel values.

From Segmentation we will find the phi value, from that by using the below formula we use to find the curve points if phi is less than Zero then its back ground or if the phi is greater than zero then it is fore ground in_pt = find(phi < 0) ; out_pt = find(phi > 0) ;

By using this function we will know the intensity values of an image and then we know that if the intensity values are one then it is fore ground and the intensity is zero then it is background.

Then based up on the intensity level we have to join the same intensity levels and then by this we will recognize the objects in the foreground and background of that image.

By using the values of Probability density function we will find the Amplitude and its average T = log((pin+eps)./(pout+eps)); D = sqrt(mean(T.^2) - mean(T).^2);

We first initialize the image into Rows and Columns , if the image has more rows than the initial rows then we will reduce the maximum rows minus one OR If the image has less than or Equal to Zero then we take two as min and these conditions are similar to the columns also.

if((nr+1) >= nrow) nr = dimR-1; end if((nr-1) <= 0) nr = 2; end if((nc+1) >= ncol) nc = dimC-1; end if((nc-1) <= 0) nc = 2; end

Now we want to know the points in all directions like Xdirection, Y-direction , XX-direction , YY-direction , XY-direction. By using the formulae phi_x = phi(nr, nc+1) - phi(nr, nc-1); phi_y = phi(nr+1, nc) - phi(nr-1, nc); phi_xx = phi(nr, nc+1) - 2*phi(nr, nc) + phi(nr,nc-1); phi_yy = phi(nr+1, nc) - 2*phi(nr, nc) + phi(nr-1,nc); phi_xy = -0.25*phi(nr-1,nc-1)-0.25*phi(nr+1,nc+1)+0.25*phi(nr1,nc+1)+0.25*phi(nr+1,nc-1);

Now we know the all boundaries and then by the intensities various places we have to consider as the seed point and then by using those points we have to find the curvature and shape of an object or thing in that particular image.

In this project we find out the Object or Thing in an image by differentiating the fore ground and back ground by using the KMeans algorithm.

Das könnte Ihnen auch gefallen