A method for calculating and testing the rotation angle of a camera module with a rotating shaft

By designing the test chart and two-dimensional coordinate system, combining the small hole imaging principle and the checkerboard corner point detection algorithm, the rotation angle of the camera module is calculated, and the problem of inability to accurately detect the rotation angle and shaft reliability in the existing technology is solved, and efficient rotation angle testing and shaft performance evaluation are achieved.

CN115507778BActive Publication Date: 2025-05-27CHONGQING TIANSHI AUTOMOTIVE ELECTRONICS CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211181620.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-27
Publication Date
2025-05-27
Estimated Expiration
2042-09-27

AI Technical Summary

Technical Problem

The prior art cannot accurately judge the rotation angle of the camera module with a rotary shaft and detect the reliability of its rotary shaft, and cannot meet the rotation angle detection of the design standards.

Method used

By designing the test chart, a two-dimensional coordinate system is established, and the small hole imaging principle and the checkerboard corner detection algorithm are used to calculate the rotation angle of the camera module, and the relationship curve is stored through the data table to achieve accurate calculation and testing.

Benefits of technology

Accurate calculation and testing of the rotation angle of the shaft is realized, and unqualified products can be quickly screened out to ensure the reliability of the shaft.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115507778B_ABST
    Figure CN115507778B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for calculating the rotation angle and a testing method of a camera module with a rotating shaft, which include the following steps: facing the camera towards the chart and placing it horizontally upward, taking a picture, obtaining the position of any corner point M in the chart, calculating the relationship between the projection P of the corner point M and the rotation angle, storing it as a data form, controlling the driving IC to rotate the rotating shaft, taking a picture, obtaining the position of the projection P', obtaining the distance |P'O'| from the center of the sensor, substituting |P'O'| into the data form to look up the rotation angle, obtaining the relationship between all corner points and their projection points according to the above method, controlling the driving IC to rotate the rotating shaft, calculating the rotation angles corresponding to all corner points, if |rotation angle - designed angle| < threshold, it is a qualified product, otherwise it is a defective product. The beneficial effects of the present invention include: the device has a simple structure and low cost, can accurately calculate the rotation angle of the rotating shaft, and can also test the performance of the rotating shaft, facilitating the screening of unqualified products.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of camera module testing, and particularly relates to a method for calculating and testing the rotation angle of a camera module with a rotating shaft. Background Art

[0002] With the increasing maturity of camera technology, camera products are increasingly appearing in daily life. There are various types of cameras on the market, including telescopic and rotatable ones. Currently, there is a camera module with a rotating shaft structure that can rotate in a specific direction. In order to detect the reliability of the rotating shaft and confirm whether the rotation angle of the module can meet the design standard, a fast and efficient rotating shaft testing method is needed.

[0003] The patent with the patent number CN201310272200.8 discloses a method and system for measuring the rotation angle of a camera. It sets a first qualified line and a second qualified line at specified positions on one side of the reference line of the test paper, and sets a third qualified line and a fourth qualified line at specified positions on the other side of the reference line of the test paper; fixes the camera to be tested at a position at a specified distance from the test paper, and sets the connection line between the imaging center of the camera to be tested and a point on the reference line of the test paper to be perpendicular to the plane where the test paper is located; when the camera to be tested rotates to the maximum angle to one side, acquires the first image of the test paper through the camera to be tested; when the camera to be tested rotates to the maximum angle to the other side, acquires the second image of the test paper through the camera to be tested; determines whether the center line of the first image is located between the first qualified line and the second qualified line on the first image, and determines whether the center line of the second image is located between the third qualified line and the fourth qualified line on the second image; if so, the rotation angle of the camera to be tested is within the specified angle range; otherwise, the rotation angle of the camera to be tested is not within the specified angle range.

[0004] This patent is only used to test whether the deflection angle of the camera meets the requirements, and cannot be used to accurately judge the rotation angle of the camera rotating shaft, nor can it be used to detect the reliability of the rotating shaft of the camera module. Summary of the Invention

[0005] Aiming at the deficiencies in the above-mentioned prior art, the present invention provides a calculation of the rotation angle of a camera module with a rotating shaft, which establishes a data table for accurately calculating the rotation angle of the camera module.

[0006] To achieve the above object, the present invention adopts the following technical solutions:

[0007] A method for calculating the rotation angle of a camera module with a rotating shaft, characterized by including the following steps,

[0008] S1. Design a test chart (graphic), where the chart is a planar graphic with multiple cross chessboard corner points;

[0009] S2. Arrange the camera with a rotating shaft camera module horizontally upward, fix the chart directly above the camera, reset the rotation angle of the rotating shaft of the camera module to zero, establish a two-dimensional coordinate system. Take the section plane of the image sensor sensor of the camera module as the X-axis, the midpoint of the section plane of the image sensor sensor as the coordinate origin O(0,0), the horizontal right direction as the positive direction of the X-axis, and the direction perpendicular to the sensor section plane upward as the positive direction of the Y-axis. The unit of this coordinate system is pixel (pixel); Let the center of the rotating shaft of the camera module be point A, and the optical center of the lens be point D. The trajectory of point D rotating around point A for one week is a circle C, and the circle C intersects the X-axis at points B and Q;

[0010] S3. Use the camera to take a clear and non-overexposed picture of the chart. In the coordinate system, draw a perpendicular line from point D to intersect the chart plane at point I. The length of the line segment DI is measured as h;

[0011] S4. For any corner point M on the chart, according to the principle of pinhole imaging, the projection point of the corner point M on the sensor section plane through the optical center D is P. The coordinates of point P obtained through the chessboard corner detection algorithm are P(x p ,0). Since the perpendicular distance from point M to point D is h, and DO is the effective focal length EFL, according to the property of similar triangles, the coordinates of point M can be obtained as:

[0012] M(-x p *h / EFL,(h + EFL) / pixelsize)

[0013] where pixelsize is the actual physical distance per pixel of the sensor;

[0014] S5. After the camera module rotates a certain angle around the rotating shaft, the center coordinate of the sensor is point O', the optical center of the lens is D', and the projection point of M moves to P'. The rotation angle is defined as ∠DAD';

[0015] S6. Draw a parallel line to the x-axis through point A to intersect the circle C at points H and G. In order to obtain the relationship between ∠DAD' and the position of point P', the following method is proposed:

[0016] S6.1. Assume that the line segment D'A rotates counterclockwise around point A, and calculate the coordinates of D' once every α degrees increase in ∠D'AG:

[0017] D'(EFL * cos(∠D'AG), EFL * sin(∠D'AG));

[0018] S6.2. The M point has been obtained in step S4, and the coordinates of point A are also known. The linear equations of MD’ and D’A can be solved. Since AO = AO’, the coordinates of O’ can be obtained. Since the line segment EF passes through point O’ and is perpendicular to D’A, the linear equation of EF can be solved. Both the line segment EF and the ray MD’ are known, and the coordinates of their intersection point P’ can be obtained. Furthermore, the linear distance |P’O’| from P’ to O’ can be calculated.

[0019] S6.3. Repeat steps S6.1 and S6.2 180 / α times. ∠D’AG increases from 0° to 180°, and ∠DAD’ = ∠D’AG - 90°. Using ∠DAD’ as the independent variable and |P’O’| as the dependent variable, a relationship curve is formed, and these points are stored as a data form to obtain the rotation angle.

[0020] The present invention also aims to provide a method for testing the rotation angle of a camera module with a rotating shaft, which is characterized in that: the above method for calculating the rotation angle of the camera module with a rotating shaft further includes the following steps.

[0021] S7. Simultaneously perform the table building in step S6 for multiple corner points in the chart.

[0022] S8. Adjust the corresponding register code of the rotating shaft drive chip IC at a fixed step to make the rotating shaft rotate; each time the register is adjusted, the chart is photographed. For any corner point M, the coordinates of its projection point P’ are obtained through the corner point detection algorithm, so as to calculate the corresponding |P’O’|; then |P’O’| is brought into the data form pre-calculated in step S6 to query the rotation angle ∠DAD’ closest to it.

[0023] S9. Continuously repeat step S8, and each time it is repeated, the rotation angle ∠DAD’ corresponding to all corner points needs to be calculated. i (i = 1, 2, 3... n). According to the designed angle β of the rotating shaft module, a threshold δ is set. When |∠DAD’ i - β| < δ (i = 1, 2, 3... n), this rotating shaft module is a good product, and at this time the rotating shaft stops rotating; otherwise, the rotating shaft continues to move until the code exceeds the predetermined range.

[0024] S10. When the product is determined to be a good product in step 9, obtain the register code of the rotating shaft drive IC at this time. According to the standard code’ obtained from the pre-production data, a threshold δ’ is set. When |code - code’| < δ’, this product is a good product; otherwise, it is a defective product.

[0025] Furthermore, in step S8, due to the symmetry of the curve, usually two rotation angle values, left and right, will be obtained when looking up the table with |P’O’|. The correct rotation angle ∠DAD’ can be selected by the left and right directions of the P’ point in the center of the image.

[0026] The beneficial effects of the present invention include: the device has a simple structure and low cost, can accurately calculate the rotation angle of the rotating shaft, and can also test the performance of the rotating shaft, facilitating the screening of unqualified products. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 is a test picture for testing the present invention;

[0028] Figure 2 is a schematic diagram of the two-dimensional coordinate system constructed by the present invention;

[0029] Figure 3 is a schematic diagram of the change in the position of the rotating shaft of the camera module of the present invention in the two-dimensional coordinate system after rotation;

[0030] Figure 4 is a simulation diagram of the rotation of the rotating shaft of the camera module of the present invention in the two-dimensional coordinate system;

[0031] Figure 5 is a curve graph showing the relationship between the rotation angle and the distance from the projection point to the origin of the present invention;

[0032] Figure 6 is a data chart of the rotation angle of the present invention;

[0033] Figure 7 is a flow chart for calculating the rotation angle of the present invention;

[0034] Figure 8 is a flow chart for testing the rotating shaft of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0035] The present invention will be further described in detail below in conjunction with specific embodiments and the accompanying drawings.

[0036] According to Figure 7 the rotation angle calculation process shown, the following steps are included,

[0037] 1. As Figure 1 Design a test chart, which can have n cross-checkerboard corner points.

[0038] 2. Place the camera facing the chart and horizontally upward, and set the rotation angle of the rotating shaft to zero to establish as Figure 2Two-dimensional coordinate system. The line segment EF is the cross-section of the image sensor, with its center being the origin O(0,0) of the coordinate system. The positive x-axis direction is horizontally to the right, and the positive y-axis direction is perpendicular to the sensor cross-section and upward. The center of the rotation axis is A, the optical center of the lens is D, and the circle c is the trajectory of the optical center D of the lens moving in a circle, intersecting the x-axis at two points B and Q. The unit of this coordinate system is pixel (picture element), and according to the specification of the corresponding sensor, the actual physical distance of each pixel is pixelsize millimeters.

[0039] 3. Take a clear and non-overexposed picture of the chart. At this time, the perpendicular distance from the camera lens D to the chart plane is the line segment DI, and the physical distance of DI can be measured and is set as h millimeters here.

[0040] 4. For any corner point M on the chart, according to the principle of pinhole imaging, the projection point of the corner point M on the sensor cross-section through the optical center D is P. Since the P point is imaged on the sensor, its coordinates P(x p ,0) can be obtained through the checkerboard corner detection algorithm. The perpendicular physical distance from the M point to the lens D is h, and DO is the effective focal length EFL (unit: millimeter). According to the property of similar triangles, the coordinates of M can be obtained as:

[0041] M(-x p *h / EFL,(h + EFL) / pixelsize).

[0042] 5. As Figure 3 , after rotating by a certain angle, the center coordinates of the sensor are the point O', the optical center of the lens is D', and the projection point of M moves to P'. The rotation angle is defined as ∠DAD'.

[0043] 6. As Figure 4 , draw a parallel line to the x-axis through point A, intersecting the circle c at points H and G. In order to obtain the relationship between ∠DAD' and the position of point P', the following method is proposed:

[0044] (1) Assume that the line segment D'A rotates counterclockwise around A, and calculate the coordinates of D' once every α degrees increase in ∠D'AG:

[0045] D'(EFL * cos(∠D'AG), EFL * sin(∠D'AG))

[0046] (2) The coordinates of the M point have been obtained in step 4, and the coordinates of point A are also known. The straight-line equations of MD' and D'A can be solved. Since AO = AO', the coordinates of O' can be obtained. Since the line segment EF passes through point O' and is perpendicular to D'A, the straight-line equation of EF can be solved. Both the line segment EF and the ray MD' are known, and the coordinates of their intersection point P' can be obtained, and then the straight-line distance |P'O'| from P' to O' can be calculated.

[0047] (3) Repeat steps (1) and (2) 180 / α times. ∠D’AG increases from 0° to 180°, and ∠DAD’ = ∠D’AG - 90°. Using ∠DAD’ as the independent variable and |P’O’| as the dependent variable, form a relationship curve as shown in Figure 5 and store these points as a data form. The data structure of this form is as shown in Figure 6 .

[0048] According to Figure 8 the shaft rotation test flow chart shown, the shaft rotation test includes the following steps.

[0049] 7. When actually performing the shaft rotation test, the table building operation in step 6 needs to be carried out for all n corner points simultaneously.

[0050] 8. Adjust the corresponding register code (digital-to-analog conversion analog quantity) of the shaft drive IC (chip) at a fixed step to make the shaft rotate. Take a picture every time the register is adjusted. For any corner point M, obtain the coordinates of its current projection point P’ through the corner point detection algorithm, and then calculate the corresponding |P’O’|. Then substitute |P’O’| into the data form pre-calculated in step 6 to query the closest rotation angle ∠DAD’. Since Figure 5 the curve is symmetric, substituting |P’O’| into the table usually gives two rotation angles on the left and right. The correct rotation angle ∠DAD’ can be selected by the left and right directions of the P’ point relative to the center of the image.

[0051] 9. Keep repeating step 8. Each time it is repeated, calculate the rotation angle ∠DAD’ corresponding to all corner points i (i = 1, 2, 3... n). According to the designed angle β of the shaft module, set a threshold δ. When |∠DAD’ i - β| < δ (i = 1, 2, 3... n), this shaft module is a good product, and at this time the shaft stops rotating; otherwise, the shaft continues to move until the code exceeds the predetermined range.

[0052] 10. When the product is determined to be a good product by step 9, obtain the register code of the shaft drive IC at this time. According to the standard code’ (standard digital-to-analog conversion analog quantity) obtained from the previous trial production data, set a threshold δ’. When |code - code’| < δ’, this product is a good product; otherwise, it is a defective product.

[0053] The above has introduced in detail the technical solutions provided by the embodiments of the present invention. Specific examples are used herein to elaborate on the principles and implementation manners of the embodiments of the present invention. The description of the above embodiments is only applicable to helping understand the principles of the embodiments of the present invention; at the same time, for those of ordinary skill in the art, according to the embodiments of the present invention, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation on the present invention.

Claims

1. A method for calculating the rotation angle of a camera module with a rotating shaft, characterized in that: It includes the following steps, S1. Design a test chart, and the chart is a planar graph with multiple cross-checkerboard corner points; S2. Arrange the camera of the camera module with a rotating shaft horizontally upward, fix the chart directly above the camera, zero the rotation angle of the rotating shaft of the camera module, establish a two-dimensional coordinate system, take the section plane of the image sensor sensor of the camera module as the X-axis, the midpoint of the section plane of the image sensor sensor as the coordinate origin O(0,0), the horizontal right direction as the positive direction of the X-axis, and the direction perpendicular to the sensor section plane upward as the positive direction of the Y-axis. The unit of this coordinate system is pixel; let the center of the rotating shaft of the camera module be point A, and the optical center of the lens be point D. The trajectory of point D rotating around point A for one week is a circle C, and the circle C intersects the X-axis at two points B and Q; S3. Use the camera to take a clear picture of the chart without overexposure. In the coordinate system, draw a perpendicular line from point D to intersect the chart plane at point I, and the length of the line segment DI is measured as h; S4. For any corner point M on the chart, according to the principle of pinhole imaging, the projection point of the corner point M on the sensor plane through the optical center D is P, and the coordinates of point P obtained by the chessboard corner detection algorithm are P(x p , 0). Since the perpendicular distance from point M to point D is h and DO is the effective focal length EFL, according to the property of similar triangles, the coordinates of point M can be obtained as follows: M(-x p *h / EFL,(h + EFL) / pixelsize) where pixelsize is the actual physical distance of each pixel of the sensor; S5. After the camera module rotates a certain angle around the rotating shaft, the center coordinate of the sensor is point O’, the optical center of the lens is D’, and the projection point of M moves to P’. The rotation angle is defined as ∠DAD’; S6. Draw a parallel line to the x-axis through point A to intersect the circle C at points H and G. In order to obtain the relationship between ∠DAD’ and the position of point P’, the following method is proposed: S6.

1. Assume that the line segment D’A rotates counterclockwise around point A, and calculate the coordinates of D’ once every α degrees increase in ∠D’AG: D’(EFL*cos(∠D’AG), EFL*sin(∠D’AG)); S6.

2. The coordinates of point M have been obtained in step S4, and the coordinates of point A are also known. The straight-line equations of MD’ and D’A can be solved. Since AO = AO’, the coordinates of O’ can be obtained. Since the line segment EF passes through point O’ and is perpendicular to D’A, the straight-line equation of EF can be solved. Both the line segment EF and the ray MD’ are known, and the coordinates of their intersection point P’ can be obtained, and then the straight-line distance |P’O’| from P’ to O’ can be calculated. S6.

3. Repeat steps S6.1 and S6.2 180 / α times. ∠D’AG increases from 0° to 180°, and ∠DAD’ = ∠D’AG - 90°. Taking ∠DAD’ as the independent variable and |P’O’| as the dependent variable, form a relationship curve, and store these points as a data form to obtain the rotation angle.

2. A method for testing the rotation angle of a camera module with a rotating shaft, characterized in that: Based on the method for calculating the rotation angle of the camera module with a rotating shaft described in claim 1, it further includes the following steps, S7. Simultaneously perform the table building in step S6 for multiple corner points in the chart, S8. Adjust the corresponding register code of the shaft drive chip IC at a fixed step to rotate the shaft; take a chart each time the register is adjusted. For any corner point M, obtain the coordinates of its current projection point P' through the corner point detection algorithm, and thus calculate the corresponding |P'O'|; then substitute |P'O'| into the data form pre-calculated in step S6 to query the closest rotation angle ∠DAD'. S9. Continuously repeat step S8. Each time it is repeated, calculate the rotation angle ∠DAD' corresponding to all corner points. i (i = 1, 2, 3...n). According to the designed angle β of the rotating shaft module, set a threshold δ. When |∠DAD' i -β| < δ (i = 1, 2, 3...n), this rotating shaft module is a good product. At this time, the rotating shaft stops rotating. Otherwise, the rotating shaft continues to move until the code exceeds the predetermined range. S10. When the product is determined to be a good product in step 9, obtain the register code of the shaft drive IC at this time. Based on the standard code' obtained from the pre-production data, set a threshold δ'. When |code - code'| < δ', the product is a good product; otherwise, it is a defective product.

3. A method for testing the rotation angle of a camera module with a rotating shaft according to claim 2, characterized in that: In step S8, due to the symmetry of the curve, usually two rotation angle values, left and right, will be obtained by looking up the table with |P'O'|. The correct rotation angle ∠DAD' can be selected by the left-right direction of the P' point in the center of the image.

Citation Information

Patent Citations

  • A method and system for measuring the rotation angle of a camera.

    CN103344200B

  • Method and system for measuring rotation angle of camera

    CN103344200A

  • A method for calibrating a fisheye lens

    CN109003311A