IMAGE MATCHING TECHNIQUE
IMAGE MATCHING
ITS A TECHNIQUE TO COMPARE TO IMAGES BY COMPARING THERE WHITE PIXELS, THIS IS VERY USEFUL WHILE CALCULATING PERCENTAGE CHANGE IN SAME IMAGE CAPTURED AT DIFFERENT INTERVALS OF TIME.
1 Image Processing
An Image is rectangular graphical object. Image processing involves issues related to image representation, compression techniques and various complex operations, which can be carried out on the image data. The operations that come under image processing are image enhancement operations such as sharpening, blurring, brightening, edge enhancement.
2. Steps in Image Processing Image Representation
Image representation is concerned with characterization of the quantity that each picture-element (pixel) represents. The fundamentals requirement of digital processing is that images can be sampled and quantized.
Image can be represented in analog or digital form. In digital representation, image can be represented in gray-scale or color format. The gray-level images are represented as 8-bits which allows 256(0-255) possible gray color combinations. The color images are represented as 24-bits (32-bits including alpha transparency) in which each 8-bits represents red, green and blue colors.
· Image Enhancement
In Image enhancement, the goal is to accentuate certain image features for subsequent analysis or for image display. Examples include contrast and edge enhancement is useful in feature extraction, image analysis, and visual information display. The enhancement process itself does not increase the inherent information content in the data. It simply emphasizes certain specified image characteristics.
· Image Restoration
Image restoration refers to removal or minimization of unknown degradations in an image. This includes deblurring of images degraded by the limitation of sensor or its environment, noise filtering, and correction of geometric distortion or non- linearties due to sensors.
· Edge Detection
The image consists of objects of interest displayed on a contrasting background; an edge is a transition from background to object or vice versa. The total change in intensity from background to foreground is called the strength of the edge or edge detection.
· Histogram Calculation
The histogram of an image represents the relative frequency of occurrence of the various gray levels in the image. The histogram of a digital image with gray levels in the range(0,l-1) is a discrete function
P(rk)= nk/n
Where,
rk is the kth gray level
nk is the number of pixels in the image with that gray
level
n is the total number of pixels in the image k=0, l-1.
P(rk) gives an estimate of the probability of occurrence of gray level rk. A plot of this function for all values of k provides a global description of the appearance of an image.
The horizontal axis of the histogram encompasses the range (0,255), which is possible range of gray level values for an 8-bit image. The vertical axis shows the number of pixels for each gray level instead of probabilities.
FOR VALENTINE DAY UPDATES VISIT: Greetings (A complete solution for wishing your love ones).
Linear Spatial Filter (Convolution Operation)
TECHNIQUE FOR IMAGE MATCHING
- take an image to compare say CAPTURED IMAGE
- take another image to which the captured image is compared say REFERENCE IMAGE
- apply RGB to gray conversion procedure on 1st image
- apply RGB to gray conversion procedure on 2nd image
- apply image enhancement technique on 1st image i.e removable of noise from the image by applying median filter or applying wiener2.
- apply image enhancement technique on 2nd image i.e removable of noise from the image by applying median filter or applying wiener2.
- apply edge enhancement technique over the 1st image by simply applying canny edge detection technique(famous and simple).
- apply edge enhancement technique over the 2nd image by simply applying canny edge detection technique(famous and simple).
- apply image matching comparison procedure for comparing the images by simply counting the white pixels matched.
- calculate the percentage by simply dividing the matched white pixel to the total no of white pixels.
MATLAB CODE FOR IMAGE MATCHING
CODE FOR IMAGE COMPARISON
<code>
A=imread('Image1');
M=imread('Image2');
A=rgb2gray(A);
M=rgb2gray(M);
figure,imshow(A);
title('after gray conversion A');
figure,imshow(M);
title('after gray conversion M');
J=wiener2(A,[5 5]);
title('image after wiener filtering A');
figure,imshow(J);
J1=wiener2(M,[5 5]);
title('image after wiener filtering M');
figure,imshow(J1);
BW1=edge(J,'canny');
figure,imshow(BW1);
title('image after edge detection A');
BW2=edge(J1,'canny');
figure,imshow(BW2);
title('image after edge detection M');
OUTPUT_MESSAGE = 'almost same x-ray images ';
OUTPUT_MESSAGE2 = ' x-ray images not matching ';
matched_data = 0;
white_points1 = 0;
white_points2 = 0;
black_points = 0;
x=0;
y=0;
l=0;
m=0;
time=0;
for a = 1:1:300
for b = 1:1:300
if(BW1(a,b)==1)
white_points1 = white_points1+1;
else
black_points = black_points+1;
end
end
end
for a = 1:1:300
for b = 1:1:300
if(BW2(a,b)==1)
white_points2 = white_points2+1;
else
black_points = black_points+1;
end
end
end
display(white_points1);
display(white_points2);
%total_data = white_points;
total_matched_percentage = (white_points1/white_points2)*100;
display((total_matched_percentage));
if(total_matched_percentage >= 85)
display(OUTPUT_MESSAGE);
else
display(OUTPUT_MESSAGE2);
end
</code>