Color Balance for Panoramic Images

Color correction or color balancing in multi-view image stitching is the process of correcting the color differences between neighboring views which arise due to different exposure levels and view angles. This paper concerns the problem of color balance for panoramic images. A new algorithm is presented to create visual normalization by using correlated feature points between adjacent image sequences. After image mosaicking directly, a weighted average method is used to calculate the pixel value of panoramic image Experimental result shows that the algorithm can achieve images color balance and good visual performance.


Introduction
A panorama is a wide-angle representation of a scene and is usually built from multiple images captured at a single location with slightly different viewpoints.The multiple captured images have to be geometrically aligned and then stitched together to form the final panorama.Various commercial applications have been developed to provide panoramic image stitching functions [1] .There are two main approaches in the literature to stitch multiple images for the panorama: optimal seam finding and transition smoothing, assuming the images have been already aligned.Optimal seam finding algorithms [2][3][4] search for a seam in the overlapping area so that the differences between two adjacent images on the seam are minimized.The optimal seam can be found by graph-cut [2] .Dynamic programming [3] [4] or other algorithms.Then each image is copied to the corresponding side of the seam.The advantage of optimal seam finding is its low computational and memory cost, but it is very sensitive to photometric inconsistency, which appears as a global intensity or color difference between the images due to changes of scene illumination and camera responses.
Color correction is thus often used before the stitching process to balance colors and luminance in the whole image sequence.A common approach is to transform the color of all the images in the sequence to match the basic image.the transform matrix across images can be represented as a linear model [5] [6] or a diagonal model [7] , in which the mapping parameters are computed from the averages of each channel over the overlapping areas or from the mapping of histograms [5] [8] .These approaches are not sensitive to the quality of geometric alignment, but the accuracy of color correction needs to be improved.Recently, Xiong et al [4] proposed a much accurate color correction algorithm that minimizes a global error function, to get the correction coefficients simultaneously for the whole image sequence, followed by a color blending step to further smooth the transition.To establish the global error function, it is necessary to extract all the mean values of overlapping areas between every pair of adjacent images.In other words, the color correction process and panorama stitching process can only be started after the complete image sequence is captured, which causes unwanted delays.In this paper, an efficient image stitching approach is proposed to address the color balance for the panoramic image.

Work Flow of the Algorithm
In this section, the work flow of the algorithm for color balance.It mainly consists of three steps as the following and these explaining as shown in Figure 1.
1. Two images sequences from adjacent cameras with overlapped region are selected.Then we take one as a reference image and the other as the target image.
2. Feature points are extracted and matched by using SURF detector.
3. Finally, a panoramic image created and the seam line between two images is remove because this paper use edge blending at pixel level to remove a seam before creating the final panoramic image.
It is fundamental and important premise for color correction to extract feature points and match them.Points on two different views that correspond to the same point on the image are seen as corresponding points.

Figure 1. Flow chart of the algorithm
As all of the corresponding pairs are located in the overlapping region of two different views, its precondition for pairwise registration to extract them.We use a simple but effective interest point's detector, SURF Detector [9], to extract these points.Then, we take advantage of the maximum correlation rule to identify corresponding pairs between two images.Points which have maximum bidirectional correlation will be taken as corresponding pairs SURF algorithm is applied in this work as the process of feature extraction and matching.There are two sets of correlated feature points, it is necessary to define a model which can translate points from one set to the other.We used a homography matrix of homogeneous coordinates to match the correlated feature points [10] .Firstly, we calculate a homography matrix by using part of the feature points as samples, and then we use RANSAC method to discriminate the matching precision of the feature points under this homography matrix.After finished computations, the homography matrix with the highest precision which is the best matching model between the two sets of correlated feature points would be found finally.That's when we get the accuracy matching.

Color Correction Algorithm
The essence of all color correction algorithms is transferring the color (or intensity) palette of a source image to a target image.In the context of multi-view image stitching, the source image corresponds to the view selected as the reference by the user, and the target image corresponds to the image whose color is to be corrected.Rather than giving a historic review of color balancing and color transfer respectively, here we will categorize the techniques used according to their basic approaches.
Transform RGB to HSV to count brightness difference.While, as we have to count the mean difference of the feature points pairs in different channels, we use statistical method to takes the reference image pixel as the goal to adjust the target image which has a stronger adaptability and better correction effect.Then we calculate the difference of each pair correlated pairs points pixel values in each color space channel of the reference and target image, the function used is defined as follows: where, k is the sign of different channel, and k=1, 2, 3 can express the three channels of RGB or HSV color space.
, , is the value of the pixel in ( , ) of the reference image its correlated point is located in ( , ) of the target image whose pixel value of channel k is , , , is the difference pixel value of a pair of correlated feature points, we can get the average difference by calculating the arithmetic mean of all pairs of correlated feature point's value difference.By using , we can adjust the pixel value in each color space channel of the target image.The functions are defined as follows: ( , , ) = ( , , ) 0 ≤ data(i, j, k) ≤ 255 data(i, j, k) Otherwise (3) where ( , , ) is the original value of the pixel which is at the location of ( , ) in channel k of the target image.Because of the variation region of ( , , ) May beyond [0,255], it should be conducted as the function 3.In this section, we extract the brightness value by calculating pixel value in channel V of HSV and after color correction different channels will be combined to form the new image.
Obviously, for the multiple images (1 … ) case, the image (i) and image (i+1) can be considered as reference and target image.

Image Registration
Generally, image registration one is free to choose any orientation of the virtual camera/projector.But for panoramic images, one wants to align these images.The usual software approach is to mark a set of same features in image pairs and have the distance between such markers pairs minimized in an overall optimization process.In this section, we describe different image alignment techniques.

Edge Blending
Blending is applied across the stitch so that the stitching would be seamless.There are two popular ways of blending the images [11] .One is called alpha "feathering" blending, which takes a weighted average of two images.Another popular approach is Gaussian pyramid [12] .This method essentially merges the images at different frequency bands and filters them accordingly.In practice, the pairwise registration and the subsequent camera calibration is bound to be imperfect for various reasons.There will be mosaic seam line in the transition at a certain degree.The difference between adjacent images must be smoothed by edge blending.The development of edge blending can be divided into three stages: hard edge stitching, overlapping patchwork phase and edge fusion splicing stage.Edge fusion splicing is the improvement of overlapping patchwork, the RGB values of the points in the overlapped region besides the right edge of the left image are increasing or attenuating according to a curve function, and the corresponding points RGB values in the right image will attenuate or increase.The final result of this processing is that the whole stitching image has a natural and smooth transition.Even though edge fusion splicing includes many different kinds of methods, we choose the method at pixel level which has a fast fusion speed and good stitching effect.This method contains these algorithms as following kinds: direct average method, weighted average method and multi resolution fusion method.As multi-resolution fusion method has large computation and low efficiency, we take the first two methods into consideration [13].

Weighted Average Method
Weighted averaging with a distance map is often called feathering and does a reasonable job of blending over exposure differences, however, brightness, blurring, and ghosting can still be problems.This method is also a simple edge blending algorithm, it will obtain the value of the pixel which in the final stitching image by calculating the weighted sum of the correlated points in the target and reference image [14] , and we define the functions as follow: ∈ 0,1 is the weighted coefficient.In the transition region, in figure 2(a) the weights of Image1 decrease from 1.0 to 0.0 while the weights of Image 2 increase from 0.0 to 1.0.A pixel in the transition area is a weighted sum of two pixels from two images [15] .(The principle of this method is shown in Figure ( 2)).In the overlapping area change from 1 to 0, while the change from 0 to 1. Finally, we achieve a smooth transition.This method can effectively weaken or eliminate image blending seam-line, so this paper chooses it to make the edge blending.

Experiment Results
In this paper, we presented a simple and efficient approach of color and luminance for image sequences and implemented it to produce high-resolution and high-quality panoramic images.In this part we give two experiments results to demonstrate our method: In the first one, we select two images with the overlapping region of view from two adjacent cameras, which have different brightness and luminance.And we correct the images color balance by using the statistical mean methods with the overlapped region of the images after the feature points matching.The color correction and color blending approach has been incorporated into an image stitching algorithm to create panoramic images.Finally, the algorithm achieves color balance and good visual performance for the panoramic image.In the process of image stitching, the goal of image color balance processing is to make the brightness and luminance of the panoramic image consistent.Besides, achieve a color balance of the panoramic image and good visual performance.
Figure 5.The results of stitching image after color balance In the second experiment, we used six images that it was taken from our laboratory with the overlapping region of view from six adjacent cameras.And from the sequences of images we create a panoramic image with a large field of view by using the statistical mean methods to correct the color balance of the images after the feature points extracting and matching.In this experiment, we used this method to solve the basic problem in panoramic image stitching, and our method makes a seamless panoramic stitching Experimental results demonstrate that this method has good stitching performance and fast computation speed, as well as good robustness and light intensity.Thus, it can meet the need of image stitching for practical application.

Conclusion
In this paper, color balance approach is presented to solve the color problem and luminance in multi-image stitching, we presented a simple and efficient approach of correction balance in multi-image sequences and implemented it to produce seamless panoramic images.By comparing kinds of color correction method, we have shown the advantage and approach of the statistical method based on the mean pixel value of feature point pair.Some applications of color transfer, such as colorizing grayscale images and restoring the color of the old image, have not overlapped area between source and target images.In these cases, the correspondences might be obtained by finding similar regions between source and target images [16] , or by determining the desired coordinates of some pixels in the embedding space.And weighted average method proposed to remove stitching seam and makes seamless panoramic stitching possible by solving the basic problem in brightness and luminance.
Furthermore, a simple linear blending is enough to remove stitching artifacts instead of additionally complicated blending methods because of its outstanding quality.
region in the target image.The correlated feature point of it is located in , of the overlapped region in the reference image, its pixel value is , .The fusion result of this pair of correlated feature points is located in , and the pixel value of it is , .
Figure 2. The schematic diagram of weighted average edge blending Figure (3) shown the reference image and target image.The source image corresponds to the view selected as the reference by the user, and the target image corresponds to the image whose color is to be corrected.
Input images from (1-6) with different luminance (b) Image mosaic before color balance processing (c)The results of stitching image after color balance Figure 6.The results of stitching images after edge blending and color balance In Figure 6(b), we can see the difference in the brightness and luminance after images stitching.And in Figure 6(c) we obtained the panoramic image with the seam brightness and luminance.