image processing
DESCRIPTION
Image Processing. What is Image Processing ?. Image Processing is any form of signal processing for which our input is an image, such as photographs or frames of video and our output can be either an image or a set of characteristics or parameters related to the image. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/1.jpg)
Image Processing
![Page 2: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/2.jpg)
Image Processing is any form of signal processing for which our input is an image, such as photographs or frames of video and our output can be either an image or a set of characteristics or parameters related to the image.
What is Image Processing ?
![Page 3: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/3.jpg)
Image Processing generally refers to processing of two dimensional picture and by two dimensional picture we implies a digital image.
A digital image is an array of real or complex numbers represented by a finite number of bits.But now in these days optical and analog image processing is also possible.
![Page 4: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/4.jpg)
Face detection Feature detection Non-photorealistic rendering Medical image processing Microscope image processing Morphological image processing Remote sensing Automated Sieving Procedures Finger print recognization
Applications
![Page 5: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/5.jpg)
Image processing can be done using various softwares and languages such as:-Software
Matlab Adobe photoshop Irfan view
Language VHDL C/C++
How image processing is done ?
![Page 6: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/6.jpg)
Image processing using MATLAB
![Page 7: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/7.jpg)
The name MATLAB stands for matrix laboratory . It is a high-performance language for technical computing. It is an interactive system whose basic data element is an array which does not require any dimensioning. This allows us to solve many technical computing problems, especially those with matrix and vector formulations, in a fraction of the time.
MATLAB
![Page 8: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/8.jpg)
MATLAB features a family of add-on application-specific solutions called toolboxes. These toolboxes are comprehensive collections of matlab functions (M-files) that extend the matlab environment to solve particular classes of problems. Areas in which toolboxes are available include image processing, signal processing, control systems, neural networks, fuzzy logic, wavelets, simulation, and many others..
![Page 9: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/9.jpg)
Image Processing Toolbox
![Page 10: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/10.jpg)
The Image Processing Toolbox is a collection of functions that extend the capability of the Matlab numeric computing environment. These functions are written on M-files and further we can extend the capabilities of the Image Processing Toolbox by writing our own M-files. This toolbox supports a wide range of image processing operations such as..
Image processing toolbox
![Page 11: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/11.jpg)
Color corrections such as brightness and contrast adjustments, quantization, or color translation to a different color space.
Image registration, the alignment of two or more images.
Image segmentation.
Operations of image processing
![Page 12: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/12.jpg)
Neighborhood and block operations. Linear filtering and filter design. Transforms. High dynamic range imaging by combining multiple
images. Deblurring.
![Page 13: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/13.jpg)
The following image formats are supported by Matlab:
BMP HDF JPEG PCX TIFF XWB
Image formats supported by Matlab
![Page 14: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/14.jpg)
Intensity imageThis is the equivalent to a "gray scale image“ . It represents an image as a matrix where every element has a value corresponding to how bright/dark (each element represent intensities).
Binary imageThis image format also stores an image as a matrix but can only color a pixel black or white (and nothing in between). It assigns a 0 for black and a 1 for white.
Types of images
![Page 15: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/15.jpg)
Indexed image
This is a practical way of representing color images. An indexed image stores an image as two matrices. The first matrix has the same size as the image and one number for each pixel. The second matrix is called the color map and its size may be different from the image. The numbers in the first matrix is an instruction of what number to use in the color map matrix.
![Page 16: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/16.jpg)
RGB image
It represents an image with three matrices of sizes matching the image format. Each matrix corresponds to one of the colors red, green or blue and gives an instruction of how much of each of these colors a certain pixel should use. A pixel whose color components are (255,255,255) is displayed as White. And whose color components are (0,0,0) is displayed as Black.
![Page 17: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/17.jpg)
Histeq( ): This command is used to improve the contrast in the image. This function spreads the intensity values over the full range of the image, and this process is known as histogram equalization.
Syntaxhisteq(‘Image_name.format’);
Commands for intensity Adjustment
Before After
![Page 18: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/18.jpg)
Imadjust( ): This command is used to adjust the contrast of the image. Imadjust increases the contrast of the image by saturating 1% of the data at both low and high intensities of Image and by stretching the intensity.
SyntaxImadjust(‘image_name.format’)
![Page 19: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/19.jpg)
Examples of imadjust
![Page 20: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/20.jpg)
Adapthisteq( ): This command is used to perform contrast-limited adaptive histogram equalization (CLAHE). It is an alternative to function histeq, While histeq works on the entire image, adapthisteq operates on small regions in the image, called tiles.
Syntaxadapthisteq(‘Image_name.format’);
Before After
![Page 21: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/21.jpg)
Imread( ): This command is used to read that image on which the operation has to be done. Imread returns the image data in the array. If the file contains a grayscale image, then it will return a two-dimensional (M-by-N) array and if the file contains a color image, it will return a three-dimensional (M-by-N-by-3) array. The class of the returned array depends on the data type used by the file format.
SyntaxImread(‘image_name.format’)
Commands used for various file operations in image processing toolbox.
![Page 22: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/22.jpg)
Imview( ): This command is used to view the image on the screen. And this command is always used with the imread and imwrite command, because, it views only that image which is under process.
SyntaxImview(‘image_name.format’)
![Page 23: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/23.jpg)
Result of above explained commands.
![Page 24: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/24.jpg)
Imwrite( , ): This command is used to change the format of read file. By using this command we can change the file formats from one to another.
Syntax Imwrite(‘image_name.format2’, ‘image_name.format1’)
Imfinfo( ): This command is used to obtain the information about the image under process. It is used to obtain information such as size, position of pixels, number of rows and columns etc.
Syntax Iminfo(‘image_name.format’)
![Page 25: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/25.jpg)
Imsubtract( , ): This command is used to create a more uniform background, by subtracting the background image from the original image.
To estimate the background image, we use following command:
background=imopen(‘Image_name.format’,strel('disk',15))
To see the estimated background image, type: imview(background)
Now subtract the background image from the original image, type:
imsubtract(‘image_name.format’,background);
![Page 26: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/26.jpg)
Result of the above used commands
![Page 27: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/27.jpg)
Imresize( , ): This command is used to resize the processed image. To enlarge an image, specify a magnification factor greater than 1 in the command. To reduce an image, specify a magnification factor between 0 and 1 in the command.
Syntaximresize(‘Image_name.format’, value);
![Page 28: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/28.jpg)
Image Rotation( , ): This command is used to rotate the given image. This command accepts two primary arguments, one is the image to be rotated and other one is rotation angle. We have to specify the rotation angle in degrees. If a positive value is specified then imrotate rotates the image counterclockwise and if a negative value then imrotate rotates the image clockwise.
Syntaximrotate(‘Image_name.format’, angle_in_degree);
![Page 29: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/29.jpg)
Result of the above used commands
![Page 30: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/30.jpg)
Imcrop( , ); This command is used to crop the particular image. It accepts two primary arguments:
The image to be cropped. The coordinates of a rectangle that defines the crop area.
If we call imcrop without specifying the crop rectangle, we can specify the crop rectangle interactively. In this case, the cursor changes to crosshairs when it is over the image. Position the crosshairs over a corner of the crop region and press and hold the left mouse button. When we drag the crosshairs over the image we specify the rectangular crop region. imcrop draws a rectangle around the area we are selecting. When we release the mouse button, imcrop creates a new image from the selected region.
![Page 31: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/31.jpg)
SyntaxImcrop(‘image_name.format’);
Before
After
If we call imcrop with specifying the crop rectangle, imcrop operates on the image in the current axes.Syntax
Imcrop(‘Image_name.format’ , [rect]);
![Page 32: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/32.jpg)
Imerode( , ): This command is used to erode the image. This function accepts two primary arguments:
The input image to be processed (grayscale, binary image), A structuring element object, returned by the strel
function, or a binary matrix defining the neighborhood of a structuring element.
SyntaxImerode(‘binary_image.format’ , strel);
Before After
![Page 33: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/33.jpg)
Im2bw = This command is used to convert the given image in to binary image. This command is mainly followed by one another command i.e. level=graythresh(image_name.format).
SyntaxLevel=graythresh(‘image_name.format’)Bw=im2bw(‘image_name.format’, level)
Before After
![Page 34: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/34.jpg)
Duller = This command is used to fade the image, so that, other image on which it is overlapped can be easily viewed.
Syntax Duller= * ‘image_name.format’
This is the amount by which the fading is done.
Combine = This command is used to combine or overlap the two images. This is the command on which over all project stands.
SyntaxCombine= image1 +image2.
0.5
![Page 35: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/35.jpg)
We can convert images in any of formats/types described above using the following commands.
Intensity format to Indexed format. gray2ind( )
Image Conversions
Gray Indexed
![Page 36: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/36.jpg)
indexed format to intensity format. ind2gray()
Indexed Gray
![Page 37: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/37.jpg)
RGB format to intensity format. rgb2gray( )
RGB Gray
![Page 38: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/38.jpg)
RGB format to indexed format. rgb2ind( )
RGB Indexed
![Page 39: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/39.jpg)
Image analysis return information about the structure of an image. This section describes toolbox functions that we can use for these image analysis techniques which includes:
Edge Detection Boundary Tracing Quadtree Decomposition
IMAGE ANALYSIS
![Page 40: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/40.jpg)
We can use the edge function to detect edges, which are those places in an image that correspond to object boundaries. To find edges, this function looks for places in the image where the intensity changes rapidly. Edge takes an intensity image I as its input, and returns a binary image BW of the same size as I, with 1's where the function finds edges in I and 0's elsewhere.
Edge Detection
![Page 41: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/41.jpg)
Canny MethodThe most powerful edge-detection method that edge provides is the Canny method. The Canny method differs from the other edge-detection methods in that it uses two different thresholds (to detect strong and weak edges), and includes the weak edges in the output only if they are connected to strong edges. This method is therefore less likely than the others to be fooled by noise, and more likely to detect true weak edges.
Syntax Edge (‘image_name.fomat’,'canny');
Before After
![Page 42: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/42.jpg)
The toolbox includes two functions you can use to find the boundaries of objects in a binary image:
Bwtraceboundary Bwboundaries
Boundary Tracing
![Page 43: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/43.jpg)
Bwtraceboundary
The bwtraceboundary function returns the row and column coordinates of all the pixels on the border of an object in an image. We must specify the location of a border pixel on the object as the starting point for the trace.
Syntaxboundary = bwtraceboundary(binary_image,[row, col],'N');
![Page 44: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/44.jpg)
Bwboundaries
The bwboundaries function returns the row and column coordinates of border pixels of all the objects in an image.
Syntaxbinary_image _filled = imfill(binary_image,'holes');boundaries = bwboundaries(binary_image _filled);
![Page 45: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/45.jpg)
Example of above explained commands
![Page 46: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/46.jpg)
Quadtree decomposition is an analysis technique that involves subdividing an image into blocks that are more homogeneous than the image itself. This technique reveals information about the structure of the image.
Syntaxqtdecomp(‘Image_name.format’,threshold);
Quadtree Decomposition
Before After
![Page 47: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/47.jpg)
Digital images are prone to a variety of types of noise. There are several ways that noise can be introduced into an image, depending on how the image is created. For example:
If the image is scanned from a photograph made on film, the film grain is a source of noise. Noise can also be the result of damage to the film, or be introduced by the scanner itself.
If the image is acquired directly in a digital format, the mechanism for gathering the data (such as a CCD detector) can introduce noise.Electronic transmission of image data can introduce noise.
The Image Processing toolbox provides a number of different ways to remove or reduce noise in an image. Different methods are better for different kinds of noise. The method which is used mostly to remove noise is Filtering.
Noise Removal
![Page 48: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/48.jpg)
Filtering is a technique for modifying or enhancing an image. It is a neighborhood operation, in which the value of any given pixel in the output image is determined by applying some algorithm to the values of the pixels in the neighborhood of the corresponding input pixel. A pixel's neighborhood is some set of pixels, defined by their locations relative to that pixel. Filtering is further categories as following:
Linear Filtering Median Filtering Adaptive Filtering
Filtering
![Page 49: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/49.jpg)
An image histogram is a chart that shows the distribution of intensities in an indexed or intensity image. The image histogram function imhist creates this plot by making n equally spaced bins, each representing a range of data values. It then calculates the number of pixels within each range.
SyntaxImhist(‘Image_name.format’);
Image Histogram
![Page 50: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/50.jpg)
Histogram of a given image
![Page 51: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/51.jpg)
Project: fingerprint Recognition
![Page 52: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/52.jpg)
FINGERPRINT RECOGNITION or FINGERPRINT AUTHENTICATION refers to the automated method of verifying a match between two human fingerprints. Fingerprints are one of many forms of biometrics used to identify an individual and verify their identity.
Fingerprint Recognition touches on two major classes of algorithms, one is based upon PATTERNS and other one is based upon MINUTIA.
Project: Fingerprint Recognition
![Page 53: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/53.jpg)
The basic patterns of fingerprint ridges includes :- Arch pattern: An arch is a pattern where the ridges enter
from one side of the finger, rise in the center forming an arc, and then exit the other side of the finger as shown in following figure..
Patterns of Fingerprints
![Page 54: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/54.jpg)
Loop Pattern: It is a pattern where the ridges enter from one side of a finger, form a curve, and tend to exit from the same side they enter as shown in the following figure..
![Page 55: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/55.jpg)
Whirl Pattern: It is completely different from others. In this ridges form circularly around a central point on the finger as shown in the following figure..
![Page 56: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/56.jpg)
The major Minutia features of fingerprint ridges includes :
Ridge Ending: The ridge ending is the point at which a ridge terminates and this could be better explained with the help of image, which is shown below..
Minutia Features
![Page 57: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/57.jpg)
Bifurcations : These are the points at which a single ridge splits into two ridges as shown in the following image..
![Page 58: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/58.jpg)
Short ridges (or dots): These are ridges which are significantly shorter than the average ridge length on the fingerprint as shown in the following image..
Shor
t Rid
ge (o
r
Dot)
![Page 59: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/59.jpg)
There are various methods of fingerprint recognization using MATLAB which includes:-
Overlapping or Combining. Comparing slopes of ridges. Other methods.
Methods of Fingerprint Recognition
![Page 60: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/60.jpg)
Overlapping or Combining Method
![Page 61: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/61.jpg)
Overlapping or Combining Method
It is the one of the oldest technique of fingerprint matching. In this the two images of known fingerprints and unknown fingerprints are overlapped and checked for similarities. Also for recognization the position of the pixels of combined image is matched with the other images for the better result.
![Page 62: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/62.jpg)
Basically for overlapping the images, firstly they are converted into the binary images and then they are overlapped. Also for improving the results some other operation are also done like normalization, thinning etc.. according to the requirements.
![Page 63: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/63.jpg)
Program for overlapping
![Page 64: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/64.jpg)
Program
i=imread('fp1.bmp');imview(i);level=graythresh(i);bw=im2bw(i,level);imview(bw);imview(~bw);imshow(bw,[1 0 0 ; 0 0 1]);
![Page 65: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/65.jpg)
Result of the above used commands
![Page 66: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/66.jpg)
i2=imread('fp2.bmp');imview(i2);level=graythresh(i);bw2=im2bw(i2,level);imview(bw2);imview(~bw2);imshow(bw2,[1 0 0 ; 0 0 1]);
![Page 67: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/67.jpg)
Result of the above used commands
![Page 68: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/68.jpg)
duller= bw2 * 0.5;imview(duller);
combine=bw+duller;imview(combine);
![Page 69: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/69.jpg)
From the above program, we come to know that whether two finger prints are similar or not.
As it is clear from the above program that two fingerprints does not overlap each other completely. Hence these finger prints are of two different persons.
Result
![Page 70: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/70.jpg)
Advantages It is the simplest method for fingerprint
authentication. It is less time consuming method. It is comparatively easy to implement. It is an interactive method for recognizing
fingerprints.Disadvantages It does not give us accurate result everytime
because it does not relates the minutia features. We can only overlap the pictures having same
dimensions.
![Page 71: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/71.jpg)
Comparing slopes of ridges
![Page 72: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/72.jpg)
This method is mainly used in these days for fingerprint authentication. In this method we compare the slopes of the ridges of two images of fingerprints. This method is mainly based upon matching minutia.
Comparing slopes of ridges
![Page 73: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/73.jpg)
Program for comparing slopes
![Page 74: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/74.jpg)
Program
Step 1: Load Image
RGB = imread('fingerprint.bmp');imshow(RGB);imview(RGB);
Original image
![Page 75: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/75.jpg)
Step 2: Extract The Region Of Interest start_row = 73;start_col = 105;cropRGB = RGB(start_row:134, start_col:233, :);figure, imshow(cropRGB);imview(RGB);offsetX = start_col-1;offsetY = start_row-1;
Cropped image
![Page 76: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/76.jpg)
Step 3: Threshold The Image
Convert the image to black and white for subsequent extraction of the edge coordinates using bwtraceboundary routine.
I = rgb2gray(cropRGB);threshold = graythresh(I);BW = im2bw(I,threshold);BW = ~BW; Figure, imshow(BW);i2=edge(BW, 'canny');figure, imshow(i2);imview(i2);
Binary image
Canny image
![Page 77: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/77.jpg)
Step 4: Find Initial Point On Each Boundary
The bwtraceboundary routine requires that you specify a single point on a boundary. This point is used as the starting location for the boundary tracing process.
dim = size(i2);col1 = 40;row1 = min(find(i2(:,col1)));row2 = 30;col2 = min(find(i2(row2,:)));
![Page 78: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/78.jpg)
Step 5: Trace The Boundaries
boundary1 = bwtraceboundary(BW, [row1, col1], 'N', 8, 70);boundary2 = bwtraceboundary(i2, [row2, col2], 'E', 8, 90,'counter');figure, imshow(RGB);
imview(RGB);plot(offsetX+boundary1(:,2),offsetY+boundary1(:,1),'g','LineWidth',2);plot(offsetX+boundary2(:,2),offsetY+boundary2(:,1),'g','LineWidth',2);
Marked image
![Page 79: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/79.jpg)
Step 6: Fit Lines To The Boundaries
ab1 = polyfit(boundary1(:,2), boundary1(:,1), 1);ab2 = polyfit(boundary2(:,2), boundary2(:,1), 1);
![Page 80: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/80.jpg)
Step 7: Find The Angle Of Intersection
Use the dot product to find the angle.
vect1 = [1 ab1(1)]; vect2 = [1 ab2(1)];dp = dot(vect1, vect2);length1 = sqrt(sum(vect1.^2));length2 = sqrt(sum(vect2.^2));angle = 180-acos(dp/(length1*length2))*180/pi
![Page 81: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/81.jpg)
Result of all used command in program
![Page 82: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/82.jpg)
Angle between the marked ridges of image is 142.0786 .
Result
![Page 83: Image Processing](https://reader035.vdocuments.mx/reader035/viewer/2022062723/56813b46550346895da42447/html5/thumbnails/83.jpg)
Advantages This one is more accurate than the overlapping
method because it is based upon minutia. It is an interactive method for recognizing
fingerprints.
Disadvantages It is more time consuming as compared to the
former. More complex program.