A ball path tactic recognition method for badminton
Through the frame difference method and OpenCV-Python library combined with the OpenPose algorithm, players and ball positions in badminton are detected and the trajectory is analyzed, which solves the problem of low accuracy in ball paths and technical tactical recognition in the existing technology, and achieves the latest developments. High recognition accuracy.
Patent Information
- Application Number
- CN202111590232.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-23
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2041-12-23
AI Technical Summary
The existing methods have low accuracy in identifying ball paths and technical tactics in badminton, and it is necessary to improve the accuracy of the recognition.
The frame difference method and OpenCV-Python library are combined with the OpenPose algorithm to detect badminton and player positions, and the ball path and techniques are judged through motion trajectory analysis to improve the accuracy of recognition.
Through the combination of frame difference method and OpenPose algorithm, the ball paths and techniques in badminton can be more accurately identified, improving the credibility and accuracy of the recognition results.
Smart Images

Figure CN114241391B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of sports ball path recognition, and in particular relates to a ball path tactical recognition method for badminton. Background Art
[0002] The wave of the artificial intelligence era has swept people's lives, and various machine learning algorithms have gradually been integrated into all walks of life, injecting new vitality into various fields. Among them, with the development of human posture estimation research, the increasingly mature motion capture technology has been widely used in various sports, game development, film and television production and other fields. Badminton is a project in college physical education classes. There are many different types of techniques and tactics, and different techniques and tactics have different characteristics. Through the videos of the games or practices shot by the players, the artificial intelligence algorithm is used to extract and analyze the ball path of each round, find out the techniques and tactics used by the players and put forward optimization suggestions, which is of great significance to improving the technical level of the players.
[0003] However, the accuracy of ball path and technique and tactics recognition using existing methods is still low. Therefore, it is necessary to propose a new ball path and technique and tactics recognition method to improve the accuracy of ball path and technique and tactics recognition in badminton. Summary of the invention
[0004] The purpose of the present invention is to solve the problem of low accuracy of ball path and technique and tactics recognition using existing methods, and propose a ball path and technique and tactics recognition method for badminton.
[0005] A method for identifying badminton ball path tactics comprises the following steps:
[0006] Step 1: After collecting a video of a player in a certain round of badminton practice or competition, pre-process the collected video to obtain a pre-processed video;
[0007] Step 2: Perform frame processing on the pre-processed video to obtain a frame-processed image;
[0008] Step 3: Detect the positions of the badminton and the player in the image obtained in step 2 to obtain the coordinates of the positions of the badminton and the player;
[0009] Step 4: Determine the position of the player in the image obtained in step 2 and the start and end of the round based on the badminton position coordinates. If the ball is in the over-the-net stage in the current image, it is determined that the previous round has ended and the next round has begun. If the ball is not over the net and the coordinates of the ball are in a half area of a certain half of the court, the player position coordinates and key point coordinates are processed. By continuously accumulating the area where the player coordinates are located, a motion trajectory is formed, and the ball path and techniques and tactics used in all rounds are determined based on the motion trajectory.
[0010] Furthermore, the process of preprocessing the captured video includes a step of converting the captured analog video into a digital video.
[0011] Furthermore, in step three, the process of detecting the badminton and the player's position in the image obtained in step two uses the OpenCV-Python library and the frame difference method to detect the target, or, in step three, the process of detecting the badminton and the player's position in the image obtained in step two uses the OpenCV algorithm to detect the target.
[0012] Furthermore, the specific process of detecting the target using the OpenCV-Python library and the frame difference method includes the following steps:
[0013] Step 3: Before pre-processing the video, first use the frame difference method to process the video;
[0014] Based on the OpenCV-Python library, the image size after framing is unified, and the image is grayed and Gaussian blurred;
[0015] Step 32: for the image processed in step 31, extract the features of the image according to the difference between the current frame and the previous frame;
[0016] Step 33: Thresholding the features extracted in step 32 to binarize the frame difference results, and then dilating the features, and then comparing the two images processed by dilation and thresholding to fill the holes;
[0017] Step 34: traverse the contours of the image processed by filling holes in step 33 and calculate the area of the boundary area, then determine the coordinates, width and height of the upper left corner of the minimum bounding rectangle, and finally draw the minimum bounding rectangle of the target area;
[0018] Step 35: Output the position coordinates of the badminton and the player according to the minimum circumscribed rectangle obtained in step 34.
[0019] Furthermore, the process of using the frame difference method to perform frame processing on the video includes the following steps:
[0020] (1) The digital video converted from the analog video is framed and grayed, and each frame image is saved;
[0021] (2) The nth and n-1th frames in the video sequence are denoted as fn and fn-1, and the grayscale values of the corresponding pixels in the two frames are denoted as fn(x, y) and fn-1(x, y). The grayscale values of the corresponding pixels in the two frames are subtracted according to the following formula, and the absolute value is taken to obtain the difference image Dn:
[0022] D n (x,y)=|f n (x,y)-f n-1 (x,y)|
[0023] (3) Binarize the pixels one by one according to the above formula to obtain a binary image Rn'; among them, the points with a gray value of 255 are foreground points, and the points with a gray value of 0 are background points. Connectivity analysis is performed on the image Rn', and finally an image Rn containing a complete moving target can be obtained;
[0024]
[0025] Among them, T is the foreground determination threshold;
[0026] (4) performing erosion and dilation processing on the image Rn to determine the image feature region, calculating the contour area of the desired image feature region, and thereby constructing the minimum circumscribed rectangular area of the image feature region;
[0027] (5) Take the midpoint of the rectangle as the position of the badminton and the player.
[0028] Furthermore, the specific process of detecting the target using the OpenCV algorithm includes the following steps:
[0029] Step 3.1, detect the badminton and player positions, and load the trained OpenCV network model respectively;
[0030] Step 3.2: Input the image obtained in step 2 into the OpenCV network model. Grab the image obtained in step 2 and set it as a blob as the input of the neural network, and pass the input through net.
[0031] Step 3.3: Use the OpenCV network model for detection. After detecting the target in the image, the OpenCV network model calculates the confidence of the detection. If the confidence is greater than the confidence threshold, the prediction is displayed on the terminal, the bounding box is drawn, and the output position coordinates are output.
[0032] Furthermore, in the process of using the OpenCV network model for detection, the process of obtaining the position and frame type of the detection target by the detection loop in the OpenCV network model includes the following steps:
[0033] (a) When multiple blobs are input into the detection loop, the confidence value is first extracted;
[0034] (b) Compare the extracted confidence with the set minimum threshold. If the confidence is higher than the minimum threshold, extract the class label index and calculate the coordinates of the detected target.
[0035] (c) Extract the (x, y) coordinates of the bounding box and draw the object bounding rectangle.
[0036] Furthermore, the process of data processing of the coordinates of the player's key points in step 4 includes the following steps:
[0037] First, the feature map of the player image is extracted through the VGG19 network, and the obtained feature map is then used to extract PCM and PAF using a neural network;
[0038] PCM is used to detect key points and predict the positions of body parts to form a set of 2D confidence maps S;
[0039] PAF is used to predict the association between the 2D vector field L encoding parts of a set of partial affinities, that is, to determine whether all the key points output in PCM come from the same person or object, forming a set of affinity vector graphs to perform joint connections between the associated key points;
[0040] Finally, the key points of the same person are combined and pieced together to form an overall framework.
[0041] Furthermore, the specific process of extracting PCM and PAF using a neural network includes the following steps:
[0042] (4.1) After the feature map probmap is processed by Gaussian filtering, mapMask is further obtained;
[0043] (4.2) Determine the coordinate values of key points:
[0044] First, find the entire contour of each key point area; generate a blob mask for this area; extract the probMap of this area by multiplying this mask by the probMap; finally, find the local maximum of this area;
[0045] (4.3) Detection of key point pairs:
[0046] Divide the line between the two points of the key point pair to obtain n points on the line; determine whether the PAF on these points is in the same direction as the line connecting the key points; if the direction meets a certain degree, it is a valid key point pair;
[0047] (4.4) Key point combination:
[0048] For each detected valid joint pair, the joints belonging to a human body are assigned; then the joint connection between the associated key points is realized; finally, the key points of the same person are trained and stitched together to merge into an overall framework.
[0049] Beneficial effects of the present invention:
[0050] The invention proposes a ball path tactic recognition method for badminton. The invention extracts the position coordinates of a badminton in an image by a frame difference method, extracts the coordinates of key point positions (feet) of a human body by an OpenPose algorithm, divides a badminton court into regions by a high-order difference function, and judges whether the frame is at the beginning, end or in the middle of a round according to the extracted position coordinates of the badminton. A set is formed by extracting the regional points where the key point position coordinates are located in the whole hitting process, and a movement trajectory of a hitter is formed by the regions in the set. The movement trajectory is compared with the movement trajectory in an original database, thereby realizing the recognition of ball paths and techniques and tactics, and finally outputting the result.
[0051] The method of the present invention identifies the ball path in the entire hitting process according to the extracted badminton position coordinates and key point position coordinates, analyzes the used techniques and tactics, can make the identification result more credible, and improves the accuracy of the ball path and technique and tactics identification. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 A flow chart of a ball path and technique and tactics recognition technology for badminton according to the present invention;
[0053] Figure 2 This is a rendering of the key points of a human body's joints. DETAILED DESCRIPTION
[0054] Specific implementation method 1. Combination Figure 1 The present embodiment describes a method for identifying badminton ball path tactics, the method specifically comprising the following steps:
[0055] Step 1: After collecting a video of a player in a certain round of badminton practice or competition, pre-process the collected video to obtain a pre-processed video;
[0056] Step 2: Perform frame processing on the pre-processed video to obtain a frame-processed image;
[0057] Step 3: Detect the positions of the badminton and the player in the image obtained in step 2 to obtain the coordinates of the positions of the badminton and the player;
[0058] Step 4: Determine the position of the player in the image obtained in step 2 and the start and end of the round according to the badminton position coordinates. If the ball is in the stage of passing the net in the current image, it is determined that the previous round has ended and the next round has begun. If the ball is in the stage of not passing the net and the coordinates of the ball are in a half area of a certain half of the court, the player position coordinates and key point coordinates are processed. By continuously accumulating the areas where the player coordinates are located and the areas where the key points are located, a motion trajectory is formed to determine the ball paths and techniques and tactics used in all rounds. Specific implementation method 2:
[0060] In the method for identifying ball path tactics for badminton described in this embodiment, in step one, the process of preprocessing the collected video includes the step of converting the collected analog video into a digital video.
[0061] The other steps and parameters are the same as those in the first embodiment. Specific implementation method three:
[0063] In the ball path tactical recognition method for badminton described in this implementation scheme, the process of detecting the badminton and the player's position in the image obtained in step 2 in step three uses the OpenCV-Python library and the frame difference method to detect the target.
[0064] The specific process of detecting the target using the OpenCV-Python library and the frame difference method includes the following steps:
[0065] Step 3 1. Before preprocessing the video, first use the frame difference method to divide the video into frames. After processing, use the resize method in the OpenCV-Python library to reset the image size after dividing the frames to unify the size, and then use the cvtColor() and GaussianBlur() methods to grayscale and Gaussian blur the image. The processing method uses the Gaussian filtering method to remove the Gaussian noise in the image, that is, the result of weighted averaging of the entire image.
[0066] Step 32: Calculate the difference between the current frame and the previous frame using the absdiff() method in the OpenCV-Python library to extract the features of the image.
[0067] Step 33: The features extracted in step 32 are further thresholded by the threshold() method to binarize the frame difference results. On this basis, the features are further expanded by the dilate() method. The two images processed by expansion and thresholding are compared to perform hole filling processing.
[0068] Step 34: Traverse the contours of the image processed by filling holes in step 33 and calculate the area of the boundary area through the contourArea() method, then use the boundingRect() method to get the coordinates (x, y), width and height of the upper left corner of the minimum enclosing rectangle, and finally use the rectangle() method to draw the minimum enclosing rectangle of the target area;
[0069] Step 35: Output the position coordinates of the badminton and the player according to the minimum circumscribed rectangle obtained in step 34.
[0070] The present invention uses the inter-frame difference method and the mixed Gaussian model method to detect moving targets. First, the frames are processed, and then the differences between the previous and next frames are found to identify the objects and mark their positions.
[0071] The process of the inter-frame difference method is as follows:
[0072] (1) Convert the read video file from analog video to digital video and perform frame processing and grayscale processing, and save each frame image;
[0073] (2) The nth and n-1th frames in the video sequence are denoted as fn and fn-1, and the grayscale values of the corresponding pixels in the two frames are denoted as fn(x, y) and fn-1(x, y). The grayscale values of the corresponding pixels in the two frames are subtracted according to the following formula, and their absolute values are taken to obtain the difference image Dn:
[0074] D n (x,y)=|f n (x,y)-f n-1 (x,y)|
[0075] (3) Set the threshold T, and perform binarization processing on each pixel one by one according to the above formula to obtain a binary image Rn'. Among them, the point with a gray value of 255 is the foreground (moving target) point, and the point with a gray value of 0 is the background point; perform connectivity analysis on the image Rn', and finally obtain an image Rn containing a complete moving target.
[0076]
[0077] (4) Use the method in the OpenCV-Python library to erode and dilate the image Rn to be identified to determine the image feature area, calculate the contour area of the required image feature area, and thus construct the minimum circumscribed rectangular area of the image feature area.
[0078] (5) Finally, the coordinates of the feature area are determined by the area of the minimum circumscribed rectangle;
[0079] The present invention uses OpenCV-Python library and inter-frame difference method to detect the positions of badminton and players. First, frame division is performed and then the framed images are preprocessed. Then, the minimum circumscribed rectangle corresponding to the area is taken out, and then the midpoint of the rectangle is taken as the position of the badminton and the player.
[0080] The other steps and parameters are the same as those in the first or second embodiment. Specific implementation method four:
[0082] In the ball path tactical recognition method for badminton described in this implementation scheme, the process of detecting the badminton and the player's position in the image obtained in step 2 in step 3 uses the OpenCV algorithm to detect the target.
[0083] The specific process of detecting the target using the OpenCV algorithm includes the following steps:
[0084] Step 3.1, build an OpenCV network model, and train the built OpenCV network model to obtain a trained OpenCV network model;
[0085] For the recognition of badminton, an OpenCV network model was constructed. When training the OpenCV network model, the positive and negative sample files must be prepared first. For the recognition of badminton, when preparing the positive sample, a large number of badminton pictures need to be taken with a camera and grayed out with a white background to improve the recognition accuracy. At the same time, when preparing the negative sample, a large number of real-life photos of badminton courts are taken, which are completely irrelevant to the positive sample and are also grayed out. The OpenCV network model is trained using the images in the positive and negative samples.
[0086] For the recognition of players’ bodies, an OpenCV network model was also constructed. When preparing positive samples for training the OpenCV network model, a large number of human body motion postures need to be captured from the Internet or with a camera, and grayscaled, with a white background, to improve the recognition accuracy. At the same time, negative samples are prepared, and the same negative samples as the previous OpenCV network model are used, which are completely irrelevant to the positive samples and are also grayscaled. The OpenCV network model is trained using images from the positive and negative samples.
[0087] Step 3.2: Input the image obtained in step 2 into the trained OpenCV network model. Grab the image obtained in step 2 and set it as blob as the input of the neural network detections = net.setInput(blob), and pass the input through net.
[0088] Step 3.3: After detecting the target in the input frame, i.e. the image in step 3.2, the OpenCV network model calculates the confidence of the detection. If the confidence is high enough (higher than the set threshold), the prediction is displayed on the terminal, the bounding box is drawn, and the output position coordinates are output.
[0089] The present invention uses the OpenCV algorithm to detect the positions of the badminton and the player. First, a rectangular frame is taken out, and then the midpoint of the rectangle is taken as the positions of the badminton and the player.
[0090] OpenCV consists of 5 parts:
[0091] (1) Build an OpenCV network model and train it to improve the accuracy of target detection.
[0092] (2) Traverse the video file to be identified frame by frame and extract the image corresponding to each frame.
[0093] (3) Resize the image frame read in the previous step using imutils.resize(frame, width=400) and then perform target capture (h, w)=frame.shape[:2], and convert the frame into a blob of a dnn module.
[0094] (4) Use the blob from the previous step as the input of the neural network net.setInput(blob) and pass the input detections = net.forward() through net.
[0095] (5) In the detections loop, the confidence of the input passed in the previous step is calculated and compared with the pre-set threshold to identify the target object. If it is greater than the threshold, the position coordinates of the detected object are calculated and the position coordinates and bounding box are output at the terminal.
[0096] The overall process of the detection loop in the OpenCV network model to obtain the position and frame of the detected target is as follows:
[0097] (a) When multiple blobs are input into the detections loop, the confidence value is first extracted, confidence = detections[0, 0, i, 2].
[0098] (b) Compare the extracted confidence with the set minimum threshold. If the confidence is higher than the minimum threshold, extract the class label index (idx = int(detections[0, 0, i, 1])) and calculate the coordinates of the detected target (box = detections[0, 0, i, 3:7] * np.array([w, h, w, h])).
[0099] (c) Extract the (x, y) coordinates of the bounding box ((startX, startY, endX, endY) = box.astype("int")) and draw the object border rectangle (cv2.rectangle(frame, (startX, startY), (endX, endY), COLORS[idx], 2)).
[0100] The other steps and parameters are the same as those in the first or second embodiment.
[0101] Compared with the third specific implementation, this implementation not only has better adaptability when detecting the badminton and the player's position, but also the detection result is more accurate. Specific implementation method five:
[0103] In the method for identifying badminton ball path tactics described in this embodiment, the process of processing the data of the coordinates of the player's key points in step 4 includes the following steps:
[0104] First, the feature map of the player image is extracted through the VGG19 network, and the obtained feature map is used; then the neural network (CNN network) is used to extract PCM (partial confidence map, heat map of key points) and PAF (partial affinity field),
[0105] PCM is Part Confidence Maps, PAF is Part Affinity Fields;
[0106] PCM is used for key point detection and predicting the location of body parts (e.g., knees, arms) to form a set of 2D confidence maps (S);
[0107] PAF describes the affinity between different key points and is used to predict a set of 2D vector fields (L) of partial affinities, which encode the association between the parts, i.e., to determine whether all the key points output in the PCM come from the same person or object, forming a set of affinity vector graphs to perform joint connections between the associated key points.
[0108] For the PCM heatmap output, the x-values of the 2D points annotated in the image arej,k Calculate the groundtruth position corresponding to position j of person k:
[0109] It is a heat map modeled using a 2D Gaussian distribution;
[0110] Among them, σ is used to control the propagation range of the peak in the confidence map.
[0111] For the output of the PAF partial affinity field, let x j1,k and x j2,k Represents two key points of person k. By judging whether there is a pixel point p other than the key points located on the detected torso or body, if p is located on the torso or body, the value It means that from the key point x j1,k To the key point x j2,k The unit vector v of the pixel; if p is not on the torso or body, the vector corresponding to this pixel is the zero vector.
[0112]
[0113]
[0114] To determine whether a pixel point p falls on a limb, the following two judgment conditions must be met:
[0115] 0≤v·(px j1,k )≤l c,k And|v ⊥ ·(px j1,k )|≤σ l ,
[0116] Among them, l c,k represents the limb length, σ l Indicates the thickness of the limbs; v ⊥ represents the unit vector perpendicular to the unit vector v;
[0117] The cth limb in each image is the average value of the vectors of k people at position p:
[0118]
[0119] Among them, n c (p) is the number of non-zero vectors for all k people at a certain point position p;
[0120] Specifically, for the pixel point d corresponding to two candidate key points j2 and d j1 , calculate this PAF:
[0121]
[0122] p(u) is the interpolation of d by uniformly sampling u. j2 and d j1 Get the position:
[0123] p(u)=(1-u)d j1 +ud j2
[0124] Through the above two steps, the splicing of key points (joints) is completed;
[0125] Considering the accuracy of target detection, the feature map will be circularly convolved in the openpose network. After each convolution, the loss function will be output and substituted into the calculation in the next network operation. The purpose is to identify more key points and locate the key point coordinates of the person more accurately. The calculation method of the loss function is as follows:
[0126] S=(S1,S2,...,S J )
[0127] T=(T1,T2,...,T C )
[0128] S represents the confidence map for predicting the position of a certain part of the human body, T represents the Part Affinity Fields for predicting the key points of the position of a certain part of the human body, J represents J confidence maps, and C represents C Part Affinity Fields.
[0129] For a layer 1 network, S 1 =ρ 1 (F), L 1 =φ 1 (F), then for each subsequent layer of the neural network, the following formula can be used:
[0130] S t =ρ t (F,S t-1 ,L t-1 )
[0131] L t =φ t (F,S t-1 ,L t-1 )
[0132]
[0133]
[0134] in, The ground truth part confidence map is also called a heat map, and is the groundtruthpart affinity field. W is a binary mask. When the position p is missing (i.e., it does not exist), W(p) = 0, otherwise it is 1, that is, the unlabeled task key point will not affect the entire model; ρ, φ represent the convolutional neural network, and F is the input feature image;
[0135] The final losses are as follows:
[0136]
[0137] Where t is each layer of the neural network, and T is the total number of neural network layers participating in the calculation.
[0138] After looping to get the desired number of key points, the openpose network will output the heatmap containing confidence and affinity heatmap obtained by the above steps.
[0139] Since the number of human bodies to be recognized in the present invention is two to four, the problem of multi-person key point detection and splicing is involved. Since the key point splicing is an NP-Hard problem, the greedy relaxation method is used to generate a globally optimal connection. By taking the key points as the vertices of the graph and considering the PAF between the key points as the weight between the two points, the problem is transformed into a bipartite graph matching problem. The bipartite graph force ensures that no two edges share the same vertex. First, define Used to indicate and Whether two detected key point position candidates are connected, the following constraints are given:
[0140]
[0141] Among them, m and n represent the detected key points, D j1 ,D j2 It is the candidate key point position detected by the part;
[0142] Through this constraint, no two identical limbs contain the same body part. Based on the above constraints, the edge with the maximum matching weight is calculated:
[0143]
[0144] Among them, E c is the edge with the maximum matching weight, E mn Represents the edge of the m,n connection;
[0145] The clustering of key points is achieved through the bipartite matching method. Since the PAF affinity vector is calculated in the above steps, it satisfies the vector property, which ensures the correctness of the generated bipartite matching. Finally, the key points of the same person can be combined into an overall framework to better extract the player's position coordinates.
[0146] The process of determining the key points includes the following steps:
[0147] (1) After the feature map probmap is processed by Gaussian filtering, mapMask is further obtained;
[0148] cv2.GaussianBlur: Gaussian filter, a linear smoothing filter, is very effective in removing Gaussian noise. mapMask is a prob binary map, which is 1 if it is greater than the threshold, and 0 otherwise.
[0149] (2) Determine the coordinate values of key points:
[0150] In order to find the exact location of the key point, we need to find the maximum value of each blob, which can be achieved by the following steps:
[0151] First, find the entire outline of each key point area;
[0152] Generate a blob mask for this area;
[0153] Extract the probMap for that region by multiplying this mask with the probMap;
[0154] Find the local maximum in this region.
[0155] The above processing needs to be performed on each contour (i.e., key point area).
[0156] (3) Detection of key point pairs:
[0157] Divide the line between the two points of the key point pair to obtain n points on the line;
[0158] Determine whether the PAF at these points is in the same direction as the line connecting the key points;
[0159] If the directions meet a certain degree, they are valid keypoint pairs;
[0160] (4) Specific implementation analysis of key point combination:
[0161] For each detected valid joint pair, assign the joints belonging to a human body, such as Figure 2 As shown;
[0162] In this process, an empty list is first created to store all the key points of each human body; if partA is not in any human body list, it means that the key point pair belongs to a newly appeared human body, so a new list is created.
[0163] The other steps and parameters are the same as those in Specific Embodiments 1 to 4.
[0164] The above calculation examples of the present invention are only used to explain the calculation model and calculation process of the present invention in detail, and are not intended to limit the implementation methods of the present invention. For ordinary technicians in the relevant field, other different forms of changes or modifications can be made based on the above description. It is impossible to list all the implementation methods here. All obvious changes or modifications derived from the technical solution of the present invention are still within the scope of protection of the present invention.
Claims
1. A ball path tactic recognition method for badminton, characterized in that: The following steps are involved: Step 1: After collecting a video of a player in a certain round of badminton practice or competition, pre-process the collected video to obtain a pre-processed video; Step 2: Perform frame processing on the pre-processed video to obtain a frame-processed image; Step 3: Detect the positions of the badminton and the player in the image obtained in step 2 to obtain the coordinates of the positions of the badminton and the player; Step 4: Determine the position of the player in the image obtained in step 2 and the start and end of the round according to the badminton position coordinates. If the ball is in the stage of passing the net in the current image, it is determined that the previous round has ended and the next round has begun. If the ball is in the stage of not passing the net and the coordinates of the ball are in the half area of a half side of the court, the player position coordinates and key point coordinates are processed, and the motion trajectory is formed by continuously accumulating the area where the player coordinates are located. According to the motion trajectory, the ball path and technical tactics used in all rounds are determined; The process of data processing of player key point coordinates includes the following steps: First, the feature map of the player image is extracted through the VGG19 network, and the obtained feature map is then used to extract PCM and PAF using a neural network; PCM is used to detect key points and predict the positions of body parts to form a set of 2D confidence maps S; PAF is used to predict the association between the 2D vector field L encoding parts of a set of partial affinities, that is, to determine whether all the key points output in PCM come from the same person or object, forming a set of affinity vector graphs to perform joint connections between the associated key points; Finally, the key points of the same person are combined and merged into an overall framework; The specific process of extracting PCM and PAF using neural network includes the following steps: (4.1) After the feature map probmap is processed by Gaussian filtering, mapMask is further obtained; (4.2) Determine the coordinate values of key points: First, find the entire contour of each key point area; generate a blob mask for this area; extract the probMap of this area by multiplying this mask by the probMap; finally, find the local maximum of this area; (4.3) Detection of key point pairs: Divide the line between the two points of the key point pair to obtain n points on the line; determine whether the PAF on these points is in the same direction as the line connecting the key points; if the direction meets a certain degree, it is a valid key point pair; (4.4) Key point combination: For each detected valid joint pair, the joints belonging to a human body are assigned; then the joint connection between the associated key points is realized; finally, the key points of the same person are trained and stitched together to merge into an overall framework.
2. A method for identifying badminton ball path tactics according to claim 1, characterized in that: The process of preprocessing the captured video includes the step of converting the captured analog video into digital video.
3. A method for identifying badminton ball path tactics according to claim 2, characterized in that: In step 3, the process of detecting the badminton and the player positions in the image obtained in step 2 uses the OpenCV-Python library and the frame difference method to detect the target.
4. A method for identifying badminton ball path tactics according to claim 3, characterized in that: The specific process of detecting the target using the OpenCV-Python library and the frame difference method includes the following steps: Step 3: Before pre-processing the video, first use the frame difference method to process the video; Based on the OpenCV-Python library, the image size after framing is unified, and the image is grayed and Gaussian blurred; Step 32: for the image processed in step 31, extract the features of the image according to the difference between the current frame and the previous frame; Step 33: Thresholding the features extracted in step 32 to binarize the frame difference results, and then dilating the features, and then comparing the two images processed by dilation and thresholding to fill the holes; Step 34: traverse the contours of the image processed by filling holes in step 33 and calculate the area of the boundary area, then determine the coordinates, width and height of the upper left corner of the minimum bounding rectangle, and finally draw the minimum bounding rectangle of the target area; Step 35: Output the position coordinates of the badminton and the player according to the minimum circumscribed rectangle obtained in step 34.
5. A method for identifying ball path tactics for badminton according to claim 4, characterized in that: The process of using the frame difference method to process the video frame includes the following steps: (1) The digital video converted from the analog video is framed and grayed, and each frame image is saved; (2) The nth and n-1th frames in the video sequence are denoted as fn and fn-1, and the grayscale values of the corresponding pixels in the two frames are denoted as fn(x, y) and fn-1(x, y). The grayscale values of the corresponding pixels in the two frames are subtracted according to the following formula, and the absolute value is taken to obtain the difference image Dn: D n (x,y)=|f n (x,y)-f n-1 (x,y)| (3) Binarize the pixels one by one according to the above formula to obtain a binary image Rn'; among them, the points with a gray value of 255 are foreground points, and the points with a gray value of 0 are background points. Connectivity analysis is performed on the image Rn', and finally an image Rn containing a complete moving target can be obtained; Among them, T is the foreground determination threshold; (4) performing erosion and dilation processing on the image Rn to determine the image feature region, calculating the contour area of the desired image feature region, and thereby constructing the minimum circumscribed rectangular area of the image feature region; (5) Take the midpoint of the rectangle as the position of the badminton and the player.
6. A method for identifying badminton ball path tactics according to claim 2, characterized in that: Step 3 is the process of detecting the badminton and the player positions in the image obtained in step 2 by using the OpenCV algorithm to detect the target.
7. A method for identifying badminton ball path tactics according to claim 6, characterized in that: The specific process of detecting the target using the OpenCV algorithm includes the following steps: Step 3.1, detect the badminton and player positions, and load the trained OpenCV network model respectively; Step 3.2: Input the image obtained in step 2 into the OpenCV network model. Grab the image obtained in step 2 and set it as a blob as the input of the neural network, and pass the input through net. Step 3.3: Use the OpenCV network model for detection. After detecting the target in the image, the OpenCV network model calculates the confidence of the detection. If the confidence is greater than the confidence threshold, the prediction is displayed on the terminal, the bounding box is drawn, and the output position coordinates are output.
8. A method for identifying ball path tactics for badminton according to claim 7, characterized in that: In the process of using the OpenCV network model for detection, the process of the detection loop in the OpenCV network model to obtain the position and frame of the detected target includes the following steps: (a) When multiple blobs are input into the detection loop, the confidence value is first extracted; (b) Compare the extracted confidence with the set minimum threshold. If the confidence is higher than the minimum threshold, extract the class label index and calculate the coordinates of the detected target. (c) Extract the (x, y) coordinates of the bounding box and draw the object bounding rectangle.
