Method for measuring the rotation of a sphere based on machine vision and related apparatus

CN117722978BActive Publication Date: 2026-08-11SHENZHEN GREENJOY TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-11
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

[0005]有鉴于此,本申请提供了一种基于机器视觉的球体旋转测量按方法、装置、电子设备以及存储介质,以解决球体旋转值测量存在转速阈值限定的问题

Benefits of technology

[0016]This application provides a machine vision-based method and related equipment for measuring the rotation of a sphere. The method involves acquiring a rotated image of the target sphere, extracting pixel information from the image, sampling the pixel information to obtain multiple spherical coordinates, and then calculating a first rotation parameter based on these coordinates. The pixel information is then rotated according to the first rotation parameter, and a matching value for the first rotation parameter is determined based on the grayscale values ​​of the pixels before and after the transformation. The first rotation parameter is verified by comparing the matching value with a matching threshold. When the matching value reaches the threshold, the first rotation parameter is determined as the rotation value of the target sphere. This application, by acquiring a static image of the target sphere at a specific moment during its rotation and calculating the rotation value based on pixel analysis, can meet the measurement requirements of spheres rotating at different speeds. Simultaneously, a verification mechanism ensures the accuracy of the final obtained rotation value.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117722978B_ABST
    Figure CN117722978B_ABST
Patent Text Reader

Abstract

This application relates to the field of sensing technology, and provides a method and related equipment for measuring the rotation of a sphere based on machine vision. The method involves acquiring a rotated image of the target sphere, extracting pixel information from the image, sampling the pixel information to obtain multiple spherical coordinates, and then calculating a first rotation parameter based on these coordinates. The pixel information is then rotated according to the first rotation parameter, and a matching value for the first rotation parameter is determined based on the grayscale values ​​of the pixels before and after the transformation. The first rotation parameter is verified by comparing the matching value with a matching threshold. When the matching value reaches the matching threshold, the first rotation parameter is determined as the rotation value of the target sphere. This application calculates and verifies the rotation value by randomly acquiring static images of the target sphere's rotation process, thereby ensuring the accuracy and reliability of the rotation value. Furthermore, rotation analysis using static images can adapt to the measurement of sphere rotation values ​​at different rotational speeds.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of sensing technology, and in particular to a machine vision-based method for measuring the rotation of a sphere and related equipment. Background Technology

[0002] As more and more technologies are applied to the field of sports, the accurate sensing of motion using advanced methods such as machine vision plays an increasingly important role. In ball sports, the rotation of the ball itself (hereinafter referred to as rotation) is a parameter of great interest, especially when the ball is rotating at high speed. Machine vision technology is an important method for measuring the rotation of a ball.

[0003] Research on sphere rotation measurement has been developing for a long time, resulting in various technical solutions. One solution utilizes changes in the sphere's image information to calculate the rotation by analyzing the image data. Another solution uses the similarity of the sphere's image information to calculate the rotation by generating images of the sphere taken by a camera at different angles and comparing the similarity of the image information at different times. A third solution measures the sphere's trajectory using its image information to calculate the rotation.

[0004] Existing measurement methods calculate the sphere's rotation value based on dynamic images of the sphere's rotation process. However, measuring the sphere's rotation value using dynamic image information requires the sphere's rotation speed to be within a specific speed threshold range. Summary of the Invention

[0005] In view of this, this application provides a method, apparatus, electronic device, and storage medium for measuring the rotation of a sphere based on machine vision, in order to solve the problem of a limited rotation speed threshold in the measurement of sphere rotation values.

[0006] The first aspect of this application provides a machine vision-based method for measuring the rotation of a sphere, the method comprising: Obtain a rotated image of the target sphere and extract all pixel information of the target sphere from the rotated image; Select multiple spherical coordinates from the pixel information; Calculate the first rotational parameters of the target sphere based on the multiple spherical coordinates; Determine the matching value of the first rotation parameter; When the matching value reaches the matching threshold, the rotation value of the target sphere is determined by the first rotation parameter.

[0007] In an optional implementation, selecting multiple spherical coordinates from the pixel information includes: Extract multiple first pixel information of the target sphere from the pixel information; Sparse sampling is performed on multiple first pixel information to select multiple second pixel information; Randomly sample multiple pieces of the second pixel information to select multiple target pixel information; Each of the target pixel information is converted into spherical coordinates to obtain multiple spherical coordinates.

[0008] In an optional implementation, the first rotation parameter includes a rotation matrix and a rotation vector, and calculating the first rotation parameter of the target sphere based on the plurality of spherical coordinates includes: The first rotation parameter is calculated using the following formula: r=acos(p2·p1)·Normalize((p1-p2)×(p3-p4)); R = Rodrigues(r); Wherein, P4, P3, P2, and P1 are multiple spherical coordinates, r is the rotation vector, R is the rotation matrix, Normaliza() is the vector normalization function, acos() is the inverse cosine function, and Rodrigues() is the Rodrigues formula.

[0009] In an optional implementation, determining the matching value of the first rotation parameter includes: Each pixel information is converted into first spherical coordinates and the first grayscale value of each first spherical coordinate is recorded. The first spherical coordinates are rotated and transformed into second spherical coordinates according to the first rotation parameter, and the second gray value of each second spherical coordinate is recorded. The matching value of the first rotation parameter is calculated based on the first gray value and the second gray value.

[0010] In an optional implementation, the matching value of the first rotation parameter is calculated based on the first grayscale value and the second grayscale value using the following formula: Where s is the matching value, i is the index of the spherical coordinates, and I(P) i P is the first spherical coordinate. i The first grayscale value; I(p' i (p' is the second spherical coordinate) i The second grayscale value; |()| represents the calculation of the absolute value, and M is the calculation parameter of the matching value.

[0011] In an optional implementation, when the matching value does not reach the matching threshold, the method further includes: recording the number of samplings of the plurality of spherical coordinates; Compare the number of samples with a preset sampling threshold; When the number of samplings reaches the sampling threshold, an alarm is triggered according to a preset alarm method. If the number of samplings does not reach the sampling threshold, multiple spherical coordinates are reselected from the pixel information.

[0012] In an optional implementation, extracting all pixel information of the target sphere in the rotated image includes: Identify the target region of the target sphere in the rotated image; The pixel information within the target area is determined as all pixel information of the target sphere, and all pixel information of the target sphere in the rotated image is extracted.

[0013] A second aspect of this application provides a sphere rotation measurement device based on machine vision. The device includes: an extraction module for acquiring a rotation image of a target sphere and extracting all pixel information of the target sphere from the rotation image; The selection module is used to select multiple spherical coordinates from the pixel information; The calculation module is used to calculate the first rotation parameters of the target sphere based on the multiple spherical coordinates; A determining module is used to determine the matching value of the first rotation parameter; The judgment module is used to determine the rotation value of the target sphere by the first rotation parameter when the matching value reaches the matching threshold.

[0014] A third aspect of this application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the machine vision-based sphere rotation measurement method as described above.

[0015] A fourth aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the machine vision-based sphere rotation measurement method described above.

[0016] This application provides a machine vision-based method and related equipment for measuring the rotation of a sphere. The method involves acquiring a rotated image of the target sphere, extracting pixel information from the image, sampling the pixel information to obtain multiple spherical coordinates, and then calculating a first rotation parameter based on these coordinates. The pixel information is then rotated according to the first rotation parameter, and a matching value for the first rotation parameter is determined based on the grayscale values ​​of the pixels before and after the transformation. The first rotation parameter is verified by comparing the matching value with a matching threshold. When the matching value reaches the threshold, the first rotation parameter is determined as the rotation value of the target sphere. This application, by acquiring a static image of the target sphere at a specific moment during its rotation and calculating the rotation value based on pixel analysis, can meet the measurement requirements of spheres rotating at different speeds. Simultaneously, a verification mechanism ensures the accuracy of the final obtained rotation value. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a flowchart of a machine vision-based sphere rotation measurement method provided in an embodiment of this application; Figure 2 This is a functional block diagram of the sphere rotation measurement device based on machine vision provided in the embodiments of this application; Figure 3 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0019] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0020] The machine vision-based ball rotation measurement method provided in this application is executed by an electronic device, and correspondingly, the machine vision-based ball rotation measurement device operates within the electronic device. The electronic device can be a high-speed motion camera system. The machine vision-based ball rotation measurement method provided in this application will be described below from the perspective of a high-speed motion camera system in conjunction with the process of measuring the rotation of a golf ball. It should be understood that, in the following text, the target ball is a golf ball.

[0021] like Figure 1 The diagram shows a flowchart of a machine vision-based sphere rotation measurement method provided in an embodiment of this application. The machine vision-based sphere rotation measurement method provided in this embodiment includes the following steps.

[0022] S10: Obtain a rotated image of the target sphere and extract all pixel information of the target sphere from the rotated image.

[0023] The rotating image is a still photograph of the target sphere at a specific moment during its rotation. The high-speed motion camera system incorporates a Convolutional Neural Network (CNN) system. Through model training, the CNN system enables the high-speed motion camera system to recognize golf balls. When the golf ball is rotating and passes through a specific shooting area of ​​the high-speed motion camera system, the system automatically adjusts exposure and other photographic parameters based on the ball's speed to capture the motion of the ball, ensuring the clarity of the resulting rotating image.

[0024] In an optional implementation, extracting all pixel information of the target sphere in the rotated image includes: Identify the target region of the target sphere in the rotated image; The pixel information within the target area is determined as all pixel information of the target sphere, and all pixel information of the target sphere in the rotated image is extracted.

[0025] After a high-speed motion camera system acquires a rotating image of a golf ball, preprocessing operations, including but not limited to grayscale conversion and filtering, are performed to improve the recognition of the target ball. A CNN system is used to acquire golf image information from the image, and the golf ball image is segmented from the background image. The pixel coordinates of the golf ball are obtained through image segmentation to determine its position and bounding box. Based on the golf ball's bounding box, the coordinates of all pixel units within the golf ball's image area are obtained. All pixel units within the target ball's bounding box are traversed. For each pixel unit, its corresponding pixel information is extracted. This pixel information includes, but is not limited to, grayscale values, color information, and brightness information.

[0026] By identifying the target sphere, the algorithm ensures that the extracted pixel information is contained only within the target sphere, reducing its sensitivity to changes in the image background and improving its robustness. Simultaneously, it significantly reduces computational load and improves algorithm efficiency.

[0027] S11: Select multiple spherical coordinates from the pixel information.

[0028] It should be understood that after acquiring an image of a golf ball, the high-speed motion camera system establishes a two-dimensional spherical coordinate system based on the geometric center (i.e., the center of the ball) of the sphere in the image. Therefore, the positional relationship between each pixel unit in the target sphere can be represented by spherical coordinates.

[0029] In an optional implementation, selecting multiple spherical coordinates from the pixel information includes: Extract multiple first pixel information of the target sphere from the pixel information; Sparse sampling is performed on multiple first pixel information to select multiple second pixel information; Randomly sample multiple pieces of the second pixel information to select multiple target pixel information; Each of the target pixel information is converted into spherical coordinates to obtain multiple spherical coordinates.

[0030] The first pixel information represents the image contour of the target sphere. After acquiring all pixel information of the golf ball, the high-speed motion camera system converts the image of the target sphere into a grayscale image to facilitate contour finding. Image edges are detected using the Canny edge detector algorithm, and contours are found using a cross-platform computer vision library, thus filtering out the first pixel information. The first pixel information is sparsely sampled at a preset sampling interval to further reduce the amount of information to be processed. Then, through random sampling with a preset number of samples and acquisition order, a corresponding number of target pixels are obtained from the second pixel information. Based on the target pixel information and a two-dimensional spherical coordinate system, the target pixel information is converted into spherical coordinates.

[0031] By sparsely sampling the first pixel information on the contour, the amount of data for subsequent processing can be reduced. Random sampling is added on the basis of sparse sampling to ensure that more target pixel information is obtained from different parts of the contour, thereby increasing the diversity of data and improving the robustness and adaptability of the algorithm.

[0032] S12: Calculate the first rotation parameters of the target sphere based on the plurality of spherical coordinates.

[0033] The first rotation parameter includes a rotation matrix and a rotation vector. The first rotation parameter is calculated using the following formula: r=acos(p2·p1)·Normalize((p1-p2)×(p3-p4)); R = Rodrigues(r).

[0034] Where P4, P3, P2, and P1 are multiple spherical coordinates obtained sequentially in a single direction, r is the rotation vector, R is the rotation matrix, Normaliza() is the vector normalization function, acos() is the inverse cosine function, and Rodrigues() is the Rodrigues formula. It should be understood that the symbol · represents the vector inner product, and the symbol × represents the vector outer product.

[0035] The inner product between spherical coordinate points P2 and P1 is calculated using (P2·P1), and the angle between the two vectors is calculated using the inverse cosine function acos(). Simultaneously, the vector difference between adjacent vectors is calculated, and the outer product of vector differences (P1-P2) and (P3-P4) is calculated. The outer product result is then normalized (e.g., the vector length becomes 1). The rotation vector r of the target sphere is then represented by the product of the inverse cosine function result (i.e., the angle of rotation change) and the normalized result (i.e., the unit change in the corresponding coordinate vector). Finally, the rotation vector r is converted into a rotation matrix R using the Rodriguez formula.

[0036] S13: Determine the matching value of the first rotation parameter.

[0037] It should be understood that, according to the above calculation process, the first rotation parameter refers to the angle change corresponding to the change in the unit vector difference of the spherical coordinates. Furthermore, during the movement, the speed at which the sphere can be rotated by human intervention is limited; therefore, the magnitude of the positional change of the same spherical coordinates according to the rotation of the first rotation parameter is limited.

[0038] Because the spherical coordinates used in calculating the first rotation parameter are randomly selected, the obtained spherical coordinates may be inaccurate, leading to a significant error between the first rotation parameter and the actual rotation value of the target sphere, making the first rotation parameter too large. To verify the correctness of the first rotation parameter, all pixel information of the target sphere needs to be rotated according to the first rotation parameter, and the similarity before and after the transformation needs to be compared. The higher the similarity before and after the transformation, the closer the first rotation parameter is to the actual rotation value of the target sphere.

[0039] In an optional implementation, determining the matching value of the first rotation parameter by comparing the changes in grayscale values ​​of the corresponding spherical coordinates before and after the rotation transformation includes: Each pixel information is converted into first spherical coordinates and the first grayscale value of each first spherical coordinate is recorded. The first spherical coordinates are rotated and transformed into second spherical coordinates according to the first rotation parameter, and the second gray value of each second spherical coordinate is recorded. The matching value of the first rotation parameter is calculated based on the first gray value and the second gray value.

[0040] Each pixel information is represented using a spherical coordinate system to obtain first spherical coordinates, and the first grayscale value corresponding to each first spherical coordinate is recorded. All first spherical coordinates are then rotated according to a first rotation parameter to obtain transformed second coordinates, and the second grayscale value corresponding to each second spherical coordinate is recorded.

[0041] After completing the rotation transformation, the matching value is calculated using the following formula: Where s is the matching value, i is the index of the spherical coordinates, and I(P) i P is the first spherical coordinate. i The first grayscale value; I(p' i (p' is the second spherical coordinate) i The second grayscale value; |()| represents the calculation of the absolute value, and M is the calculation parameter of the matching value.

[0042] A larger matching value results in a smaller difference in grayscale values ​​before and after the rotation transformation, meaning the image after rotation transformation based on the first rotation parameter is more similar to the image before rotation. Conversely, a smaller matching value results in a larger difference in grayscale values ​​before and after the rotation transformation, meaning the image after rotation transformation based on the first rotation parameter differs more from the image before rotation, indicating that the calculated first rotation parameter is inaccurate.

[0043] S14: When the matching value reaches the matching threshold, the first rotation parameter is determined as the rotation value of the target sphere.

[0044] The matching threshold can be set based on reasonable motion experiment data or by experienced users based on their own motion experience. The matching value calculated by the high-speed motion camera system is compared with the preset matching threshold. If the matching value is greater than or equal to the matching threshold, it indicates that the similarity between the images before and after the rotation transformation is high enough, and the first rotation parameter can be determined as the rotation value of the target sphere.

[0045] By setting a matching threshold, the system can adapt to different experimental conditions or varying levels of user experience. Experienced users are allowed to set the matching threshold, which can be adjusted according to actual circumstances, improving the system's flexibility and user-friendliness.

[0046] In an optional implementation, when the matching value does not reach the matching threshold, the method further includes: recording the number of samplings of the plurality of spherical coordinates; Compare the number of samples with a preset sampling threshold; When the number of samplings reaches the sampling threshold, an alarm is triggered according to a preset alarm method. If the number of samplings does not reach the sampling threshold, multiple spherical coordinates are reselected from the pixel information.

[0047] It should be understood that when a high-speed motion camera system performs an operation to select multiple spherical coordinates from the same batch of pixel information, it generates an execution record. The execution record records the number of operations and the surface coordinates selected for each operation.

[0048] When the matching value does not reach the matching threshold, the high-speed motion camera system first queries the records to obtain the sampling count of the multiple spherical coordinates currently being attempted for matching. It then compares the sampling count with the preset sampling threshold. When the sampling count reaches the preset threshold, the high-speed motion camera system triggers a preset alarm mechanism, such as sending a preset error correction message to inform the user that the acquired image information is incorrect. When the sampling count does not reach the preset threshold, the system will reselect multiple spherical coordinates from the pixel information to recalculate the new first rotation parameter until the calculated first rotation parameter passes verification.

[0049] By recording and comparing data, the matching process is automated. This reduces the need for manual intervention and improves the system's reliability and operability. Simultaneously, the alarm mechanism provides users with timely feedback, enabling them to understand matching failures and facilitating prompt handling of image information acquisition issues.

[0050] This application is applied to a machine vision analysis system, capable of detecting rotation values ​​based on the grayscale image of a target sphere. It acquires a rotated image of the target sphere, extracts pixel information from the image, samples the pixel information to obtain multiple spherical coordinates, and then calculates a first rotation parameter based on these coordinates. The pixel information is then rotated according to the first rotation parameter, and a matching value for the first rotation parameter is determined based on the grayscale values ​​of the pixels before and after the transformation. The first rotation parameter is verified by comparing the matching value with a matching threshold. When the matching value reaches the matching threshold, the first rotation parameter is determined as the rotation value of the target sphere. This application, by acquiring a static image of the target sphere at a specific moment during its rotation and calculating the rotation value based on pixel analysis, can meet the measurement requirements of spheres with different rotational speeds. Simultaneously, a verification mechanism ensures the accuracy of the final acquired rotation value.

[0051] like Figure 2 The diagram shown is a functional block diagram of a sphere rotation measurement device based on machine vision provided in an embodiment of this application.

[0052] In some embodiments, the machine vision-based sphere rotation measuring device 2 may include multiple functional modules composed of computer program segments. The computer programs for each program segment in the machine vision-based sphere rotation measuring device 2 may be stored in the memory of an electronic device and executed by at least one processor to perform (see details). Figure 1 (Description) Functionality of a machine vision-based method for measuring sphere rotation.

[0053] In this embodiment, the machine vision-based sphere rotation measuring device 2 can be divided into multiple functional modules according to its functions. These functional modules may include: an extraction module 21, a selection module 22, a calculation module 23, a determination module 24, and a judgment module 25. The module referred to in this invention is a series of computer program segments that can be executed by at least one processor and perform a fixed function, stored in memory. In this embodiment, the functions of each module will be detailed in subsequent embodiments.

[0054] Extraction module 21 is used to acquire a rotated image of the target sphere and extract all pixel information of the target sphere in the rotated image.

[0055] In an optional implementation, the extraction module 21 is specifically used for: Identify the target region of the target sphere in the rotated image; The pixel information within the target area is determined as all pixel information of the target sphere, and all pixel information of the target sphere in the rotated image is extracted.

[0056] The selection module 22 is used to select multiple spherical coordinates from the pixel information.

[0057] In an optional implementation, the selection module 22 is specifically used for: Extract multiple first pixel information of the target sphere from the pixel information; Sparse sampling is performed on multiple first pixel information to select multiple second pixel information; Randomly sample multiple pieces of the second pixel information to select multiple target pixel information; Each of the target pixel information is converted into spherical coordinates to obtain multiple spherical coordinates.

[0058] The calculation module 23 is used to calculate the first rotation parameters of the target sphere based on the multiple spherical coordinates.

[0059] In an optional implementation, the first rotation parameter includes a rotation matrix and a rotation vector, and the calculation module 23 is specifically used for: The first rotation parameter is calculated using the following formula: r=acos(p2·p1)·Normalize((p1-p2)×(p3-p4)); R = Rodrigues(r); Wherein, P4, P3, P2, and P1 are multiple spherical coordinates, r is the rotation vector, R is the rotation matrix, Normaliza() is the vector normalization function, acos() is the inverse cosine function, and Rodrigues() is the Rodrigues formula.

[0060] The determining module 24 is used to determine the matching value of the first rotation parameter.

[0061] In an optional implementation, the determining module 24 is specifically used for: Each pixel information is converted into first spherical coordinates and the first grayscale value of each first spherical coordinate is recorded. The first spherical coordinates are rotated and transformed into second spherical coordinates according to the first rotation parameter, and the second gray value of each second spherical coordinate is recorded. The matching value of the first rotation parameter is calculated based on the first gray value and the second gray value.

[0062] In an optional implementation, the determining module 24 is further configured to calculate the matching value using the following formula: Where s is the matching value, i is the index of the spherical coordinates, and I(P) i P is the first spherical coordinate. i The first grayscale value; I(p' i (p' is the second spherical coordinate) i The second grayscale value; |()| represents the calculation of the absolute value, and M is the calculation parameter of the matching value.

[0063] The judgment module 25 is used to determine the first rotation parameter as the rotation value of the target sphere when the matching value reaches the matching threshold.

[0064] In an optional implementation, when the matching value does not reach the matching threshold, the machine vision-based sphere rotation measuring device 2 is further configured to: Record the number of times the multiple spherical coordinates are sampled; Compare the number of samples with a preset sampling threshold; When the number of samplings reaches the sampling threshold, an alarm is triggered according to a preset alarm method. If the number of samplings does not reach the sampling threshold, multiple spherical coordinates are reselected from the pixel information.

[0065] It should be understood that the various variations and specific embodiments of the methods provided in the above embodiments are also applicable to the machine vision-based sphere rotation measurement device of this embodiment. Through the foregoing detailed description of the machine vision-based sphere rotation measurement method, those skilled in the art can clearly understand the implementation method of the machine vision-based sphere rotation measurement device of this embodiment. For the sake of brevity, it will not be described in detail here.

[0066] like Figure 3 The diagram shown is a structural schematic of an electronic device provided in an embodiment of this application.

[0067] In a preferred embodiment of the present invention, the electronic device 3 may include, but is not limited to, a memory 31, at least one processor 32, and at least one communication bus 33.

[0068] Those skilled in the art should understand that Figure 3 The structure of the electronic device 3 shown does not constitute a limitation of the embodiments of the present invention. The electronic device 3 may also include more or fewer other hardware or software than shown, or different component arrangements.

[0069] In some embodiments, the electronic device 3 is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits, programmable gate arrays, digital processors, and embedded devices.

[0070] It should be noted that the electronic device 3 is merely an example. Other existing or future electronic products that are suitable for this application should also be included within the scope of protection of this application and are incorporated herein by reference.

[0071] In some embodiments, the memory 31 stores a computer program that, when executed by the at least one processor 32, implements all or part of the steps in the machine vision-based sphere rotation measurement method described above. The memory 31 includes a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium capable of carrying or storing data. Further, the computer-readable storage medium may primarily include a program storage area and a data storage area, wherein the program storage area may store an operating system, at least one application program required for a function, etc.

[0072] In some embodiments, the at least one processor 32 is the control unit of the electronic device 3, connecting various components of the electronic device 3 via various interfaces and lines. It executes programs or modules stored in the memory 31 and calls data stored in the memory 31 to perform various functions and process data. For example, when the at least one processor 32 executes the computer program stored in the memory 31, it implements all or part of the steps of the machine vision-based sphere rotation measurement method described in this application embodiment; or it implements all or part of the functions of the machine vision-based sphere rotation measurement device. The at least one processor 32 may be composed of integrated circuits, such as a single-packaged integrated circuit or multiple integrated circuits with the same or different functions, including combinations of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips.

[0073] In some embodiments, the at least one communication bus 33 is configured to enable communication between the memory 31 and the at least one processor 32, etc. Although not shown, the electronic device 3 may also include a power supply (e.g., a battery) to power the various components. Preferably, the power supply can be logically connected to the at least one processor 32 via a power management device, thereby enabling functions such as charging, discharging, and power consumption management. The power supply may also include one or more DC or AC power supplies, recharging devices, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device 3 may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be described in detail here.

[0074] The integrated unit implemented as a software functional module described above can be stored in a computer-readable storage medium. This software functional module, stored in a storage medium, includes several instructions to cause an electronic device (which may be a personal computer, electronic device, or network device, etc.) or processor to execute portions of the methods described in the various embodiments of this application.

[0075] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and other division methods may be used in actual implementation.

[0076] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0077] The above are all preferred embodiments of this application, and are not intended to limit the scope of protection of this application. Therefore, all equivalent changes made in accordance with the structure, shape and principle of this application should be covered within the scope of protection of this application.

Claims

1. A method for measuring the rotation of a sphere based on machine vision, characterized in that, The method includes: A rotating image of the target sphere is obtained, and all pixel information of the target sphere in the rotating image is extracted. The rotating image is a static photograph of the target sphere at a certain moment during its rotation. Select multiple spherical coordinates from the pixel information; Based on the multiple spherical coordinates, the first rotation parameter of the target sphere is calculated, and the first rotation parameter includes a rotation matrix and a rotation vector. Determine the matching value of the first rotation parameter; When the matching value reaches the matching threshold, the first rotation parameter is determined as the rotation value of the target sphere; The step of calculating the first rotational parameter of the target sphere based on the plurality of spherical coordinates includes: pass Calculate spherical coordinates spherical coordinates The inner product between the two vectors is calculated, and the angle between the two vectors is calculated using the inverse cosine function acos(). The vector difference between adjacent vectors is calculated, and the vector difference is then converted into a vector product. and An outer product is calculated, and the result is normalized. The rotation vector is represented by the product of the inverse cosine function and the normalized result. The rotation vector is then converted into the rotation matrix using the Rodrigues formula. as well as These are multiple spherical coordinates obtained sequentially in a single direction.

2. The sphere rotation measurement method based on machine vision according to claim 1, characterized in that, Selecting multiple spherical coordinates from the pixel information includes: Extract multiple first pixel information of the target sphere from the pixel information; Sparse sampling is performed on multiple first pixel information to select multiple second pixel information; Randomly sample multiple pieces of the second pixel information to select multiple target pixel information; Each of the target pixel information is converted into spherical coordinates to obtain multiple spherical coordinates.

3. The sphere rotation measurement method based on machine vision according to claim 2, characterized in that, Determining the matching value of the first rotation parameter includes: Each pixel information is converted into first spherical coordinates and the first grayscale value of each first spherical coordinate is recorded. The first spherical coordinates are rotated and transformed into second spherical coordinates according to the first rotation parameter, and the second gray value of each second spherical coordinate is recorded. The matching value of the first rotation parameter is calculated based on the first gray value and the second gray value.

4. The sphere rotation measurement method based on machine vision according to claim 3, characterized in that, The matching value of the first rotation parameter is calculated based on the first grayscale value and the second grayscale value using the following formula: ; Where s is the matching value, i is the index of the spherical coordinates, and I(P) i P is the first spherical coordinate. i The first grayscale value; I(p' i (p' is the second spherical coordinate) i The second grayscale value; This indicates the calculation of the absolute value, where M is the calculation parameter for the matching value.

5. The sphere rotation measurement method based on machine vision according to claim 1, characterized in that, When the matching value does not reach the matching threshold, the method further includes: Record the number of times the multiple spherical coordinates are sampled; Compare the number of samples with a preset sampling threshold; When the number of samplings reaches the sampling threshold, an alarm is triggered according to a preset alarm method. If the number of samplings does not reach the sampling threshold, multiple spherical coordinates are reselected from the pixel information.

6. The sphere rotation measurement method based on machine vision according to claim 1, characterized in that, The step of extracting all pixel information of the target sphere in the rotated image includes: Identify the target region of the target sphere in the rotated image; The pixel information within the target area is determined as all pixel information of the target sphere, and all pixel information of the target sphere in the rotated image is extracted.

7. A sphere rotation measuring device based on machine vision, characterized in that, The device includes: An extraction module is used to acquire a rotating image of the target sphere and extract all pixel information of the target sphere in the rotating image, wherein the rotating image is a static photograph of the target sphere at a certain moment during its rotation. The selection module is used to select multiple spherical coordinates from the pixel information; The calculation module is used to calculate the first rotation parameters of the target sphere based on multiple spherical coordinates, wherein the first rotation parameters include a rotation matrix and a rotation vector; A determining module is used to determine the matching value of the first rotation parameter; The judgment module is used to determine the rotation value of the target sphere by the first rotation parameter when the matching value reaches the matching threshold. The calculation module is specifically used for: pass Calculate spherical coordinates spherical coordinates The inner product between the two vectors is calculated, and the angle between the two vectors is calculated using the inverse cosine function acos(). The vector difference between adjacent vectors is calculated, and the vector difference is then converted into a vector product. and An outer product is calculated, and the result is normalized. The rotation vector is represented by the product of the inverse cosine function and the normalized result. The rotation vector is then converted into the rotation matrix using the Rodrigues formula. as well as These are multiple spherical coordinates obtained sequentially in a single direction.

8. An electronic device, characterized in that, The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the machine vision-based sphere rotation measurement method according to any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the machine vision-based sphere rotation measurement method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Three-dimensional ultrasonic image volume rendering method based on CPU (Central Processing Unit)

    CN106846445A

  • Table tennis rotation estimation method and rotation estimation system based on vision measurement

    CN116012415A