240 likes | 272 Views
Data Extraction using Image Similarity. CIS 601 Image Processing Ajay Kumar Yadav. Overview. Segmentation. Edge Detection. Contour Mapping. Image Matching. Segmentation. Segmentation of data is a method by which large sets of data is grouped into clusters of smaller sets of similar data.
E N D
Data ExtractionusingImage Similarity CIS 601 Image Processing Ajay Kumar Yadav
Overview • Segmentation. • Edge Detection. • Contour Mapping. • Image Matching
Segmentation • Segmentation of data is a method by which large sets of data is grouped into clusters of smaller sets of similar data. • Segmentation techniques are also referred as clustering techniques. It attempts to find natural groups of components (or data) based on some similarity.
Common Metric • The distance between two points is taken as a common metric to assess the similarity among the components of a population Euclidean Metric
Type of Algorithms • Hierarchical methods – Minimal Spanning Tree Method • Nonhierarchical methods – K-means Algorithm
K-mean Clustering • Number of segmentations are provided as input to the algorithm. • Depending upon the input value, number of points are chosen which are mutually farthest apart. • Each component of the population is assigned to the respected cluster depending upon the minimum distance. • The centroid's position is recalculated on addition of each new component.
Edge Detection • Edge detection uses the difference in color between the background color and the foreground color. The end result is an outline of the borders. • Edge detection techniques are broadly classified as: • Gradient -Detects the edges by looking for the maxima and minima of the first derivative. • Laplacian -searches for zero-crossing in the second derivative.
Gradient Method • Sobel: Performs 2D spatial gradient measurement. • Canny: Uses gradient to highlight regions with high spatial derivatives. If gradient of x is zero, depending upon the value of y edge direction would be either 0 or 90. • Robert: Uses 2x2 convolution matrix, one mask is simply rotated by 90. Respond maximally to edge running at 45 to pixel grid. • Prewitt: Similar to sobel. Strength of edge is defined by sum of square of two derivatives.
Laplacian Method • Calculates the second derivative of the image to find the zero crossing . • It also calculates the local variance and compare it with the threshold value. If threshold exceeds declare it as edge. • It’s an lowest order orientation independent operator.
Contour Mapping • The basic idea is to trace closed contours at each slice of data and then connect between contours in adjacent slices using a mesh of triangles.
Contoured Image Two Level Contoured Image
Image Matching • Recognition of the similar image in the target image. • The approach considered is the crude or brute force method. The assumption is taken that the images do not differ all that much. A point is mapped onto the second image and a window is slided over the neighboring area to determine the resemblance of the corners. If the value passes a certain threshold the match is accepted.
Algorithm: • Find the three Euclidean distances for the source image and the target image: Starting corner, Ending corner, Centroid. • Normalize all the three Euclidean distances for both source and target. • Calculate the correlation coefficient between the similar normalized vectors of source and target. • If image is similar the plot of the output value should be linear and generate a peak.
Image Correlation Similar Image Different Segmentation
Image Correaltion Correlation of Starting data shows some similarity Complete and Partial Image
Image Correlation Starting and Ending are near to matching may be because of the posture of the images Dissimilar Images
Cont’d Dissimilar Image
Conclusion • Segmentation: removes noise and cluster the useful data in one population. • Edge Detection: Differentiate between the foreground and background. • Image similarity is performed on the basis Euclidean correlation between the different Indices value.
Project Files • im_clustering (input: Enter number of desired clusters in command window for source image) • Save the data of well defined edges. • Go to step 1 run the im_clustering algorithm for the target image and save the data extracted from edge detection. • [a1,a2,a3] = DistView(edge); (input: saved data of the edge detection, output will be the Euclidean distance array for starting, ending and centroid) • Repeat the same step for target data • [out1,out2,out3]=cor(s1,s2,s3,t1,t2,t3); (Input: All the Euclidean distance vector for source and target, output would be the correlation coefficient between source and target for starting, ending and centroid)
References • Digital Image Processing (Rafael Gonzalez & Richard Woods) • The Analysis of Simple k-means Clustering Algorithm (University of Maryland, January 2000) • Contour Detection Based on Non-classical Receptive Field Inhibition (IEEE, Vol. 12, No. 7, July 2003) • Matching and Retrieval Based on the Vocabulary and Grammar of Color Patterns (IEEE, Vol. 9, No. 1, January 2000) • Lecture Slides.