Motor motion analysis method, device, equipment and medium

By covering the lens of the image acquisition device with a light-blocking component and utilizing light spot image recognition technology, the problem of motor motion analysis under the installation of internal motion components of the image acquisition device was solved, and effective motor motion testing and analysis were achieved.

CN121664973APending Publication Date: 2026-03-13KUNSHAN QIUTI PHOTOELECTRIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-28
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing technologies make it difficult to perform motion analysis of AF motors when motion components are installed inside image acquisition devices.

Method used

By covering the lens of the image acquisition device with a light-blocking component, the image distance is determined and the motor motion is analyzed using spot image recognition technology. This includes acquiring spot images, parsing spot information, constructing linear relationships, and determining the correspondence between motor code values ​​and image distances.

Benefits of technology

This technology enables effective testing and analysis of motor motion even when the motion components are installed inside the image acquisition device, avoiding direct ranging laser irradiation of the motion components.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121664973A_ABST
    Figure CN121664973A_ABST
Patent Text Reader

Abstract

The invention discloses a motor motion analysis method and device, equipment and a medium, and belongs to the technical field of computers. The method comprises the following steps: carrying out at least one image distance determination operation on image acquisition equipment until an end condition is met, and obtaining an image distance corresponding to each image distance determination operation; determining a motion analysis result of the motor of the image acquisition equipment based on the image distance corresponding to each image distance determination operation and the adopted motor code value; wherein the image distance determination operation comprises the following steps: acquiring a motor code value corresponding to the current image distance determination operation; a light spot image shot when a motor of the image acquisition equipment is set to be a motor code value is obtained, a lens of the image acquisition equipment is covered with a shading assembly, the shading assembly comprises a light through hole perpendicular to the plane of the lens, and the height of the light through hole is larger than a preset image distance value of the image acquisition equipment; analyzing the light spot image to obtain light spot information in the light spot image; and determining the image distance of the image acquisition equipment based on the information of the light spots.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, device and medium for analyzing motor motion. Background Technology

[0002] The operational testing of the automatic focus (AF) motor in image acquisition equipment is of great significance in many aspects, directly affecting the focusing performance of the image acquisition equipment, user experience, product reliability, and market competitiveness.

[0003] Currently, the operation test of AF motors usually uses a ranging laser to measure the lens displacement of the image acquisition device to obtain the change in the image distance of the image acquisition device, and then performs motion analysis of the AF motor. However, this method requires the ranging laser to directly illuminate the moving components in the image acquisition device, which is difficult to support for scenarios where the moving components are inside the image acquisition device. The moving components refer to the motor in the image acquisition device and other components that are driven by the motor's movement. In other words, if the moving components are installed inside the image acquisition device, it is impossible to perform motion analysis of the motor. Summary of the Invention

[0004] In view of the above problems, this application is made to provide a motor motion analysis method, apparatus, device and medium that solves the above problems, and can perform motor motion analysis even when the moving component is installed inside an image acquisition device.

[0005] In a first aspect, this application provides a method for analyzing motor motion, the method comprising: Perform at least one image distance determination operation on the image acquisition device until the termination condition is met, and obtain the image distance corresponding to each image distance determination operation. Based on the image distance corresponding to each image distance determination operation and the motor code value used, the motion analysis result of the motor of the image acquisition device is determined. The image distance determination operation includes: Obtain the motor code value corresponding to the current image distance determination operation; the motor code value is a motor code value that has not been set and is selected from multiple preset motor code values; The image acquisition device captures a light spot image when its motor is set to the motor code value. The lens of the image acquisition device is covered with a light-blocking component, which includes a light-transmitting hole perpendicular to the lens plane. The height of the light-transmitting hole is greater than the preset image distance value of the image acquisition device. The light spot image is obtained by the image acquisition device capturing an image of a scene illuminated by a light source. The light spot image is analyzed to obtain information about the light spot in the image; Based on the information of the light spot, the image distance of the image acquisition device is determined.

[0006] In one embodiment, the termination condition includes: the motor has been set to each of the plurality of preset motor code values.

[0007] In one embodiment, the step of parsing the light spot image to obtain information about the light spot in the light spot image includes: Determine at least one of the key point coordinates and key parameters of the light spot in the light spot image; Based on the coordinates of the key points and at least one of the key parameters, determine the area of ​​the light spot in the light spot image; The area of ​​the light spot is used as information about the light spot.

[0008] In one embodiment, when the light spot is a polygonal light spot, the key point coordinates are the vertex coordinates of the polygonal light spot; When the light spot is a circular light spot, the key point coordinates are the coordinates of the center of the circular light spot, and the key parameter is the light spot radius of the circular light spot.

[0009] In one embodiment, determining the image distance of the image acquisition device based on the information of the light spot includes: Based on the target linear relationship, determine the image distance corresponding to the area of ​​the light spot; The corresponding image distance is taken as the image distance of the image acquisition device.

[0010] In one embodiment, the process of constructing the target linear relationship includes: An initial linear relationship is obtained, which is used to characterize the linear relationship between the area of ​​the light spot and the image distance of the image acquisition device; Multiple light spot image samples and their corresponding true image distance values ​​are acquired; the multiple light spot image samples are captured by the image acquisition device when the motors in the image acquisition device are respectively set to the multiple preset motor code values; The initial linear relationship is optimized at least once based on multiple light spot image samples until a preset termination condition is met, thereby obtaining the target linear relationship. The optimization operations include: For each of the plurality of spot image samples, the spot image sample is analyzed to obtain the area of ​​the spot in the spot image sample; Based on the area of ​​the light spot and the linear relationship corresponding to the current optimization operation, the image distance prediction value of the image acquisition device is determined; wherein, the linear relationship corresponding to the first optimization operation is the initial linear relationship; Determine the first difference between the predicted image distance value and the actual image distance value; The total loss is determined based on the first difference corresponding to each spot image sample. Based on the total loss, adjust the parameters in the linear relationship corresponding to the current optimization operation, and use the adjusted linear relationship as the linear relationship corresponding to the next optimization operation.

[0011] In one embodiment, the number of light-transmitting holes is at least two, and the number of light spots in each captured light spot image is at least two. The image distance determination operation also includes: Determine the perimeter of each spot in the light spot image, as well as the coordinates of the center point of each spot; For each light spot, the perimeter coordinates are determined based on the perimeter of the light spot and the perimeter of the corresponding light spot in the light spot image captured in the previous image distance determination operation; Based on the perimeter coordinates and the center point coordinates, the three-dimensional coordinates of the light spot are constructed; Based on the three-dimensional coordinates corresponding to each light spot, the light spot vectors between multiple light spots are determined. Based on the light spot vector, determine the normal vector; Accordingly, determining the motion analysis result of the motor of the image acquisition device based on the image distance corresponding to each image distance determination operation and the motor code value used includes: Based on the image distance corresponding to each image distance determination operation, the motor code value used, and the normal vector, the motion analysis result of the motor of the image acquisition device is determined.

[0012] In one embodiment, determining the motion analysis result of the motor of the image acquisition device based on the image distance corresponding to each image distance determination operation, the motor code value used, and the normal vector includes: For the normal vector corresponding to the first image distance determination operation, determine the normal angle between the normal vector corresponding to the image distance determination operation and at least one target normal vector; the target normal vector is the normal vector corresponding to the image distance determination operation other than the first one. Based on the image distance corresponding to each image distance determination operation, the motor code value used, and the included angle of the normal, the motion analysis result of the motor of the image acquisition device is determined.

[0013] Secondly, this application provides a motor motion analysis device, the device comprising: The first determining module is used to perform at least one image distance determination operation on the image acquisition device until the termination condition is met, and to obtain the image distance corresponding to each image distance determination operation. The second determining module is used to determine the motion analysis result of the motor of the image acquisition device based on the image distance corresponding to each image distance determination operation and the motor code value used. The image distance determination operation includes: Obtain the motor code value corresponding to the current image distance determination operation; the motor code value is a motor code value that has not been set and is selected from multiple preset motor code values; The image acquisition device captures a light spot image when its motor is set to the motor code value. The lens of the image acquisition device is covered with a light-blocking component, which includes a light-transmitting hole perpendicular to the lens plane. The height of the light-transmitting hole is greater than the preset image distance value of the image acquisition device. The light spot image is obtained by the image acquisition device capturing an image of a scene illuminated by a light source. The light spot image is analyzed to obtain information about the light spot in the image; Based on the information of the light spot, the image distance of the image acquisition device is determined.

[0014] Thirdly, this application provides an electronic device, including: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the method as described in the first aspect.

[0015] Fourthly, this application provides a computer-readable storage medium storing computer instructions for causing the computer to perform the method described in the first aspect.

[0016] The technical solutions provided in this application embodiment have at least the following technical effects or advantages: This application provides a motor motion analysis device, apparatus, equipment, and medium that can perform at least one image distance determination operation on an image acquisition device until a termination condition is met. Each image distance determination operation includes: acquiring the motor code value corresponding to the current image distance determination operation; the motor code value is a motor code value that has not been set and selected from a plurality of preset motor code values; acquiring a light spot image captured when the motor of the image acquisition device is set to the motor code value; the lens of the image acquisition device is covered with a light-shielding component, which includes a light-transmitting hole perpendicular to the lens plane, and the height of the light-transmitting hole is greater than the preset image distance value of the image acquisition device; the light spot image is obtained by the image acquisition device capturing an image of a scene illuminated by a light source, and the light spot image is analyzed. The image acquisition device obtains information about the light spot in the light spot image. Based on this information, the image distance of the image acquisition device is determined. In this way, it is only necessary to cover the lens of the image acquisition device with the aforementioned light-shielding component. The image acquisition device is then used to capture the light spot image, and the image distance corresponding to each image distance determination operation can be obtained. That is, the image distance is determined by recognizing the light spot image. It is not necessary to directly illuminate the motion component in the image acquisition device with the ranging laser to measure the image distance. Even if the motion component is inside the image acquisition device, the corresponding image distance can still be obtained. Based on the image distance corresponding to each image distance determination operation and the motor code value used, the motion analysis result of the motor of the image acquisition device can be determined. Even if the motion component is installed inside the image acquisition device, testing and motion analysis can still be performed.

[0017] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0018] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 This is a schematic flowchart of a motor motion analysis method provided in an embodiment of this application; Figure 2 This is a schematic diagram of the structure of a light-shielding component provided in an embodiment of this application; Figure 3 This is a schematic flowchart of another motor motion analysis method provided in the embodiments of this application; Figure 4 This is a schematic diagram of the structure of a motor motion analysis device provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings. It should be understood that the embodiments of this disclosure and the specific features in the embodiments are detailed descriptions of the technical solutions of this application, rather than limitations on the technical solutions of this application. Unless otherwise specified, the embodiments of this application and the technical features in the embodiments can be combined with each other.

[0020] Figure 1 This is a flowchart of a motor motion analysis method provided in an embodiment of this application, such as... Figure 1 As shown, this method is executed by the running analysis system, and the method includes: Step S101: Perform at least one image distance determination operation on the image acquisition device until the termination condition is met, and obtain the image distance corresponding to each image distance determination operation; In this embodiment, the image acquisition device can be a camera; the image acquisition device includes an image sensor, which can acquire images.

[0021] The image acquisition device is repeatedly subjected to the image distance determination operation, with the number of iterations being at least once. Each image distance determination operation can obtain an image distance value (it should be noted that the image distance value and image distance in this article are actually the same concept).

[0022] Step S102: Based on the image distance corresponding to each image distance determination operation and the motor code value used, determine the motion analysis result of the motor of the image acquisition device; wherein, the image distance determination operation includes: obtaining the motor code value corresponding to the current image distance determination operation; the motor code value is a motor code value that has not been set from multiple preset motor code values; obtaining a spot image captured when the motor of the image acquisition device is set to the motor code value, wherein the lens of the image acquisition device is covered with a light-blocking component, the light-blocking component includes a light-transmitting hole perpendicular to the lens plane, and the height of the light-transmitting hole is greater than the preset image distance value of the image acquisition device; the spot image is obtained by the image acquisition device capturing an image of the scene illuminated by the light source; analyzing the spot image to obtain the information of the spot in the spot image; and determining the image distance of the image acquisition device based on the information of the spot.

[0023] In this embodiment, a linear relationship can be constructed between the image distance corresponding to each image distance determination operation and the motor code value set by the motor of the image acquisition device when the corresponding image distance determination operation is performed. This linear relationship can characterize the corresponding change of the image distance value as the motor code value changes. Based on this linear relationship, motion analysis of the motor can be performed to determine the corresponding change of the image distance value when the motor code value changes, and thus obtain the motion analysis results.

[0024] In this embodiment, the motor can be a voice coil motor (VCM).

[0025] In this embodiment of the application, the image distance determination operation to be performed in each loop specifically includes the following steps: The analysis system obtains the motor code value corresponding to the current image distance determination operation. The motor code value refers to the motor encoding value, which is contained in the motor control command. The motor code value in the motor control command can control the motor's stroke, thereby controlling the motor's movement.

[0026] The motor code value corresponding to the current image distance determination operation is: a motor code value selected from multiple preset motor code values, and it is a motor code value that the motor of the image acquisition device has not been set.

[0027] Among them, multiple preset motor code values ​​can be: motor code values ​​that increase sequentially according to preset code value changes. For example, multiple preset motor code values ​​are: initial code value, code value + 100, code value + 200, code value + 100*n, where n is a positive integer greater than 2, and "+" is a plus sign.

[0028] The motor code value obtained in the current image distance determination operation can be obtained from multiple preset motor code values ​​according to a preset rule. The preset rule can be a rule where the code value increases from small to large, for example, setting the motor code value to the initial code value, code value + 100, code value + 200... code value + 100*n in sequence; or it can be a rule where the code value decreases from large to small, for example, setting the motor code value to code value + 100*n, code value + 100*n-1,... the initial code value in sequence; or it can be obtained randomly from multiple preset motor code values. It can be understood that randomness is the opposite of the above preset rule.

[0029] Among the multiple preset motor code values, the motor code value corresponding to the current image distance determination operation and the motor code value corresponding to the previous image distance determination operation are motor code values ​​that have been set. The motor code values ​​that have not been set for the motors of the image acquisition device refer to other motor code values ​​excluding these set motor code values.

[0030] For each image distance determination operation, the motor of the image acquisition device is set to the motor code value corresponding to the current image distance determination operation, and then the analysis system is run to obtain the spot image captured by the image acquisition device.

[0031] In this embodiment, the lens of the image acquisition device is covered with a light-blocking component, which includes a light-transmitting hole. The light-transmitting hole is perpendicular to the lens plane along the height direction. At the same time, it is necessary to ensure that the height of the light-transmitting hole is greater than the preset image distance value of the image acquisition device. The preset image distance value refers to the preset lower limit value of the image distance for the image acquisition device, indicating that the image distance value of the image acquisition device is generally greater than or equal to the lower limit value.

[0032] When a light source illuminates a scene or image, an image acquisition device captures the scene or image to obtain a light spot image. Therefore, it can be understood that the light spot image includes not only the light spot (or light spot element), but also other elements in the scene besides the light spot element.

[0033] The analysis system analyzes the spot image to obtain information about the spot, including its area. Based on the area of ​​the spot, the image distance corresponding to that area is determined, thus obtaining the image distance of the image acquisition device.

[0034] Therefore, this application can perform at least one image distance determination operation on the image acquisition device until the termination condition is met. Each image distance determination operation includes: obtaining the motor code value corresponding to the current image distance determination operation; the motor code value is a motor code value that has not been set and selected from multiple preset motor code values; obtaining a light spot image captured when the motor of the image acquisition device is set to the motor code value; the lens of the image acquisition device is covered with a light-blocking component, which includes a light-transmitting hole perpendicular to the lens plane, and the height of the light-transmitting hole is greater than the preset image distance value of the image acquisition device; the light spot image is obtained by the image acquisition device capturing an image of the scene illuminated by the light source, and the light spot image is analyzed to obtain the light spot in the light spot image. Based on the information of the light spot, the image distance of the image acquisition device is determined. In this way, it is only necessary to cover the lens of the image acquisition device with the aforementioned light-shielding component, and then take a picture of the light spot image through the image acquisition device. Thus, the image distance corresponding to each image distance determination operation can be obtained. That is, the image distance is determined by recognizing the light spot image. It is not necessary to directly illuminate the motion component in the image acquisition device with the ranging laser to measure the image distance. Even if the motion component is inside the image acquisition device, the corresponding image distance can still be obtained. Therefore, based on the image distance corresponding to each image distance determination operation and the motor code value used, the motion analysis result of the motor of the image acquisition device can be determined. Even if the motion component is installed inside the image acquisition device, testing and motion analysis can still be performed.

[0035] In one possible embodiment, the termination condition includes: the motor has been set to each of the plurality of preset motor code values.

[0036] As mentioned above, each time the image distance determination operation is performed in a loop, the motor of the image acquisition device will be set to the motor code value corresponding to the current image distance determination operation. Therefore, as long as the motor of the image acquisition device has been set to each of the multiple preset motor code values, the loop can be terminated. In another possible embodiment, if the motor code value obtained in the current image distance determination operation is obtained in a pattern of code values ​​from large to small, then the termination condition includes: the motor code value corresponding to the current image distance determination operation is the smallest motor code value among multiple preset motor code values; In another possible embodiment, if the motor code value obtained in the current image distance determination operation is obtained in accordance with the rule of code value from small to large, then the termination condition includes: the motor code value corresponding to the current image distance determination operation is the largest motor code value among multiple preset motor code values.

[0037] In this embodiment, several possible termination conditions are explained, which is helpful for ending the loop and for implementing the scheme.

[0038] In one embodiment, the step of parsing the spot image to obtain information about the spot in the spot image includes: determining at least one of the key point coordinates and key parameters of the spot in the spot image; determining the area of ​​the spot in the spot image based on the key point coordinates and at least one of the key parameters; and using the area of ​​the spot as information about the spot.

[0039] The light-transmitting aperture can be axially symmetric or centrally symmetric; for example, it can be a regular polygon or a circle. It is understood that the shape of the light-transmitting aperture is set to influence the shape of the light spot pattern.

[0040] In this embodiment, the key point coordinates of the light spot refer to the key point coordinates of the light spot pattern formed by the light spot boundary; the key parameters of the light spot refer to the key parameters of the light spot pattern formed by the light spot boundary.

[0041] In this embodiment, the area of ​​the light spot can be used as the information of the light spot, or the area of ​​the light spot, the perimeter of the light spot, the coordinates of the key points of the light spot, and key parameters can be used together as the information of the light spot.

[0042] In one embodiment, when the light spot is a polygonal light spot, the key point coordinates are the vertex coordinates of the polygonal light spot; when the light spot is a circular light spot, the key point coordinates are the center coordinates of the circular light spot, and the key parameter is the light spot radius of the circular light spot.

[0043] In this embodiment, the shape of the light spot in the light spot image can be axially symmetric or centrally symmetric. When the light spot is a polygonal light spot, the key point coordinates are the vertex coordinates of the polygonal light spot, so the side length of the polygonal light spot can be determined based on the vertex coordinates, and the area of ​​the polygonal light spot can be determined based on the side length.

[0044] For example, a polygonal light spot can specifically be a regular polygonal light spot. The area of ​​the regular polygonal light spot can then be determined based on its side length and number of sides. The area of ​​the light spot is calculated using the following formula: Where: A is the area of ​​the light spot, Let be the number of sides. Let be the side length. It is the cotangent function.

[0045] When the light spot is circular, the key point coordinates are the coordinates of the center of the circular light spot, and the key parameter is the radius of the circular light spot. Thus, the area of ​​the circular light spot is determined based on the radius of the circular light spot.

[0046] In this embodiment, the coordinates of multiple vertices of the polygonal light spot can be calculated using quadrilateral functions, thereby determining the perimeter and area of ​​the light spot based on the multi-point coordinates.

[0047] In the above embodiments, there is a linear relationship between the area of ​​the light spot and the image distance of the image acquisition device. Therefore, in one embodiment, determining the image distance of the image acquisition device based on the information of the light spot includes: determining the image distance corresponding to the area of ​​the light spot based on the target linear relationship; and using the corresponding image distance as the image distance of the image acquisition device.

[0048] The target linear relationship refers to the linear relationship between the area of ​​the light spot and the image distance of the image acquisition device. By substituting the area of ​​the light spot into the relational expression corresponding to the target linear relationship, the corresponding image distance value can be obtained. This corresponding image distance value is used as the image distance value of the image acquisition device in the current image distance determination operation.

[0049] The area of ​​the light spot is directly proportional to the image distance of the image acquisition device. Specifically, the linear relationship between the target and the target is expressed as follows: Where S is the area of ​​the light spot; k is the scaling factor, which is determined by performing at least one optimization operation on the initial linear relationship, and the specific implementation of the optimization operation is described in the following embodiment; L is the image distance of the image acquisition device; * indicates a multiplication sign.

[0050] In the above embodiments, the process of constructing the target linear relationship includes: obtaining an initial linear relationship, which is used to characterize the linear relationship between the area of ​​the light spot and the image distance of the image acquisition device; obtaining multiple light spot image samples and the true image distance values ​​corresponding to the multiple light spot image samples respectively; the multiple light spot image samples are taken by the image acquisition device when the motor in the image acquisition device is set to the multiple preset motor code values ​​respectively; and performing at least one optimization operation on the initial linear relationship based on the multiple light spot image samples until a preset termination condition is met to obtain the target linear relationship. In this embodiment, in the initial linear relationship, the area of ​​the light spot is the independent variable and the image distance of the image acquisition device is the dependent variable. The initial linear relationship can be obtained by manually setting the parameters in the linear relationship. Similarly, the initial linear relationship is also used to characterize the linear relationship between the area of ​​the light spot and the image distance of the image acquisition device. The area of ​​the light spot and the image distance are directly proportional.

[0051] In the image acquisition device, each motor is set to a multiple preset motor code value. For each motor code value, a spot image sample captured by the image acquisition device when the motor is set to that motor code value is obtained. The number of spot image samples captured by the image acquisition device can be one or more. The spot image samples captured separately when set to each motor code value together form multiple spot image samples, and each spot image sample is a true value of the marked image distance.

[0052] For example, one or more light spot image samples taken when the motor in the image acquisition device is set to the initial code value, one or more light spot image samples taken when the motor in the image acquisition device is set to the code value +100, one or more light spot image samples taken when the motor in the image acquisition device is set to the code value +200, ... and one or more light spot image samples taken when the motor in the image acquisition device is set to the code value +100*n, together form the above-mentioned multiple light spot image samples.

[0053] The initial linear relationship is optimized at least once based on multiple spot image samples until a preset termination condition is met. This termination condition can be that the number of optimizations reaches a preset number, or that the difference between the predicted image distance based on the optimized linear relationship and the corresponding true image distance remains essentially unchanged. The target linear relationship is obtained after at least one optimization operation on the initial linear relationship.

[0054] The optimization operation includes: for each of the multiple spot image samples, analyzing the spot image sample to obtain the area of ​​the spot in the spot image sample; determining the image distance prediction value of the image acquisition device based on the area of ​​the spot and the linear relationship corresponding to the current optimization operation; wherein the linear relationship corresponding to the first optimization operation is the initial linear relationship; determining the first difference between the image distance prediction value and the actual image distance value; determining the total loss based on the first difference corresponding to each spot image sample; adjusting the parameters in the linear relationship corresponding to the current optimization operation based on the total loss, and using the adjusted linear relationship as the linear relationship corresponding to the next optimization operation.

[0055] The specific implementation of parsing a light spot image sample to obtain the area of ​​the light spot in the light spot image is similar to the specific implementation of parsing a light spot image to obtain the area of ​​the light spot in the light spot image described above, and will not be repeated here.

[0056] The area of ​​the light spot is substituted into the linear relationship equation corresponding to the current optimization operation for calculation to obtain the image distance prediction value of the image acquisition device. For each spot image sample, the first difference between the predicted image distance and the actual image distance is determined. The first differences corresponding to each spot image sample in the multiple spot image samples are formed into multiple first differences. The multiple first differences are divided by the number of spot image samples to obtain the average difference. The average difference is used as the total loss. The parameters in the linear relationship corresponding to the current optimization operation are adjusted based on the total loss. The adjusted linear relationship is the linear relationship corresponding to the next optimization operation.

[0057] As can be seen, this embodiment provides a detailed explanation of the linear relationship between the area of ​​the light spot and the image distance of the image acquisition device. This allows the image distance of the image acquisition device to be determined based on the area of ​​the light spot, eliminating the need for the ranging laser to directly illuminate the moving component in the image acquisition device to measure the image distance. Even if the moving component is inside the image acquisition device, the corresponding image distance can still be obtained. Thus, based on each image distance, the image distance corresponding to the operation and the motor code value used can be determined, thereby determining the motion analysis results of the motor of the image acquisition device. Even if the moving component is installed inside the image acquisition device, testing and motion analysis can still be performed.

[0058] Reference Figure 2 In one embodiment, the light-shielding component is made of light-shielding material 10, and its design should be able to completely cover the lens of the image acquisition device 20. The light-shielding component includes one or more light-transmitting holes 101 perpendicular to the lens in a square or other easily identifiable direction. The height of the light-transmitting hole should be greater than the nearest image distance of the image acquisition device (100mm). By completely covering the lens of the image acquisition device 20 with the light-shielding component 10 and aligning the light-transmitting hole 101 with the center of the lens, and turning on the light source, the scene can be captured.

[0059] Reference Figure 3 One possible application scenario for this application is as follows: Step 1: Assemble the light-shielding components and light source, push the motor in the camera to the initial code value position to take a picture and obtain a light spot image; Step 2: Motion analysis is used to acquire an image of the light spot, which includes a square light spot. Step 3: Perform Hough transform on the spot image to obtain the quadrilateral equation; Step 4: Calculate the intersection points and the coordinates of the four corner pixels using the quadrilateral equations, and calculate the perimeter and area of ​​the light spot based on the coordinates of the four corner pixels. Step 5: Determine the image distance of the image acquisition device based on the spot area; Step 6: Push the motor sequentially to, for example, code value + 100, code value + 200, and so on, until code value + 100*n. Repeat the capture of the light spot image, then return to execute steps 2, 3, 4, and 5 to obtain the corresponding image distances. Step 7: Obtain the mapping relationship between motor code value and image distance, and the mapping relationship between spot perimeter and motor code value.

[0060] This application acquires light spot images using the image sensor of the image acquisition device itself, thereby determining the image distance of the image acquisition device for different motor code values. It can capture motor motion, analyze the linear relationship between motor code value and image distance, and analyze the offset of motor motion.

[0061] In this application embodiment, the number of light-transmitting holes in the light-shielding component can be one or more. For cases where there are multiple light-transmitting holes, and all light-transmitting holes have the same shape, this application's motor motion analysis also includes analysis of the motion offset, specifically: In one embodiment, the number of light-transmitting holes is at least two, and the number of light spots in each captured light spot image is at least two. The image distance determination operation further includes: determining the perimeter of each light spot in the light spot image and the coordinates of the center point of each light spot; for each light spot, determining the perimeter coordinates based on the perimeter of the light spot and the perimeter of the corresponding light spot in the light spot image captured in the previous image distance determination operation; constructing the three-dimensional coordinates of the light spot based on the perimeter coordinates and the center point coordinates; determining the light spot vector between multiple light spots based on the three-dimensional coordinates corresponding to each light spot; and determining the normal vector based on the light spot vector. Each light-passing hole can form a corresponding light spot, therefore the number of light-passing holes is consistent with the number of light spots in each captured light spot image; In this embodiment, when the light spot is a polygonal light spot, the coordinates of the center point of the light spot are the position coordinates of the center point of the polygonal light spot, and the coordinates of the center point of the light spot are the two-dimensional coordinates of the light spot in a two-dimensional coordinate system. For example, the center point of a square light spot is the intersection of the diagonals. When the light spot is a circular light spot, the coordinates of the center point of the light spot are the coordinates of the center of the circle.

[0062] If the current image distance determination operation is the first image distance determination operation, then for each light spot, the perimeter coordinates are determined as the initial coordinate values, and the initial coordinate values ​​can be 0; If the current image distance determination operation is the second or more image distance determination operations, for each spot, based on the perimeter of the spot and the perimeter of the spot at the corresponding position in the image of the spot captured in the previous image distance determination operation, the perimeter coordinate value can be determined and used as the perimeter coordinate. For each light spot, the three-dimensional coordinates of the light spot are constructed based on the perimeter coordinates and the two-dimensional center point coordinates. Then, based on the three-dimensional coordinates corresponding to multiple light spots, the light spot vector between each pair of light spots is determined. It can be understood that each pair of adjacent light spots forms a light spot vector.

[0063] For example, the three-dimensional coordinates of two adjacent light spots are (x1, y1, L1) and (x2, y2, L2), where x and y represent the coordinates of the two-dimensional center point and L represents the perimeter of the light spot. The light spot vector between these two adjacent light spots can be determined.

[0064] Based on the spot vector corresponding to the current image distance determination operation, the normal vector corresponding to the current image distance determination operation can be determined. Specifically: the cross product of non-collinear spot vectors yields the normal vector of the plane formed by the two spot vectors; if multiple spots are not coplanar, the average normal vector is calculated.

[0065] Accordingly, determining the motion analysis result of the motor of the image acquisition device based on the image distance corresponding to each image distance determination operation and the motor code value used includes: determining the motion analysis result of the motor of the image acquisition device based on the image distance corresponding to each image distance determination operation, the motor code value used, and the normal vector.

[0066] In one embodiment, determining the motion analysis result of the motor of the image acquisition device based on the image distance corresponding to each image distance determination operation, the motor code value used, and the normal vector includes: for the normal vector corresponding to the first image distance determination operation, determining the normal angle between the normal vector corresponding to the current image distance determination operation and at least one target normal vector; the target normal vector is the normal vector corresponding to the other image distance determination operations besides the first one; and determining the motion analysis result of the motor of the image acquisition device based on the image distance corresponding to each image distance determination operation, the motor code value used, and the normal angle.

[0067] The normal vectors corresponding to each image distance determination operation are sorted according to the execution order of the image distance determination operations; For the normal vector corresponding to the first image distance determination operation in all image distance determination operations, determine the normal vector corresponding to the first image distance determination operation, as well as the normal vector corresponding to each of the other image distance determination operations in the sorted sequence. Then, take the normal vectors corresponding to each of the other image distance determination operations as the target normal vectors in sequence, and determine the normal angle between the normal vector corresponding to the first image distance determination operation and the target normal vector. The specific implementation is as follows: First, take the normal vector corresponding to the second image distance determination operation as the target normal vector and determine the normal angle between the normal vector corresponding to the first image distance determination operation and the target normal vector; then take the normal vector corresponding to the third image distance determination operation as the target normal vector and determine the normal angle between the normal vector corresponding to the first image distance determination operation and the target normal vector; ... until the normal vector corresponding to the kth image distance determination operation is taken as the target normal vector and the normal angle between the normal vector corresponding to the first image distance determination operation and the target normal vector is determined, where k is an integer greater than 2.

[0068] The specific implementation of determining the included angle of the normals will be explained below with concrete examples: Step 1: With the motor code value set to the initial code value, obtain the perimeters of the four light spots at position P1, from P11 to P14, and the center positions of the four light spots (x1, y1), (x2, y2), (x3, y3), and (x4, y4). Convert these to base 3D coordinates to obtain (x1, y1, 0), (x2, y2, 0), (x3, y3, 0), and (x4, y4, 0), thus obtaining the edge vectors such as v(x1-x2, y1-y2, 0), (x2-x3, y2-y3, 0), (x3-x4, y3-y4, 0), and (x4-x1, y4-y1, 0). The cross product yields the corresponding normal vector v(a, b, c).

[0069] Step 2: Similar to the example above, when the motor code value is set to code+100, the perimeters of the four light spots P21 to P24 at the next position P2, and the center positions of the four light spots (x`1,y`1), (x`2,y`2), (x`3,y`3), and (x`4,y`4) are obtained. These are then converted to the reference three-dimensional coordinates to obtain (x`1,y`1,P11-P21), (x`2,y`2,P12-P22), (x`3,y`3,P13-P23), and (x`4,y`4). From P14 to P24, we obtain the edge vectors such as v(x`1-x`2,y`1-y`2,(P11-P21)-(P12-P22)), v(x`2-x`3,y`2-y`3,(P12-P23)-(P12-P23)), v(x`3-x`4,y`3-y`4,(P13-P23)-(P14-P24)), and v(x`4-x`1,y`4-y`1,(P14-P24)-(P11-P21)). The cross product yields the normal vector v`(a`,b`,c` at position P2.

[0070] Step 3: The angle between the normals is theta1 = acos(|v·v`| / (|v|*|v`|)), where "*" is the multiplication sign, " / " is the division sign, and |x| represents the modulus of the data x.

[0071] Step 4: Adjust the motor code value, setting it sequentially to code + 200, ... up to code + 100*n. Similarly, following a method similar to Step 1 or Step 2 above, obtain the normal vectors corresponding to positions P3 to Pk, and sequentially calculate the normal angle between the normal vectors corresponding to positions P1 and P3, P4 and P4, ... up to the normal angle between the normal vectors corresponding to positions P1 and Pk.

[0072] It can be understood that the correspondence between motor code values ​​and positions is as follows: the motor code value is set to code+200, and the corresponding position is P3; the motor code value is set to code+300, and the corresponding position is P4; the motor code value is set to code+100*n, and the corresponding position is Pk. More correspondences between motor code values ​​and positions are not detailed here.

[0073] As can be seen, this application can obtain multiple normal angles, thereby enabling the analysis of the motor's motion offset.

[0074] In one embodiment, the motion analysis results of the motor include at least one of the following: Based on the image distance and motor code value used in each image distance determination operation, a linear relationship between the motor code value and the image distance is determined. Based on the included angle of the normal corresponding to each image distance determination operation, the motion offset of the motor can be analyzed. When there is only one spot in each captured image, the spot perimeter can be determined. Based on each image distance, the spot perimeter corresponding to the operation and the motor code value used can be determined, thus establishing a linear relationship between the motor code value and the spot perimeter. The linearity is obtained based on the mapping relationship between the motor code value and the object distance used in each image distance determination operation.

[0075] As can be seen, this application can analyze motor motion from multiple perspectives and can serve as a reference for improving motor performance.

[0076] Based on the same concept, embodiments of the present invention also provide a motor motion analysis device. Figure 4 This is a structural block diagram of a motor motion analysis device provided in an embodiment of this application, as shown below. Figure 4 As shown, the device 400 includes: The first determining module 401 is used to perform at least one image distance determining operation on the image acquisition device until the termination condition is met, and to obtain the image distance corresponding to each image distance determining operation. The second determining module 402 is used to determine the motion analysis result of the motor of the image acquisition device based on the image distance corresponding to each image distance determination operation and the motor code value used. The image distance determination operation includes: Obtain the motor code value corresponding to the current image distance determination operation; the motor code value is a motor code value that has not been set and is selected from multiple preset motor code values; The image acquisition device captures a light spot image when its motor is set to the motor code value. The lens of the image acquisition device is covered with a light-blocking component, which includes a light-transmitting hole perpendicular to the lens plane. The height of the light-transmitting hole is greater than the preset image distance value of the image acquisition device. The light spot image is obtained by the image acquisition device capturing an image of a scene illuminated by a light source. The light spot image is analyzed to obtain information about the light spot in the image; Based on the information of the light spot, the image distance of the image acquisition device is determined.

[0077] In one embodiment, the termination condition includes: the motor has been set to each of the plurality of preset motor code values.

[0078] In one embodiment, the step of parsing the light spot image to obtain information about the light spot in the light spot image includes: Determine at least one of the key point coordinates and key parameters of the light spot in the light spot image; Based on the coordinates of the key points and at least one of the key parameters, determine the area of ​​the light spot in the light spot image; The area of ​​the light spot is used as information about the light spot.

[0079] In one embodiment, when the light spot is a polygonal light spot, the key point coordinates are the vertex coordinates of the polygonal light spot; When the light spot is a circular light spot, the key point coordinates are the coordinates of the center of the circular light spot, and the key parameter is the light spot radius of the circular light spot.

[0080] In one embodiment, determining the image distance of the image acquisition device based on the information of the light spot includes: Based on the target linear relationship, determine the image distance corresponding to the area of ​​the light spot; The corresponding image distance is taken as the image distance of the image acquisition device.

[0081] In one embodiment, the process of constructing the target linear relationship includes: An initial linear relationship is obtained, which is used to characterize the linear relationship between the area of ​​the light spot and the image distance of the image acquisition device; Multiple light spot image samples and their corresponding true image distance values ​​are acquired; the multiple light spot image samples are captured by the image acquisition device when the motors in the image acquisition device are respectively set to the multiple preset motor code values; The initial linear relationship is optimized at least once based on multiple light spot image samples until a preset termination condition is met, thereby obtaining the target linear relationship. The optimization operations include: For each of the plurality of spot image samples, the spot image sample is analyzed to obtain the area of ​​the spot in the spot image sample; Based on the area of ​​the light spot and the linear relationship corresponding to the current optimization operation, the image distance prediction value of the image acquisition device is determined; wherein, the linear relationship corresponding to the first optimization operation is the initial linear relationship; Determine the first difference between the predicted image distance value and the actual image distance value; The total loss is determined based on the first difference corresponding to each spot image sample. Based on the total loss, adjust the parameters in the linear relationship corresponding to the current optimization operation, and use the adjusted linear relationship as the linear relationship corresponding to the next optimization operation.

[0082] In one embodiment, the number of light-transmitting holes is at least two, and the number of light spots in each captured light spot image is at least two. The image distance determination operation also includes: Determine the perimeter of each spot in the light spot image, as well as the coordinates of the center point of each spot; For each light spot, the perimeter coordinates are determined based on the perimeter of the light spot and the perimeter of the corresponding light spot in the light spot image captured in the previous image distance determination operation; Based on the perimeter coordinates and the center point coordinates, the three-dimensional coordinates of the light spot are constructed; Based on the three-dimensional coordinates corresponding to each light spot, the light spot vectors between multiple light spots are determined. Based on the light spot vector, determine the normal vector; Accordingly, determining the motion analysis result of the motor of the image acquisition device based on the image distance corresponding to each image distance determination operation and the motor code value used includes: Based on the image distance corresponding to each image distance determination operation, the motor code value used, and the normal vector, the motion analysis result of the motor of the image acquisition device is determined.

[0083] In one embodiment, determining the motion analysis result of the motor of the image acquisition device based on the image distance corresponding to each image distance determination operation, the motor code value used, and the normal vector includes: For the normal vector corresponding to the first image distance determination operation, determine the normal angle between the normal vector corresponding to the image distance determination operation and at least one target normal vector; the target normal vector is the normal vector corresponding to the image distance determination operation other than the first one. Based on the image distance corresponding to each image distance determination operation, the motor code value used, and the included angle of the normal, the motion analysis result of the motor of the image acquisition device is determined.

[0084] It is understood that the device provided in the above embodiments is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0085] Reference Figure 5 The present invention also provides an electronic device, which may include a processor 502 and a memory 501, wherein the processor and the memory may be connected to each other via a bus or other means.

[0086] The processor 502 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application, or it may be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or other chips, or combinations of the above types of chips.

[0087] Memory 501 may include mass storage for data or instructions. For example, and not limitingly, memory may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory may include removable or non-removable (or fixed) media. Where appropriate, memory may be internal or external to an electronic device. In a particular embodiment, memory may be non-volatile solid-state memory.

[0088] In one instance, memory 501 may be read-only memory (ROM). In one instance, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these.

[0089] The processor 502 reads and executes computer program instructions stored in the memory to implement any of the motor motion analysis methods in the above embodiments.

[0090] In one example, the electronic device may further include a communication interface and a bus. The processor, memory, and communication interface are connected via the bus to communicate with each other. The communication interface is primarily used to enable communication between the various modules, devices, units, and / or equipment in the embodiments of this application. Where appropriate, the bus may include one or more buses.

[0091] Furthermore, in conjunction with the motor motion analysis methods in the above embodiments, this invention can be implemented using a computer-readable storage medium. This computer-readable storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the motor motion analysis methods in the above embodiments.

[0092] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. The storage medium can be read-only memory (ROM), random access memory (RAM), flash memory, hard disk drive (HDD), or solid-state drive (SSD), etc.; the storage medium can also include combinations of the above types of memory.

[0093] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.

[0094] Similarly, it should be understood that, in order to simplify this disclosure and aid in understanding one or more of the various aspects of the invention, in the above description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof. However, this method of disclosure should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as reflected in the following claims, inventive aspects lie in fewer than all features of a single foregoing disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into this detailed description, wherein each claim itself is a separate embodiment of the invention.

[0095] It should be noted that the above embodiments are illustrative of the invention and not restrictive, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The invention can be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.

Claims

1. A method for analyzing motor motion, characterized in that, The method includes: Perform at least one image distance determination operation on the image acquisition device until the termination condition is met, and obtain the image distance corresponding to each image distance determination operation. Based on the image distance corresponding to each image distance determination operation and the motor code value used, the motion analysis result of the motor of the image acquisition device is determined. The image distance determination operation includes: Obtain the motor code value corresponding to the current image distance determination operation; the motor code value is a motor code value that has not been set and is selected from multiple preset motor code values; The image acquisition device captures a light spot image when its motor is set to the motor code value. The lens of the image acquisition device is covered with a light-blocking component, which includes a light-transmitting hole perpendicular to the lens plane. The height of the light-transmitting hole is greater than the preset image distance value of the image acquisition device. The light spot image is obtained by the image acquisition device capturing an image of a scene illuminated by a light source. The light spot image is analyzed to obtain information about the light spot in the image; Based on the information of the light spot, the image distance of the image acquisition device is determined.

2. The method according to claim 1, characterized in that, The termination condition includes: the motor has been set to each of the plurality of preset motor code values.

3. The method according to claim 1 or 2, characterized in that, The step of parsing the light spot image to obtain information about the light spot in the image includes: Determine at least one of the key point coordinates and key parameters of the light spot in the light spot image; Based on the coordinates of the key points and at least one of the key parameters, determine the area of ​​the light spot in the light spot image; The area of ​​the light spot is used as information about the light spot.

4. The method according to claim 3, characterized in that, When the light spot is a polygonal light spot, the key point coordinates are the vertex coordinates of the polygonal light spot; When the light spot is a circular light spot, the key point coordinates are the coordinates of the center of the circular light spot, and the key parameter is the light spot radius of the circular light spot.

5. The method according to any one of claims 3 or 4, characterized in that, Determining the image distance of the image acquisition device based on the information of the light spot includes: Based on the target linear relationship, determine the image distance corresponding to the area of ​​the light spot; The corresponding image distance is taken as the image distance of the image acquisition device.

6. The method according to claim 5, characterized in that, The process of constructing the target linear relationship includes: An initial linear relationship is obtained, which is used to characterize the linear relationship between the area of ​​the light spot and the image distance of the image acquisition device; Multiple light spot image samples and their corresponding true image distance values ​​are acquired; the multiple light spot image samples are captured by the image acquisition device when the motors in the image acquisition device are respectively set to the multiple preset motor code values; The initial linear relationship is optimized at least once based on multiple light spot image samples until a preset termination condition is met, thereby obtaining the target linear relationship. The optimization operations include: For each of the plurality of spot image samples, the spot image sample is analyzed to obtain the area of ​​the spot in the spot image sample; Based on the area of ​​the light spot and the linear relationship corresponding to the current optimization operation, the image distance prediction value of the image acquisition device is determined; wherein, the linear relationship corresponding to the first optimization operation is the initial linear relationship; Determine the first difference between the predicted image distance value and the actual image distance value; The total loss is determined based on the first difference corresponding to each spot image sample. Based on the total loss, adjust the parameters in the linear relationship corresponding to the current optimization operation, and use the adjusted linear relationship as the linear relationship corresponding to the next optimization operation.

7. The method according to any one of claims 1 to 5, characterized in that, The number of light-transmitting holes is at least two, and the number of light spots in each captured light spot image is at least two. The image distance determination operation also includes: Determine the perimeter of each spot in the light spot image, as well as the coordinates of the center point of each spot; For each light spot, the perimeter coordinates are determined based on the perimeter of the light spot and the perimeter of the corresponding light spot in the light spot image captured in the previous image distance determination operation; Based on the perimeter coordinates and the center point coordinates, the three-dimensional coordinates of the light spot are constructed; Based on the three-dimensional coordinates corresponding to each light spot, the light spot vectors between multiple light spots are determined. Based on the light spot vector, determine the normal vector; Accordingly, determining the motion analysis result of the motor of the image acquisition device based on the image distance corresponding to each image distance determination operation and the motor code value used includes: Based on the image distance corresponding to each image distance determination operation, the motor code value used, and the normal vector, the motion analysis result of the motor of the image acquisition device is determined.

8. The method according to claim 7, characterized in that, The determination of the motion analysis results of the motor of the image acquisition device based on the image distance corresponding to each image distance determination operation, the motor code value used, and the normal vector includes: For the normal vector corresponding to the first image distance determination operation, determine the normal angle between the normal vector corresponding to the image distance determination operation and at least one target normal vector; the target normal vector is the normal vector corresponding to the image distance determination operation other than the first one. Based on the image distance corresponding to each image distance determination operation, the motor code value used, and the included angle of the normal, the motion analysis result of the motor of the image acquisition device is determined.

9. A motor motion analysis device, characterized in that, The device includes: The first determining module is used to perform at least one image distance determining operation on the image acquisition device until the termination condition is met, and to obtain the image distance corresponding to each image distance determining operation. The second determining module is used to determine the motion analysis result of the motor of the image acquisition device based on the image distance corresponding to each image distance determination operation and the motor code value used. The image distance determination operation includes: Obtain the motor code value corresponding to the current image distance determination operation; the motor code value is a motor code value that has not been set and is selected from multiple preset motor code values; The image acquisition device captures a light spot image when its motor is set to the motor code value. The lens of the image acquisition device is covered with a light-blocking component, which includes a light-transmitting hole perpendicular to the lens plane. The height of the light-transmitting hole is greater than the preset image distance value of the image acquisition device. The light spot image is obtained by the image acquisition device capturing an image of a scene illuminated by a light source. The light spot image is analyzed to obtain information about the light spot in the image; Based on the information of the light spot, the image distance of the image acquisition device is determined.

10. An electronic device, characterized in that, include: A memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, the processor executing the computer instructions to perform the method of any one of claims 1-8.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the method of any one of claims 1-8.