Tennis ball collision detection method and device

Through image processing and acceleration fluctuation judgment, a monocular camera is used to perform tennis collision detection, which solves the problems of expensive equipment and complex calculations in the prior art, and realizes fast and low-cost indoor tennis collision detection.

CN118864532BActive Publication Date: 2025-08-26SHENZHEN DELE SPORTS TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410909888.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-05
Publication Date
2025-08-26
Estimated Expiration
2044-07-05

AI Technical Summary

Technical Problem

The existing tennis collision detection methods are expensive, complex in calculations and are not suitable for rapid indoor batch applications, resulting in positioning deviations and high maintenance costs, making it difficult to promote the popularization of indoor tennis.

Method used

By obtaining the image sequence during the target ball movement, performing image processing to obtain the spherical center coordinates and radius, constructing a coordinate point sequence, calculating the acceleration sequence, and using acceleration fluctuations to determine the collision, and using a monocular camera for detection.

Benefits of technology

It realizes fast and low-cost tennis collision detection, reduces positioning deviation, is suitable for indoor tennis, and promotes the development of indoor tennis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118864532B_ABST
    Figure CN118864532B_ABST
Patent Text Reader

Abstract

The present invention discloses a tennis collision detection method and device. The method includes: acquiring an image sequence of a target ball during its motion; sequentially performing image processing on each frame in the image sequence to obtain the pixel coordinates and radius of the target ball's center relative to the corresponding image; constructing a coordinate point sequence based on the pixel coordinates and the radius; calculating an acceleration sequence of the target ball based on the coordinate point sequence; determining the acceleration change of the target ball in each frame based on the acceleration sequence; and determining that a collision has occurred when the acceleration change meets a preset fluctuation condition. The method only requires using a single monocular camera to capture the tennis ball's motion and collision process from a top-down angle, eliminating the need for conversion between physical coordinates and pixel coordinates. The collision position and time can be simply and accurately obtained, thereby improving detection speed, reducing development costs, and alleviating the problem of severe positioning deviations caused by mis-hitting, thereby lowering equipment costs and being applicable to indoor tennis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a tennis ball collision detection method and device, computer equipment, and storage medium. Background Art

[0002] Tennis is a beautiful and intense ball sport. It not only improves an individual's physical and mental health and strengthens their physique, but also plays an important role in social interaction and psychological quality cultivation.

[0003] It's well known that collision point detection is particularly important in tennis. Current common collision point detection methods typically involve installing vibration sensors, lidar, or binocular cameras to obtain data from multiple dimensions and then calculate the resulting data. The physical coordinate changes of the target ball can be used to determine whether the target ball has collided with a target object or plane, and the corresponding collision location can be determined. All three of these methods suffer from stricter algorithm requirements, poor accuracy, slow speed, and long technical development cycles. They also face the risk of serious positioning errors caused by accidental hits by the target ball and high equipment maintenance costs, making them unsuitable for rapid, mass-produced applications in indoor ball games.

[0004] In particular, specific application cases are rare in tennis collision detection, which is often seen in the Hawkeye replay function of large-scale official tennis tournaments. It uses multiple ultra-high-definition high-speed cameras combined with multiple sets of multi-dimensional data to simulate the movement trajectory of the tennis ball and determine the landing position. The equipment is expensive, the calculation method is complex, and it occupies a large area.

[0005] However, compared to outdoor activities, which are subject to weather constraints, indoor tennis is more suitable for 24-hour tennis play. This has led to the development of tennis scoring games similar to basketball shooting. However, the use of expensive equipment and complex systems has hindered the popularization of this model. Therefore, the development of a tennis collision detection method with fast speed, short development cycle, and low equipment maintenance costs to promote the development of indoor tennis has become a pressing issue. Summary of the Invention

[0006] Based on this, it is necessary to provide a tennis ball collision detection method and device, computer equipment and storage medium to address the above technical problems, so as to solve at least one problem existing in the above-mentioned prior art.

[0007] The embodiment of the present application is implemented as follows: in a first aspect, a tennis ball collision detection method is provided, comprising the following steps:

[0008] Acquire an image sequence of the target ball during its motion, and perform image processing on each frame of the image sequence in sequence to obtain pixel coordinates and a radius of the center of the target ball relative to the corresponding image;

[0009] Constructing a coordinate point sequence based on the pixel coordinates and the radius;

[0010] Calculating the acceleration sequence of the target ball based on the coordinate point sequence;

[0011] Determining the acceleration change of the target ball in each frame of image based on the acceleration sequence;

[0012] When the acceleration change meets the preset fluctuation condition, it is determined that the target ball has collided.

[0013] In one embodiment, sequentially performing image processing on each frame of the image sequence to obtain pixel coordinates and a radius of the center of the target ball relative to the corresponding image includes:

[0014] Normalizing multiple color components corresponding to target pixels of each frame of the image in the image sequence;

[0015] Based on the normalized color components, calculate each component in the HSV color space to obtain a new image;

[0016] Based on the components of each pixel in the new image in the HSV color space, a mask image is obtained for distinguishing the target ball from the background;

[0017] Performing a closing operation on the mask image, and performing contour tracing on the mask image after the closing operation to obtain a circular contour;

[0018] Based on the circular outline, the pixel coordinates and radius of the center of the target ball relative to the corresponding image are obtained.

[0019] In one embodiment, the calculating of each component in the HSV color space based on the normalized color components to obtain a new image includes:

[0020] Calculate the maximum and minimum values ​​of the components through the normalized color components;

[0021] Calculating a component difference based on the component maximum value and the component minimum value;

[0022] Based on the component differences and the normalized color components, each component in the HSV color space is calculated to obtain the new image.

[0023] In one embodiment, obtaining a mask image for distinguishing the target ball from the background based on a component of each pixel in the new image in the HSV color space includes:

[0024] For each pixel in the new image, the component in the HSV color space;

[0025] When the component in the HSV color space is less than or equal to a first preset threshold and greater than or equal to a second preset threshold, the color of the pixel is set to white; otherwise, the color of the pixel is set to black to obtain a mask image for distinguishing the target ball from the background.

[0026] In one embodiment, calculating the acceleration sequence of the target ball based on the coordinate point sequence includes:

[0027] Copy all elements except the first element in the coordinate point sequence as a new coordinate point sequence;

[0028] Interleaving the coordinate point sequence with the new coordinate point sequence to obtain a first velocity sequence;

[0029] Copy all elements in the speed sequence except the first element as a second speed sequence;

[0030] The first velocity sequence and the second velocity sequence are interleaved and calculated to obtain the acceleration sequence.

[0031] In one embodiment, determining the acceleration change of the target ball in each frame of the image based on the acceleration sequence includes:

[0032] Starting from the second acceleration in the acceleration sequence, calculating the acceleration difference between each acceleration and the previous acceleration, and adding the difference to the acceleration change sequence;

[0033] Based on the acceleration change sequence, the acceleration change of the target ball in each frame of the image is determined.

[0034] In one embodiment, constructing a coordinate point sequence based on the pixel coordinates and the radius includes:

[0035] Determine all circular regions in each frame of image, and filter out circular regions in each frame of image whose area is smaller than a preset area threshold;

[0036] The pixel coordinates and the variable diameter corresponding to the remaining circle area are added to the pre-constructed coordinate point empty sequence and radius empty sequence respectively to obtain the target coordinate point sequence and target radius sequence;

[0037] When the element in the target coordinate point sequence is not empty, traverse the target coordinate point sequence, calculate the average value between the horizontal coordinate, the vertical coordinate and the radius, and add it as a new element to the target coordinate point sequence; or

[0038] When the elements in the target coordinate point sequence are not empty and the sequence length is greater than a preset value, extracting the first preset elements in the target coordinate point sequence;

[0039] When the vertical coordinates of the first preset elements increase in sequence and the maximum value is greater than a third preset threshold, a new element is added to the target coordinate point sequence to obtain the coordinate point sequence.

[0040] In one embodiment, after constructing the coordinate point sequence based on the pixel coordinates and the radius, the following steps are included:

[0041] When the radius meets a preset update condition, the corresponding pixel coordinates in the coordinate point sequence are updated, and at the same time, the sequence length of the coordinate point sequence is maintained at a preset length.

[0042] In one embodiment, when the acceleration change meets a preset fluctuation condition, it is determined that the target ball has collided, and the following steps are performed:

[0043] Obtaining the collision time point and the current center coordinate point of the target ball to obtain a first collision point sequence;

[0044] Establishing a second collision point sequence with the same format as the first collision point sequence, and initializing the last time point to be empty;

[0045] Traversing each element in the first collision point sequence, and based on the previous time point and the target time point corresponding to each element, adding the element in the first collision point sequence to the second collision point sequence or deleting the corresponding element in the first collision point sequence according to a preset rule;

[0046] When the second collision point sequence overlaps with the first collision point, the first collision point sequence completes a round of updating.

[0047] In a second aspect, a tennis ball collision detection device is provided, comprising:

[0048] An image processing module is used to obtain an image sequence of the target ball during its motion, and sequentially process each frame of the image sequence to obtain the pixel coordinates and radius of the center of the target ball relative to the corresponding image;

[0049] A coordinate point sequence construction module, configured to construct a coordinate point sequence based on the pixel coordinates and the radius;

[0050] An acceleration sequence generating module, configured to calculate the acceleration sequence of the target ball based on the coordinate point sequence;

[0051] An acceleration change module, configured to determine an acceleration change of the target ball in each frame of image based on the acceleration sequence;

[0052] The collision detection module is used to determine that the target ball has collided when the acceleration change meets a preset fluctuation condition.

[0053] In a third aspect, a computer device is provided, comprising a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, wherein the processor implements the above-mentioned tennis ball collision detection method when executing the computer-readable instructions.

[0054] In a fourth aspect, a computer-readable storage medium is provided, wherein when the computer-readable instructions are executed by one or more processors, the one or more processors execute the tennis ball collision detection method as described above.

[0055] The above-mentioned tennis collision detection method, device, computer equipment and storage medium are implemented by: acquiring an image sequence of a target ball during its motion, performing image processing on each frame of the image sequence in sequence to obtain the pixel coordinates and radius of the center of the target ball relative to the corresponding image; constructing a coordinate point sequence based on the pixel coordinates and the radius; calculating an acceleration sequence of the target ball based on the coordinate point sequence; determining the acceleration change of the target ball in each frame of the image based on the acceleration sequence; and determining that a collision has occurred with the target ball when the acceleration change meets a preset fluctuation condition. In an embodiment of the present application, a sequence of images of a target ball in motion is collected and image processing is performed to obtain the coordinates of the target ball in each frame of the image, and then the corresponding velocity and acceleration are calculated. The acceleration is used to obtain the acceleration change of the target ball in each frame of the image, and the fluctuation of the acceleration of the target ball during collision is used to determine whether a collision has occurred. Only a single monocular camera is required to shoot the process of tennis movement and collision at a top-down angle. There is no need to convert physical coordinates into pixel coordinates, and the collision position and time are obtained simply and accurately. This can improve the detection speed, reduce development costs, and reduce the problem of serious positioning deviation caused by mishitting, thereby reducing equipment costs. The system is applicable to indoor tennis and is conducive to the development of indoor tennis. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0057] Figure 1 is a schematic diagram of an application environment of a tennis ball collision detection method according to an embodiment of the present invention;

[0058] Figure 2 is a flow chart of a tennis ball collision detection method according to an embodiment of the present invention;

[0059] Figure 3 is a schematic diagram of a scenario of an image processing method according to an embodiment of the present invention;

[0060] Figure 4 This is a schematic diagram of a scenario of a method for optimizing the trajectory of a tennis ball according to an embodiment of the present invention;

[0061] Figure 5 A schematic diagram of a tennis ball collision detection device according to an embodiment of the present invention is shown in FIG. Figure 1 ;

[0062] Figure 6 A schematic diagram of a tennis ball collision detection device according to an embodiment of the present invention is shown in FIG. Figure 2 ;

[0063] Figure 7 FIG. 1 is a schematic diagram of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0064] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0065] See also Figure 1 , provides an application environment diagram of a tennis collision detection method, specifically disclosing an image acquisition device and the arrangement position of the tennis collision detection. The image acquisition device can be set above the tennis movement path, and the shooting line of sight is toward the side of the collision object. The tennis collision detection can be set on the side of the collision object to detect the collision between the tennis ball and the collision object. It can be understood that the Figure 1 Only one feasible implementation scenario is provided, and the layout of the above-mentioned devices can be adjusted according to the actual scenario requirements.

[0066] Optionally, the arrangement relationship of the image acquisition device, tennis collision detection and collision object is as follows: the distance between the image acquisition device C and the collision object S is D c , the height between the image acquisition device C and the ground is H cThe angle between the image acquisition device C and the fixed plane F is θ. When the tennis ball T appears in the shooting range of the camera C, the camera C uses a frame rate of FPS60 to capture each frame of the tennis ball T's movement. The camera C is connected to the tennis ball collision detection device D using a data cable L. The tennis ball collision detection device D is responsible for running a method to identify the collision position p of the tennis ball T on the collision object S. t .

[0067] It should be noted that the tennis ball collision detection device C can be fixed on a specific plane F at a specific angle θ to capture the tennis ball T flying from the back to the front and colliding with the object / plane S.

[0068] Among them, the image acquisition device C can be a camera, such as a monocular RGB camera, and the tennis collision detection device D is a movable device, and its position can be moved according to actual scene requirements.

[0069] In one embodiment, if Figure 2 As shown, a tennis ball collision detection method is provided, which is applied in Figure 1 The tennis ball collision detection device in the embodiment is used as an example to illustrate the method, which includes the following steps:

[0070] In step S110, an image sequence of the target ball in motion is acquired, and image processing is performed on each frame of the image sequence in sequence to obtain the pixel coordinates and radius of the center of the target ball relative to the corresponding image;

[0071] In an embodiment of the present application, the movement process of the target ball can be sorted in real time by a pre-set image acquisition device, so that continuous images of the target ball's movement process, that is, an image sequence, can be obtained. The tennis collision detection device can receive the images captured in real time by the image acquisition device and perform image processing to obtain the pixel coordinates and radius of the center of the target ball relative to the corresponding image.

[0072] In an embodiment of the present application, an image sequence includes consecutive image frames. For each image frame, a new image is obtained by normalizing the color components of any pixel, calculating the maximum and minimum values ​​of the component, and then calculating each component in the HSV color space based on the difference between the maximum and minimum values. This new image is then filled with the colors of the tennis ball and the background to obtain a mask image used to distinguish the tennis ball from the background. The mask image is then closed and contour traced to obtain a circular outline. Based on this circular outline, the pixel coordinates and radius of the center of the tennis ball T in the image are obtained. Specifically, color space conversion is used, and background features unrelated to the tennis ball are filtered out within a specific value range. Denoising and fragmentation region concatenation are performed. Finally, contour estimation is used to obtain a circle that approximates the shape of the tennis ball, thereby obtaining the coordinates and radius of its center.

[0073] In step S120, a coordinate point sequence is constructed based on the pixel coordinates and the radius;

[0074] In an embodiment of the present application, the tennis ball appears blurred due to the low frame rate of the image acquisition device, such as the combination of two hemispheres and a cylinder, or the uneven distribution of light, which causes the color of the tennis ball to deviate from the normal value, thereby failing to recognize the contour and causing deviation in collision point detection. Therefore, based on the detected pixel coordinates and radius, virtual approximation calculation can be used to fit adjacent coordinates, and approximate estimation and true and false fusion can be performed to optimize the motion trajectory of the tennis ball to obtain an optimized motion trajectory, thereby alleviating the problem of contour recognition failure caused by the blurred features of the tennis ball in the image.

[0075] The coordinate point sequence stores the pixel coordinates of the center of the tennis ball and the corresponding time point information.

[0076] It can be understood that the coordinate point sequence can be updated in real time. By designing time intervals to update the stored coordinate point queue, the data of the tennis ball in the image can be quickly saved in different situations to maintain efficiency and timeliness. Unlike binocular cameras or lidars that have long calculation time and high latency, it consumes less computing power on mobile / edge devices.

[0077] In step S130, based on the coordinate point sequence, the acceleration sequence of the target ball is calculated;

[0078] In an embodiment of the present application, all elements except the first element in the coordinate point sequence can be copied and used as a new coordinate point sequence. The new coordinate point sequence and the original coordinate point sequence are interleaved to obtain a velocity sequence. Then, all elements except the first element in the velocity sequence are copied and used as a new velocity sequence. The new velocity sequence and the original velocity sequence are interleaved to obtain the acceleration sequence.

[0079] It should be noted that the time interval between calculating speed and acceleration is 1 second. Furthermore, the calculation process and the subsequent collision point detection process can be run in the same functional area to reduce data transmission delays and enhance integrity.

[0080] In step S140, based on the acceleration sequence, the acceleration change of the target ball in each frame of the image is determined;

[0081] In an embodiment of the present application, the acceleration sequence is traversed, starting from the second acceleration in the acceleration sequence, and the acceleration difference between each acceleration and the previous acceleration is calculated. The obtained difference is placed in the acceleration change sequence Ca, and the acceleration change of the target ball in each frame image can be determined.

[0082] In step S150, when the acceleration change meets the preset fluctuation condition, it is determined that the target ball has collided.

[0083] In the embodiment of the present application, the fluctuation parameter W can be configured in advance, and after the acceleration change is obtained, the acceleration change sequence C can be traversed. a , calculate to satisfy a Δ(i+1) <0 and a Δi >0 number of conditions Wn,a Δ Indicates the acceleration difference, when W n When it is greater than or equal to the fluctuation parameter W, it is considered that a collision occurs and the collision point P is obtained. i , and added to the collision point sequence W l Since the acceleration of a tennis ball is relatively stable when in flight, if multiple acceleration fluctuations occur, it can be considered that the tennis ball is likely in a state of impact-buffered vibration. By detecting the number of fluctuations, it can be determined whether a collision has occurred. By performing a mosaic calculation on the sequence, the accurate velocity and acceleration of the center coordinates of the tennis ball in the image are obtained. The principle of fluctuations generated by tennis ball collisions is utilized, combined with repeated changes in acceleration to determine the collision of the tennis ball. This can effectively improve the accuracy of detection, reduce the difficulty of calculation, and expand the scope of application.

[0084] It is understandable that all collision points of the target ball during its movement can be detected, and a collision point sequence can be generated for output.

[0085] An embodiment of the present application provides a tennis collision detection method, comprising: acquiring an image sequence of a target ball during its motion, performing image processing on each frame of the image sequence in sequence to obtain pixel coordinates and a radius of the center of the target ball relative to the corresponding image; constructing a coordinate point sequence based on the pixel coordinates and the radius; calculating an acceleration sequence of the target ball based on the coordinate point sequence; determining a change in the acceleration of the target ball in each frame of the image based on the acceleration sequence; and determining that a collision has occurred with the target ball when the acceleration change meets a preset fluctuation condition. In an embodiment of the present application, a sequence of images of a target ball in motion is collected and image processing is performed to obtain the coordinates of the target ball in each frame of the image, and then the corresponding velocity and acceleration are calculated. The acceleration is used to obtain the acceleration change of the target ball in each frame of the image, and the fluctuation of the acceleration of the target ball during collision is used to determine whether a collision has occurred. Only a single monocular camera is required to shoot the process of tennis movement and collision at a top-down angle. There is no need to convert physical coordinates into pixel coordinates, and the collision position and time can be obtained simply and accurately. This can improve the detection speed, reduce development costs, and reduce the problem of serious positioning deviation caused by mishitting, thereby reducing equipment costs and being applicable to indoor tennis.

[0086] In an embodiment of the present application, the processing of each frame image in the image sequence to obtain the pixel coordinates and radius of the center of the target ball relative to the corresponding image includes:

[0087] Normalize multiple color components corresponding to the target pixel points of each frame image in the image sequence;

[0088] Based on the normalized color components, calculate each component in the HSV color space to obtain a new image;

[0089] Based on the components of each pixel point in the new image in the HSV color space, obtain a mask image for distinguishing the target ball from the background;

[0090] Perform a closing operation on the mask image, and perform contour tracking on the mask image after the closing operation to obtain a circular contour;

[0091] Based on the circular contour, obtain the pixel coordinates and radius of the center of the target ball relative to the corresponding image.

[0092] See Figure 3 , specifically, obtain the image sequence [P1, P2,..., P n , and image processing can be performed on each frame image. For example, taking the image processing of image P n as an example, the pixel coordinates p n (x n , y n , y n ) of the center of the tennis ball T relative to image P n can be obtained. Among them, the attributes of image P n are defaulted to height hn, width wn, and the resolution of the whole image (number of pixels) is hn×wn. Each pixel contains color information of three channels (R n , G n , B n ), 0 <= R, G, B <= 255. Any pixel point P i in image P i can be taken, 0 <= i < hn×wn, and the values of (R i , G i ) are normalized as follows:

[0093]

[0094] Based on the normalized color components, each component in the HSV color space can be calculated to obtain a new image. Then, the component of each pixel in the new image in the HSV color space is calculated to obtain a mask image used to distinguish the target ball from the background. Closing and contour tracing are performed on this mask image to obtain a circular contour. The pixel coordinates and radius of the center of the target ball relative to the corresponding image are obtained, and the pixel coordinates and radius of the center of the tennis ball T in the image are obtained. Specifically, color space conversion is used and background features unrelated to the tennis ball are filtered through a specific value range. Denoising and concatenation of fragmented areas are performed. Finally, contour estimation is used to obtain a circle that approximates the shape of the tennis ball, thereby obtaining its center coordinates and radius.

[0095] In one embodiment of the present application, the calculation of each component in the HSV color space based on the normalized color components to obtain a new image includes:

[0096] Calculate the maximum and minimum values ​​of the components through the normalized color components;

[0097] Calculating a component difference based on the component maximum value and the component minimum value;

[0098] Based on the component differences and the normalized color components, each component in the HSV color space is calculated to obtain the new image.

[0099] Specifically, by (R' i , G' i , B' i )Calculate the maximum value of the component Cmax=max(R' i , G' i , B' i ), Cmin=min(R' i , G' i , B' i ), and calculate the difference C Δ =Cmax-Cmin.

[0100] Use (R' i , G' i , B' i ) and the difference C Δ Calculate each component in the HSV color space to get a new image P' n Specifically, it can be obtained using the following formula:

[0101]

[0102] In one embodiment of the present application, obtaining a mask image for distinguishing the target ball from the background based on the component of each pixel in the new image in the HSV color space includes:

[0103] For each pixel in the new image, the component in the HSV color space;

[0104] When the component in the HSV color space is less than or equal to a first preset threshold and greater than or equal to a second preset threshold, the color of the pixel is set to white; otherwise, the color of the pixel is set to black to obtain a mask image for distinguishing the target ball from the background.

[0105] Specifically, the first preset threshold value can be predefined as the highest value (H hight , G hight , B hight ), the second preset threshold is the lowest value (H low , G low , B low ), then filter the image P n Each pixel P i Get (H i , S i , V i ), if low<=(H i , S i , V i )<=hight, then P i =1 is white, otherwise P i =0 is black, and the mask image P is used to distinguish the tennis ball from the background. mask .

[0106] Furthermore, the mask image P mask Perform a closing operation, that is, first perform an expansion operation, then perform an erosion operation, fill the black holes in the white areas of the image, connect the adjacent white areas, and remove the small black noise points, and then perform the mask image P after the closing operation. mask Contour tracing can be performed by tracing along the boundary of the white area to form a closed contour. At the same time, the contour hierarchy information can be established, and finally the contour approximation can be performed. For example, the cv2.findCountours() function can be used to obtain the circular contour O T , the circular profile O T The default is the outline of a tennis ball, so by the circular outline O T Get the center of tennis ball T in image P n The pixel coordinate p in i (x i ,y i ) and radius r i .

[0107] In one embodiment of the present application, calculating the acceleration sequence of the target ball based on the coordinate point sequence includes:

[0108] Copy all elements except the first element in the coordinate point sequence as a new coordinate point sequence;

[0109] Interleaving the coordinate point sequence with the new coordinate point sequence to obtain a first velocity sequence;

[0110] Copy all elements in the speed sequence except the first element as a second speed sequence;

[0111] The first velocity sequence and the second velocity sequence are interleaved and calculated to obtain the acceleration sequence.

[0112] Specifically, for the coordinate point sequence S l , copy S l All elements except the first element in the new coordinate point sequence S2 are taken as the new coordinate point sequence. The coordinate point sequence is interleaved with the elements in the new coordinate point sequence to obtain the first velocity sequence E of the coordinate point. v , the specific calculation formula is as follows:

[0113] e i =(x 2i -x li ,y 2i -y li )

[0114] E v =[e0, e1, ..., e n ];

[0115] Among them, e i Indicates the speed, the x 2i Indicates the X-axis coordinate of the element in the new coordinate point sequence. 1i Indicates the X-axis coordinate of the element in the original coordinate point sequence, y 2i Indicates the Y-axis coordinate of the element in the new coordinate point sequence, y1 i Indicates the Y-axis coordinate of the element in the original coordinate point sequence.

[0116] Then, copy the first speed sequence E v All elements except the first element are taken as the second velocity sequence E2, and the elements in the first velocity sequence and the second velocity sequence are interleaved to obtain the acceleration sequence K of the coordinate point. a , the specific calculation formula is as follows:

[0117] k i =(e2i -e vi , e 2i -e vi )

[0118] K a =[k0, k1, ..., k n ]

[0119] Among them, the k i represents acceleration, the e 2i Represents the velocity element in the second velocity sequence. vi Represents the velocity element in the original velocity sequence.

[0120] In one embodiment of the present application, determining the acceleration change of the target ball in each frame of the image based on the acceleration sequence includes:

[0121] Starting from the second acceleration in the acceleration sequence, calculating the acceleration difference between each acceleration and the previous acceleration, and adding the difference to the acceleration change sequence;

[0122] Based on the acceleration change sequence, the acceleration change of the target ball in each frame of the image is determined.

[0123] Traverse the acceleration sequence K a , skip the first acceleration, and calculate the difference a between each acceleration and the previous one Δ , and add the acceleration change sequence C a The specific calculation formula is as follows:

[0124] a Δ =k yi -k y(i-1) ;

[0125] Among them, k yi represents the acceleration in the acceleration sequence, k y(i-1) represents k yi The previous acceleration.

[0126] It should be noted that the acceleration may be the y-axis acceleration calculated by the y-axis velocity.

[0127] The fluctuation parameter W can be configured in advance. After obtaining the acceleration change, the acceleration change sequence C can be traversed. a , calculate to satisfy a Δ(i-1) <0 and a Δi >0 number of conditions Wn,a Δ Indicates the acceleration difference, when W n When it is greater than or equal to the fluctuation parameter W, it is considered that a collision occurs and the collision point P is obtained. i, and added to the collision point sequence W1. Since the acceleration of a tennis ball is relatively stable when in flight, if multiple acceleration fluctuations occur, it can be considered that the tennis ball is likely in a state of impact-buffering vibration. By detecting the number of fluctuations, it can be determined whether a collision has occurred.

[0128] See also Figure 4 In one embodiment of the present application, constructing a coordinate point sequence based on the pixel coordinates and the radius includes:

[0129] Determine all circular regions in each frame of image, and filter out circular regions in each frame of image whose area is smaller than a preset area threshold;

[0130] The pixel coordinates and the variable diameter corresponding to the remaining circle area are added to the pre-constructed coordinate point empty sequence and radius empty sequence respectively to obtain the target coordinate point sequence and target radius sequence;

[0131] When the element in the target coordinate point sequence is not empty, traverse the target coordinate point sequence, calculate the average value between the horizontal coordinate, the vertical coordinate and the radius, and add it as a new element to the target coordinate point sequence; or

[0132] When the elements in the target coordinate point sequence are not empty and the sequence length is greater than a preset value, extracting the first preset elements in the target coordinate point sequence;

[0133] When the vertical coordinates of the first preset elements increase in sequence and the maximum value is greater than a third preset threshold, a new element is added to the target coordinate point sequence to obtain the coordinate point sequence.

[0134] Specifically, the circular contour area A in each frame image can be i , that is, the area of ​​the target ball is determined, when the A i Greater than the preset area parameter A T When the pixel coordinate p is obtained i (x i ,y i ) and radius r i Add them to the pre-created empty sequence V of coordinate points c And V in the radius empty sequence r , used to filter closed circles in areas with too small an area and eliminate interference.

[0135] When the coordinate point empty sequence V c Not empty and coordinate point sequence S l When the length of is greater than a preset threshold, for example, greater than 3, the coordinate point sequence S is taken out. l The first three elements are preset in the middle, for example, the first three, v1, v2, v3, otherwise no processing is performed.

[0136] If the y coordinates y1, y2, y3 in v1, v2, v3 increase in sequence, that is, y1>y2>y3, and y3>preset parameter C p When , then in the coordinate point sequence S l Add a new element S new , specifically expressed as:

[0137] s new =((x1, y1+1), r1);

[0138] When the coordinate point empty sequence V c If it is not empty, you can traverse the empty sequence V of coordinate points c , and calculate the mean a of the xy coordinates and radius r x , a y , a r , as the new element s new Add coordinate point sequence S l Thus, we can get the coordinate point sequence S l , where a x , a y , a r Calculated by the following formula:

[0139]

[0140] In the embodiment of the present application, the trajectory of the tennis ball is optimized in the above-mentioned manner. The method is extremely sensitive to the situation where the outline of the tennis ball is not recognized in the image, and focuses on optimizing the problem of unclear tennis shots caused by vibration, dim light, and camera overheating. Approximate estimation and true and false fusion of data are performed instead of simple general smoothing operations. The predicted trajectory of the tennis ball is more in line with the actual situation, making the system more fault-tolerant and versatile.

[0141] In one embodiment of the present application, after constructing the coordinate point sequence based on the pixel coordinates and the radius, the following steps are included:

[0142] When the radius meets a preset update condition, the corresponding pixel coordinates in the coordinate point sequence are updated, and at the same time, the sequence length of the coordinate point sequence is maintained at a preset length.

[0143] Specifically, the coordinate point sequence S l Initialized to 0, the coordinate point p of the center of the tennis ball i After confirmation, the current time point t can be obtained i , then ((p i , r i ), t i ) format is added to the sequence S l In the l=[((p0,r0),t0),((p1,r1),t1),...,((p Ll ,r Ll ), t Ll )].

[0144] Then traverse the sequence S l , when the radius r i Greater than the minimum radius threshold R min When r i If 1 is subtracted, the original element must be overwritten to update, otherwise the original data will be invalidated.

[0145] It should be noted that for the coordinate point sequence S l The update can be in a real-time loop process, and each time the coordinate point sequence S is obtained l Length L' l , that is, the number of coordinate points included, check whether there is invalid data in the sequence, if so, delete it, if the length L' l >Length is L l , sequence S l Use the latest L l Elements overwrite the original data to always keep the latest front L l The effect of each element / coordinate point.

[0146] As an implementation method, the radius r i Optionally, the coordinate point sequence S can be traversed in each loop. l , get the radius corresponding to each coordinate point, when the radius is greater than the preset minimum radius, subtract 1 to get a new radius, and replace the original radius with the new radius. When the radius is less than the preset minimum radius, the coordinate point is considered to be an invalid coordinate point and is removed to ensure the sequence S l It is updated in real time and does not retain expired elements.

[0147] In an embodiment of the present application, the stored coordinate point queue is updated at pre-designed time intervals, and the data of the tennis ball in the image is quickly saved in different situations to maintain efficiency and timeliness. Unlike binocular cameras or lidars that have problems of long calculation time and high latency, it consumes less computing power on mobile / edge devices.

[0148] In the embodiment of the present application, when the acceleration change meets the preset fluctuation condition, it is determined that the target ball has collided, and the following steps are performed:

[0149] Obtaining the collision time point and the current center coordinate point of the target ball to obtain a first collision point sequence;

[0150] Establishing a second collision point sequence with the same format as the first collision point sequence, and initializing the last time point to be empty;

[0151] Traversing each element in the first collision point sequence, and based on the previous time point and the target time point corresponding to each element, adding the element in the first collision point sequence to the second collision point sequence or deleting the corresponding element in the first collision point sequence according to a preset rule;

[0152] When the second collision point sequence overlaps with the first collision point, the first collision point sequence completes a round of updating.

[0153] Specifically, the first preset parameter I1 and the second preset parameter I2 can be set in advance, and combined with the time point t corresponding to the pixel element i Update the collision point P in the collision point sequence t , the updated collision point sequence W l It can be used for final data output. The specific update process is as follows:

[0154] When the collision point sequence W l If it is empty, no processing is done. If it is not empty, an empty sequence W′ with the same format is created. l , initialize the previous time point t past is None.

[0155] Traverse each element of the sequence, if the previous time point t past If None, add the element to W' l , the previous time point t past = time point t i , that is, the collision point sequence W l The first element (p0, t0) is added to W′ by default l .

[0156] If the previous time point t pas , not None, calculate t i With t past The difference t Δ1 , when the difference t Δ1 When it is not less than the first preset parameter I1, the collision point is added to the sequence W' l , the difference can be calculated by the following formula:

[0157] t Δ1 =t i -t past ;

[0158] Get the current time point t current , traverse the sequence W' l , calculate t current With ti The difference t Δ2 , when the difference t Δ2 When it is greater than the second preset parameter I2, the collision point p is deleted. t .

[0159] It should be noted that when the sequence W′ l Covering the sequence W l , that is, a round of collision point update is completed, and the updated sequence W l If the sequence length is greater than 0, it can be considered that a collision has occurred, and the corresponding collision coordinate position can be obtained.

[0160] In an embodiment of the present application, a sequence of images of a target ball in motion is collected and image processing is performed to obtain the coordinates of the target ball in each frame of the image, and then the corresponding velocity and acceleration are calculated. The acceleration is used to obtain the acceleration change of the target ball in each frame of the image, and the fluctuation of the acceleration of the target ball during collision is used to determine whether a collision has occurred. Only a single monocular camera is required to shoot the process of tennis movement and collision at a top-down angle. There is no need to convert physical coordinates into pixel coordinates, and the collision position and time are obtained simply and accurately. This can improve the detection speed, reduce development costs, and reduce the problem of serious positioning deviation caused by mishitting, thereby reducing equipment costs. The system is applicable to indoor tennis and is conducive to the development of indoor tennis.

[0161] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0162] In one embodiment, a tennis ball collision detection device is provided, which corresponds to the tennis ball collision detection method in the above embodiment. Figure 5 As shown, the tennis ball collision detection device includes an image processing module 10, a coordinate point sequence construction module 20, an acceleration sequence generation module 30, an acceleration change module 40 and a collision detection module 50. The functional modules are described in detail as follows:

[0163] An image processing module 10 is configured to obtain an image sequence of a target ball during its motion, and sequentially process each frame of the image sequence to obtain pixel coordinates and a radius of the center of the target ball relative to the corresponding image.

[0164] A coordinate point sequence construction module 20, configured to construct a coordinate point sequence based on the pixel coordinates and the radius;

[0165] An acceleration sequence generating module 30 is configured to calculate the acceleration sequence of the target ball based on the coordinate point sequence;

[0166] An acceleration change module 40 is used to determine the acceleration change of the target ball in each frame of the image based on the acceleration sequence;

[0167] The collision detection module 50 is configured to determine that a collision has occurred with the target ball when the acceleration change meets a preset fluctuation condition.

[0168] In one embodiment of the present application, the image processing module 10 is further configured to:

[0169] Normalizing multiple color components corresponding to target pixels of each frame of the image in the image sequence;

[0170] Based on the normalized color components, calculate each component in the HSV color space to obtain a new image;

[0171] Based on the components of each pixel in the new image in the HSV color space, a mask image is obtained for distinguishing the target ball from the background;

[0172] Performing a closing operation on the mask image, and performing contour tracing on the mask image after the closing operation to obtain a circular contour;

[0173] Based on the circular outline, the pixel coordinates and radius of the center of the target ball relative to the corresponding image are obtained.

[0174] In one embodiment of the present application, the image processing module 10 is further configured to:

[0175] Calculate the maximum and minimum values ​​of the components through the normalized color components;

[0176] Calculating a component difference based on the component maximum value and the component minimum value;

[0177] Based on the component differences and the normalized color components, each component in the HSV color space is calculated to obtain the new image.

[0178] In one embodiment of the present application, the image processing module 10 is further configured to:

[0179] For each pixel in the new image, the component in the HSV color space;

[0180] When the component in the HSV color space is less than or equal to a first preset threshold and greater than or equal to a second preset threshold, the color of the pixel is set to white; otherwise, the color of the pixel is set to black to obtain a mask image for distinguishing the target ball from the background.

[0181] In one embodiment of the present application, the acceleration sequence generation module 30 is further configured to:

[0182] Copy all elements except the first element in the coordinate point sequence as a new coordinate point sequence;

[0183] Interleaving the coordinate point sequence with the new coordinate point sequence to obtain a first velocity sequence;

[0184] Copy all elements in the speed sequence except the first element as a second speed sequence;

[0185] The first velocity sequence and the second velocity sequence are interleaved and calculated to obtain the acceleration sequence.

[0186] In one embodiment of the present application, the acceleration change module 40 is further configured to:

[0187] Starting from the second acceleration in the acceleration sequence, calculating the acceleration difference between each acceleration and the previous acceleration, and adding the difference to the acceleration change sequence;

[0188] Based on the acceleration change sequence, the acceleration change of the target ball in each frame of the image is determined.

[0189] In one embodiment of the present application, the coordinate point sequence construction module 20 is further configured to:

[0190] Determine all circular regions in each frame of image, and filter out circular regions in each frame of image whose area is smaller than a preset area threshold;

[0191] The pixel coordinates and the variable diameter corresponding to the remaining circle area are added to the pre-constructed coordinate point empty sequence and radius empty sequence respectively to obtain the target coordinate point sequence and target radius sequence;

[0192] When the element in the target coordinate point sequence is not empty, traverse the target coordinate point sequence, calculate the average value between the horizontal coordinate, the vertical coordinate and the radius, and add it as a new element to the target coordinate point sequence; or

[0193] When the elements in the target coordinate point sequence are not empty and the sequence length is greater than a preset value, extracting the first preset elements in the target coordinate point sequence;

[0194] When the vertical coordinates of the first preset elements increase in sequence and the maximum value is greater than a third preset threshold, a new element is added to the target coordinate point sequence to obtain the coordinate point sequence.

[0195] See also Figure 6 In one embodiment of the present application, the apparatus further includes a coordinate point sequence updating module 60, configured to:

[0196] When the radius meets a preset update condition, the corresponding pixel coordinates in the coordinate point sequence are updated, and at the same time, the sequence length of the coordinate point sequence is maintained at a preset length.

[0197] See also Figure 6 In one embodiment of the present application, the apparatus further includes a collision point sequence updating module 70, configured to:

[0198] Obtaining the collision time point and the current center coordinate point of the target ball to obtain a first collision point sequence;

[0199] Establishing a second collision point sequence with the same format as the first collision point sequence, and initializing the last time point to be empty;

[0200] Traversing each element in the first collision point sequence, and based on the previous time point and the target time point corresponding to each element, adding the element in the first collision point sequence to the second collision point sequence or deleting the corresponding element in the first collision point sequence according to a preset rule;

[0201] When the second collision point sequence overlaps with the first collision point, the first collision point sequence completes a round of updating.

[0202] In an embodiment of the present application, a sequence of images of a target ball in motion is collected and image processing is performed to obtain the coordinates of the target ball in each frame of the image, and then the corresponding velocity and acceleration are calculated. The acceleration is used to obtain the acceleration change of the target ball in each frame of the image, and the fluctuation of the acceleration of the target ball during collision is used to determine whether a collision has occurred. Only a single monocular camera is required to shoot the process of tennis movement and collision at a top-down angle. There is no need to convert physical coordinates into pixel coordinates, and the collision position and time are obtained simply and accurately. This can improve the detection speed, reduce development costs, and reduce the problem of serious positioning deviation caused by mishitting, thereby reducing equipment costs. The system is applicable to indoor tennis and is conducive to the development of indoor tennis.

[0203] The specific definition of the tennis ball collision detection device can be found in the definition of the tennis ball collision detection method above and will not be repeated here. Each module in the aforementioned tennis ball collision detection device can be implemented in whole or in part via software, hardware, or a combination thereof. Each of the aforementioned modules can be embedded in or independent of a processor in a computer device in hardware form, or can be stored in a memory in the computer device in software form, so that the processor can call and execute the corresponding operations of each of the aforementioned modules.

[0204] In one embodiment, a computer device is provided. The computer device may be a terminal device, and its internal structure diagram may be as follows: Figure 7As shown. The computer device includes a processor, memory, and a network interface connected via a device bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a readable storage medium. The readable storage medium stores computer-readable instructions. The network interface of the computer device is used to communicate with an external terminal via a network connection. When executed by the processor, the computer-readable instructions implement a tennis ball collision detection method. The readable storage medium provided in this embodiment includes a non-volatile readable storage medium and a volatile readable storage medium.

[0205] In an embodiment of the present application, a computer device is provided, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor. When the processor executes the computer-readable instructions, the steps of the tennis ball collision detection method described above are implemented.

[0206] In an embodiment of the application, a readable storage medium is provided, wherein the readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the tennis ball collision detection method as described above are implemented.

[0207] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through computer-readable instructions. The computer-readable instructions can be stored in a non-volatile readable storage medium or a volatile readable storage medium. When the computer-readable instructions are executed, they can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0208] Those skilled in the art can clearly understand that for the convenience and conciseness of description, only the above-mentioned functional modules and module divisions are used as examples. In actual applications, the above-mentioned functions can be distributed and completed by different functional modules and modules as needed, that is, the internal structure of the device can be divided into different functional modules or modules to complete all or part of the functions described above.

[0209] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention, and should all be included in the scope of protection of the present invention.

Claims

1. A tennis ball collision detection method, characterized in that: Applied to a tennis collision detection device, the tennis collision detection device is set on one side of the collision object, the image acquisition device is set above the tennis movement path, and the shooting line of sight is toward the side of the collision object. The image acquisition device is connected to the tennis collision detection device using a data cable. The tennis collision detection device is responsible for running a method for identifying the collision position of the target ball on the collision object, and the method includes: Acquire an image sequence of the target ball during its motion, and perform image processing on each frame of the image sequence in sequence to obtain pixel coordinates and a radius of the center of the target ball relative to the corresponding image; Constructing a coordinate point sequence based on the pixel coordinates and the radius; Calculating the acceleration sequence of the target ball based on the coordinate point sequence; Determining the acceleration change of the target ball in each frame of image based on the acceleration sequence; When the acceleration change meets a preset fluctuation condition, it is determined that the target ball has collided, wherein the acceleration change includes the acceleration difference between adjacent accelerations, and if the current acceleration difference is greater than zero and the number of times the adjacent acceleration differences of the current acceleration difference are less than zero is greater than the fluctuation parameter, it is determined that the target ball has collided; When the acceleration change meets a preset fluctuation condition, it is determined that the target ball has collided, and the method further includes: Obtaining the collision time point and the current center coordinate point of the target ball to obtain a first collision point sequence; Establishing a second collision point sequence with the same format as the first collision point sequence, and initializing the last time point to be empty; Traversing each element in the first collision point sequence, and based on the previous time point and the target time point corresponding to each element, adding the element in the first collision point sequence to the second collision point sequence or deleting the corresponding element in the first collision point sequence according to a preset rule; When the second collision point sequence covers the first collision point, the first collision point sequence completes a round of updating; if the sequence length of the updated second collision point sequence is greater than 0, it is considered that a collision occurs, and the corresponding collision coordinate position can be obtained.

2. The tennis ball collision detection method according to claim 1, wherein: The sequentially performing image processing on each frame of the image sequence to obtain the pixel coordinates and radius of the center of the target ball relative to the corresponding image includes: Normalizing multiple color components corresponding to target pixels of each frame of the image in the image sequence; Based on the normalized color components, calculate each component in the HSV color space to obtain a new image; Based on the components of each pixel in the new image in the HSV color space, a mask image is obtained for distinguishing the target ball from the background; Performing a closing operation on the mask image, and performing contour tracing on the mask image after the closing operation to obtain a circular contour; Based on the circular outline, the pixel coordinates and radius of the center of the target ball relative to the corresponding image are obtained.

3. The tennis ball collision detection method according to claim 2, wherein: The method of calculating each component in the HSV color space based on the normalized color components to obtain a new image includes: Calculate the maximum and minimum values ​​of the components through the normalized color components; Calculating a component difference based on the component maximum value and the component minimum value; Based on the component differences and the normalized color components, each component in the HSV color space is calculated to obtain the new image.

4. The tennis ball collision detection method according to claim 2, wherein: The step of obtaining a mask image for distinguishing the target ball from the background based on a component of each pixel in the new image in the HSV color space includes: For each pixel in the new image, the component in the HSV color space; When the component in the HSV color space is less than or equal to a first preset threshold and greater than or equal to a second preset threshold, the color of the pixel is set to white; otherwise, the color of the pixel is set to black to obtain a mask image for distinguishing the target ball from the background.

5. The tennis ball collision detection method according to claim 1, wherein: The step of calculating the acceleration sequence of the target ball based on the coordinate point sequence includes: Copy all elements except the first element in the coordinate point sequence as a new coordinate point sequence; Interleaving the coordinate point sequence with the new coordinate point sequence to obtain a first velocity sequence; Copy all elements in the speed sequence except the first element as a second speed sequence; The first velocity sequence and the second velocity sequence are interleaved and calculated to obtain the acceleration sequence.

6. The tennis ball collision detection method according to claim 1, wherein: Determining the acceleration change of the target ball in each frame of image based on the acceleration sequence includes: Starting from the second acceleration in the acceleration sequence, calculating the acceleration difference between each acceleration and the previous acceleration, and adding the difference to the acceleration change sequence; Based on the acceleration change sequence, the acceleration change of the target ball in each frame of the image is determined.

7. The tennis ball collision detection method according to claim 1, wherein: The step of constructing a coordinate point sequence based on the pixel coordinates and the radius includes: Determine all circular regions in each frame of image, and filter out circular regions in each frame of image whose area is smaller than a preset area threshold; The pixel coordinates and the variable diameter corresponding to the remaining circle area are added to the pre-constructed coordinate point empty sequence and radius empty sequence respectively to obtain the target coordinate point sequence and target radius sequence; When the element in the target coordinate point sequence is not empty, traverse the target coordinate point sequence, calculate the average value between the horizontal coordinate, the vertical coordinate and the radius, and add it as a new element to the target coordinate point sequence; or When the elements in the target coordinate point sequence are not empty and the sequence length is greater than a preset value, extracting the first preset elements in the target coordinate point sequence; When the vertical coordinates of the first preset elements increase in sequence and the maximum value is greater than a third preset threshold, a new element is added to the target coordinate point sequence to obtain the coordinate point sequence.

8. The tennis ball collision detection method according to claim 1, wherein: After constructing the coordinate point sequence based on the pixel coordinates and the radius, the method includes: When the radius meets a preset update condition, the corresponding pixel coordinates in the coordinate point sequence are updated, and at the same time, the sequence length of the coordinate point sequence is maintained at a preset length.

9. A tennis ball collision detection device, characterized in that: The tennis ball collision detection device is set on one side of the collision object, and the image acquisition device is set above the tennis ball's motion path, with the shooting line of sight facing the side of the collision object. The image acquisition device is connected to the tennis ball collision detection device using a data cable. The tennis ball collision detection device is responsible for running a method for identifying the collision position of the target ball on the collision object. The device includes: An image processing module is used to obtain an image sequence of the target ball during its motion, and sequentially process each frame of the image sequence to obtain the pixel coordinates and radius of the center of the target ball relative to the corresponding image; A coordinate point sequence construction module, configured to construct a coordinate point sequence based on the pixel coordinates and the radius; An acceleration sequence generating module, configured to calculate the acceleration sequence of the target ball based on the coordinate point sequence; An acceleration change module, configured to determine an acceleration change of the target ball in each frame of image based on the acceleration sequence; a collision detection module, configured to determine that a collision has occurred with the target ball when the acceleration change meets a preset fluctuation condition, wherein the acceleration change includes an acceleration difference between adjacent accelerations, and if a current acceleration difference is greater than zero and the number of times that adjacent acceleration differences of the current acceleration difference are less than zero is greater than a fluctuation parameter, then a collision has occurred with the target ball; Collision point sequence update module, used to: Obtaining the collision time point and the current center coordinate point of the target ball to obtain a first collision point sequence; Establishing a second collision point sequence with the same format as the first collision point sequence, and initializing the last time point to be empty; Traversing each element in the first collision point sequence, and based on the previous time point and the target time point corresponding to each element, adding the element in the first collision point sequence to the second collision point sequence or deleting the corresponding element in the first collision point sequence according to a preset rule; When the second collision point sequence covers the first collision point, the first collision point sequence completes a round of updating; if the sequence length of the updated second collision point sequence is greater than 0, it is considered that a collision occurs, and the corresponding collision coordinate position can be obtained.

Citation Information

Patent Citations

  • Flight parameter measuring apparatus and flight parameter measuring method

    CN109392306A

  • Football shooting moment identification method and device, storage medium and computer device

    CN110543856A

  • Robot collision detection method, device and equipment and computer readable storage medium

    CN111037564A