## 3 Discriminative Regional Weight
### Object Detection  
This section describes our object detection approach where the template representation is modified to deal with texture-less objects. In particular, we build on the work of spreading the orientations of LINE2D [33], yet extend it by adding a discriminative regional weight for better performance. To be robust to small image transformations, an image representation for template matching is designed by spreading the orientations. The core of spreading orientation is to spread gradient orientations in local image neighborhoods. Base on the quantized gradient orientation in the first of stage, and the formulation is as follow:  
\[\text{sori}_{i}(\mathcal{T},r^{s})=\text{sori}_{i}(\mathcal{T},r^{s})\big{|} \text{ori}_{i^{\prime}}(\mathcal{T})\forall i^{\prime}\in B(i,r^{s}), \tag{12}\]  
Figure 5: Regional weight of model. (**a**) The original model; (**b**) The deeper color of the pixel where the weight value is bigger.  
where \(\text{sori}_{i}(\mathcal{T},r^{s})\) is the spread orientation at location \(i\) in the template image. According to LINE2D [33], \(r^{s}\) is set to 3 in our experiments.  
According to the scale and rotation of each possible object location, the appropriate template is selected and matched with the possible object location. The similarity measure is obtained by the following:  
\[S_{j}=\frac{\sum\limits_{i}w_{i}\Gamma_{j+i,i}(\mathcal{I},\mathcal{T})}{\sum \limits_{i}w_{i}}, \tag{13}\]  
where \(w_{i}\) is the discriminative regional weight at location \(i\). \(\Gamma_{j+i,j}\) is the similarity function, which measures the similarity for each pixel between the candidate patch and template patch, it can be formally expressed as:  
\[\Gamma_{j+i,j}(\mathcal{I},\mathcal{T})=\left\{\begin{array}{cc}\epsilon_{ j+i,i}(\mathcal{I},\mathcal{T})&\text{if}(\epsilon_{j+i,i}(\mathcal{I}, \mathcal{T})\geq\cos(\pi/3))\\ p&\text{otherwise}\end{array}\right., \tag{14}\]  
where \(p\) is the penalty coefficient and its range is \([-1,0]\) in this paper, \(p\) is set to \(-0.2\) according to the experimental results. \(\epsilon_{j+i,i}(\mathcal{I},\mathcal{T})\) can be seen as the measure defined by LINE2D [33]:  
\[\epsilon_{j+i,i}(\mathcal{I},\mathcal{T})=\max\limits_{\text{ori}_{i}^{i}( \mathcal{T})\in\text{ori}_{i}(\mathcal{T},r^{s})}|\text{cos}(\text{ori}_{j+i}( \mathcal{I})-\text{ori}_{i}^{i}(\mathcal{T}))|, \tag{15}\]  
where \(\text{ori}_{j+i}(\mathcal{I})\) is the quantized orientation at location \(i\) shifted by \(j\) in the input image \(\mathcal{I}\). And \(\text{ori}_{i}^{i}(\mathcal{T})\) represents one quantized orientation, of the spread orientation \(\text{sori}_{i}(\mathcal{T},r^{s})\).  
The proposed similarity measure which integrates the discriminative regional weight achieves better results for similar objects recognition. As shown in Figure 6, to detect the spanner model (Model_02), a vernier caliper (Model_03) places in the input image, and part of its texture is similar to spanners'. Consequently, there is a great possibility to mistake the vernier caliper as a spanner without applying the discriminative regional weight as shown in Figure 6b. And Figure 6c represents a correct recognition by using the weight of model as displayed in Figure 6b.  
Figure 6: To detect Model_02, an example to explain the effect of the discriminative region weight. (**a**) Possible object locations are generated in the first stage; (**b**) There is a false detection without using a discriminative region weight; (**c**) Applying the discriminative region weight can eliminate other negative candidate regions in the second stage.