Next Article in Journal
Improvement of Crystal Identification Accuracy for Depth-of-Interaction Detector System with Peak-to-Charge Discrimination Method
Previous Article in Journal
The Development of a Cost-Effective Imaging Device Based on Thermographic Technology
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Image Stitching Based on Color Difference and KAZE with a Fast Guided Filter

Changchun Institute of Optics, Fine Mechanics and Physics, Chinese Academy of Sciences, Changchun 130033, China
*
Author to whom correspondence should be addressed.
Sensors 2023, 23(10), 4583; https://doi.org/10.3390/s23104583
Submission received: 25 March 2023 / Revised: 2 May 2023 / Accepted: 5 May 2023 / Published: 9 May 2023
(This article belongs to the Section Sensing and Imaging)

Abstract

:
Image stitching is of great importance for multiple fields such as moving object detection and tracking, ground reconnaissance and augmented reality. To ameliorate the stitching effect and alleviate the mismatch rate, an effective image stitching algorithm based on color difference and an improved KAZE with a fast guided filter is proposed. Firstly, the fast guided filter is introduced to reduce the mismatch rate before feature matching. Secondly, the KAZE algorithm based on improved random sample consensus is used for feature matching. Then, the color difference and brightness difference of the overlapping area are calculated to make an overall adjustment to the original images so as to improve the nonuniformity of the splicing result. Finally, the warped images with color difference compensation are fused to obtain the stitched image. The proposed method is evaluated by both visual effect mapping and quantitative values. In addition, the proposed algorithm is compared with other current popular stitching algorithms. The results show that the proposed algorithm is superior to other algorithms in terms of the quantity of feature point pairs, the matching accuracy, the root mean square error and the mean absolute error.

1. Introduction

Currently, image stitching is still a topical research issue and is widely used in computer vision, unmanned aerial vehicle (UAV) reconnaissance and other fields [1,2]. Image stitching consists of synthesizing different types of images captured by different imaging devices at different shooting positions into an image with a larger field of vision [3,4]. On the one hand, image stitching can synthesize panoramic and ultra-wide-view images, so that ordinary cameras can achieve grand scene shooting. On the other hand, image stitching can synthesize fragmented images into a complete image. The stitching technology can be applied to combine medical images, scientific microscope fragments or local images from seabed exploration into a complete image. In addition, image mosaic is also a basic technology in scene rendering methods, which uses panoramic images instead of 3D scenes to model and draw. However, image stitching still encounters many challenges at present, such as parallax caused by viewpoint change, ghosting, distortion, detail distortion and image unevenness [5,6,7].
Up to now, many image stitching methods have been proposed by researchers. Li et al. [8] proposed a model of appearance and motion variation based on the traditional speeded up robust features (SURF) algorithm, which mainly contains Hessian matrix construction, Hessian matrix determinant approximation calculations and non-maximal suppression determination feature points in its key steps. In order to improve the matching accuracy and robustness, Liu et al. [9] introduced an improved random sample consensus (RANSAC) feature image matching method based on SURF. First of all, the SURF method is used to detect and extract image features, and the fast library of the approximate nearest neighbor-based matcher method is used to perform initial matching on image feature points. The RANSAC algorithm is improved to increase the probability of correct matching points. In 2017, Guan et al. [10] presented an interest point detector and binary feature descriptor for spherical images. Inspired by the Binary Robust Invariant Scalable Keypoints (BRISKs), they adapted the method to operate on spherical images. All of the processing is intrinsic to the sphere and avoids the distortion inherent in storing and indexing spherical images in a 2D representation. Liu et al. [11] developed the BRISK_D algorithm, which effectively combines features from the Accelerated Segment Test (FAST) and BRISK methods. The keypoints are detected by the FAST algorithm and the location of the keypoint is refined in scale and space. The scale factor of the keypoint is directly computed with the depth information of the image. Zhang et al. [12] proposed a screening method based on binary mutual information for the mismatch problem. The feature points extracted by the ORB algorithm are distributed in a color change area. Then, the new feature points are obtained by internal points. In this way, feature points can be eliminated and the best transformation matrix can be obtained by using an iterative method. In 2020, Ordóñez et al. [13] introduced a registration method for hyperspectral remote sensing images based on MSER, which effectively utilized the information contained in different spectral bands. Elgamal et al. [14] proposed an improved Harris hawks optimization by utilizing elite opposite-based learning and proposing a new search mechanism. This method can avoid falling into local optimum, improve the calculation accuracy and accelerate the convergence speed. Debnath et al. [15] utilized Min Eigen feature extraction based on the Shi-Tomasi corner detection method which detects interest points to identify image forgery.
With the continuous development of machine learning, many scholars have applied it to the field of image stitching. However, learning-based image stitching solutions are rarely studied due to the lack of labeled data, making the supervised methods unreliable. To address this limitation, Lang Nie et al. [16] proposed an unsupervised deep image stitching framework consisting of two stages: unsupervised coarse image alignment and unsupervised image reconstruction. The stitching effect of this method is more obvious for images with few features or low resolution. However, stitching algorithms based on machine learning require extensive training, have a high resource consumption and are highly time consuming.
Alcantarilla et al. [17] introduced the KAZE feature in 2012. Their results revealed that it performs better than other feature-based detection methods in terms of detection and description. Pourfard et al. [18] proposed an improved version of the KAZE algorithm with the accelerated robust feature (SURF) descriptor for SAR image registration. Discrete random second-order nonlinear partial differential equations (PDEs) are used to model the edge structure of SAR images. The KAZE algorithm uses nonlinear diffusion filtering to build up the scale levels of the SIFT descriptor. It preserves edges while smoothing the image and reduces speckle noise.
For the purpose of alleviating the sensitivity of KAZE and improving the stitching effect, we proposed image stitching based on color difference and KAZE with a fast guided filter as an efficient stitching method. The contributions of this paper are as follows: firstly, we introduce a fast guided filter into the KAZE algorithm to effectively reduce the mismatch information and improve the matching efficiency. Secondly, we use the improved RANSAC algorithm to increase the probability of correct matching points sampled and effectively eliminate the wrong matching point pairs. Thirdly, we introduce color difference and brightness difference to compensate for the whole image when fusing and stitching images. This method cannot just only effectively eliminate seams, but also results in perfectly uniform color and luminance.
The remainder of the paper is organized as follows. Section 2 depicts the fast guided filter and Additive Operator Splitting (AOS) algorithm briefly. Section 3 details the proposed method in this paper. Section 4 presents the experimental results and assessments. Finally, the conclusions and outstanding issues are listed in Section 5.

2. Related Work

In this section, we introduce the fast guided filter, nonlinear diffusion and the AOS algorithm briefly.

2.1. Fast Guided Filter

A guided filter is an adaptive weight filter which can restore the boundaries while smoothing images via a guide map [19]. Assume that the input image, the output image and the guidance map are expressed as p, q and I, respectively. A guided filter driven by a local linear model can be defined as shown in Equation (1):
q i = a k I i + b k , i ω k ,
where i is the index of pixels and ω expresses the selected local square window. a k and b k are two constants in the window ω . Aiming at minimizing the reconstruction error between the input image and the output result, optimal values of a k and b k can be acquired by Equations (2) and (3).
a k = 1 ω i ω k I i p i μ k p ¯ k σ k 2 + ε ,
b k = p ¯ k a k μ k ,
where μ k and σ k are the mean and variance of the guided image I in the window k, respectively, and ε is a regularization parameter controlling the degree of smoothness. The values of a k and b k will determine the weight of gradient information and smoothing information. It is obvious that b k is approximately equal to the mean value of the pixel points when the value of a is small.
To reduce the time complexity, He et al. [20] proposed a fast guided filter on this basis. The filtering output is computed by Equation (4):
q i = a ¯ i I i + b ¯ i ,
where a ¯ i and b ¯ i are the averages of a and b, respectively, on the same centered window, which can be calculated by Equations (2) and (3), respectively. Firstly, the input image and the guided image are downsampled by scale s. Secondly, the output image q′ can be calculated by Equation (4). Finally, q′ is upsampled s times to obtain an output image with the same size as the original image. The time complexity of the method becomes O ( N / s 2 ) .
In this paper, a fast guided filter is applied to preprocessing before feature matching. The fast guided filter not only removes mismatch point pairs effectively, but also protects the texture information of the image preferably. The specific method is shown in Section 3.

2.2. Nonlinear Diffusion and the AOS Algorithm

The nonlinear diffusion method describes the luminance of an image with the increase in scale as the divergence of a flow function that controls the diffusion process [21]. This method is normally described by nonlinear partial differential equations (PDEs) owing to the nonlinear properties of the differential equations involved in diffusing the luminance of the image to the nonlinear scale space [22]. The classical nonlinear diffusion formula can be described by Equation (5):
L t = d i v ( c ( x , y , t ) L ) ,
where d i v and represent the divergence and gradient operations, respectively.
Li et al. [23] introduced nonlinear diffusion filtering and its implementation in detail. Nonlinear diffusion is a good smoothing method, which can reduce noise while maintaining the peak shape. In order to reduce the calculation loss at the local edges, more smooth regions are selected instead of boundaries. The conduction function can be defined by Equation (6):
c ( x , y , t ) = g ( L σ ( x , y , t ) ) ,
where L σ indicates the gradient of the Gaussian smoothing version of the original image. Since we chose to smooth both sides of the edge, the conduction function can be defined as follows:
g = { 1 1 exp ( 3.315 ( | L σ | / k ) 2 ) , | L σ | 2 = 0 , | L σ | 2 > 0 ,
However, there are no analytical solutions for the PDEs involved in nonlinear diffusion filtering. The AOS algorithm uses numerical methods to approximate differential equations [24]. The diffusion equation is a semi-implicit scheme. In vector matrix representation, the discretization of Equation (5) can be expressed by Equation (8):
L i + 1 L i τ = i = 1 m A l ( L i ) L i + 1 ,
where A l is a matrix that encodes the image transmission of each dimension. The solution of L i + 1 can be obtained in the following way:
L i + 1 = ( I τ i = 1 m A l L i ) 1 L i ,
The AOS algorithm is absolutely stable for any step size. Furthermore, it also creates a discrete nonlinear diffusion scale space for any large time step. The semi-implicit method greatly improves the convergence performance by reducing mask synthesis to successive one-dimensional updates represented by tridiagonal linear equations [25].

3. Methods

This section presents our proposed stitching method completely. Aiming at the problems of inaccurate matching and obvious splicing seams in stitched images, we propose an efficacious stitching method based on color difference and an improved KAZE with a fast guided filter. Figure 1 describes the overall process of the proposed method. Allowing for the phenomenon that feature points detected by KAZE are commonly large and intensive, we introduce a fast guide filter which uses one image as a guide map to filter the other image. This method can efficiently diminish the mismatching point pairs with preservation of original visual features. During feature matching, the KAZE algorithm based on RANSAC is utilized to match the feature points which further eliminates the mismatched points. Since the color and luminance of the images may be different, there are several clear seams in the stitching result. In order to improve the splicing effect, we produce a compensation method based on color and brightness to calculate the color difference in the overlapping area. Then, the obtained local color and luminance compensation values are applied to the overall image to be spliced. In addition, our proposed method can realize the stitching of multiple images. In order to avoid excessive variation, we use the middle image as the reference image to warp the images.

3.1. Fast Guided Filtering

The first image is imported as a guide map to repair the texture information in the other image. The purpose of introducing fast guided filtering is to decline the mismatch rate of the KAZE algorithm. Here, we select a window size of 8 pixels and set the regularization parameter that controls the smoothness level to 0.01. The sampling ratio is set to four pixels in the fast guided filter. Figure 2 shows the results of fast guided filtering.
Figure 2a,b contains input images, where (a) is the original image and (b) is the guide image. The fast guided filter filters redundant information by analyzing common textures and spatial features in both the original image and guide image. Additionally, then the fast guided filter can restore the boundaries while smoothing the original image by the guide map. This method greatly reduces the number of feature matching pairs, which results in a lower mismatch rate. After guided filtering, a lot of invalid information in the image can be filtered out, which widely improves the iterative efficiency during matching. At the same time, it can also reduce the mismatch rate to a certain extent.

3.2. KAZE Algorithm Based on RANSAC

Both the SIFT algorithm and the SURF algorithm detect feature points in a linear scale space, which can notably cause blurred boundaries and loss of detail. The KAZE algorithm detects feature points in the nonlinear scale space by constructing the nonlinear scale space, which retains more image detail. In the KAZE algorithm, AOS technology and variable transfer diffusion are used to establish a nonlinear scale space for the input images. Then, the 2D features of interest that exhibit the maximum value of scale-normalized determinant detection of Hessian response are detected by the nonlinear scale space. Finally, the scale and rotation invariance scriptors considering the first-order image derivatives are obtained through calculating the principal direction of the key point.
We introduce the RANSAC algorithm on the basis of the traditional KAZE algorithm, which can further eliminate mismatched point pairs. The flow of the KAZE algorithm based on RANSAC is shown in Figure 3.

3.2.1. Construction of Nonlinear Scale Space

The KAZE algorithm constructs a nonlinear scale space through nonlinear diffusion filtering and the AOS algorithm [26]. The scale of KAZE features increases logarithmically. Each level of the KAZE algorithm adopts the same resolution as the original image. According to the principle of the difference of Gaussian (DoG) pyramid model [27], each group needs S + 2 layers of images to detect the extreme points of S scales. Then, the parameter of scale space, θ , can be described as follows:
θ ( o , s ) = θ 0 2 o + s S , o [ 0 , 1 , , O 1 ] , s [ 0 , 1 , , S + 2 ] ,
where θ 0 is the baseline scale, o is the index of the group octave and S represents the index of the intra-group layer. The scale parameters of key points are calculated according to the group of key points and the number of layers in the group in combination with Equation (10).
The scale parameters of each layer in the group for constructing the Gaussian pyramid are calculated according to the following formulas:
θ ( s ) = ( r s θ 0 ) 2 ( r s 1 θ 0 ) 2 ,
r = 2 1 S ,
From the above formulas, the scale parameters of the same layer in different groups are the same. The scale calculation formula of a layer of images in the group is shown in Equation (13).
θ ( s ) = θ 0 2 s S , s [ 0 , 1 , , S + 2 ] ,
To ensure the continuity of the scale space, the first image of a group is obtained by sampling the penultimate layer of the previous group. We assume that the initial scale of the first group is θ . Then, the scale parameters of each layer in the first group are θ , r θ , r 2 θ and so on. The scale of the penultimate layer can be defined as follows:
r s θ = 2 θ ,
Since the nonlinear diffusion filter model is based on time, it is necessary to convert the scale parameters into evolution time. We suppose that the standard deviation used in Gaussian scale space is σ . Then, the convolution of the Gaussian is equivalent to filtering the image with a duration of t = σ 2 / 2 . According to a set of evolution time, all images in the nonlinear scale space can be obtained by the AOS algorithm as follows:
L i + 1 = [ I ( t i + 1 t i ) i = 1 m A i ( L i ) ] 1 L i ,

3.2.2. Detection and Location of Feature Points

The feature points are obtained by seeking the local maximum points of the Hessian determinant normalized by different scales. For multi-scale feature detection, we normalize the set of differential operators for scale:
L H e s s i a n = θ 2 ( L x x L y y L x y 2 ) ,
where L x x and L y y are the second-order horizontal derivative and vertical derivative, respectively, and L x y expresses the second-order cross derivative. For the filtered image set in a nonlinear scale space, we analyze the response of the detector at different scale levels θ i . The maximum values of scale and spatial position are searched in all filtered images except i = 0 and i = N . Then, we check the response in a 3 × 3 pixels window to quickly find the maximum value.
As shown in Figure 4, each feature point is compared with 26 pixel points from the same layer and two adjacent layers. All pixels are traversed in this way until the maximum point is found. The derivative is calculated by the Taylor expression.
L ( x ) = L + ( L x ) T x + x T 2 ( 2 L 2 x ) x ,
We take the derivative of the above equation and make it equal to zero. Then, the solution can be obtained by the following.
x ^ = ( 2 L x 2 ) 1 L x ,
L ( X ^ ) = L + 1 2 ( L x ) T X ^ ,
One of the feature points that meets L ( X ^ ) T is selected as the key point.

3.2.3. Determination of Main Direction

Assuming that the scale parameter of the characteristic point is θ i , the search radius is set to 6 θ i . We make six 60 degree sector regions in this radius and count the sum of Haar wavelet features in each sector region. The direction with the largest sum of wavelet features is the main direction.

3.2.4. Generation of Feature Descriptors

For feature points whose scale parameter is θ i , we take a window of 24 θ i × 24 θ i in the gradient image centered on the feature point. Then, the window is divided into 4 × 4 sub-regions with a size of 9 θ i × 9 θ i . Adjacent sub-areas have an overlapping zone with a width of 2 θ i . In the process of calculating the sub-region description vector, a Gaussian kernel with a weight of θ 1 = 2.5 θ i is used for each sub-region to obtain the description vector as Equation (20):
d v = ( L x , L y , | L x | , | L y | ) ,
After that, the vector d v of each sub-region is weighted by another 4 × 4 Gaussian window where θ 2 = 1.5 θ i . Finally, a 64-dimensional description vector is attained through normalization processing.

3.2.5. Eliminate Mismatched Point Pairs

In the case of information loss caused by image blur, noise interference and compression reconstruction, the robustness of KAZE feature point detection is significantly better than other features. In addition, the nonlinear scale space does not cause boundary blurring and detail loss compared to the linear scale space. However, the matching of KAZE features is sensitive to the setting of parameters, which can easily prompt mismatching. Aiming at the problem of excessive concentration and mismatch of feature points, the RANSAC method is introduced to effectively eliminate mismatched points. Firstly, KAZE feature matching is performed on the previous input image and the filtered image. Additionally, then RANSAC algorithm is applied to eliminate the mismatched point pairs.
The RANSAC algorithm is used to find an optimal homography matrix. The standardized matrix satisfies Equation (21).
s x y 1 = h 11 h 12 h 13 h 21 h 22 h 23 h 31 h 32 h 33 x y 1 ,
To calculate the homography matrix, we randomly extract four samples from the matching dataset which are not collinear. Then, the model is utilized for all datasets to calculate the number of points and the projection error. If the model is optimal, the loss function is the smallest. The loss function can be calculated by Equation (22).
i = 1 n x i h 11 x i + h 12 y i + h 13 h 31 x i + h 32 y i + h 33 + ( y i h 21 x i + h 22 y i + h 23 h 31 x i + h 32 y i + h 33 ) 2 ,
The process of the RANSAC algorithm is shown in Algorithm 1.
Algorithm 1: The process of RANSAC
Input: The feature point pair S of the image to be spliced and the maximum iteration number k.
Output: Remove the feature point pair D of mismatched point pairs.
1: S->D.
2: Repeat:
3: Randomly extract four sample data from all feature point pairs detected, which cannot be collinear.
4: Use Equations (21) and (22) to calculate the transformation matrix H, and record it as model M.
5: Calculate the projection error between all data in the dataset and model M. If the error is less than the threshold, add the interior point set I.
6: If the number of elements of the current interior point set I is greater than the optimal interior point set I_ Best, update I_ Best = I, update the number of iterations at the same time k = log ( 1 p ) log ( 1 ω m ) .
7: Until iterations are greater than the iteration number k.
The iteration number k is constantly updated rather than fixed when it is not greater than the maximum iteration number. The formula for calculation of the iteration number is as follows:
k = log ( 1 p ) log ( 1 ω m ) ,
where p expresses the confidence level, ω is the proportion of the interior point and m is the minimum number of samples required to calculate the model.
The RANSAC algorithm performs precise matching of feature points through the above iterative process, which effectively eliminates mismatched point pairs. The inner point pairs obtained by the method are the most advantageous pairs. The matching accuracy is the foundation for accurately evaluating warped equations. If there are many mismatched pairs, it is easy for problems such as ghosting and distortion to occur in the splicing result.

3.3. Color Difference Compensation

The luminance and color of the image to be stitched may be uneven, which can easily result in obvious stitching seams in the stitching result. To improve this problem, we put forward a color difference compensation method. The process is shown in Figure 5.
We calculate the color difference and luminance difference of the overlapping area of the two distorted images. Here, we chose the LAB color model. The average color difference is calculated as follows:
L a v g = 1 n 1 i = 1 n ( L i 1 L i 2 ) ,
A a v g = 1 n 1 i = 1 n ( A i 1 A i 2 ) ,
B a v g = 1 n 1 i = 1 n ( B i 1 B i 2 ) ,
where L a v g represents the average brightness difference, L i 1 is the brightness of the overlapping area of the first image and L i 2 is the brightness of the overlapping area of the second image. Similarly, A a v g and B a v g are the average color difference, A i 1 and B i 1 are the colors of the overlapping area of the first image and A i 2 and B i 2 are the colors of the overlapping area of the second image. We chose the image with the higher brightness as the standard to compensate for the global brightness and color of another image. Finally, the compensated distorted image is fused to obtain the final mosaic image. Figure 6 shows the original images and Figure 7 shows the comparison of color compensated and uncompensated splicing results.
It can be seen from the figure that the stitching effect after color compensation is smoother. Not only does the stitching result have no obvious seams, but also has an improved uniformity.

4. Experiments

This section introduces some experiments to evaluate our proposed splicing method. The images used in the experiment are mainly from the ground truth database of the University of Washington [28] and the USI-SIPI image database of the University of Southern California [29]. The ground truth database of the University of Washington addresses the need for experimental data to quantitatively evaluate emerging algorithms. The high-quality and high-resolution color images in the database represent valuable extended duration digitized footage to those interested in driving scenarios or ego-motion. The images in the USI-SIPI image database of the University of Southern California have been provided for research purposes. The USI-SIPI image database contains multiple types of image sets, including texture images, aerial images, miscellaneous images and sequence images. Most of the material was scanned many years ago in the research group from a variety of sources.
At the same time, all test methods are run on a 2.60 GHz CPU with 16 GB RAM under the same experimental settings in this paper. In order to better evaluate the algorithm, we compared subjective images and quantitative evaluation. We compare the results with several popular splicing methods.

4.1. Intuitive Effect

We took a group of images in the USI-SIPI image database of the University of Southern California as an example to compare our method with SURF, BRISK, Harris, MinEigen, MSER and ORB matching algorithms. The splicing effect is shown in Table 1.
The upper right corner of the stitched image in the table shows a magnification of the area marked in blue. It is not difficult to see from the table that the proposed algorithm is not only better than other algorithms regarding detail, but also more uniform in the color and brightness of the mosaic image. As shown in the red marked area in the table, the stitching method we proposed has no obvious stitching seams, while other algorithms have several obvious stitching seams.
In addition, our method can be applied to multiple image stitching. We selected multiple UAV images from the image library, and the splicing effect is shown in Figure 8.

4.2. Quantitative Evaluation

In order to effectively evaluate the effectiveness of the algorithm, we quantitatively evaluated the above algorithms from four aspects: the number of matching pairs, the correct matching rate, the root mean square error (RMSE) and the mean absolute error (MAE) [30,31,32].
Assuming that the total number of matches is N and the correct matching logarithm is A, the correct matching rate can be defined as Equation (27).
A c c u r a n c y = A N × 100 % ,
We randomly selected eight groups (Table 2) of data from the two databases for feature matching. The table shows the matching logarithms and the matching accuracy results of several comparison algorithms.
It can be seen from the above table that the extent of feature matching based on ORB is the largest. Although the overall matching of the ORB is relatively stable, the matching rate is lower than the proposed method in this paper. Other comparison algorithms detect fewer feature points. Even though other algorithms have high matching rates for individual data, their performance in terms of the number of feature points, matching accuracy and stability is poor. The improved KAZE algorithm based on a fast guided filter is second only to the ORB algorithm in the number of feature matching pairs. Our proposed method further filters out the mismatched point pairs, thereby improving the matching efficiency and matching stability.
In order to judge the stability of the matching algorithm more intuitively, we compared the accuracy of several algorithms in a line chart (Figure 9).
The red color in the figure shows the matching accuracy of our proposed algorithm. It is not difficult to see from the figure that the algorithm we proposed is not only more accurate, but also more stable.
For two images, I1 and I2, to be spliced, given N matching pairs (pi1 and pi2), where i = 1, 2, N, the RMSE and the MAE are defined as follows:
R M S E ( I , I ) = 1 N i = 1 N ( f ( p i ) p i ) 2 ,
M A E ( I , I ) = 1 N i = 1 N | f ( p i ) p i | ,
Additionally, taking the selected eight groups (Table 3) of data as an example for splicing, the table shows the comparison results of the RMSE and the MAE of several different algorithms.
The table shows that the RMSE and the MAE values of our proposed method are lower. The overall stitching effect is better than other stitching algorithms.
In addition, we also compared the processing time of the proposed algorithm with other algorithms. The result shows that the processing time of the proposed algorithm is similar to that of other algorithms. The comparison results of processing time are shown in Table 4.
It is not difficult to draw the conclusion from Table 4 that the processing time of the SURF algorithm is relatively low and the ORB algorithm is the most time consuming among the studied algorithms. The proposed method has similar processing times compared to other methods.

5. Conclusions

In this paper, we propose an improved image stitching algorithm based on color difference and KAZE with a fast guided filter, which solves the problems of a high mismatch rate in feature matching and obvious seams in the stitched image. In this paper, a fast guide filter is introduced to reduce the mismatch rate before matching. The KAZE algorithm based on RANSAC is used for feature matching of the image to be spliced, and the matrix transformation of the image to be spliced is performed. Then, the color difference and brightness difference of the overlapping area of the image to be spliced is calculated, and overall adjustments of the image to be spliced are made so as to improve the nonuniformity of the spliced image. Finally, the converted image is fused to obtain the stitched image.
Our proposed method was evaluated via the resulting visual image and quantitative value of the images of the ground truth database and USI-SIPI image database and compared with other popular algorithms. On the one hand, the stitching method we proposed can achieve smoother and more detailed stitched images. On the other hand, the algorithm proposed in this paper is superior to other algorithms in terms of matching accuracy, the RMSE and the MAE.
The proposed stitching method in this paper can be used in many fields, such as UAV panoramic stitching and virtual reality. However, the limitations of our proposed method are as follows: firstly, the method proposed in this paper is prone to ghosting when splicing moving objects in close proximity. Secondly, the proposed algorithm has a similar processing time compared to other algorithms, but cannot achieve the effect of real-time stitching. In the future, we will further improve the efficiency of image stitching.

Author Contributions

Conceptualization, C.Z.; methodology, C.Z., D.W. and H.S.; formal analysis, C.Z. and D.W.; investigation, C.Z. and D.W.; resources, H.S., C.Z. and D.W.; writing—original draft preparation, C.Z.; writing—review and editing, C.Z.; supervision, D.W. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the Youth Foundation of Jilin Province 62205332.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Gómez-Reyes, J.K.; Benítez-Rangel, J.P.; Morales-Hernández, L.A. Image Mosaicing Applied on UAVs Survey. Appl. Sci. 2022, 12, 2729. [Google Scholar] [CrossRef]
  2. Jiang, X.; Ma, J.; Fan, A. Robust feature matching for remote sensing image registration via linear adaptive filtering. IEEE Trans. Geosci. Remote Sens. 2020, 59, 1577–1591. [Google Scholar] [CrossRef]
  3. Liao, T.; Li, N. Single-perspective warps in natural image stitching. IEEE Trans. Image Process. 2019, 29, 724–735. [Google Scholar] [CrossRef] [PubMed]
  4. Nie, L.; Lin, C.; Liao, K. Learning edge-preserved image stitching from multi-scale deep homography. Neurocomputing 2022, 491, 533–543. [Google Scholar] [CrossRef]
  5. Lin, M.; Liu, T.; Li, Y. Image stitching by disparity-guided multi-plane alignment. Signal Process. 2022, 197, 108534. [Google Scholar] [CrossRef]
  6. Zhang, L.; Huang, H. Image Stitching with Manifold Optimization. IEEE Trans. Multimed. 2022, 10, 1109. [Google Scholar] [CrossRef]
  7. Zhang, Y.; Lai, Y.K.; Zhang, F.L. Content-preserving image stitching with piecewise rectangular boundary constraints. IEEE Trans. Vis. Comput. Graph. 2020, 27, 3198–3212. [Google Scholar] [CrossRef]
  8. Li, Y.; Yang, C.; Zhang, L. A novel SURF based on a unified model of appearance and motion-variation. IEEE Access 2018, 6, 31065–31076. [Google Scholar] [CrossRef]
  9. Liu, J.; Bu, F.L. Improved RANSAC features image-matching method based on SURF. J. Eng. 2019, 2019, 9118–9122. [Google Scholar] [CrossRef]
  10. Guan, H.; Smith, W.A.P. BRISKS: Binary features for spherical images on a geodesic grid. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017; pp. 4516–4524. [Google Scholar]
  11. Liu, Y.; Zhang, H.; Guo, H. A fast-brisk feature detector with depth information. Sensors 2018, 18, 3908. [Google Scholar] [CrossRef]
  12. Zhang, M.Y.; Wang, Y.Y.; Hou, X.H. Image Stitching Algorithm Based on ORB and Improved RANSAC. Comput. Sci. 2019, 46, 294–298. [Google Scholar] [CrossRef]
  13. Ordóñez, Á.; Heras, D.B.; Argüello, F. Exploring the MSER-based hyperspectral remote sensing image registration. In Proceedings of the Image and Signal Processing for Remote Sensing XXVI, SPIE, Online, 21–25 September 2020; Volume 11533, pp. 89–96. [Google Scholar]
  14. Elgamal, Z.M.; Yasin, N.B.M.; Tubishat, M. An improved harris hawks optimization algorithm with simulated annealing for feature selection in the medical field. IEEE Access 2020, 8, 186638–186652. [Google Scholar] [CrossRef]
  15. Debnath, A.; Das, S. Identification of Image Forgery based on various Corner Detection methods. In Proceedings of the 2022 IEEE World Conference on Applied Intelligence and Computing (AIC), Sonbhadra, India, 17–19 June 2022; pp. 314–319. [Google Scholar]
  16. Nie, L.; Lin, C.; Liao, K.; Liu, S.; Zhao, Y. Unsupervised deep image stitching: Reconstructing stitched features to images. IEEE Trans. Image Process. 2021, 30, 6184–6197. [Google Scholar] [CrossRef]
  17. Alcantarilla, P.F.; Bartoli, A.; Davison, A.J. KAZE features. In Proceedings of the Computer Vision–ECCV 2012: 12th European Conference on Computer Vision, Florence, Italy, 7–13 October 2012; pp. 214–227. [Google Scholar]
  18. Pourfard, M.; Hosseinian, T.; Saeidi, R. KAZE-SAR: SAR image registration using KAZE detector and modified SURF descriptor for tackling speckle noise. IEEE Trans. Geosci. Remote Sens. 2021, 60, 5207612. [Google Scholar] [CrossRef]
  19. Li, Z.; Zheng, J.; Zhu, Z.; Yao, W.; Wu, S. Weighted guided image filtering. IEEE Trans. Image Process. 2014, 24, 120–129. [Google Scholar]
  20. He, K.; Sun, J. Fast guided filter. arXiv 2015, arXiv:1505.00996. [Google Scholar]
  21. Fan, J.; Wu, Y.; Li, M.; Liang, W.; Cao, Y. SAR and optical image registration using nonlinear diffusion and phase congruency structural descriptor. IEEE Trans. Geosci. Remote Sens. 2018, 56, 5368–5379. [Google Scholar] [CrossRef]
  22. Weickert, J.; Romeny, B.T.H.; Viergever, M.A. Efficient and reliable schemes for nonlinear diffusion filtering. IEEE Trans. Image Process. 1998, 7, 398–410. [Google Scholar] [CrossRef]
  23. Li, Y.; Ding, Y.; Li, T. Nonlinear diffusion filtering for peak-preserving smoothing of a spectrum signal. Chemom. Intell. Lab. Syst. 2016, 156, 157–165. [Google Scholar] [CrossRef]
  24. Jeon, M.; Alexander, M.; Pedrycz, W. Unsupervised hierarchical image segmentation with level set and additive operator splitting. Pattern Recognit. Lett. 2005, 26, 1461–1469. [Google Scholar] [CrossRef]
  25. Shen, Y.; Peng, F.; Zhang, Z. Efficient optical proximity correction based on semi-implicit additive operator splitting. Opt. Express 2019, 27, 1520–1528. [Google Scholar] [CrossRef] [PubMed]
  26. Jong, T.K.; Bong, D.B.L. An effective feature detection approach for image stitching of near-uniform scenes. Signal Process. Image Commun. 2023, 110, 116872. [Google Scholar] [CrossRef]
  27. Setumin, S.; Suandi, S.A. Difference of Gaussian oriented gradient histogram for face sketch to photo matching. IEEE Access 2018, 6, 39344–39352. [Google Scholar] [CrossRef]
  28. Brostow, G.J.; Fauqueur, J.; Cipolla, R. Semantic object classes in video: A high-definition ground truth database. Pattern Recognit. Lett. 2009, 30, 88–97. [Google Scholar] [CrossRef]
  29. Mahto, D.K.; Anand, A.; Singh, A.K. Hybrid optimisation-based robust watermarking using denoising convolutional neural network. Soft Comput. 2022, 26, 8105–8116. [Google Scholar] [CrossRef]
  30. Wang, Y.; Yuan, Y.; Lei, Z. Fast SIFT feature matching algorithm based on geometric transformation. IEEE Access 2020, 8, 88133–88140. [Google Scholar] [CrossRef]
  31. Khajehzadeh, M.; Taha, M.R.; Keawsawasvong, S. An effective artificial intelligence approach for slope stability evaluation. IEEE Access 2022, 10, 5660–5671. [Google Scholar] [CrossRef]
  32. Qi, J.; Du, J.; Siniscalchi, S.M. On mean absolute error for deep neural network based vector-to-vector regression. IEEE Signal Process. Lett. 2020, 27, 1485–1489. [Google Scholar] [CrossRef]
Figure 1. The proposed framework.
Figure 1. The proposed framework.
Sensors 23 04583 g001
Figure 2. (a) is the original image; (b) is the guide image; (c) is the binary image without filtering; (d) is the filtered binary image.
Figure 2. (a) is the original image; (b) is the guide image; (c) is the binary image without filtering; (d) is the filtered binary image.
Sensors 23 04583 g002
Figure 3. The flow of KAZE algorithm based on RANSAC.
Figure 3. The flow of KAZE algorithm based on RANSAC.
Sensors 23 04583 g003
Figure 4. Detection and location of each feature point.
Figure 4. Detection and location of each feature point.
Sensors 23 04583 g004
Figure 5. The flow of the color difference compensation.
Figure 5. The flow of the color difference compensation.
Sensors 23 04583 g005
Figure 6. Original images. (ac) are the original images.
Figure 6. Original images. (ac) are the original images.
Sensors 23 04583 g006
Figure 7. (a) Mosaic image without color compensation. (b) Mosaic image with color compensation.
Figure 7. (a) Mosaic image without color compensation. (b) Mosaic image with color compensation.
Sensors 23 04583 g007
Figure 8. UAV images panoramic mosaic: (ai) are the original images; (j) is the stitched image.
Figure 8. UAV images panoramic mosaic: (ai) are the original images; (j) is the stitched image.
Sensors 23 04583 g008
Figure 9. Comparison of accuracy.
Figure 9. Comparison of accuracy.
Sensors 23 04583 g009
Table 1. Splicing effect.
Table 1. Splicing effect.
MethodsMatch FigureStitched Image
SURF
[9]
Sensors 23 04583 i001Sensors 23 04583 i002
BRISK
[11]
Sensors 23 04583 i003Sensors 23 04583 i004
Harris
[14]
Sensors 23 04583 i005Sensors 23 04583 i006
MinEigenSensors 23 04583 i007Sensors 23 04583 i008
MSER
[13]
Sensors 23 04583 i009Sensors 23 04583 i010
ORB
[12]
Sensors 23 04583 i011Sensors 23 04583 i012
Our methodSensors 23 04583 i013Sensors 23 04583 i014
Table 2. The results of a comparison of different algorithms.
Table 2. The results of a comparison of different algorithms.
DataEstimateSURFBRASKMSERMinEigenHarrisORBProposed
Data1Matching pairs6914203219101267
Accuracy89.85%100%90.00%96.87%100%99.01%98.50%
Data2Matching pairs12371196836321243
Accuracy99.18%98.59%94.73%8100%100%99.38%99.59%
Data3Matching pairs2051095112587771606
Accuracy98.54%99.08%96.08%100%97.70%99.48%100%
Data4Matching pairs47423113523215723481280
Accuracy99.36%98.70%95.56%98.28%98.73%99.32%99.38%
Data5Matching pairs613873922167148
Accuracy90.16%100%71.43%100%95.45%98.80%100%
Data6Matching pairs3915102919133154
Accuracy92.31%100%100%96.55%100%99.93%99.35%
Data7Matching pairs5642667939823331121242
Accuracy97.69%99.25%96.20%99.50%98.71%99.94%100%
Data8Matching pairs154442510454440212
Accuracy94.81%88.64%76.00%91.35%92.59%97.95%98.11%
Table 3. The comparison results of the RMSE and the MAE of different algorithms.
Table 3. The comparison results of the RMSE and the MAE of different algorithms.
DataEstimateSURFBRASKMSERMinEigenHarrisORBProposed
Data1RMSE0.10370.13540.13010.13210.13090.12610.1237
MAE0.07590.11570.10510.10600.10960.09350.0935
Data2RMSE0.09170.13670.09730.11730.11850.10990.0797
MAE0.06710.09330.08190.09160.08460.08330.0649
Data3RMSE0.12850.14390.13860.17380.17270.18310.1283
MAE0.09920.11550.12430.13700.13870.15050.0999
Data4RMSE0.09200.09460.09660.16160.17340.14170.0903
MAE0.05920.06550.05970.11240.11940.09050.0545
Data5RMSE0.07760.08950.25730.08670.82500.11690.0760
MAE0.05880.06500.13050.07080.07170.07690.0586
Data6RMSE0.05390.07130.05620.05990.04820.06910.0417
MAE0.03980.05100.04670.04290.03940.04580.0302
Data7RMSE0.10740.11200.13860.13920.12220.14940.1038
MAE0.08470.08880.10840.10400.09470.10750.0842
Data8RMSE0.07050.07190.04000.11390.10470.09940.0701
MAE0.04940.04960.03450.07770.08120.06660.0447
Table 4. The comparison results of processing time of different algorithms.
Table 4. The comparison results of processing time of different algorithms.
DataSURFBRASKMSERMinEigenHarrisORBProposed
Data11.226 s1.681 s1.456 s1.772 s1.354 s1.879 s1.798 s
Data22.239 s3.001 s2.489 s2.096 s2.204 s5.370 s3.232 s
Data31.168 s1.444 s1.549 s2.238 s1.179 s2.523 s2.389 s
Data41.219 s1.341 s1.318 s1.996 s1.487 s2.653 s1.979 s
Data51.149 s1.362 s1.251 s1.359 s1.160 s2.568 s1.356 s
Data61.715 s2.406 s1.998 s1.337 s1.181 s1.661 s1.509 s
Data71.089 s1.964 s1.981 s1.549 s1.347 s2.017 s1.973 s
Data82.147 s3.010 s2.984 s2.471 s2.309 s4.175 s2.992 s
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Zhang, C.; Wang, D.; Sun, H. Image Stitching Based on Color Difference and KAZE with a Fast Guided Filter. Sensors 2023, 23, 4583. https://doi.org/10.3390/s23104583

AMA Style

Zhang C, Wang D, Sun H. Image Stitching Based on Color Difference and KAZE with a Fast Guided Filter. Sensors. 2023; 23(10):4583. https://doi.org/10.3390/s23104583

Chicago/Turabian Style

Zhang, Chong, Dejiang Wang, and He Sun. 2023. "Image Stitching Based on Color Difference and KAZE with a Fast Guided Filter" Sensors 23, no. 10: 4583. https://doi.org/10.3390/s23104583

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop