# Digital Image Automatic Recognition and Tracking Based on Electronic Derotation Algorithm

Authors: Meirong Gao
Journal: Advances in Multimedia
 (2021)

---

## Abstract

With the continuous development of my country’s social economy, the ways to acquire images have become more and more abundant. How to effectively process, manage, and mine images has become a major and difficult problem in research. In view of the difficult problem of image recognition, the electronic derotation algorithm is introduced in this study, by combing and monitoring the edge features, establishing a corresponding sample database, analyzing the edge features of the image, and performing effective and stable tracking, so as to realize the automatic recognition and tracking of the digital image. The simulation experiment results show that the electronic derotation algorithm is effective and can support the automatic recognition and tracking of digital images.


---

## Body

## 1. Introduction

With the continuous development of my country’s society and economy, the methods for acquiring digital images have been greatly improved, such as traditional photography, modern remote sensing photography, and other technologies, but how to process the acquired images and information mining have become important research hotspots and difficulties [1–5]. Image recognition and mining are widely used, such as judging the growth cycle and growth situation of crops from the acquired images, judging the scale and development direction of urban construction from the acquired images. There have been certain applications and research in various aspects in image-based recognition, tracking, and mining [6–8]. In terms of mechanical operation, image recognition can be used to track mechanical operations, ensure the safety of mechanical production, improve the corresponding mechanical production efficiency, realize the automation of mechanical processing, and improve the level of mechanical manufacturing in the manufacturing industry [5, 9, 10].It should be noted that when acquiring images, due to the difference in the specific location of the image acquisition and the state of the equipment, a certain amount of shaking or rotation is prone to occur, which will affect the quality of the image, therefore causing the user to misjudge and miss the corresponding key information. For the automatic tracking part of the image, the stability and accuracy of the image tracking will occur due to the unstable image, resulting in a large error in the final result. Therefore, in the image processing, the derotation is extremely important [11, 12]. The so-called derotation can be divided into three methods: optical, electronic, and physical derotation according to the way of image acquisition. For optical derotation, optical equipment is used to eliminate lens; there are several characteristics of using electronic derotation. The derotation image transformation and the original image coordinate transformation are accurately analyzed, and it has the advantages of lower cost, strong reliability, and high efficiency.Therefore, in view of the current automatic recognition and tracking of digital images, the electronic derotation algorithm is introduced in an attempt to sort out the flow of edge features and sort out the monitoring process, establish a corresponding sample database, analyze the edge features of the image, and perform effective and stable tracking, so as to achieve the automatic recognition and tracking of images, aiming to explore the effectiveness of automatic image recognition.


## 2. Principle of Image Derotation

The essence of the derotation of the acquired image is to perform the rotation transformation according to the corresponding angle transformation, and the original image is rotated according to the angle. Therefore, in general, the feature of the image electronic derotation algorithm is based on the rotation transformation of the image. The final target image is obtained by transforming the original image into another angle. But for electronic derotation, the angle of the rotation operation of the transformation is less than 1, but because the coordinates need to be round, the image problem after the rotation is prone to occur.In order to perform image rotation, the method of reverse rotation is usually used to calculate the pixel coordinates (x', y') of the specific image after rotation, the corresponding pixel coordinates (x, y) of the original image, and the specific transformation formula is(1)x0=x+y′−y0sinθ−x′−x0cosθy0=y−y′−y0cosθ−x′−x0sinθ.In the formula, for the pixel coordinate value of each image after rotation, it is changed according to formula (1) to find the pixel coordinate value of the corresponding image.According to formula (1), the cos function and sin function only need to be calculated once, and the corresponding constants can be saved accordingly, so that they can be reused and save the amount of calculation. This part needs to be improved, and the floating point multiplication and floating point addition need to be improved, thereby increasing the processing speed.After rotating the image, it should be noted that the complete structure of the image does not change, that is, the specific direction and specific relative distance between pixels cannot be changed. Therefore, the corresponding formula can be used to calculate the pixel coordinates.Assuming that the image is rotated in a clockwise direction, the offset of the horizontal axisX axis direction, relative to the horizontal direction, and the vertical axis can be calculated using the cos and sin functions, respectively; the pixels in the vertical axis direction are calculated quantitatively with sin and cos functions, respectively, relative to the horizontal axis and vertical axis offsets of the original point [13, 14].Therefore, whether it is a forward or reverse rotation, all the pixel values of the image can be calculated by reasoning using the above process, so as to determine the position of the pixel, but it should be noted that except for the initial pixel needing floating point multiplication, the rest of the subsequent calculations are completed by floating point addition, which saves calculation time and improves calculation efficiency.However, in the actual electronic derotation process, due to floating point calculations, there will be decimal points in adjacent calculated pixels, which makes it impossible to obtain accurate gray values. Therefore, the industry has gradually introduced interpolation methods to solve the problem of decimal floating point. The most common ones are the nearest neighbor interpolation method, bilinear interpolation method, and cubic convolution interpolation method [15, 16].


### 2.1. The Nearest Neighbor Interpolation Method

This method essentially samples the gray value according to the sampled points. The algorithm is less complex, and the operation efficiency is faster, but meanwhile, this brings a poor interpolation effect, limited image quality, and prone to blur. Some experts have pointed out that the maximum error may exceed 50% of the error.


### 2.2. Bilinear Interpolation Method

The characteristic of this method is to perform interpolation in two different directions according to the 4 points around the sample. Its advantage is that the accuracy of interpolation is high, and the complexity of the algorithm is relatively low. Therefore, it is relatively easy to be accepted.


### 2.3. Cubic Convolution Interpolation Method

This method essentially uses the cubic sampling function S(ω) for interpolation approximation and uses 16 points around the sample for sampling interpolation. The cubic function is used for approximation, which brings high complexity calculations, the long calculation time, which is not suitable for real-time processing of the image.Each of these three methods has its own advantages and disadvantages. The specific method of image electronic derotation needs to be selected according to actual needs, while considering the comprehensive hardware conditions.


## 2.1. The Nearest Neighbor Interpolation Method

This method essentially samples the gray value according to the sampled points. The algorithm is less complex, and the operation efficiency is faster, but meanwhile, this brings a poor interpolation effect, limited image quality, and prone to blur. Some experts have pointed out that the maximum error may exceed 50% of the error.


## 2.2. Bilinear Interpolation Method

The characteristic of this method is to perform interpolation in two different directions according to the 4 points around the sample. Its advantage is that the accuracy of interpolation is high, and the complexity of the algorithm is relatively low. Therefore, it is relatively easy to be accepted.


## 2.3. Cubic Convolution Interpolation Method

This method essentially uses the cubic sampling function S(ω) for interpolation approximation and uses 16 points around the sample for sampling interpolation. The cubic function is used for approximation, which brings high complexity calculations, the long calculation time, which is not suitable for real-time processing of the image.Each of these three methods has its own advantages and disadvantages. The specific method of image electronic derotation needs to be selected according to actual needs, while considering the comprehensive hardware conditions.


## 3. Automatic Recognition and Tracking of Image

### 3.1. Feature Extraction for Image Recognition

For the feature extraction of automatic image recognition, the specific process is given as follows, taking a mechanical drill bit as an example:First, perform threshold segmentation on the drill bit image and extract the moving image target of the drill bit, and on this basis, perform wavelet transform processing on the input drill bit moving image target and use the following formula to calculate:(2)Fi,jk,l=Ii,j⋅Gi,jk,l,ηpq=μpqμ00γ,γ=p+q2+1,p+q=2,3,⋯.For the definition of the central order of the moving image, the specific formula is(3)Gx=VI1×VT1+VI2×VT2+VI3×VT3+VI4×VT4+VI5×VT5+VI6×VT6+VI7×VT7+VI8×VT8+VI9×VT9.Among them, the coordinates of the moving image of the drill bit are represented byx¯,y¯.Define the following four moments that are invariant to translation, rotation, and scale transformation:(4)ϕ=η20+η02,ϕ=η20−η022+4η114,ϕ=η30−η122+3η21−η032,ϕ=η30+η122+η21+η032.The pixel probability model of any pixel of the moving image at a certain moment can be specifically calculated by the following formula:(5)pXijt=∑s=B,FpsXijt|θij,st.The background mixing model of moving image pixels in formula can be calculated by the following formula:(6)pbXijt=∑kwij,b,kt×ηXijt,μij,b,kt,Σij,b,kt.From the background mixing model of the drill bit motion image, the submodel with the maximum fitness value can be found as the current frame background distribution model of the drill bit motion image, and equation (7) is used to calculate; the pixel (i, j) of the bit motion image at time (t) can be obtained, which belongs to conditional probability of the background:(7)ηX,μ,Σ=12πn/2Σ1/2exp−12X−μTΣ−1X−μ,where X represents the feature vector of the pixel of the drill bit moving image, n represents the dimension of the feature vector, and μ and S represent the mean value and covariance matrix of the conditional probability, respectively.Based on the pixel prior probability of the acquired motion image of the drill bit, the pixel is judged as shown in the following formula:(8)pCB=nB8,pCF=1−pCB,where pCB represents the prior distribution density function of pixels pCB in the motion image of the drill bit, and pCF represents the prior distribution density function of pixels pCB in the motion image of the drill bit. If pCB≥pCF, the pixel is classified as background; otherwise, it is foreground.After the moving image background is obtained, the current frame of the drill moving image is subtracted from the drill moving image background to obtain the candidate drill moving image target, which can be expressed as(9)puy=Ch∑i=1nky−xih2δbxi−u.


### 3.2. Moving Image Target Detection

The gray value of each image of the moving image frame obeys the distribution of meanµ and variance σ, and the Gaussian distribution of the pixels of each drill moving image is a single variable [17–19]. The probability model of each pixel of the drill bit image frame to form a normally distributed target and background can be specifically calculated by the following formula:(10)px|ωi=12πσexp−12x−μσ2,whereωi represents the gray information feature value of the moving image of the drill bit.In theK = 2, 3, ..., L frame, the update formula of the mean value and variance in the drill bit moving image target (background) model is as follows.Mean:μK+1′=K−1/KμK+1′+1/KμK.Variance:σK+12′=K−1/KσK2′+1/KσK2.In theK = L+1 frame, the parameter update formula in the moving image target (background) model of the drill is as follows:Mean:μK+1′=1−ρμK′+ρμK,Variance:σK+12′=1−ρσK2′+ρσK2,where μK=1/NK∑j=1NKIj and σK2=1/NK∑j=1NKIj−μK2, respectively, represent the statistical mean and variance of the target (background) points in the drill moving image of the Kth frame, μ′K and σK2′ represent the mean and variance of the Gaussian model used to determine the target (background) sample points in the Kth frame of the drill moving image, NK represent the number of sample points of the bit moving image target (background), Ij represents the gray value of each sample point of the bit image, and ρ represents the update rate.The Kalman filter is used to predict the target position of the drill bit moving image, and the motion covariance can be expressed as shown in the followingformula:(11)X^K+1=AXK.The target position of the drill bit moving image is predicted through combiningformula (11) to obtain the true center position ZK+1, and the filter equation for tracking the drill bit moving image target is shown in the following formula:(12)XK+1=X^K+1+GK+1ZK+1−Z^K+1.


### 3.3. Automatic Tracking of Drill Bits Based on Image Recognition

To classify the multitargets of the drill bit moving image, the Bayesian formula is used to calculate, and the posterior conditional probability of the drill bit moving image is obtained, which can be expressed as(13)Pωi|x=Px|ωiPωi∑i=12Px|ωiPωi,where i = 1, 2, Pω1|x represents the target model of the moving image of the drill bit, and Pω2|x represents the background model of the moving image of the drill bit. On this basis, formula (8) is transformed combining formula (11), the initial position of the drill bit moving image target is given, and the target model is established using the gray information, and the posterior conditional probability judgment is performed for each sample point I′(i, j) of the drill bit moving image of the Kth frame, the confidence map LKof the drill movement can be obtained as shown in the following formula:(14)LKi,j=Pω1|xPω2|x.Combining the mean shift theory, the peak point of the confidence map of the drill motion is found, and the calculation result can be expressed as(15)I¯t+1=∑i,j∈NCI¯tLKi,j∑i,j∈NCI¯tLKi,j,J¯t+1=∑i,j∈NCJ¯tLKi,j∑i,j∈NCLKi,j,where NC represents the neighborhood centered on the peak point I¯t,J¯t of the drill motion confidence map, the initial value I¯0,J¯0 represents the predicted value obtained by Kalman filter filtering, and (i, j), respectively, represent the coordinates of each point in the drill motion confidence map LK.After the peak value of the drill bit motion confidence map is obtained by the mean shift algorithm, the drill bit motion image window size of the previous frame is the initial value, and the optimum point of the motion image target is framed. The specific calculation is carried out using the following formula:(16)F=ei∑i=1NpuyLKI¯t+1,J¯t+1,where ei represents the size of the drill moving image window of the previous frame, and the automatic tracking of the drill moving image is completed according to the window size of the previous frame.


## 3.1. Feature Extraction for Image Recognition

For the feature extraction of automatic image recognition, the specific process is given as follows, taking a mechanical drill bit as an example:First, perform threshold segmentation on the drill bit image and extract the moving image target of the drill bit, and on this basis, perform wavelet transform processing on the input drill bit moving image target and use the following formula to calculate:(2)Fi,jk,l=Ii,j⋅Gi,jk,l,ηpq=μpqμ00γ,γ=p+q2+1,p+q=2,3,⋯.For the definition of the central order of the moving image, the specific formula is(3)Gx=VI1×VT1+VI2×VT2+VI3×VT3+VI4×VT4+VI5×VT5+VI6×VT6+VI7×VT7+VI8×VT8+VI9×VT9.Among them, the coordinates of the moving image of the drill bit are represented byx¯,y¯.Define the following four moments that are invariant to translation, rotation, and scale transformation:(4)ϕ=η20+η02,ϕ=η20−η022+4η114,ϕ=η30−η122+3η21−η032,ϕ=η30+η122+η21+η032.The pixel probability model of any pixel of the moving image at a certain moment can be specifically calculated by the following formula:(5)pXijt=∑s=B,FpsXijt|θij,st.The background mixing model of moving image pixels in formula can be calculated by the following formula:(6)pbXijt=∑kwij,b,kt×ηXijt,μij,b,kt,Σij,b,kt.From the background mixing model of the drill bit motion image, the submodel with the maximum fitness value can be found as the current frame background distribution model of the drill bit motion image, and equation (7) is used to calculate; the pixel (i, j) of the bit motion image at time (t) can be obtained, which belongs to conditional probability of the background:(7)ηX,μ,Σ=12πn/2Σ1/2exp−12X−μTΣ−1X−μ,where X represents the feature vector of the pixel of the drill bit moving image, n represents the dimension of the feature vector, and μ and S represent the mean value and covariance matrix of the conditional probability, respectively.Based on the pixel prior probability of the acquired motion image of the drill bit, the pixel is judged as shown in the following formula:(8)pCB=nB8,pCF=1−pCB,where pCB represents the prior distribution density function of pixels pCB in the motion image of the drill bit, and pCF represents the prior distribution density function of pixels pCB in the motion image of the drill bit. If pCB≥pCF, the pixel is classified as background; otherwise, it is foreground.After the moving image background is obtained, the current frame of the drill moving image is subtracted from the drill moving image background to obtain the candidate drill moving image target, which can be expressed as(9)puy=Ch∑i=1nky−xih2δbxi−u.


## 3.2. Moving Image Target Detection

The gray value of each image of the moving image frame obeys the distribution of meanµ and variance σ, and the Gaussian distribution of the pixels of each drill moving image is a single variable [17–19]. The probability model of each pixel of the drill bit image frame to form a normally distributed target and background can be specifically calculated by the following formula:(10)px|ωi=12πσexp−12x−μσ2,whereωi represents the gray information feature value of the moving image of the drill bit.In theK = 2, 3, ..., L frame, the update formula of the mean value and variance in the drill bit moving image target (background) model is as follows.Mean:μK+1′=K−1/KμK+1′+1/KμK.Variance:σK+12′=K−1/KσK2′+1/KσK2.In theK = L+1 frame, the parameter update formula in the moving image target (background) model of the drill is as follows:Mean:μK+1′=1−ρμK′+ρμK,Variance:σK+12′=1−ρσK2′+ρσK2,where μK=1/NK∑j=1NKIj and σK2=1/NK∑j=1NKIj−μK2, respectively, represent the statistical mean and variance of the target (background) points in the drill moving image of the Kth frame, μ′K and σK2′ represent the mean and variance of the Gaussian model used to determine the target (background) sample points in the Kth frame of the drill moving image, NK represent the number of sample points of the bit moving image target (background), Ij represents the gray value of each sample point of the bit image, and ρ represents the update rate.The Kalman filter is used to predict the target position of the drill bit moving image, and the motion covariance can be expressed as shown in the followingformula:(11)X^K+1=AXK.The target position of the drill bit moving image is predicted through combiningformula (11) to obtain the true center position ZK+1, and the filter equation for tracking the drill bit moving image target is shown in the following formula:(12)XK+1=X^K+1+GK+1ZK+1−Z^K+1.


## 3.3. Automatic Tracking of Drill Bits Based on Image Recognition

To classify the multitargets of the drill bit moving image, the Bayesian formula is used to calculate, and the posterior conditional probability of the drill bit moving image is obtained, which can be expressed as(13)Pωi|x=Px|ωiPωi∑i=12Px|ωiPωi,where i = 1, 2, Pω1|x represents the target model of the moving image of the drill bit, and Pω2|x represents the background model of the moving image of the drill bit. On this basis, formula (8) is transformed combining formula (11), the initial position of the drill bit moving image target is given, and the target model is established using the gray information, and the posterior conditional probability judgment is performed for each sample point I′(i, j) of the drill bit moving image of the Kth frame, the confidence map LKof the drill movement can be obtained as shown in the following formula:(14)LKi,j=Pω1|xPω2|x.Combining the mean shift theory, the peak point of the confidence map of the drill motion is found, and the calculation result can be expressed as(15)I¯t+1=∑i,j∈NCI¯tLKi,j∑i,j∈NCI¯tLKi,j,J¯t+1=∑i,j∈NCJ¯tLKi,j∑i,j∈NCLKi,j,where NC represents the neighborhood centered on the peak point I¯t,J¯t of the drill motion confidence map, the initial value I¯0,J¯0 represents the predicted value obtained by Kalman filter filtering, and (i, j), respectively, represent the coordinates of each point in the drill motion confidence map LK.After the peak value of the drill bit motion confidence map is obtained by the mean shift algorithm, the drill bit motion image window size of the previous frame is the initial value, and the optimum point of the motion image target is framed. The specific calculation is carried out using the following formula:(16)F=ei∑i=1NpuyLKI¯t+1,J¯t+1,where ei represents the size of the drill moving image window of the previous frame, and the automatic tracking of the drill moving image is completed according to the window size of the previous frame.


## 4. The Overall Structure of the System

The system is mainly composed of four modules: image information acquisition module, image target information recognition and tracking module, image storage module, and image recognition and tracking result output module. The specific overall structure of the system is shown in Figure1.Figure 1
The overall structure of the system.The system hardware is mainly composed of three parts of circuits: image information acquisition circuit, image storage circuit, and tracking result output display circuit.The tracking result output display circuit is mainly used to receive the digital image signals processed by the electronic derotation algorithm and the line and field synchronization signals of the data clock and convert these signals into analog image signals. The specific hardware structure is shown in Figure2.Figure 2
System hardware structure.For the image recognition module, it is to detect the characteristic edges of the image accordingly to conduct edge detection algorithms for different target objects. This method has higher efficiency and strong antiinterference, can smooth the noise, and can get edge information, so as to achieve the most efficient tracking; the specific structure is shown in Figure3:Figure 3
System software architecture.


### 4.1. Image Recognition Module Design

The so-called image recognition is based on the detection of the edge of the image, and the detected edge is between the image and the image background, so it is a collection of pixel points according to the gray value of pixel. For the collected images, first of all, the corresponding operators need to be used to calculate the horizontal and vertical convolution of the two gradients, the second step is to merge the results of the gradient convolution, and finally, the edge pixels of the background image are obtained according to the corresponding threshold setting; finally, the result of the edge detection is obtained. The specific edge detection block diagram is shown in Figure4:Figure 4
Block diagram of edge detection.For the pixel point calculation, a linear buffer is used for calculation, which is specifically 9 pixels, as shown in Figure5:Figure 5
List of image areas.The horizontal gradient operator is shown in Figure6.Figure 6
Horizontal gradient operator.According to the edge detection algorithm, theGxcomponent of I5 can be calculated using the following formula:(17)Gx=VI1×VT1+VI2×VT2+VI3×VT3+VI4×VT4+VI5×VT5+VI6×VT6+VI7×VT7+VI8×VT8+VI9×VT9.


### 4.2. Image Track

Image tracking generally has two methods, based on the model matching and tracking method based on motion parameter estimation. This system studies tracking methods based on model matching. This tracking method can be divided into two types. One is the tracking algorithm based on the edge feature information of the target image. This algorithm is widely used, but it is susceptible to interference and can easily cause target tracking. The other is a tracking algorithm based on the feature information of the target image area. This algorithm has strong antiinterference ability and is very stable in tracking the target image in a complex background.


## 4.1. Image Recognition Module Design

The so-called image recognition is based on the detection of the edge of the image, and the detected edge is between the image and the image background, so it is a collection of pixel points according to the gray value of pixel. For the collected images, first of all, the corresponding operators need to be used to calculate the horizontal and vertical convolution of the two gradients, the second step is to merge the results of the gradient convolution, and finally, the edge pixels of the background image are obtained according to the corresponding threshold setting; finally, the result of the edge detection is obtained. The specific edge detection block diagram is shown in Figure4:Figure 4
Block diagram of edge detection.For the pixel point calculation, a linear buffer is used for calculation, which is specifically 9 pixels, as shown in Figure5:Figure 5
List of image areas.The horizontal gradient operator is shown in Figure6.Figure 6
Horizontal gradient operator.According to the edge detection algorithm, theGxcomponent of I5 can be calculated using the following formula:(17)Gx=VI1×VT1+VI2×VT2+VI3×VT3+VI4×VT4+VI5×VT5+VI6×VT6+VI7×VT7+VI8×VT8+VI9×VT9.


## 4.2. Image Track

Image tracking generally has two methods, based on the model matching and tracking method based on motion parameter estimation. This system studies tracking methods based on model matching. This tracking method can be divided into two types. One is the tracking algorithm based on the edge feature information of the target image. This algorithm is widely used, but it is susceptible to interference and can easily cause target tracking. The other is a tracking algorithm based on the feature information of the target image area. This algorithm has strong antiinterference ability and is very stable in tracking the target image in a complex background.


## 5. Simulation Experiment Analysis

The accuracy of automatic image recognition and tracking using the electronic derotation algorithm is higher than that of simple tracking using filtering. The main reason is that moving images can be obtained for image recognition, which can separate the background and foreground and then recognize motion tracking. The feature points of each moving image are matched separately, so that the accuracy of image recognition is higher.The specific simulation experiment results are shown in Figures7–10. The position obtained by the tracking algorithm is compared with the error curve.Figure 7
Position curve of the electronic derotation algorithm.Figure 8
Position error curve of the electronic derotation algorithm.Figure 9
Position curve of the electronic derotation algorithm.Figure 10
The position error curve of the electronic derotation algorithm.By analyzing the results of Figures7–10, under different simulation experiments, image recognition methods are used to visualize the position and trend curves. From the results, the trends of the two curves are basically the same. From the error position curve, it can be seen that it is compared with the actual position. The error is very small; this is through the threshold segmentation of the digital image, and the normalized calculation of the image is realized. The corresponding algorithm is used to identify the initial position of the moving image, and at the same time, the calculation function of the tracking target is obtained through the electronic derotation algorithm and the mean value theory to realize the tracking and positioning of the position.


## 6. Conclusions

Digital image recognition is an important step in mining and discovery of digital image information and is also a key difficulty in digital image research. Based on the electronic derotation algorithm, the image acquisition, color conversion, and image processing are analyzed through sorting out the edge features of the digital image. The edge features of the image are analyzed, and effective and stable tracking is performed, which can accurately and effectively track the target object. Simulation experiments show that the electronic derotation algorithm is effective and can support the automatic recognition and tracking of digital images.



---

*Source: 6111812-2021-12-08.xml*