# Well-Distributed Feature Extraction for Image Registration Using Histogram Matching
## 3 Method
### Contrast Adjustment Using Histogram Matching  
Let \(R(x,y)\) be the panchromatic image (reference image) and \(Z(x,y)\) be the multi-spectral (sensed) image. Due to the different spectral responses in Figure 2 for different band images, the image contrast varies. The proposed method falls into the area-based methods where image similarity between reference and sensed images is compared. Therefore, it is important to adjust the contrast between different images. In the proposed method, we use the global and the local histogram matching for contrast adjustment. In global Histogram Matching, histogram of panchromatic image \(R(x,y)\) is specified by the histogram of the multi-spectral image \(Z(x,y)\). Let \(p_{r}(r)\) and \(p_{z}(z)\) be the histograms of panchromatic image \(R(x,y)\) and multi-spectral image \(Z(x,y)\), respectively, and \(r\) denote the intensities of an image with range \([0,L-1]\). The intensity level \(s\) in panchromatic image \(R(x,y)\) can be expressed as  
\[T(r)=(L-1)\int_{0}^{r}p_{r}(w)dw,0\leq r\leq L-1. \tag{1}\]  
The transformation function \(H(z)\) is obtained by using the specified histogram \(p_{z}(z)\) as  
\[H(z)=(L-1)\int_{0}^{z}p_{z}(w)dw=s. \tag{2}\]  
By equating Equations (1) and (2), i.e., setting \(H(z)=T(r)\), the inverse transformation for \(z\) is obtained as follows:  
\[z=H^{-1}(s)=H^{-1}\left[T(r)\right]. \tag{3}\]  
Thus, \(z\) is obtained from \(s\), which is a mapping process from \(s\) to \(z\). Figure 4 represents the global histogram matching process. We can observe that, after applying histogram specification, the reference and sensed images have similar histograms. The global histogram matching adjusts the pixel intensities of the reference and the sensed images coarsely. To adjust the fine image details, the local histogram matching is applied, In local histogram matching, first reference and sensed images \(R(x,y)\) and \(Z(x,y)\) are divided into image blocks of sizes \(M\times N\). The blocks can be represented as  
\[ \begin{array}{l}R_{\{i\}\{j\}}(x,y)=\left\{(i,j)|\:|i-x|\:\leq\frac{M}{2} \wedge|j-y|\:\leq\frac{N}{2}\right\}\\ Z_{\{i\}\{j\}}(x,y)=\left\{(i,j)|\:|i-x|\:\leq\frac{M}{2}\wedge|j-y|\:\leq\frac {N}{2}\right\}\end{array}  \tag{4}\]  
where \(i\) and \(j\) are the indices for the pixels inside a block, while \(M\) and \(N\) determine the block dimensions. The \(k\)th blocks in the sets of blocks for the reference and the sensed images, respectively, in the lexicographical order, can be represented as follows:  
\[ \begin{array}{l}\left\{R^{(1)}\:(x,y),\cdots,R^{(k)}\:(x,y),\cdots,R^{(K)} \:(x,y)\right\}\\ \left\{Z^{(1)}\:(x,y),\cdots,Z^{(k)}\:(x,y),\cdots,Z^{(K)}\:(x,y)\right\} \end{array}  \tag{5}\]  
where \(X\) and \(Y\) is the size of input image sizes and \(K\) is the total numbers of blocks  
\[K=\left\lceil\frac{X}{M}\right\rceil\times\left\lceil\frac{Y}{N}\right\rceil \tag{6}\]  
Once input images are divided into blocks, then block-wise histogram matching is performed. The histogram of each block in the sensed is specified by the histogram of the corresponding block in the reference image. Algorithm 1 shows the flow of local histogram matching. The procedure is same as done in the case of global histogram matching; however, here, histograms of blocks (Figure 5a,d: the block-wise reference and sensed image) are matched instead of histograms of entire images (Figure 4a,c). Figure 4: Global histogram matching: (**a**) reference image; (**b**) histogram of (**a**); (**c**) sensed image; (**d**) histogram of (**c**); (**e**) global histogram matching; and (**f**) histogram matched image. Figure 5: Local histogram matching: (**a**) reference image; (**b**) one image block; (**c**) histogram of (**b**); (**d**) sensed image; (**e**) one image block; (**f**) histogram of (**e**); (**g**) local histogram matching; and (**h**) histogram matched image.