Ball height estimation method and device, electronic equipment and storage medium

By obtaining target images in the height of the sphere, determining the reference object and the position of the sphere, and calculating the height of the sphere, the problem of low efficiency and accuracy of traditional methods is solved, and a more efficient and accurate altitude of the sphere.

CN119379780APending Publication Date: 2025-01-28IFLYTEK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411222345.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-02
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

Traditional sphere height estimation methods rely on manual observation and measurement, are inefficient and have low accuracy.

Method used

By obtaining the target image, determine the position of the reference object and the sphere, determine the target reference point based on these positions, and use the actual height of the reference object, the position of the sphere, and the target reference point to calculate the actual height of the sphere.

Benefits of technology

It improves the accuracy of the height of the sphere, reduces the demand for manual measurement, improves efficiency and saves costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119379780A_ABST
    Figure CN119379780A_ABST
Patent Text Reader

Abstract

The invention discloses a sphere height estimation method and device, electronic equipment and a storage medium. The method comprises the following steps: acquiring a target image; wherein the target image comprises a reference object and a sphere; determining a reference position of the reference object in the target image and a sphere position of the sphere in the target image; determining a target reference point based on the reference position and the sphere position; wherein the target reference point and the reference position are located at the same height, and the target reference point and the sphere position are located at the same depth plane; and calculating the actual height of the sphere based on the actual height of the reference object, the sphere position and the target reference point. In this way, the height of the sphere can be obtained, and the accuracy of the height of the sphere is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer vision technology, and in particular to a method and device for estimating the height of a sphere, an electronic device, and a storage medium. Background Art

[0002] In sports training, competitions and examinations, it is generally necessary to estimate the height of a sphere to determine the result. However, traditional sphere height estimation methods mainly rely on manual observation and measurement, which is inefficient and has low accuracy. Summary of the invention

[0003] The main technical problem solved by the present application is to provide a method and device for estimating the height of a sphere, an electronic device and a storage medium, which can obtain the height of the sphere and improve the accuracy of the height of the sphere.

[0004] To solve the above technical problems, the first aspect of the present application provides a method for estimating the height of a sphere, the method comprising: acquiring a target image; wherein the target image comprises a reference object and a sphere; determining a reference position of the reference object in the target image and a spherical position of the sphere in the target image; based on the reference position and the spherical position, determining a target reference point; wherein the target reference point and the reference position are at the same height, and the target reference point and the spherical position are at the same depth plane; based on the actual height of the reference object, the spherical position and the target reference point, calculating the actual height of the sphere.

[0005] To solve the above technical problems, the second aspect of the present application provides a sphere height estimation device, which includes: an acquisition module, an identification module, a determination module and a calculation module, the acquisition module is used to acquire a target image; wherein the target image includes a reference object and a sphere; the identification module is used to determine the reference position of the reference object in the target image and the sphere position of the sphere in the target image; the determination module is used to determine the target reference point based on the reference position and the sphere position; wherein the target reference point and the reference position are at the same height, and the target reference point and the sphere position are at the same depth plane; the calculation module is used to calculate the actual height of the sphere based on the actual height of the reference object, the sphere position and the target reference point.

[0006] To solve the above technical problem, the third aspect of the present application provides an electronic device, which includes a memory and a processor, the memory stores program instructions, and the processor is used to execute the program instructions to implement the method provided by the first aspect above.

[0007] In order to solve the above technical problems, the fourth aspect of the present application provides a computer-readable storage medium, which is used to store program instructions, and the program instructions can be executed to implement the method provided by the first aspect above.

[0008] The beneficial effects of the present application are as follows: Different from the prior art, after the present application determines the reference position of the reference object in the target image and the spherical position of the sphere in the target image, based on the reference position and the spherical position, the target reference point is determined; finally, based on the actual height of the reference object, the spherical position and the target reference point, the actual height of the sphere is calculated. Since the target reference point is at the same height as the reference position and is in the same depth plane as the spherical position, the accuracy of calculating the actual height of the sphere based on the actual height of the reference object, the spherical position and the target reference point is improved. Furthermore, the present application does not require manual measurement of the actual height of the sphere, which can improve efficiency and save costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] Figure 1 It is a flow chart of an implementation method of a sphere height estimation method provided by the present application;

[0010] Figure 2 is a schematic diagram of an embodiment of a court and a reference object provided by the present application;

[0011] Figure 3 It is a flow chart of another embodiment of the method for estimating the height of a sphere provided by the present application;

[0012] Figure 4 It is a schematic diagram of the framework structure of an embodiment of a sphere height estimation device provided by the present application;

[0013] Figure 5 It is a schematic diagram of the framework structure of an embodiment of an electronic device provided by the present application;

[0014] Figure 6 It is a schematic diagram of the framework structure of an implementation scheme of a computer-readable storage medium provided in this application. DETAILED DESCRIPTION

[0015] The following is a clear and complete description of the technical solutions in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0016] It should be noted that in the embodiments of the present application, there are descriptions involving "first", "second", etc., which are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" or "second" may explicitly or implicitly include at least one of the features.

[0017] In the description of the application, the meaning of "multiple" is at least two, for example, two, three, etc., unless otherwise clearly and specifically limited. In the embodiment of the present application, all directional indications (such as up, down, left, right, front, back ...) are only used to explain the relative position relationship, movement, etc. between the components under a certain specific posture (as shown in the drawings). If the specific posture changes, the directional indication also changes accordingly. In addition, the terms "including" and "having" and any of their deformations are intended to cover non-exclusive inclusions. For example, the process, method, system, product or equipment comprising a series of steps or units is not limited to the steps or units listed, but optionally also includes the steps or units not listed, or optionally also includes other steps or units inherent to these processes, methods, products or equipment.

[0018] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0019] The inventor has discovered through exploration that the existing sphere height estimation schemes include a method based on fixed point calibration of image processing technology and a method based on binocular stereo vision. The method based on fixed point calibration of image processing technology can only determine whether the sphere reaches the height line when the camera position is fixed and the sphere movement is limited to the same depth plane, thereby achieving the purpose of counting. However, the changes in the movement of the sphere in the depth direction are often complex and changeable, and this dynamic change of the sphere will bring about a huge prediction error. The method based on binocular stereo vision requires strict synchronization of the internal and external parameters of the camera and the binocular camera, and has high requirements on software and hardware.

[0020] In order to solve the shortcomings of the existing solutions, the sphere height estimation method provided in the present application determines the reference position of the reference object in the target image and the sphere position of the sphere in the target image, and then determines the target reference point at the same height as the reference position and in the same depth plane as the sphere position based on the reference position and the sphere position; finally, the actual height of the sphere is calculated based on the actual height of the reference object, the sphere position and the target reference point. The present application has no restrictions on the camera position and the sphere depth, that is, for scenes where the camera position is not fixed and the sphere moves arbitrarily and quickly at different depths, the sphere height can be effectively and accurately identified through a monocular height vision assessment algorithm, which provides certain reference value for the field of sports and analysis.

[0021] Please refer to Figure 1 and Figure 2 , Figure 1 is a flow chart of an embodiment of a sphere height estimation method provided in the present application, Figure 2 is a schematic diagram of an embodiment of a court and a reference object provided by the present application. The method for estimating the height of a sphere includes:

[0022] S11: Acquire a target image.

[0023] In one embodiment, the target image may include the entire court, and a reference object may be set in the court, so the target image may include a reference object and a sphere, and the reference object may include one or more, and the sphere may be a volleyball, a badminton, etc. The reference object may be any material, and the reference object may be set at a preset height, and the preset height may be equal to the height at which the sphere passes the test. Taking a volleyball as an example, the qualified height for a men's volleyball is 2.35 meters, and the qualified height for a women's volleyball is 2.15 meters, so the reference object may be set at any position within the court at 2.35 meters or 2.15 meters.

[0024] In one embodiment, the bottom of the reference object can be set at a first preset height, which can be 2.15 meters; the top of the reference object can be set at a second preset height, which can be 2.35 meters, so that the reference object can be used to test whether different ball hitters are qualified. The difference between the second preset height and the first preset height is equal to the actual length of the reference object. The actual diameter of the sphere can be the same as the actual length of the reference object. It can be understood that in other embodiments, the actual diameter of the sphere can also be different from the actual length of the reference object.

[0025] In a specific embodiment, the reference object may be a sleeve, and a pole may be provided at each of the four corners of the court. The pole is used to define the boundary of the court, and the sleeve may be provided on any pole. The bottom of the sleeve is located at a position where the pole is 2.15 meters above the ground, and the top of the sleeve is located at a position where the pole is 2.35 meters above the ground. If there are multiple sleeves, the multiple sleeves are provided on different poles.

[0026] In one embodiment, the target image may be an initial image obtained by photographing the court with an imaging element, or may be an image obtained after distortion correction is performed on the initial image. The imaging element may be a monocular camera, a binocular camera, etc. The distortion correction may specifically be processing the initial image with camera parameters and distortion parameters, and the camera parameters and distortion parameters are obtained by calibrating the camera.

[0027] The calibration process is as follows: focus the camera, and the focusing process covers 108 different focal length settings to cover a wide range of focal lengths; after focusing, the camera is accurately calibrated using a calibration plate with a checkerboard to obtain images taken at different angles; the camera intrinsic parameters and distortion parameters at each focal length are accurately calculated using the corner detection and calibration algorithm in Matlab, and finally a detailed dictionary is constructed, which contains 108 focal length settings, each of which is associated with the corresponding camera intrinsic parameters and distortion coefficients. In this way, users can easily achieve precise control of the camera focal length and quickly obtain detailed camera parameters at each focal length, thereby achieving the best image quality and analysis effects in various visual applications.

[0028] S12: Determine a reference position of the reference object in the target image and a spherical position of the sphere in the target image.

[0029] In one embodiment, the target image can be identified to obtain the reference position and the sphere position. Specifically, a target detection algorithm can be used to detect the sphere and the reference object in the target image. The target detection algorithm includes but is not limited to YOLOX, R-CNN, and RetinaNet.

[0030] In another embodiment, before identifying the reference object, the step further includes: calibrating the position of the reference object. The position of the reference object can be represented by the center point of the reference object, the top center point of the reference object, or the bottom center point of the reference object, or can be determined by the bottom center point of the reference object and the top center point of the reference object. Taking the reference object as a sleeve as an example, the top center point of the sleeve and the bottom center point of the sleeve can be calibrated. It can be understood that the step of calibrating the position of the reference object is performed after the camera position is fixed. If the camera position changes, recalibration is required. After the position of the reference object is calibrated, the camera takes a new image, and the position of the reference object in the new image can be directly obtained.

[0031] In one embodiment, a line segment may be determined based on the pixel coordinates of the bottom center point of the reference object and the pixel coordinates of the top center point of the reference object, and the position of the line segment represents the reference position of the reference object, such as Figure 2 As shown, Figure 2 The middle line segment AC, the line segment EG, the line segment FH and the line segment BD represent a reference object respectively; the pixel coordinates of the center point of the bottom of the reference object and the pixel coordinates of the center point of the top of the reference object may also be used to represent the position of the reference object. The spherical position of the sphere may be the position of the center point of the sphere, the position of the upper edge of the sphere, or the position of the lower edge of the sphere. In a specific embodiment, the position of the upper edge of the sphere may be the center point of the upper edge of the sphere; similarly, the position of the lower edge of the sphere may be the center point of the lower edge of the sphere.

[0032] S13: Determine the target reference point based on the reference position and the spherical position.

[0033] In one embodiment, the target reference point is at the same height as the reference position and at the same depth plane as the spherical position. If the reference position is represented by a point, which may be the center point of the reference object or the top center point of the reference object or the bottom center point of the reference object, then the target reference point is at the same height as the reference position; if the reference position is determined by the top center point of the reference object and the bottom center point of the reference object, then the target reference point may be at the same height as the top center point of the reference object or the bottom center point of the reference object. The target reference point and the spherical position being at the same depth plane can be understood as that in the real world, the three-dimensional coordinates of the target reference point and the three-dimensional coordinates of the spherical position have one coordinate value that is the same, and the other coordinate values ​​are the same or different. Figure 2 As shown, Figure 2 The midpoint K is the target reference point, and the x coordinate of the target reference point is the same as the x coordinate in the three-dimensional coordinates of the sphere position. It can be understood that, depending on the coordinate system, in other embodiments, the y coordinate of the target reference point can also be the same as the y coordinate in the three-dimensional coordinates of the sphere position.

[0034] The target reference point can be obtained based on the reference height line. Specifically, based on the sphere position, the diameter pixel size of the sphere diameter is determined; and based on the reference position, the reference pixel size of the reference object is determined; based on the reference pixel size and the diameter pixel size, a reference height line in the same depth plane as the sphere position is determined; the second axial coordinate in the sphere position is substituted into the equation of the reference height line to obtain the second axial coordinate of the target reference point; based on the second axial coordinate in the sphere position and the first axial coordinate of the target reference point, the target reference point is obtained.

[0035] In one embodiment, the diameter of the sphere can be determined based on the position of the sphere. Specifically, the two endpoints of the line segment where the diameter of the sphere is located are obtained, and the diameter pixel size is calculated according to the pixel coordinates of the two endpoints. For example, the diameter pixel size can be calculated using the Euclidean distance formula. In a specific embodiment, the center points of the upper and lower edges of the sphere can be obtained, and the diameter pixel size can be obtained according to the pixel coordinates of the two center points.

[0036] Similarly, the reference pixel size of the reference object can be obtained based on the reference position. Specifically, the pixel coordinates of the top center point of the reference object and the pixel coordinates of the bottom center point of the reference object can be obtained, and the reference pixel size can be calculated based on the pixel coordinates of the top center point of the reference object and the pixel coordinates of the bottom center point of the reference object using the Euclidean distance formula.

[0037] In the above implementation, the diameter pixel size and the reference pixel size can respectively reflect the height information of the sphere and the reference object. In certain cases, such as when the camera is facing forward and no distortion occurs, the depth ratio of the object is positively correlated with the height ratio of the object. Therefore, the depth ratio of the sphere and the reference object can be determined based on the ratio of the diameter pixel size and the reference pixel size. The depth of the sphere represents the distance information between the sphere and the camera, and the depth of the reference object represents the distance information between the reference object and the camera. Based on the depth ratio of the sphere and the reference object, at least one reference point in the same depth plane as the position of the sphere is determined, and a reference height line is determined based on the reference point, so as to obtain the target reference point based on the reference height line.

[0038] Specifically, in one embodiment, the depth of the reference object can be predetermined, and the depth of the sphere is obtained based on the depth ratio of the sphere and the reference object, and then the depth plane is determined, and at least one reference point is determined from the depth plane. In this embodiment, the number of reference objects can be one or more, which is not specifically limited here.

[0039] In another embodiment, the number of reference objects includes at least two, and any two reference objects are located on the same side of the camera element that captures the target image, and the camera element may face the court, for example, the camera element may be located on the center line of the court. If there are two reference objects, both reference objects are located on the first side of the camera element; if there are three reference objects, two reference objects may be located on the first side of the camera element, and the remaining reference object may be located on the second side of the camera element; if there are four reference objects, two reference objects may be located on the first side of the camera element, and the other two reference objects may be located on the second side of the camera element, and the second side is opposite to the first side.

[0040] In a specific embodiment, taking the number of reference objects as two as an example, at least one reference point in the same depth plane as the position of the sphere is determined based on the two reference objects. Specifically, a first difference between the first reference pixel size of the first reference object and the diameter pixel size of the diameter of the sphere is obtained, and a second difference between the first reference pixel size and the second reference pixel size of the second reference object is obtained. A second ratio between the first difference and the second difference is determined. Based on the proportional relationship between the second ratio and the target ratio, the pixel coordinates of at least one reference point are determined; wherein the target ratio is determined based on the first distance between the reference point and the target reference object and the second distance between the two reference objects; in an embodiment, the second ratio is equal to the target ratio, the first distance between the reference point and the target reference object can be the distance between the reference point and the top center point of the target reference object, and the second distance between the two reference objects can be the distance between the top center points of the two reference objects. Or the first distance between the reference point and the target reference object can be the distance between the reference point and the bottom center point of the target reference object, and the second distance between the two reference objects can be the distance between the bottom center points of the two reference objects. Based on the pixel coordinates of at least one reference point, a reference height line is obtained, and the reference height line passes through at least one reference point. In this implementation manner, the pixel coordinates of a reference point can be obtained through two reference objects, and a line passing through the reference point and perpendicular to the two reference objects can be determined as a reference height line.

[0041] In another specific embodiment, Figure 2 As shown, there are four reference objects; the first reference object AC and the second reference object EG are located on the first side of the imaging element, the third reference object BD and the fourth reference object FH are located on the second side of the imaging element, and the first side and the second side are opposite; the target ratio includes the third ratio and the fourth ratio, and the at least one reference point includes the first reference point s1 and the second reference point s2. After obtaining the second ratio, the pixel coordinates of the first reference point s1 can be determined based on the proportional relationship between the second ratio and the third ratio; the pixel coordinates of the second reference point s2 can be determined based on the proportional relationship between the second ratio and the fourth ratio; finally, the reference height line s1s2 is obtained based on the pixel coordinates of the first reference point s1 and the pixel coordinates of the second reference point s2.

[0042] The third ratio is the ratio of the third distance between the first reference point s1 and the first reference object AC to the fourth distance between the first reference object AC and the second reference object EG; the fourth ratio is the ratio of the fifth distance between the second reference point s2 and the third reference object BD to the sixth distance between the third reference object BD and the fourth reference object FH. In this embodiment, the reference height line s1s2, at this time, the actual height of the reference height line is the same as the actual height of the top center point of the reference object. Figure 2As shown, at this time, the third distance is the distance from the first reference point s1 to the top center point of the first reference object AC (i.e. Figure 2 The fourth distance is the distance between the top center point of the first reference object AC and the top center point of the second reference object EG (i.e. Figure 2 The fifth distance is the distance between the second reference point s2 and the top center point of the third reference object BD (i.e. Figure 2 The sixth distance is the distance between the top center point of the third reference object BD and the top center point of the fourth reference object FH (i.e. Figure 2 The distance between point F).

[0043] In other embodiments, the third distance may also be the distance from the first reference point s1 to the bottom center point of the first reference object AC (ie Figure 2 The fourth distance may also be the distance between the bottom center point of the first reference object AC and the bottom center point of the second reference object EG (i.e. Figure 2 The fifth distance is the distance between the second reference point s2 and the bottom center point of the third reference object BD (i.e. Figure 2 The sixth distance is the distance between the bottom center point of the third reference object BD and the bottom center point of the fourth reference object FH (i.e. Figure 2 At this time, the actual height of the reference height line is the same as the actual height of the bottom center point of the reference object.

[0044] In the above embodiment, the proportional relationship is shown in the following formula.

[0045]

[0046] Where d1 is the first reference pixel size of the first reference object, d is the diameter pixel size, d2 is the second reference pixel size of the second reference object, and AS1 is the distance from the first reference point s1 to the top center point of the first reference object AC (i.e. Figure 2 AE is the distance between the top center point of the first reference object AC and the top center point of the second reference object EG (i.e. Figure 2 BS2 is the distance from the second reference point s2 to the top center point of the third reference object BD (i.e. Figure 2 BF is the distance between the top center point of the third reference object BD and the top center point of the fourth reference object FH (i.e. Figure 2 The distance between point F).

[0047] It can be understood that in other implementations, d1 may also be the third reference pixel size of the third reference object, and d2 may also be the fourth reference pixel size of the fourth reference object.

[0048] In a specific implementation, the imaging element may be located on the center line of the court, and the four reference objects are located at the four corners of the court respectively. The court is square, and the pixel sizes of the reference objects may be represented by the average pixel size. Specifically, the four reference objects may be divided into two groups, and the distances of the two reference objects in the same group from the imaging element are close, and the two reference objects in the same group are located on the same side of the imaging element. Then, the average pixel size of the two reference objects in the same group may be calculated, and the average pixel size is used as the reference pixel size of the two reference objects.

[0049] S14: Calculate the actual height of the sphere based on the actual height of the reference object, the position of the sphere, and the target reference point.

[0050] In one embodiment, the pixel coordinate change value of the first axial coordinate in the spherical position relative to the first axial coordinate of the target reference point can be determined first, the first axial coordinate represents the coordinate in the height direction, and the spherical position in the target image can be represented by two coordinate values, one coordinate value represents the first axial coordinate, and the other coordinate value represents the second axial coordinate. The first axial coordinate in the spherical position is obtained, and the first axial coordinate in the target reference point is obtained, and the first axial coordinate in the spherical position is subtracted from the first axial coordinate in the target reference point to obtain the pixel coordinate change value.

[0051] Further, based on the pixel coordinate change value, the actual height change value of the sphere position relative to the target reference point in the actual space is determined. In one embodiment, a first ratio between the pixel coordinate change value and the diameter pixel size of the sphere diameter in the target image can be obtained; the product of the first ratio and the actual diameter of the sphere is used as the actual height change value. In other embodiments, the actual height change value can also be determined based on the pixel coordinate change value and the camera's internal parameters, external parameters and other parameters.

[0052] Finally, based on the actual height of the reference object and the actual height change value, the actual height of the sphere is obtained. In one embodiment, the actual height of the reference object and the actual height change value can be summed to obtain the actual height of the sphere, which is the height of the sphere in the real world. Through geometric relationships and proportional conversion, the height of the sphere in the real world can be accurately calculated. The method provided by the present application can realize the rapid and accurate calculation of the height of the sphere in complex weather scenes, unfixed camera positions, changes in the distance of the venue, and volleyball sports scenes.

[0053] In a specific implementation, taking the actual height of the reference object as 2.35 m and the actual diameter of the sphere as 0.2 m as an example, the actual height of the sphere can be calculated using the following formula.

[0054]

[0055] Where h is the actual height of the sphere, y is the first axial coordinate in the sphere position, y1 is the first axial coordinate in the target reference point, and d is the diameter pixel size of the sphere diameter.

[0056] In the above method, after determining the reference position of the reference object in the target image and the spherical position of the sphere in the target image, the target reference point is determined based on the reference position and the spherical position; finally, the actual height of the sphere is calculated based on the actual height of the reference object, the spherical position and the target reference point. Since the target reference point is at the same height as the reference position and is in the same depth plane as the spherical position, the accuracy of calculating the actual height of the sphere based on the actual height of the reference object, the spherical position and the target reference point is improved. Furthermore, the present application does not require manual measurement of the actual height of the sphere, which can improve efficiency and save costs.

[0057] Furthermore, the present application also provides a method for determining whether a sphere has crossed a line. After obtaining the reference height line in the above implementation, any two reference points located on the reference height line are selected; based on the sphere position and the pixel coordinates of the any two reference points, it is determined whether the sphere has crossed the reference height line.

[0058] Specifically, the position of the sphere is cross-multiplied with the pixel coordinates of any two reference points to obtain a first cross-multiplication result corresponding to each of the two reference points; and a first product between each first cross-multiplication result is obtained; a preset pixel point is obtained; the pixel coordinates of the preset pixel point are cross-multiplied with the pixel coordinates of any two reference points to obtain a second cross-multiplication result corresponding to each of the two reference points; and a second product between each second cross-multiplication result is obtained; based on the first product, the second product and the positional relationship between the preset pixel point and the reference height line, it is determined whether the sphere exceeds the reference height line.

[0059] by Figure 2 For example, Figure 2 The actual height of the reference height line is the same as the actual height of the top center point of the reference object, that is, the actual height of the reference height line is 2.35m, which represents the qualified height of men's volleyball. The actual diameter of the sphere is the same as the actual height of the reference object. Therefore, if the hitter is a man, the position of the bottom center point of the sphere can be used to represent the position of the sphere to determine whether the bottom center point of the sphere exceeds the reference height line. If so, it is qualified. If the hitter is a woman, the position of the top center point of the sphere can be used to represent the position of the sphere to determine whether the top center point of the sphere exceeds the reference height line. If so, it is qualified.

[0060] Among them, the preset pixel point can be set as needed, and the preset pixel point is a pixel point located above or below the reference height line. If the directions represented by the first product and the second product are the same, it means that the position of the sphere and the position of the preset pixel point relative to the reference height line are the same, and both are located above or below the reference height line. If the directions represented by the first product and the second product are opposite, it means that the position of the sphere and the position of the preset pixel point relative to the reference height line are opposite, one is located above the reference height line, and the other is located below the reference height line.

[0061] In this embodiment, it is not necessary to calculate the actual height of the ball to determine whether the ball has crossed the line, and then determine whether the player is qualified. In other embodiments, the actual height of the ball can also be calculated to determine whether the entity height has crossed the line.

[0062] See also Figure 3 , Figure 3 It is a flow chart of another implementation of the sphere height estimation method provided in the present application.

[0063] S31: Acquire a target image.

[0064] S32: Determine a reference position of the reference object in the target image and a spherical position of the sphere in the target image.

[0065] S33: Based on the position of the sphere, determine the diameter pixel size of the sphere diameter; and based on the reference position, determine the reference pixel size of the reference object.

[0066] S34: Based on the diameter pixel size and the reference pixel size, determine a reference height line that is in the same depth plane as the sphere position.

[0067] S35: Determine a target reference point based on the reference height line.

[0068] S36: Calculate the actual height of the sphere based on the actual height of the reference object, the position of the sphere and the target reference point.

[0069] Among them, the specific implementation of steps S31-S36 please refer to the above implementation, which will not be repeated here.

[0070] See also Figure 4 , Figure 4 It is a schematic diagram of the framework structure of an embodiment of a sphere height estimation device provided in the present application.

[0071] The sphere height estimation device 40 includes an acquisition module 41, an identification module 42, a determination module 43 and a calculation module 44, wherein the acquisition module 41 is used to acquire a target image; wherein the target image includes a reference object and a sphere; the identification module 42 is used to determine a reference position of the reference object in the target image and a sphere position of the sphere in the target image; the determination module 43 is used to determine a target reference point based on the reference position and the sphere position; wherein the target reference point is at the same height as the reference position, and the target reference point is at the same depth plane as the sphere position; the calculation module 44 is used to calculate the actual height of the sphere based on the actual height of the reference object, the sphere position and the target reference point.

[0072] Through the acquisition module 41, the recognition module 42, the determination module 43 and the calculation module 44, it is possible to flexibly use geometric relationships and proportional conversions to accurately calculate the height of the sphere in the real world. This calculation method can quickly and accurately calculate the height of the sphere in complex weather scenes, unstable camera positions, changing venue distances, and volleyball sports scenes.

[0073] In one embodiment, the calculation module 44 is also used to determine the pixel coordinate change value of the first axial coordinate in the spherical position relative to the first axial coordinate of the target reference point, the first axial coordinate representing the coordinate in the height direction; based on the pixel coordinate change value, determine the actual height change value of the spherical position relative to the target reference point in the actual space; based on the actual height of the reference object and the actual height change value, obtain the actual height of the sphere.

[0074] In one embodiment, the calculation module 44 is further used to obtain a first ratio between the pixel coordinate change value and the diameter pixel size of the sphere diameter in the target image; and the product of the first ratio and the actual diameter of the sphere is used as the actual height change value.

[0075] In one embodiment, the determination module 43 is also used to determine the diameter pixel size of the sphere diameter based on the sphere position; and determine the reference pixel size of the reference object based on the reference position; determine the reference height line in the same depth plane as the sphere position based on the diameter pixel size and the reference pixel size; substitute the second axial coordinate in the sphere position into the equation of the reference height line to obtain the second axial coordinate of the target reference point; obtain the target reference point based on the second axial coordinate in the sphere position and the first axial coordinate of the target reference point.

[0076] In one embodiment, the number of reference objects includes at least two; the two reference objects are located on the same side of the camera element that captures the target image; the determination module 43 is also used to obtain a first difference between a first reference pixel size and a diameter pixel size of the first reference object, and to obtain a second difference between the first reference pixel size and a second reference pixel size of the second reference object; determine a second ratio between the first difference and the second difference; based on the proportional relationship between the second ratio and the target ratio, determine the pixel coordinates of at least one reference point; wherein the target ratio is determined based on a first distance from a reference point to a target reference point and a second distance between the two reference objects; based on the pixel coordinates of at least one reference point, obtain a reference height line, and the reference height line passes through at least one reference point.

[0077] In one embodiment, the number of reference objects is four; the first reference object and the second reference object are located on the first side of the imaging element, the third reference object and the fourth reference object are located on the second side of the imaging element, and the first side and the second side are opposite to each other; the target ratio includes a third ratio and a fourth ratio, and at least one reference point includes a first reference point and a second reference point; the determination module 43 is also used to determine the pixel coordinates of the first reference point based on the proportional relationship between the second ratio and the third ratio; wherein the third ratio is the ratio of the third distance between the first reference point and the first reference object to the fourth distance between the first reference object and the second reference; based on the proportional relationship between the second ratio and the fourth ratio, the pixel coordinates of the second reference point are determined; wherein the fourth ratio is the ratio of the fifth distance between the second reference point and the third reference object to the sixth distance between the third reference object and the fourth reference; based on the pixel coordinates of the first reference point and the pixel coordinates of the second reference point, a reference height line is obtained.

[0078] In one embodiment, the sphere height estimation device 40 further includes a judgment module, which is used to select any two reference points located on the reference height line; based on the sphere position and the pixel coordinates of the any two reference points, determine whether the sphere exceeds the reference height line.

[0079] In one embodiment, the judgment module is also used to cross-multiply the position of the sphere with the pixel coordinates of any two reference points, to obtain a first cross-multiplication result corresponding to each of the any two reference points; and obtain a first product between each first cross-multiplication result; obtain a preset pixel point; cross-multiply the pixel coordinates of the preset pixel point with the pixel coordinates of any two reference points, to obtain a second cross-multiplication result corresponding to each of the any two reference points; and obtain a second product between each second cross-multiplication result; based on the first product, the second product and the positional relationship between the preset pixel point and the reference height line, determine whether the sphere exceeds the reference height line.

[0080] In one implementation, the acquisition module 41 is further used to acquire an initial image; and perform distortion correction on the initial image to obtain a target image.

[0081] In one embodiment, the ball is a volleyball.

[0082] In one embodiment, the actual length of the reference object is the same as the actual diameter of the sphere, the bottom of the reference object is set at a first preset height, the top of the reference object is set at a second preset height, and the difference between the second preset height and the first preset height is equal to the actual length of the reference object.

[0083] In one embodiment, the number of the reference objects is four, and the four reference objects are respectively arranged at the four corners of the volleyball court.

[0084] See also Figure 5 , Figure 5 It is a schematic diagram of the framework structure of an embodiment of an electronic device provided in the present application.

[0085] The electronic device 50 includes a memory 51 and a processor 52 coupled to each other, the memory 51 stores program instructions, and the processor 52 is used to execute the program instructions stored in the memory 51 to implement the steps of any of the above method implementations. In a specific implementation scenario, the electronic device 50 may include, but is not limited to: a microcomputer, a server, and in addition, the electronic device 50 may also include a mobile device such as a laptop computer and a tablet computer, which is not limited here.

[0086] Specifically, the processor 52 is used to control itself and the memory 51 to implement the steps of any of the above-mentioned method implementation methods. The processor 52 can also be called a CPU (Central Processing Unit). The processor 52 may be an integrated circuit chip with signal processing capabilities. The processor 52 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 52 can be implemented by an integrated circuit chip.

[0087] See also Figure 6 , Figure 6 It is a schematic diagram of the framework structure of an implementation scheme of a computer-readable storage medium provided in this application.

[0088] The computer-readable storage medium 60 stores program instructions 61 , and when the program instructions 61 are executed by a processor, they are used to implement the steps of any of the above-mentioned method implementations.

[0089] The computer-readable storage medium 60 may specifically be a medium that can store computer programs, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or may be a server that stores the computer program. The server may send the stored computer program to other devices for execution, or may also execute the stored computer program itself.

[0090] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.

[0091] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0092] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0093] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0094] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.

[0095] If the technical solution of this application involves personal information, the product using the technical solution of this application has clearly informed the personal information processing rules and obtained the individual's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using the technical solution of this application has obtained the individual's separate consent before processing the sensitive personal information, and at the same time meets the "explicit consent" requirement. For example, on personal information collection devices such as cameras, clear and prominent signs are set to inform that the personal information collection scope has been entered and personal information will be collected. If the individual voluntarily enters the collection scope, it is deemed that he or she agrees to the collection of his or her personal information; or on the device that processes personal information, the personal information processing rules are notified by obvious signs / information, and the individual's authorization is obtained through pop-up information or by asking the individual to upload his or her personal information; among them, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the type of personal information processed.

[0096] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A method for estimating the height of a sphere, characterized in that: include: Acquire a target image; wherein the target image includes a reference object and a sphere; Determine a reference position of the reference object in the target image and a spherical position of the sphere in the target image; Based on the reference position and the spherical position, determining a target reference point; wherein the target reference point is at the same height as the reference position and at the same depth plane as the spherical position; Based on the actual height of the reference object, the sphere position and the target reference point, the actual height of the sphere is calculated.

2. The method according to claim 1, characterized in that The step of calculating the actual height of the sphere based on the actual height of the reference object, the position of the sphere and the target reference point comprises: Determine a pixel coordinate change value of a first axial coordinate in the spherical position relative to a first axial coordinate of the target reference point, wherein the first axial coordinate represents a coordinate in a height direction; Based on the pixel coordinate change value, determining an actual height change value of the sphere position relative to the target reference point in the actual space; Based on the actual height of the reference object and the actual height change value, the actual height of the sphere is obtained.

3. The method according to claim 2, characterized in that The determining, based on the pixel coordinate change value, an actual height change value of the sphere position relative to the target reference point in the actual space comprises: Acquire a first ratio between the pixel coordinate change value and a diameter pixel size of the diameter of the sphere in the target image; The product of the first ratio and the actual diameter of the sphere is used as the actual height change value.

4. The method according to claim 1, characterized in that The step of determining a target reference point based on the reference position and the spherical position includes: Determine the diameter pixel size of the diameter of the sphere based on the sphere position; and determine the reference pixel size of the reference object based on the reference position; Determining a reference height line in the same depth plane as the position of the sphere based on the diameter pixel size and the reference pixel size; Substituting the second axial coordinate in the spherical position into the equation of the reference height line to obtain the second axial coordinate of the target reference point; The target reference point is obtained based on the second axial coordinate in the spherical position and the first axial coordinate of the target reference point.

5. The method according to claim 4, characterized in that The number of the reference objects includes at least two; the two reference objects are located on the same side of the imaging element that captures the target image; The step of determining a reference height line located in the same depth plane as the position of the sphere based on the diameter pixel size and the reference pixel size comprises: Obtaining a first difference between a first reference pixel size of a first reference object and the diameter pixel size, and obtaining a second difference between the first reference pixel size and a second reference pixel size of a second reference object; determining a second ratio between the first difference and the second difference; Determine the pixel coordinates of at least one reference point based on a proportional relationship between the second ratio and a target ratio; wherein the target ratio is determined based on a first distance between the reference point and a target reference point and a second distance between the two reference objects; The reference height line is obtained based on the pixel coordinates of the at least one reference point, and the reference height line passes through the at least one reference point.

6. The method according to claim 5, characterized in that The number of the reference objects is four; the first reference object and the second reference object are located on a first side of the imaging element, the third reference object and the fourth reference object are located on a second side of the imaging element, and the first side and the second side are opposite; the target ratio includes a third ratio and a fourth ratio, and the at least one reference point includes a first reference point and a second reference point; The step of determining the pixel coordinates of at least one reference point based on the proportional relationship between the second ratio and the target ratio includes: Determine the pixel coordinates of the first reference point based on a proportional relationship between the second ratio and the third ratio; wherein the third ratio is a ratio of a third distance between the first reference point and the first reference object to a fourth distance between the first reference object and the second reference object; Determine the pixel coordinates of the second reference point based on the proportional relationship between the second ratio and the fourth ratio; wherein the fourth ratio is a ratio of a fifth distance between the second reference point and the third reference object to a sixth distance between the third reference object and the fourth reference object; The obtaining the reference height line based on the pixel coordinates of the at least one reference point comprises: The reference height line is obtained based on the pixel coordinates of the first reference point and the pixel coordinates of the second reference point.

7. The method according to claim 4, characterized in that After determining a reference height line in the same depth plane as the position of the sphere based on the reference position and the diameter of the sphere in the target image, the method further includes: Select any two reference points located on the reference height line; Based on the position of the sphere and the pixel coordinates of the arbitrary two reference points, it is determined whether the sphere exceeds the reference height line.

8. The method according to claim 7, characterized in that The step of determining whether the sphere exceeds the reference height line based on the position of the sphere and the pixel coordinates of the arbitrary two reference points includes: Cross-multiply the sphere position with the pixel coordinates of the two arbitrary reference points respectively to obtain first cross-multiplication results corresponding to the two arbitrary reference points; and obtain a first product between the first cross-multiplication results; Get the preset pixel point; Cross-multiplying the pixel coordinates of the preset pixel point with the pixel coordinates of the two arbitrary reference points respectively to obtain second cross-multiplication results corresponding to the two arbitrary reference points; and obtaining a second product between the second cross-multiplication results; Based on the first product, the second product, and a positional relationship between the preset pixel point and the reference height line, it is determined whether the sphere exceeds the reference height line.

9. The method according to claim 1, characterized in that: The acquiring of the target image comprises: Get the initial image; The initial image is subjected to distortion correction to obtain the target image.

10. The method according to claim 1, characterized in that The sphere is a volleyball; And / or, the actual length of the reference object is the same as the actual diameter of the sphere, the bottom of the reference object is set at a first preset height, the top of the reference object is set at a second preset height, and the difference between the second preset height and the first preset height is equal to the actual length of the reference object; And / or, the number of the reference objects is four, and the four reference objects are respectively located at four corners of the volleyball court.

11. A sphere height estimation device, characterized in that: include: An acquisition module, used to acquire a target image; wherein the target image includes a reference object and a sphere; A recognition module, used for determining a reference position of the reference object in the target image and a spherical position of the sphere in the target image; A determination module, configured to determine a target reference point based on the reference position and the spherical position; wherein the target reference point and the reference position are at the same height, and the target reference point and the spherical position are at the same depth plane; A calculation module is used to calculate the actual height of the sphere based on the actual height of the reference object, the position of the sphere and the target reference point.

12. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein the memory stores program instructions, and the processor is configured to execute the program instructions to implement the method according to any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store program instructions, and the program instructions can be executed to implement the method according to any one of claims 1 to 10.