A Novel Image Mosaicking Algorithm for Wireless Multimedia Sensor Networks

The wisdom tourism is an important application of internet of things industry, and many cities in China have paid attention to the development of wisdom tourism, such as the national historic city of Zhenjiang. How to take advantage of the cooperation among sensor nodes to obtain the panoramic information of scenic spots is a challenging issue for the wisdom tourism. However, the existing image mosaic algorithms are not suitable for wireless multimedia sensor networks (WMSNs) due to the resource-constrained multimedia sensor nodes, such as energy, computing, and storage space. And hence an image mosaic algorithm based on phase correlation and weighted average (IMBPW) is proposed in this paper. The IMBPW algorithm uses the phase correlation based on Fourier transform to achieve the registration of translation, rotation, and scaling images. After the image registration, the adaptive weighted average algorithm is proposed to do the image fusion. The simulation experiments show that compared with homogeneous algorithms, the IMBPW algorithm has higher real-time and fast convergence speed. Furthermore, the simulation results also show that the proposed algorithm can improve the accuracy of image registration, reduce the complexity of the image mosaic, and prolong the network lifetime while providing better image quality.


Introduction
In 2010, the national historic city of Zhenjiang firstly put forward the concept of wisdom tourism.The wisdom tourism makes comprehensive use of the cloud computing, the Internet of Things [1], and other wireless broadband communication technologies, and it can provide the abundant scenic spots information for tourists at anytime and anyplace.The government has already deployed lots of wireless multimedia sensors at each scenic spot of Zhenjiang city, and then the engineers use image mosaic technology to put the local images together to form the panoramic image of scenic spots.The image mosaic technology for wireless multimedia sensor networks (WMSNs) [2,3] has played an important role in panorama images processing for the scenic spots however, most of the existing image mosaic schemes are not suitable for WMSNs.Hence, it is necessary to study this technology.
WMSNs are a network of spatially distributed smart camera sensors capable of processing and fusing images of a scene from a variety of viewpoints into some form more useful than the individual images.In WMSNs, the sensors are small and have limited resources, such as computing, transmission bandwidth, and power resources.However, multimedia applications require higher bandwidth, greater information processing capabilities, and higher energy consumption.And hence, a good image mosaic algorithm design for WMSNs has to take into consideration the tradeoff between the complexity and the accuracy of the image mosaic.
This paper proposes an image mosaic algorithm based on phase correlation and weighted average (IMBPW).The IMBPW algorithm runs on the top of a structured network.The advantage of the structured network is that fewer nodes may be deployed with lower network maintenance and management overhead.The IMBPW algorithm firstly uses the phase correlation based on Fourier transform to achieve the registration of translation, rotation, and scaling images.After the image registration, the adaptive weighted average algorithm is proposed to fulfill the task of image fusion.The IMBPW algorithm is implemented on the platform of CMUcam camera sensors.The experimental results show that the proposed algorithm can achieve the tradeoff between the image mosaic convergence speed and the quality of  image.Moreover, the IMBPW algorithm has a positive effect on controlling the energy consumption of networks and prolonging the network lifetime.
The rest of the paper is organized as follows: Section 2 introduces an overview of existing related works and motivation.Section 3 presents the image mosaic algorithm based on phase correlation and weighted average.Section 4 provides the experimental simulation and analysis.Finally, Section 5 concludes the paper.

Related Works and Motivation
Image mosaic is a technology which combines two or more partial images into a large seamless high-resolution image.It is usually made up of five steps, such as image preprocessing, image registration, the establishment of transformation model, unified coordinate transformation and image fusion.Among these steps, both the image registration and image fusion are two key issues.Figure 1 shows the process of image mosaic.

Image Registration.
Image registration is the process of transforming different sets of data into one coordinate system, and the data sets are from different multimedia sensor nodes.Registration is necessary to integrate the data obtained from different sensors.
The image registration algorithms can be classified into three categories.
(1) Gray information-based image registration: gray information-based image registration is a kind of mathematical analysis methods, which includes the crosscorrelation method (also known as template matching), the sequential similarity detection method and the mutual information method.The gray level is referred to as the brightness of pixels.This method does not require complex pre-processing, but use the statistics of the gray information of images to measure the similarity between two images.Its main characteristic is simple; however, it has the narrow scope of applications, and it cannot be directly used to correct the nonlinear distortion of the images.Moreover, it needs a mount of computation [4].
(2) Feature-based image registration: feature-based image registration method requires image preprocessing, such as the image segmentation and the image feature extraction, and then uses the extracted features to complete the match between the two images [3].At present, there are many image features, that results in a variety of feature-based approaches, including the edge point extraction methods, such as LOG operator, Canny operator, and wavelet transform-based algorithm, and the corner detection methods, such as SUSAN corner detection, Harris corner detection and other methods [5][6][7][8][9][10].
(3) Frequency domain-based image registration [11]: the most common image registration based on the frequency domain is the phase correlation algorithm [12].According to the phase information of images, the phase correlation algorithm can calculate the cross power spectrum of two images and then get the impulse function by inversing Fourier transform.It is worth to note that the Cartesian coordinate needs to be transformed into the log-polar coordinate for the scaling and rotation transformation images.
The advantages and disadvantages of the three types of image registration methods are analyzed in Table 1.

Image Fusion.
Multisensor image fusion is the process of combining relevant information from two or more images into a single panoramic image.The panoramic image will show more informative than any other partial images.Image

Types
Advantages Disadvantages Median filtering [13] Simple operation, fast running speed, and preserving the edges while removing noise The weak quality of the image fusion Wavelet transform [14,15] High-quality fused image Complex, large amounts of calculation, and lack of real time Weighted average [16,17] Simple operation, fast running speed, and improving the SNR of fused images Making the edges and contours blurry fusion methods can be broadly classified into three classes, such as the median filtering method, the wavelet transform method and the weighted average method.
(1) Median filtering method [13]: the median filter is a nonlinear digital filtering technique, often used to remove noise.Median filtering is also widely used in digital image processing because it still can preserve edges while removing noise.The principle of the median filter is described as below.Firstly, a filter window is set.Next, the filter window is moved until all pixel points in the image are traversed.If the gray value of a pixel is very different from that of the adjacent pixels, the pixel is replaced by the average gray value of the surrounding pixels.The advantage of the median filter method is the simple numerical operation and fast running speed, and its disadvantage is the weak quality of the image fusion.(2) Wavelet transform method [14,15]: wavelet transform is a time-frequency localization method in which the size of its window is fixed, but its shape is variable.
The continuous wavelet transform of square integral function () ∈  2 () is defined as where  , () = (1/√||) * (( − )/) is the wavelet generated by the mother wavelet,  denotes the scale parameter, and  denotes the translation parameter.This image fusion algorithm based on 2D wavelet transform firstly decomposes the image into low pass in horizontal and low pass in vertical (LL), high pass in horizontal and low pass in vertical (HL), low pass in horizontal and high pass in vertical (LH) and high pass in horizontal and high pass in vertical (HH) bands.The resolution of image becomes half of the original image.The wavelet transform is further applied in the temporal domain in the LL band only.The resolution of image becomes a quarter of the original image.The decomposition coefficients after decomposition are processed to highlight the contours of the image and weaken its details.Image fusion coefficient is worked out by adding the decomposition coefficients of each layer in wavelet transform region.Finally, we can reconstruct the fusion coefficient to get the image mosaic.
(3) Weighted average method [16,17]: the weighted average fusion algorithm firstly calculates the weights of images and then superimposes the images through algebra and linear mathematical operation.The method is easy implemented and has fast convergence speed.Furthermore, it can efficiently fuse the images under different illuminations and improve the signalto-noise ratio (SNR) of image fusion.
The advantages and disadvantages of the image fusion methods mentioned above are analyzed in Table 2.In conclusion, we make a decision to use the phase correlation and the weighted average methods to achieve the image mosaic for WMSNs.

Image Mosaic Algorithm Based on Phase
Correlation and Weighted Average 3.1.Network Architecture.We divide the network into uneven clusters using our proposed protocol, called UCBCPNS [18], where each cluster is deployed with heterogeneous sensors (camera, audio, and scalar sensors) that communicate directly in a certain schedule with a cluster head and relay their sensed data and images to it.Moreover, these heterogeneous sensor nodes have the same radio interface and propagation range.A cluster head has more resources, and it is able to perform intensive and complex data processing.These powerful nodes and cluster heads are nonuniformly deployed in the network, and they are wirelessly connected with the base station either directly (in case of 1st-level cluster heads) or through other cluster heads in multihop mode.The graphical depiction of the nonuniform clustering network architecture is shown in Figure 2. Our algorithm runs on the top of the nonuniform clustering network topology.

Image Registration Based on Phase Correlation.
Frequency-domain methods find the transformation parameters for registration of the images while working in the transform domain.Such methods work for simple transformations, such as translation, rotation, and scaling.Applying the phase correlation method to a pair of images produces a third image which contains a single peak.The location of this peak corresponds to the relative translation between the images.Unlike many spatial-domain algorithms, the phase correlation method is resilient to noise, occlusions, and other defects typical of medical or satellite images.Additionally, the phase correlation uses the fast Fourier transform to compute the cross-correlation between the two images, generally resulting in large performance gains.
There are two types of registration of images.One is the registration of images only with translation transform which is shown in Section 3.2.1.The other is the registration of images with translation, rotation, and scaling transforms which is shown in Section 3.2.2.Their processing procedure is depicted in Figure 3, where the blue solid line indicates the procedure of Section 3.2.1, and the red solid line indicates the procedure of Section 3.2.2.

Registration of Images with Translation Transform.
The phase correlation with translation transform method depends on the translation property of the Fourier transform, namely, the Fourier shift theorem, which is shown in (2).The shift theorem can guarantee that the phase of cross-power spectrum is equivalent to the phase difference between the images.Consider The images registration with translation transforms is described as below.
Let  1 and  2 be the two images that differ only by a displacement ( 0 ,  0 ), which is shown as Their corresponding Fourier transforms  1 and  2 will be related by The correlation between the images is calculated by the inner product of Fourier spectrum instead of the convolution due to the large amount calculation of convolution.Then the cross-power spectrum of two images  1 and  2 with Fourier transforms  1 and  2 is defined as where  * 2 (, ]) is the complex conjugate of  2 .By taking inverse Fourier transform of (5) in the frequency domain, we can get a impulse function which is shown in (6).It is approximately zero everywhere except at the displacement that is needed to optimally register the two images.And hence, we can use a way of solving the location of the maximum of impulse function to determine the translation parameters ( 0 ,  0 ) between image  1 and image  2 .Consider The specific solving steps are described as follows: (1) input two images  1 and  2 which have the same dimensions, such as  × .If the images are color images, we have to turn them into 2D gray images; (2) use the two-dimensional fast Fourier transform (FFT) on the two images to get  1 and  2 ; (3) use ( 5) to compute the cross-power spectrum to get the phase difference matrix; (4) the impulse function is obtained by taking the inverse FFT of the phase difference matrix, and then the displacement ( 0 ,  0 ) can be solved by (6).

Registration of Images with Translation, Rotation, and
Scaling Transforms.The phase correlation with translation transform can accurately detect the displacement between images, but it is very sensitive to rotation and scaling transform.And hence, we have to use an improved image registration algorithm to deal with the registration of images with rotation and scaling transforms.The principle of the improved image registration scheme can be described as below.
We firstly combine the log polar with the phase correlation.And then according to the distance invariance and angle invariance in log-polar transformation, the image rotation and scaling transforms are converted into the translation of amplitude spectrum in log-polar coordinate system.Let us elaborate the scheme by the formal method as below.
If  2 (, ) is a translated, scaled, and rotated replica of  1 (, ) with translation ( 0 ,  0 ), scale factor , and rotation  0 , then we can get (7) According to the Fourier translation property and the Fourier rotation property, transforms of  1 and  2 in (7) are related by ( 8) Let  1 (, ]) and  2 (, ]) be the magnitudes of  1 (, ]) and  2 (, ]) from ( 8), and then we can get After the Cartesian coordinate system is converted into the log polar coordinate system,  1 (, ]) and  2 (, ]) are converted into  1 (, ) and  2 (, ) simultaneously.The ( 9) is equivalent to Then let  = lg and  0 = lg; then, we can get where  is the log-polar radius.Equation ( 11) coverts the rotation and scaling transforms in spatial domain into the translation between  1 (, ) and  2 (, ) in frequency domain.
We can obtain an impulse function by taking inverse Fourier transform of (12), and then the phase correlation scheme is used to solve the scale value  and the angle value  0 .The specific solving algorithms are described as follows.
(1) Obtain two original images  1 and  2 which have the same dimensions, such as ×.If the images are the color images, we have to convert them into 2D gray images.
(2) The two-dimensional fast Fourier transform (FFT) of each image is taken to get  1 and  2 respectively.(3) Solve the magnitudes of  1 and  2 , and convert the Cartesian coordinate system into the log-polar coordinate system.(4) The phase difference matrix is derived by forming the cross-power spectrum computed by (12).( 5) Take the inverse FFT of the phase difference matrix to obtain the impulse function and calculate the scale and the angle information.(6) Once the scale  and the angle  0 are obtained, the image  2 is scaled and rotated by amounts  and  0 , respectively.And then the mount of translational movement ( 0 ,  0 ) is found out using the images registration algorithm in Section 3.2.1.

Image Fusion
Based on Weighted Average.Assume that  1 and  2 are the weights of pixels of the overlapping area between the image  1 and the image  2 , respectively.The image  fused by the image  1 and the image  2 is denoted as where Because  1 varies from one to zero and  2 varies from one to zero, the fused image has a smooth transition from the image  1 to the image  2 in the overlapping region.The weights of pixels  1 and  2 are denoted as ( 14) International Journal of Distributed Sensor Networks where   denotes the abscissa of the current pixel,   denotes the abscissa of the left edge of the overlapping area, and   is the abscissa of the right edge of the area.

Experimental Simulation and Analysis
4.1.Simulation Environment Settings.In this part, we simulate our proposal using CMUcam camera sensors.The network size is 400 m × 400 m deployed with 400 camera nodes for duration of 1200 time rounds.We use the first-order radio model as the energy consumption model in the paper, and assume that initial energy of a node is 0.5 J.
In the simulations, we focus on measuring the performance on different sets of the images, such as the images with white Gaussian noise and no noise.We choose (a), (b), and (c) in Figure 4 as the test images of this simulation experiments.Figure 4(a) is the reference scenic spot image.Figure 4(b) is a translated replica of Figure 4(a) with translation (30, 20), which means that the image's offset on the -axis direction is 30 pixels and its offset on the y-axis direction is 20 pixels.Figure 4(c) is a rotated and scaled replica of Figure 4(a) with scale factor 1.2 and rotation 22 ∘ .

Simulation Results
Analysis.The application of the proposed IMBPW algorithm results in a sharp peak at the point of registration.Theoretically, if the two images are the same, the peak value on the phase correlation surface should be equal to 1.0.However, both the presence of difference   between the images and the images with white Gaussian noise reduce the peak value.Figure 5 shows the phase correlation between Figures 4(a) and 4(b).In the figure, the peak value is 0.92457, and its corresponding position which may be obtained by the way of inverse Fourier transform of the cross-power spectrum lies in the coordinate (30, 20).The translation parameter calculated by the IMBPW algorithm is consistent with the pre-set translation parameter.
According to the registration algorithm mentioned in Section 3.2.2, the rotation and scaling parameters can be calculated by inverse Fourier transform of the cross-power spectrum, which is shown in Figure 6.In the figure, the phase correlation surface is characterized by a sharp peak value which corresponds with the parameters of rotation and scaling in log-polar plane.We obtain the numerical result that the rotation angle is 21.622 ∘ , and magnification is 1.1977.Moreover, their corresponding computing errors are 0.378 ∘ and 0.0023 respectively.The computing errors are induced by the coordinate transformation.
In order to verify the proposed registration algorithm for the noisy image, the white Gaussian noise with the mean value 0.2 and the variance value 0.008 is inserted into Figure 4(a).The phase correlation surface between the noisy Figure 4(a) and the noisy Figure 4(b) is shown in Figure 7.In the figure, although the peak value decreases to 0.74842, the location corresponding with the peak value still lies in the coordinate (30, 20).
The experimental results mentioned above show that our proposed image registration algorithm has a high registration accuracy and robust.
Tables 3 and 4 are the comparison of two classical image registration algorithms with our algorithm in terms of the running speed and the registration accuracy.And the two classical registration algorithms are ABS (the abbreviation of Absolute Balance Search) and SIFT (the abbreviation of Scale Invariant Feature Transform) respectively.
As we can see from Tables 3 and 4, ABS has high registration accuracy, but its running time is too long to be suitable for WMSNs; the running time of SIFT is much lower than ABS, but its registration accuracy is the worst; our algorithm has a high registration accuracy and its running time is the best among the three algorithms.And hence, our    algorithm has more advantages for the resource-constrained WMSNs.It is more suitable for WMSNs environments.
There are two scenic spot images to be stitched in Figure 8.
And then we use IMBPW algorithm to achieve the image mosaic.The images mosaic result is shown in Figure 9.The panoramic image of the scenic spot is smooth and has highquality image.
The energy consumed for transmission is a critical factor for battery-operated sensor nodes.We assume that all the sensor nodes have the same residual energy and that the chosen sensor nodes are responsible for transmitting 10 frames at each request.We evaluate the network lifetime of our proposed scheme (IMBPW), the nonoverlapping panoramic mosaic (NOPM) [3], and the scheme without image mosaic (Conventional).This simulation is repeated 1000 times to calculate the average of the network lifetime  performance.The simulation results is shown in Figure 10.For the conventional scheme, the last node depletion time is at 600 rounds.For the NOPM scheme, the last node depletion time is at 872 rounds.For our proposed scheme, the last node depletion time is at 1120 rounds.Obviously, our proposed scheme significantly improves the network lifetime.This increase is due to the method used to reduce the amount of image data transmitted.

Conclusions
This paper presented IMBPW, an image mosaic algorithm based on phase correlation and weighted average for WMSNs, which aims at intelligently providing the abundant scenic spots information for tourists at anytime and anyplace.The innovation of our proposed algorithm lies in the combined use of the phase correlation based on Fourier transform along with the adaptive weighted average algorithm.The proposed image mosaicking algorithm can process not only the images with noise but also the images with being not sensitive to the varying energy in the frequency domain.
In this way, the tradeoff between the better quality of image mosaic and lower computational and energy consumption overhead can be achieved.
Extended simulation tests performed showed that the proposed algorithm can improve the accuracy of image registration, reduce the complexity, and increase the network lifetime.These advantages of IMBPW enhance the belief that this scheme is indeed capable of achieving real-time and high quality image mosaicking in real applications for the wisdom tourism.

Figure 4 :
Figure 4: The reference image and examined image.

Figure 7 :
Figure 7: Phase correlation surface between the noisy Figure 4(a) and the noisy Figure 4(b).

Figure 8 :
Figure 8: Original images to be stitched.

Table 1 :
Advantages and disadvantages of image registration methods.

Table 2 :
Advantages and disadvantages of image fusion algorithms.

Table 3 :
Comparison of the running time of ABS, SIFT, and IMBPW algorithms.

Table 4 :
Comparison of registration accuracy for translated Figure 4(a).