Optimized Image Mosaicing with Moment Invariants and SIFT features

In the field of Image mosaicing, much research has been done to fulfil the two major challenges, time complexity and quality improvement. Proposed method is a pre-processing step before actual image stitching carried out. The method aims to find out the overlapping regions in two images. Thus features can be extracted from these overlapping regions and not from the whole images, which result into reduction of computation time. For detecting overlapping portion, gradient based edge extraction method and invariant moments are used. In the deduced region, SIFT features are extraction to determine the matching features. The registration process carried out by RANSAC algorithm and final output mosaic will obtained by warping the images. An optimizedapproach to calculate the moment difference values is presented to improve time efficiency and quality. keywords: Image registration, Edge detection, Moment invariants, Feature extraction, Image mosaicing, SIFT, RANSAC.


INTRODUCTION
Image mosaicing generally contains image pre-processing, image registration and image mosaic 3 .The aim of pre=processing is to simplify the difficulties of image registration to make some replication change and transformation od coordinates on original image.The core problem of image registration is to find out a space variation and register the coordinate points of overlapping parts between images.The main process of image mosaic includes: mosaic adjoining images' registering areas, get rid of accumulated mistakes made in the process of overall mosaic and distortion phenomenon in image overlapping area, and draw and output mosaic image.
The image mosaicing procedure generally includes three steps.First, we register input images by estimating the homography, which relates pixels in one frame to their corresponding pixels in another frame.Second, we warp input frames according to the estimated homography so that their overlapping regions align.Finally, we paste the warped images and blend them on a common mosaicing surface to build the mosaic result.

Image Registration
Image registration is the establishment of correspondence between the images of same scene.It is a process of aligning two images acquire by same or different sensors, at different time or from different viewpoint.To register images, we need to determine geometric transformation that aligns images with respect to the reference image 1 .
Steps involved in the registration process as in 2 are as follow: 1) Feature Detection: Salient and distinctive objects in both reference and sensed images are detected.

2)
Feature Matching: The correspondence between the features in the reference and the sensed image established.

3)
Transform Model Estimation:The type and parameters of the so-called mapping functions, aligning the sensed image with the reference image, are estimated.

4)
Image Resampling: The sensed image is transformed by means of the mapping functions.

Image Blending
It is the final step to blend the pixels colours (or intensity) in the overlapped region to avoid the seams.Simplest available form is to use feathering, which uses weighted averaging colour values to blend the overlapping pixels.
Our main focus is on the first step of image registration process of feature detection.Features are the distinct elements in two images that are to be matched.The image mosaicing methods can be loosely classified based on the following classes as given in 3

Proposed work
The proposed method aims in detecting overlapping portion for extracting matching points.The overlapping regions are determined using gradient based dominant edge extraction and invariant moments.In the deduced region, the SIFT (Shift Invariant Feature Transform) features are extracted to determine the matching features.The registration is carried on with RANSAC (Random Sample Consensus) algorithm and final output mosaic is obtained by warping the images 4 .

Selection of Matching Regions
Basically, proposed algorithm is the optimization of pre-processing step of image mosaicing (i.e., to find overlapping region).As in the previous section, it is found that with the increase of number of blocks of images also increase the time complexity.This complexity can be reduced by only considering the boundary blocks of both images first.Then moment difference values are calculated using standard deviation method instead of sum of absolute moment difference.Minimum difference value is selected for image blocks as overlapping region.After that, there is a need to traverse through the neighborhood blocks in both the images for continuous common region with some threshold value for blocks match.So in short the process will be as follows, 1.
Moment invariants calculation of all blocks.

2.
Compare moment difference values of boundary blocks of both images.

3.
Select with minimum value for overlapping blocks.

4.
Set the threshold value.
Fig. 2 is the flow chart of the proposed algorithm.

Edge Detection
One way to reduce the time complexity is to use only the dominant information from images like edges.This could significantly reduce the matching cost.Traditional edge detection methods like sobel, prewitt and Roberts operators are applied in determining the edges.These approaches failed to yield better results under varying environmental and illumination conditions.gradient based edge detection produced better results for natural color images 4 .
An algorithm uses a two-dimensional implementation of the Canny edge detection method to detect and localize significant edges in the input image 6 .The first step in the gradient-based edge detection is estimation of the underlying gradient function.This is achieved by convolution of the input image with an appropriately chosen filter.The filter used is a two-dimensional Canny filter, which is the directional derivative of a two-dimensional gaussian distribution defined by G = exp and F x = , F y = , where x and y denote absolute pixel coordinates.The advantage of using such a filter is that it inherently smoother the image while estimating its gradient, thereby reducing the range of scales over which intensity changes in the input image take place [6P].The overall size of each filter, Fx and Fy, is a function of the desired edge scale and the image resolution.
The gradient magnitude Imag = s = gradient length scale (pixels) = (desired edge scale / image resolution) The next step in the Canny edge detection method is to thin the contours of the gradient image, Imag, and suppress (i.e.discard) any contours of magnitude less than a given threshold 8 .
After determining the dominant edges from the images, images are partitioned into equal sized blocks and compared against each other for finding the similarity 4 .

Calculation of Moment Invariants
After determining the dominant edges from the images, images are partitioned into equal sized blocks and compared against each other for finding the similarity 4 .The moment invariants are moment-based descriptors on shapes, which are invariant under general translational, rotational, scaling transformation.The moments of a binary image f(i,j) are given by eq.(3.1).
where p and q define the order of the moment.Zero order moment are used to represent the binary object area.Second-order moments represents the distribution of matter around the center.The invariant moments of lower order are enough for most registration tasks on remotely sensed image matching.If (x, y) is a digital image, then the central moments are defined by the Eq.(3.2).

Moments
where i + j 2 can be constructed to be invariant to both translation and changes in scale by dividing the corresponding central moment by the properly scaled (00) th moment, using the following formula.The seven invariant moments M1 to M7 mentioned in from Eq. (3.4) to (3.10) are typical unchanged properties of images under rotation, scale and translation.After determining the dominant edges of the images, the images are partitioned into equal sized blocks.The standard deviation of difference between the moment values can be obtained from input images.The blocks with the minimum difference value is considered and taken up as the matching regions for the following steps of extracting SIFT features 4 .

Standard Deviation of Moment Difference
generally seven moment values of order 3 of image are used in the analysis in the field of image processing.As we seen in the previous section, seven moment invariants were calculated.let say we have moments M and N for two images as given below:

Selection Overlapping Blocks
After finding the minimum difference value for first overlapped blocks, further region can be obtain by traversing through the nearby blocks by comparison of moment difference values to some minimum threshold value.

SIFT Feature Extraction
SIFT algorithm is used for extracting the features from the matching regions.It consists of four steps namely scale-space extrema detection, keypoint localization, orientation assignment and a keypoint descriptors 4 .SIFT Algorithm is Scale Invariant Feature Transform.SIFT is an corner detection algorithm which detects features in an image which can be used to identify similar objects in other images 3 .SIFT produces key-point-descriptors which are the image features.when checking for an image match two set of key-point descriptors are given as input to the Nearest Neighbor Search (NNS) and produces a closely matching key-point descriptors.SIFT has four computational phases which includes: Scale-space construction, Scalespace extrema detection, key-point localization, orientation assignment and defining key-point descriptors 3 .
The first phase identifies the potential interest points.It searches over all scales and image locations by using a difference-of gaussian function.For all the interest points so found in phase one, location and scale is determined.Key-points are selected based on their stability.A stable keypoint should be resistant to image distortion.In Orientation assignment SIFT algorithm computes the direction of gradients around the stable keypoints.One or more orientations are assigned to each key-point based on local image gradient directions.For a set of input frames SIFT extracts features 3 .

Scale Invariant Feature Transform (SIFT) consists of four stages as below: 1)
Scale-space extrema detection: The first stage of computation searches over all scales and image locations.It is implemented efficiently by using a difference-of-gaussian function to identify potential interest points that are invariant to scale and orientation.

2)
Keypoint localization: At each candidate location, a detailed model is fit to determine location and scale.Keypoints are selected based on measures of their stability.

3)
Orientation assignment: One or more orientations are assigned to each keypoint location based on local image gradient directions.All future operations are performed on image data that has been transformed relative to the assigned orientation, scale, and location for each feature, thereby providing invariance to these transformations.

4)
Keypoint descriptor: The local image gradients are measured at the selected scale in the region around each keypoint.These are transformed into a representation that allows for significant levels of local shape distortion and change in illumination.
The first stage used difference-ofgaussian (DOg) function to identify potential interest points, which were invariant to scale and orientation.DOg was used instead of gaussian to improve the computation speed.D(x,y,s)=(g(x,y,ks) g(x,y,s) )*I(x,y) =l(x,y,ks) l(x,y,s) ... (3.16)where * is the convolution operator, g(x, y, s ) is a variable scale gaussian, I(x, y) is the input image D(x, y, s) is Difference of gaussians with scale k times.In the keypoint localization step, they are rejected the low contrast points and eliminated the edge response.hessian matrix was used to compute the principal curvatures and eliminate the keypoints that have a ratio between the principal curvatures greater than the ratio.An orientation histogram was formed from the gradient orientations of sample points within a region around the keypoint in order to get an orientation assignment 7 , 9 , 10 .

A B
SIFT features where extracted only from the overlapped region in both images thus required less computation in the proposed algorithm.

Transformation Estimation
The RANdom SAmple Consensus (RANSAC) algorithm is a general parameter estimation approach designed to cope with a large proportion of outliers in the input data 9 .RANSAC is a resampling technique that generates candidate solutions by using the minimum number observations (data points) required to estimate the underlying model parameters.Unlike conventional sampling techniques that use as much of the data as possible to obtain an initial solution and then proceed to prune outliers, RANSAC uses the smallest set possible and proceeds to enlarge this set with consistent data points 9 .1) Select randomly the minimum number of points required to determine the model parameters.

2)
Solve for the parameters of the model.

3)
Determine how many points from the set of all points fit with a predefined tolerance.

4)
If the fraction of the number of inliers over the total number points in the set exceeds a predefined threshold, re-estimate the model parameters using all the identified inliers and terminate.
The number of iterations, N, is chosen high enough to ensure that the probability p (usually set to 0.99) that at least one of the sets of random samples does not include an outlier.let u represent the probability that any selected data point is inliers and v = 1-u the probability of observing an outlier 9 .N iterations of the minimum number of points denoted m are required, where

Performance Analysis
we have tested the algorithm on four different set of images for comparison as below: From the above table, we can see that number of features extracted is less than that of applying direct SIFT.Thus the SIFT will execute faster.
As seen in table 4, proposed algorithm is able to increase the computation speed that the existing algorithm.Also from the output mosaic, we can see the improvement on the quality of mosaic image is achieved.

CONCLUSION
with the experiment result and comparison between base and proposed approach, one can say that the quality of the image mosaicing is improve in the proposed algorithm then in the existing algorithm.Also the time complexity reduces to some extend with proposed approach then that in the existing approach.Overlapping region found with proposed approach is continuous and do not have any false match as that in the base approach.By such comparison, we can say that the proposed algorithm is better to find overlapping region which will reduce time for SIFT features extraction.

ACkNOwLEDGMENT
I am very grateful and would like to thank my guides Prof. Vikram Agrawal for his advice and continued support.without him, it would have not been possible for me to complete this paper.I would like to thank all my friends for the thoughtful and mind stimulating discussion we had, which prompted us to think beyond the obvious.