# An Efficient System for Automatic Blood Type Determination Based on Image Matching Techniques
## 3 Overview of Image Matching Techniques
### Orb  
The oriented fast and rotated brief (ORB) algorithm is based on the features from accelerated segment test (FAST) and binary robust independent elementary features (BRIEF) algorithms. The ORB algorithm has the advantage of rotational invariance [25]. The ORB algorithm has the ability to reduce sensitivity to noise, and it is faster than the SIFT and SURF algorithms [25]. The principle of operation of the ORB algorithm is best illustrated by the flow chart shown in Figure 10. The operation of the ORB algorithm is summarized in the following steps:  
**Step 1: Keypoints detection using FAST. ** The ORB algorithm is based on FAST to find feature points quickly. FAST is performed by choosing an arbitrary pixel point \(P\) as a center to form a circular area with nine pixels neighbored to the pixel \(P\), taking the intensity of the arbitrary pixel \(P\) (\(I_{p}\)), the intensity of each neighbored pixel \(n\) (\(I_{n}\)), and a threshold value \(t\) into account. Each pixel (\(n\)) in these nine pixels can have one of the three states in Equation (14) [33]:  
\[stateofpixel=\left\{ \begin{aligned} & darker:& I_{n}<I_{p}-t\\ similar:& I_{p}+t>I_{n}>I_{p}-t\\ brighter:& I_{n}>I_{p}+t\end{aligned} \right\} \tag{14}\]  
\(P\) is a feature point if at least three of the neighbored pixels are brighter than \(I_{p}+t\) or darker than \(I_{p}-t\). Otherwise, \(P\) cannot be a feature point. **Step 2: Corners detection using Harris. ** ORB has large responses along edges. Therefore, the Harris algorithm is used to detect corners. The main idea is to take a small window around each feature point \(P\) and measure the amount of change around it after shifting the window by eight directions. After that, the sum squared difference (SSD) of the pixel values before and after the shift is taken to identify the pixel windows at which the SSD is large in all directions. Finding the eigenvalues \(\lambda_{1},\lambda_{2}\) for each window around each feature point \(P\) will be used to determine the corners of this feature point. If both \(\lambda_{1},\lambda_{2}\) are high, then \(P\) is a corner [34]. **Step 3: Scale pyramid transform. ** A scale pyramid is used to produce multiscale features in order to obtain scale invariance. The image pyramid is a multiscale representation of a single image that consists of a series of images that are versions of the original image at different resolutions. Each image in the pyramid contains a downsampled version of the image in the previous level. When the pyramid is created by the ORB algorithm, the FAST algorithm is employed to detect keypoints in the image. By detecting keypoints in each image of the pyramid, the key points can be detected effectively at different scales. In this way, ORB is partial scale invariant. **Step 4: Orientation assignment using IC. ** Since FAST does not produce orientations, the intensity centroid (IC) technique is used to find the orientation of each FAST-produced feature point [35]. Moments of a patch are defined as  
\[m_{pq}=\sum_{x,y}x^{p}y^{q}I(x,y) \tag{15}\]  
Figure 10: Flow chart for the ORB algorithm. With these moments, we can find the centroid, the \"center of mass\" of the patch (centroid) of the moments; this is calculated as  
\[C=(\frac{m10}{m00},\frac{m01}{m00}). \tag{16}\]  
Then, a vector from the corner's center O to the centroid \(\tilde{OC}\) is constructed and the orientation of the patch is then given as  
\[\theta=atan2(m01,m10) \tag{17}\]  
where \(atan2\) is the quadrant-aware version of \(arctan\). **Step 5: Keypoints binary descriptors using BRIEF and rBRIEF. ** Binary robust independent elementary feature (BRIEF) converts all keypoints detected by the FAST algorithm into a binary feature vector that is known as a descriptor. BRIEF chooses two random pixels around each keypoint; then, it compares their intensity. If the first pixel is brighter than the second, it assigns the value 1 to the corresponding bit, else 0 is assigned. This process is repeated until the length of each vector that describes the keypoint becomes 255 bits.