Research and Implementation of Video-based Sports Analysis System

In recent years, using athletes' training and game video images as a reference for sports training, sports analysis is an effective method widely used at home and abroad. Sports analysis uses the popular research hotspots of image processing, human simulation, computer vision and other fields. The athletes are the research objects, and they are qualitatively and quantitatively analyzed to achieve the purpose of scientific aided training.
In this paper, sports video images are taken as the main research object, and video processing technology is taken as the main research method. A kind of sports integrating video control, panorama synthesis, static background suppression, moving target tracking and quantization is designed and implemented. analysis system.

This article refers to the address: http://


1 System Design Requirements Analysis Traditional sports analysis is mainly based on experience and human eye observation and analysis methods. Obviously, such methods have obvious limitations and deficiencies.
The main purpose of sports analysis is to analyze the video images of athletes' training and competition, and use the correlation of video images in time and space to obtain various human kinematic parameters and various information of interest to athletes and coaches to realize science. Guide the training.
This article uses Visual C++. Net 2003 development platform, research and design - a video-based sports analysis system, to achieve qualitative and quantitative analysis of motion video, has a strong practicality.


2 system function design and its algorithm implementation
2.1 System overall function design The text mainly focuses on monocular video for human motion analysis, using Directshow technology to control motion video; using mosaic-based image stitching technology to extract background information in video, time-domain segmentation of video images, Extracting the moving target in the video, and finally synthesizing the panoramic image; filtering the static background by the inter-frame difference method to achieve background suppression; combining Kalman filtering and color block matching technology to automatically track the key parts of the motion and obtain the kinematic parameters of the human body Establish a video-based sports analysis system.
The main functional framework of the system is shown in Figure 1. The entire system consists of four parts.

2.2 Video Control DirectShow uses a model called Filter Graph to manage the processing of the entire data stream; the various functional modules involved in data processing are called. Filter; each Fiher is connected in a certain order in the Filter Graph into a "pipeline" to work together. The system uses advanced DirectShow video playback technology, according to the needs of coaches and athletes for motion analysis, adding various rates of video playback, video image editing, frame-by-frame image display and other functions.
2.3 Panorama synthesis The relationship between two images between adjacent frames is reduced to the elementary coordinate transformation, that is, the combination of translation, rotation, affine, bilinear and perspective transformation. In fact, when the amplitude of the movement of the camera is not very large and is far away from the scene, the deformation distortion between the images can be disregarded when the video image is spliced, and the transformation matrix M between the two images is determined by the following formula.

For the determination of 8 parameters, it is necessary to accurately determine 4 matching points, and then the determination of the transformation matrix M, M can be determined by the formula (2), as shown in FIG. 2 .


With 4 sets of matching points, 8 equations with 8 unknowns can be completely determined. These equations are all linear equations and can be solved by Gauss's all-choice principal elimination method.
Assuming that the correlation has been matched to 3 sets of points (A, A'), (B, B'), (C, C'), due to the gradual change of the inter-frame change, the displacement amplitude of point A should be the same as point B and point C. The displacement amplitude is similar, otherwise it indicates that a mismatch occurs. Take the following definition rang(A)=| A-A'| (3)
If |rang(A)-rang(B)|>ε (where ε is the appropriate threshold), a mismatch occurs, and | rang(A)-rang(C)| can be used to determine which point has appeared. Mismatch, then re-select the template for matching; repeat the above process until A, B, C meet the conditions.
The method of vote by hand in the elimination process of the entire mismatch, for the elimination of 4 sets of mismatches, at least 5 groups are selected when selecting the template. Only in this way will there be no similar situation to the correct 2:2 error. .
Since one of the two images is directly taken in the overlapping region for image synthesis, it is easy to form a clear seam at the boundary of the overlapping region. Therefore, it is necessary to synthesize the panorama using image fusion technology.
Taking two images I1(i,j) and I2(i,j) stitched together left and right as an example, the pixel value I(x, y) of the image of the overlap region can be expressed as I(i,j)=d(i) I1(i,j)+(1-d(i))I2(i,j)(4)
Where d(i) is the fusion coefficient, which is proportional to the distance from the boundary. The above calculation is performed one by one according to the scan line, so the method is suitable for the fusion of two images of arbitrary shape.
Figure 3 shows the results of the panorama synthesis. 3(a) to 3(d) are four frames extracted from the video image to be synthesized, FIG. 3(e) is a combined background panorama, and FIG. 3(f) is a panoramic view after the moving target is added.

2.4 Static background suppression The static background suppression function is to image the moving image of fixed-point shooting, and obtain the whole motion process image under pure background. It has obvious influence on the background and shooting conditions on the image quality and imaging effect. Effect.
For static background suppression, the system proposes a method of multi-frame image difference for target segmentation based on the adjacent frame difference method. The corresponding residuals obtained by the difference are binarized and then phase-ANDed. This can extract the motion area well and eliminate the effects of noise. Its algorithm flow chart is shown in Figure 4.

The difference operation of the multi-frame image is to take the difference between the current frame and Ir+1~In in front of it and Ir-1~I1 behind it. The formula is as follows: di= |I(x,y,r)-I(x ,y,i)| i=1, 2,...,r-1,r+1,...,n (5)
For the difference-derived images, threshold them are segmented to convert the difference image into a binary image.

Where T is the threshold and the threshold is set using the empirical method. This method is adopted because this method does not require more calculations than other methods and meets the requirements of real-time performance.
A binary image of the moving target Ir can be obtained by performing an operation on the binarized residual map.
Ir=ID1&&ID2&&...&&IDn (7)
Due to the influence of various factors in the scene of the video sequence, a large number of noise points are inevitably left in the motion region obtained by the operation. In addition, regions corresponding to moving objects in the image may also appear to be shredded to varying degrees. The closed operation in binary morphology, that is, the first expansion and the corrosion operation, has obvious effects in neighborhood merging and noise removal.
For the motion region image obtained through the above series of operations, the pixel of the motion region is compared with the pixel points in the original image, and for the point in the image of the binarized motion region, the gray value of the corresponding image of the original image is marked as 0; For a point of 1 in the binarized motion area image, the gray value of the corresponding point of the original image remains unchanged. In this way, the moving target is extracted, and the result is shown in FIG. 5.

2.5 Moving Target Tracking and Quantization Kalman filtering and color block matching can be used to search for the specific position of each key point in the video file at each frame, so that the speed of each key point of each frame image can be calculated (corresponding to the pixel) ), and then this speed can be determined to the specific person to determine the motion parameters of each part of the athlete: position speed, acceleration. Very convenient for the analysis of athlete training.
Kalman filtering is the best linear estimation and filtering based on the minimum mean square error. Kalman filtering only needs to estimate the current value of the signal based on the previous estimate and the most recent observation. It is estimated by a state equation and a recursive method, and the resulting solution is given in the form of an estimate. In this paper, the Kalman filter is applied and the parameters of the prediction target in the next frame. For the sports video image, the target is uniformly considered to accelerate the linear motion, which is obtained by the Newtonian mechanics formula.
Where T is a two-frame time interval, according to the Kalman filter equation
So choose in the system


Thus, the prediction information of the next frame of the moving target can be obtained by the state equation and the measurement equation, and the matching is performed according to the prediction information to achieve tracking. A sub-pixel based similarity algorithm is used in this paper. Set the coordinates of the upper left corner of the rectangle of the source target to X0, Y0. The length of the rectangle is m, the width is n, and the X1 and Y1 points are the coordinates of the upper left corner of the next frame target predicted by Kalman filtering.
Then, the coordinates of the upper left corner of the target to be matched are within a rectangle whose center length is dx and dx with the predicted point X1, Y1 as the center, where dx, dy can be determined by the user.
Any point in the rectangle with the X1 and Y1 points as the center dy and the width dx is the upper left corner of the matching target rectangle, and the color information in the rectangle is saved and the RGB of the corresponding point of the source target is respectively subtracted and then taken absolutely. Value, and add all the values ​​together, record it as diff, and finally reciprocate the diff, denoted as S. S is recorded as the similarity between two images, and the larger S is, the higher the similarity is. which is


A method such as a translational target without occlusion can solve the problem completely. However, it is very inaccurate when part of the movement is blocked by the matching position. This is a very practical problem, because the complexity of human motion is not solved if it is assumed to be unobstructed during exercise, and the adaptability is too poor. A way to solve the occlusion should be considered.
In this paper, the target is divided into several sub-blocks, and each sub-block is matched. If there is a sub-block matching, the similarity is higher, the target is found to be found, and the matching is stopped. If the similarity is low, the matching of the next sub-block is continued. Stop until the similarity is found to be high. If the similarity of all sub-blocks is very low, that is, the target is completely occluded. At this time, the source target of the previous frame is saved as the original target without updating, and the original target is used to continue the comparison with the image of the next frame. This method can effectively deal with occlusion.
In this way, the function of tracking the key parts of the human body is realized. Due to the complexity and unpredictability of human motion, appropriate manual intervention must be added during the tracking process, the tracking results are more accurate and the required displacement, speed and other types can be extracted. parameter. Tracking results, as shown in Figure 6, Figure 6 (a) is the user's three tracking points, Figure 6 (b) can see the point1 tracking error, this time you need to manually correct Figure 6 (c), After the correction, the tracking of FIG. 6(d) is continued, and FIG. 6(e) is an angle variation curve composed of three tracking points during the tracking process.

2.6 Implementation Technology and Platform This system is based on Windows XP operating system, using Visual C++. Net 2003 development and implementation, has carried out a lot of tests, its operation is stable, reliable, and high accuracy. Due to the flexibility of VC++, the system has some scalability. This system has no special requirements for the hardware environment, and CPUs above Intel Pentium III can meet the needs of sports.


3 Conclusion In this paper, human motion in monocular video is taken as the research object, and a video-based sports analysis system is designed and implemented, which provides a complete qualitative and quantitative analysis system for sports analysis. The experimental process is as follows: firstly, the sports video image taken by the camera is acquired, then detected, segmented and tracked, the motion information of the human body or a certain part and the kinematic parameters of the human body are obtained, and the intuitive data and curves are obtained. Further analyze the purpose of human movement. The algorithm of each functional module of the system has certain robustness and the obtained results are satisfactory.

SMT Equipment - Original SMT Equipment- Preowned SMT Equipment - SMT Assembly Equipment - Fuji - Juki - Panasonic - Yamaha - Samsung - DEK - MPM SMT Equipment - Panasonic Nozzle Cleaning Machine - Solder Paste Mixer - SMD Part Counter - Screen Printers - Chipshooters - PCB Conveyors -  PCB Separator - SMT Feeders - Surface Mount Technology Machines. 

SMT Equipment

SMT Equipment, Nozzle Cleaning Machine,Solder Paste Mixer,SMD Components Conuter

Guangdong Juguangheng Automation Equipment Co.,Ltd. , http://www.smtsupplier.net