1 / 36

Image Segmentation by Clustering using Moments

Image Segmentation by Clustering using Moments. by, Dhiraj Sakumalla. What is segmentation? . It is to distinguish objects from background Types of segmentation edge based region based In the present project we use region based segmentation.

amergin
Download Presentation

Image Segmentation by Clustering using Moments

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Image Segmentation by ClusteringusingMoments by, Dhiraj Sakumalla

  2. What is segmentation? • It is to distinguish objects from background • Types of segmentation edge based region based In the present project we use region based segmentation.

  3. Region based Segmentation • A region-based method usually proceeds as follows: the image is partitioned into connected regions by grouping neighboring pixels of similar intensity levels. Adjacent regions are then merged under some criterion involving perhaps homogeneity or sharpness of region boundaries. Overstringent criteria create fragmentation; lenient ones overlook blurred boundaries and overmerge.

  4. Clustering • Clustering is a classification technique. It involves grouping similar data together. Given a vector of N measurements describing each pixel or group of pixels (i.e., region) in an image, a similarity of the measurement vectors and therefore their clustering in the N-dimensional measurement space implies similarity of the corresponding pixels or pixel groups. Therefore, clustering in measurement space is an indicator of similarity of image regions, and is used for segmentation purposes

  5. Techniques used for clustering Kmeans Kmediods Hierarchical Here we use the KMeans algorithm.

  6. Abstract Texture segmentation is one of the early steps towards identifying surfaces and objects in an image. In this paper a moment based texture segmentation algorithm is presented. The moments in small windows of the image are used as texture features which are then used to segment the textures. The algorithm has successfully segmented binary images as well as a number of gray level texture images.

  7. The basic algorithm. • Step 1: To break the image into blocks. • Step 2: Compute moments for each block. • Step 3: Obtain texture feature by applying a transformation. .

  8. Step 4: Perform an unsupervised clustering of the image. • Step 5: Classify every pixel in the image according to its features

  9. Techniques Used • For computing texture features Moments Nonlinear Transformation • For clustering KMeans

  10. Computing the Moments • Our algorithm uses the moments of an image to compute texture features. The (p+q)th order moments of a function of two variables f(x,y) with respect to the origin (0,0) are defined as :Σµ mpq = Σx Σy f(x,y) xp yq • The central moments are defined as µpq = Σx Σy (x-x’)p(y-y’) f(x,y)

  11. where, x’ = m10/m00 and y’ = m01/m00 And the normalized moments are given by ŋpq = µpq /µ00 In this way seven 2D moments are calculated and are applied to each block of the image.

  12. Thus each block now has seven values in the output matrix. The moments alone are not sufficient to obtain good texture features in certain images. For this we apply a non-linear transformation function on each output.

  13. which is given by, abs(tanh(Mk(a,b) – M’)) where Mk is the kth moment of a,b and M’ is the mean of the moments

  14. Implemantation • First the image is broken into blocks. The size of the block is important. As the window size gets larger, more global features are detected. This suggests that the choice of window size could possibly be tied to the contents of the image. The images with larger texture tokens would require larger window sizes whereas finer textures would require smaller windows. The size of the block taken here ranges between 3 and 8.

  15. Kmeans • Kmeans clustering finds a grouping of the measurements that minimizes the within-cluster sum-of-squares. In this method, each measurement, represented by a vector of length N, is grouped so that it is assigned to one of a fixed number of clusters. The number of clusters is determined by the number of seeds given as the second argument of KMeans. Measurements are transferred from one cluster to another when doing so decreases the within-cluster distances. The algorithm stops when no more transfers can occur. Here we will demonstrate the application of KMeans clustering to a simple image segmentation problem. Consider the problem of programmatically manipulating individual red beans in a fragment of the "beans" image.

  16. Matlab function used for breaking into blocks is im2col • We use sliding window as an option here.what this does is rather than take distinct wiindows of size m*n it takes in each pixel individually and and takes in the pixels around it. • Each block thus obtained are processed by function

  17. The second step is to compute the moments. The function mention above does this. It takes in each block and computes the seven moments of this. Then to this the non linear transformation is applied. the output of this would then be a matrix with dimensions m*n

  18. where, m is the total number of pixels in the image n is the corresponding moment values to each pixel.

  19. The third step is to cluster the output matrix from the above step. the clustering algorithm used here is the Kmeans algorithm. this algorithm requires us to specify the number of clusters required. the distance calculations between the centriod and the points are done using euclidean and mahalanobis distance

  20. However it is observed that using Euclidean distance yields better results than Mahalanobis.

  21. The final step in this project is to classify the pixels according to its cluster. This is done assigning a particular graylevel to each cluster and then remapping it to the original image. The matlab function used here is col2im which reconstructs the matrix from the blocks obtained from im2col.

  22. Results The segmentation has been performed on various images both gray and color.

  23. original 4 clusters

  24. original 4 clusters 4 clusters

  25. original block size 5 block size 10

  26. original 3 clusters 2 clusters

  27. original 4 clusters

  28. original • 5 clusters

  29. original • 4 clusters

  30. orignal • 4 clusters

  31. orignal 4 clusters diff window

  32. Original 4 clusters 5 clusters

  33. Conclusions • This project dealt with segmenting an image based on texture using moments. From the results of this project three things could be observed 1. The size of the initial block of image. The image initial block should be smaller for images with finer textures and bigger for images with coarse textures

  34. 2. The number of moments to be considered. In this projects seven moments were taken and the results were not very satisfactory. May be fewer moments like 5 or 6 would give a better result.

  35. 3. The output is dependent on the efficiency of the clustering algorithm and the number of clusters are to be given before hand.

  36. References • http://www.cs.iupui.edu/~tuceryan/research/ComputerVision/moment-paper.pdf • http://documents.wolfram.com/applications/digitalimage/UsersGuide/7.5.html

More Related