A camera assembly skew angle measurement method and device and related products

By using a simple combination of calibration test platform and angle reference line, the hardware complexity and cost issues of camera assembly misalignment detection are solved, enabling efficient and low-cost batch testing.

CN122335978APending Publication Date: 2026-07-03深圳市星桐科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610427230.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-01
Publication Date
2026-07-03

Smart Images

  • Figure CN122335978A_ABST
    Figure CN122335978A_ABST
Patent Text Reader

Abstract

This invention discloses a method, apparatus, and related products for measuring the tilt angle of a camera assembly, relating to the field of camera inspection technology. The method includes: acquiring reference alignment parameters; establishing a parallel reference relationship between the device's reference edge and a parallel calibration line on a calibration medium to complete test reference calibration; acquiring a preview image of the parallel calibration line; superimposing an angle reference line with a preset tilt angle onto the preview image to generate an angle comparison view; extracting the imaging features of the parallel calibration line from the angle comparison view; and comparing and analyzing the imaging features with the angle reference line to obtain the camera assembly tilt angle. This solution improves inspection efficiency, reduces costs, and enhances compatibility.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of camera detection technology, and more specifically, to a method, apparatus, and related products for measuring the tilt angle of a camera assembly. Background Technology

[0002] In the mass production assembly of smart hardware devices, the camera, as a core imaging component, directly affects the device's shooting performance, visual algorithm compatibility, and overall product quality due to the accuracy of its assembly posture. Accurately obtaining the camera's assembly tilt angle is crucial for tracing the root causes of process deviations, optimizing structural design, and improving product consistency. It is also significant for reducing defect rates and controlling production costs.

[0003] In existing technologies, a typical camera skew detection scheme is based on a measurement system that combines laser ranging and a robotic arm. This scheme uses a fixture to fix the camera assembly, and a multi-degree-of-freedom robotic arm carrying a laser measuring instrument scans multiple test surfaces of the camera and the reference surface of the reference mechanism one by one. Three-dimensional spatial data is collected using the laser ranging principle, and then a dedicated algorithm calculates the angular deviation between each test surface and the reference surface, thereby determining the camera's assembly skew angle. The entire system requires customized fixtures, a high-precision robotic arm, a laser measuring instrument, and a dedicated data processing host, and must be calibrated and tested in a stable environment.

[0004] The existing technical solution has obvious technical drawbacks: the system hardware is complex, bulky and expensive, different models of cameras need to be adapted to corresponding customized chemical equipment, resulting in poor compatibility; at the same time, the process of adjusting the posture of the robotic arm, laser scanning and data processing is cumbersome, and the detection time of a single device is long, making it difficult to meet the rapid detection needs of large-scale mass production. Summary of the Invention

[0005] To address one or more technical problems in the prior art, this invention provides a method for measuring the tilt angle of a camera assembly, comprising: acquiring reference alignment parameters, establishing a parallel reference relationship between the device reference edge and a parallel calibration line on a calibration medium, and completing test reference calibration; acquiring a preview image of the parallel calibration line, superimposing an angle reference line with a preset tilt angle onto the preview image to generate an angle comparison view; extracting the imaging features of the parallel calibration line in the angle comparison view, and comparing and analyzing the imaging features with the angle reference line to obtain the camera assembly tilt angle.

[0006] This application also provides a camera assembly tilt angle measuring device, which can apply the above-described camera assembly tilt angle measuring method. The device includes:

[0007] Reference alignment unit: used to perform reference alignment and fixing operations on the support structure, calibration medium and camera device under test, so that the lower edge of the camera device under test, the positioning lower edge of the support structure and the parallel calibration lines on the calibration medium are kept parallel to each other, so as to obtain a calibration test platform; View generation unit: used to start the camera device under test based on the calibration test platform to frame the parallel calibration line, and overlay multiple angle reference lines originating from the same reference origin and having different preset tilt angles on the obtained frame preview interface to generate a multi-dimensional angle comparison view. Angle Analysis Unit: Used to extract the imaging features of parallel calibration lines based on multi-dimensional angle comparison views, and to perform intersection state analysis between the imaging features of parallel calibration lines and angle reference lines to obtain the camera assembly tilt angle.

[0008] This application also provides a computer device, the device including a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the camera assembly tilt angle measurement method.

[0009] This application also provides a computer program product or computer program, which includes computer instructions that, when executed by a processor, implement a method for measuring the tilt angle of a camera assembly.

[0010] The beneficial effects of this invention are: The camera assembly tilt angle measurement method provided in this application adopts a simple combination of support structure, calibration medium, and the camera device under test to build a calibration test platform, significantly reducing testing costs. The calibration medium supports various carriers such as solid plates, flexible sheet materials, or electronic display devices. The support structure can be adjusted to adapt to different models of the camera device under test, solving the problem of poor compatibility in existing technologies and meeting the batch testing needs of various product types on production lines. Furthermore, in terms of testing efficiency, this solution uses the camera device under test itself to acquire images, eliminating the need for additional image sensors. A multi-dimensional angle comparison view is generated by directly overlaying angle reference lines in the viewfinder preview interface, omitting the complex cross-device data transmission steps in existing technologies. Subsequent tilt angle can be obtained simply through intersection state analysis, eliminating the need for cumbersome multi-step algorithm calculations, greatly simplifying the testing process and effectively improving the testing speed on production lines. Moreover, in terms of ease of operation, this solution ensures measurement consistency through "parallel reference alignment," and the angle reference lines use differentiated color markings to quickly locate the angle range of the imaging features, making the results intuitive and readable. This solution improves testing efficiency, reduces costs, and enhances compatibility. Attached Figure Description

[0011] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof.

[0012] Figure 1 This is a schematic diagram of the overall process of a camera assembly tilt angle measurement method provided in an embodiment of this application; Figure 2 A schematic diagram of a calibration test platform for a camera assembly tilt angle measurement method provided in this application embodiment; Figure 3 A schematic diagram of a calibration test platform for a camera assembly tilt angle measurement method provided in this application embodiment; Figure 4 A schematic diagram of parallel calibration lines on a calibration medium for a method of measuring the tilt angle of a camera assembly provided in this application embodiment; Figure 5 A schematic diagram of angle reference lines on the viewfinder preview interface of a camera assembly tilt angle measurement method provided in this application embodiment; Figure 6 A schematic diagram of an angle reference line for a method of measuring the tilt angle of a camera assembly provided in this application embodiment; Figure 7 A multi-dimensional angle comparison view of a method for measuring the tilt angle of a camera assembly provided in this application embodiment; Figure 8 A system block diagram of a camera assembly tilt angle measuring device provided in this application embodiment; Figure 9 A hardware structure block diagram of an electronic device for measuring the tilt angle of a camera assembly, provided in an embodiment of this application; In the figure, the labels represent: 1. Support structure; 2. Calibration medium; 3. Camera device under test. Detailed Implementation

[0013] The present invention will now be described in detail with reference to the accompanying drawings and embodiments. Various aspects are provided by way of explanation and not limitation of the invention. Indeed, those skilled in the art will recognize that modifications and variations can be made to the invention without departing from its scope or spirit. For example, a feature represented or described as part of one embodiment may be used in another embodiment to produce yet another embodiment. Therefore, it is desirable that the invention encompass such modifications and variations falling within the scope of the appended claims and their equivalents.

[0014] In the description of this invention, the terms "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," and "bottom," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and do not require the invention to be constructed and operated in a specific orientation; therefore, they should not be construed as limitations on the invention. The terms "connected," "linked," and "set up" used in this invention should be interpreted broadly. For example, they can refer to a fixed connection or a detachable connection; they can refer to a direct connection or an indirect connection through intermediate components. Those skilled in the art can understand the specific meaning of the above terms according to the specific circumstances.

[0015] like Figures 1-7 As shown, this application provides a method for measuring the tilt angle of a camera assembly. The method includes: acquiring reference alignment parameters; establishing a parallel reference relationship between the device reference edge and a parallel calibration line on a calibration medium; completing test reference calibration; acquiring a preview image of the parallel calibration line; superimposing an angle reference line with a preset tilt angle onto the preview image to generate an angle comparison view; extracting the imaging features of the parallel calibration line in the angle comparison view; comparing and analyzing the imaging features with the angle reference line to obtain the camera assembly tilt angle.

[0016] The calibration of the test benchmark can be achieved by performing benchmark alignment and fixing operations on the support structure 1, calibration medium 2, and the camera device under test 3, so that the lower edge of the camera device under test 3, the lower edge of the support structure 1, and the parallel calibration lines on the calibration medium 2 are kept parallel to each other, thus obtaining a calibration test platform and completing the test benchmark calibration. The generation of an angle comparison view can be achieved by starting the camera device under test 3 based on the calibration test platform to frame the parallel calibration lines, and then overlaying multiple angle reference lines originating from the same benchmark origin and having different preset tilt angles on the resulting preview interface to generate a multi-dimensional angle comparison view, which is a specific implementation of the angle comparison view. The camera assembly tilt angle can be obtained by extracting the imaging features of the parallel calibration lines based on the multi-dimensional angle comparison view, and then analyzing the intersection state of the imaging features of the parallel calibration lines with the angle reference lines, thus obtaining the camera assembly tilt angle, which is a specific implementation of the comparative analysis.

[0017] Optionally, the step of obtaining the reference alignment parameters, establishing the parallel reference relationship between the device reference edge and the parallel calibration lines on the calibration medium, and completing the test reference calibration includes: obtaining the configuration parameters of the calibration medium and generating a calibration medium with equally spaced parallel calibration lines; obtaining the device positioning parameters, establishing the alignment relationship between the device reference edge and the positioning reference edge, and completing the initial positioning of the device; obtaining the position parameters of the calibration medium, adjusting the relative posture of the parallel calibration lines and the device reference edge to keep them parallel, and completing the reference alignment; and locking the parameters of the device and calibration medium after the reference alignment is completed, and completing the test reference calibration.

[0018] In one specific implementation, the above steps can be performed by aligning and fixing the support structure 1, calibration medium 2, and camera device under test 3. This process includes: selecting a base carrier for the calibration medium 2, and creating a calibration medium 2 with parallel calibration lines arranged at equal intervals on the base carrier; placing the camera device under test 3 on the support structure 1, aligning and fitting the lower edge of the camera device under test with the lower edge of the support structure 1 to complete initial positioning; fixing the calibration medium 2 with parallel calibration lines at the near end of the support structure 1, and adjusting the relative angle between the support structure 1 and the horizontal support surface to keep the parallel calibration lines parallel to the lower edge of the camera device under test 3 to complete the alignment; locking the fitted camera device under test 3, the angle-fixed support structure 1, and the position-fixed calibration medium 2 to obtain a calibration test platform, and calibrating the test reference through the calibration test platform.

[0019] Optionally, the process of selecting the base carrier of calibration medium 2 and generating calibration medium 2 with parallel calibration lines includes: selecting a solid plate, flexible sheet material, or electronic display device as the base carrier of calibration medium 2, ensuring that the surface of the base carrier is flat and free of distortion; planning the arrangement area of ​​parallel calibration lines on the base carrier, and setting the spacing parameters and extension direction of the parallel calibration lines; and printing or displaying the parallel calibration lines on the base carrier according to the planned arrangement area, spacing parameters, and extension direction to generate calibration medium 2 with parallel calibration lines.

[0020] Preferably, the specific implementation process of the adaptability screening and preprocessing of the basic carrier is as follows: Based on the camera imaging parameters of the camera device 3 under test, the candidate basic carriers are subjected to characteristic detection and optimization processing to generate an adaptable substrate; specifically, the core imaging parameters such as the field of view, resolution, and focus range of the camera are first obtained, and the surface flatness, size specifications, and material light transmittance requirements that the basic carrier must meet are determined according to these parameters; candidate carriers are selected from solid plates, flexible sheet materials, or electronic display devices, and the surface roughness of the candidate carriers is detected by an optical profilometer (it needs to be controlled below a preset threshold, such as 0.1 micrometers), and the size measurement tool is used to verify whether the carrier size covers the maximum field of view of the camera; the surface of the solid carrier is cleaned and polished to remove scratches, stains, and other impurities that affect imaging, and the pixel calibration of the electronic display device is performed to ensure that the luminous intensity of each pixel is uniform, and finally an adaptable substrate with surface characteristics and size specifications that meet the requirements is obtained. Preferably, in the specific technical implementation of parallel calibration line parameter planning and precise generation: based on the characteristics of the adaptability substrate and the camera imaging parameters, the arrangement parameters of the parallel calibration lines are intelligently planned, and a standardized calibration line group is generated through high-precision manufacturing technology to obtain the calibration medium 2 with parallel calibration lines; specifically, an imaging parameter-calibration line parameter mapping model is first established. The input of this model is the camera's field of view and resolution, and the output is the arrangement parameters of the parallel calibration lines, such as row spacing, line width, and extension length; according to the output of the mapping model, the arrangement area of ​​the calibration lines is planned to ensure that the calibration line group is fully presented within the camera's field of view, and the row spacing is set to a distance that ensures that adjacent calibration lines remain clearly distinguishable after imaging (e.g., 6 pounds, specifically depending on...). (Resolution dynamically adjusted), line width set to a range that balances image clarity and anti-interference (e.g., 2-3 pixels wide); for physical adaptable substrates, high-precision inkjet printing technology is used to print calibration lines based on planned arrangement parameters. During the printing process, a visual positioning system corrects printing deviations in real time to ensure that the parallelism error of the line group is lower than the preset value; for electronic display device adaptable substrates, the light emission state of specified pixels is precisely controlled through a pixel-driven algorithm to form a parallel calibration line group; if the physical substrate has redundant blank areas such as headers, it is trimmed along the edge of the first calibration line to finally obtain calibration medium 2 with parallel calibration lines. The parallelism and clarity of the line group of calibration medium 2 can meet the subsequent angle measurement requirements.

[0021] Preferably, the specific implementation process of validating and fine-tuning the parameters of calibration medium 2 is as follows: Imaging tests and parameter optimization are performed on calibration medium 2 with parallel calibration lines to generate the optimal calibration medium 2. Specifically, the initially generated calibration medium 2 with parallel calibration lines is placed in a preset position of the test system, and the camera of the camera device under test 3 is activated to capture the image data of the calibration line group. The designed straight line feature extraction algorithm is used to process the image data. This algorithm first performs Gaussian filtering to remove noise from the image, then enhances the contrast between the calibration lines and the background through adaptive threshold segmentation, and finally detects the straightness and parallelism parameters of the calibration lines based on the improved Hough transform algorithm. If the straightness parameter does not meet the standard, the physical medium is reprinted or polished, and the pixel driving parameters of the electronic display device are recalibrated. If the parallelism parameter has a deviation, the fixed position of calibration medium 2 is adjusted or the calibration line arrangement parameters are replanned. The above testing and adjustment process is repeated until the imaging straightness and parallelism of the calibration line group meet the preset requirements, generating the optimal calibration medium 2. This optimal calibration medium 2 can ensure the accuracy of subsequent comparison with the angle reference line.

[0022] Preferably, one implementation process for the attitude calibration and preliminary positioning of the camera device 3 under test includes: based on the positioning lower edge features of the support structure 1, a simple fitting positioning method is used to quickly fix the camera device 3 under test, generating a preliminary positioning body for the device; specifically, the positioning lower edge of the support structure 1 is pre-designed as a flat reference surface, and the lower edge of the camera device 3 under test is directly placed in contact with this reference surface. Positioning is assisted by alignment or simple limiting blocks to ensure that the lower edge of the device and the positioning lower edge of the support structure are in contact along the same extension direction, and the contact gap is controlled within a reasonable range that does not affect the measurement accuracy (e.g., within 1 mm); a snap-on or magnetic quick fixing structure is used to fix the camera device 3 under test, without the need for complex clamping force adjustment, only to ensure that there is no obvious displacement after the device is placed, quickly forming a preliminary positioning body for the device. The entire positioning process takes no more than 1 second, which is suitable for the fast testing rhythm of the production line. Preferably, in the specific technical implementation of spatial positioning and parallel calibration of calibration medium 2: based on the reference characteristics of support structure 1 and the lower edge reference of the preliminary positioning body of the equipment, a simple fixing method with a preset parallel relationship is adopted to quickly complete the positioning and calibration of calibration medium 2 and generate a medium calibration body; specifically, a calibration medium mounting position is preset at the near end of support structure 1. The design of this mounting position has ensured that: after calibration medium 2 is fixed, the parallel calibration lines on its surface are parallel to the lower edge of the positioning of support structure 1, and thus form a parallel relationship with the lower edge of the camera device 3 under test; the calibration medium 2 with parallel calibration lines is installed in the preset mounting position, and the fixing and calibration are completed after confirming that the calibration medium is not skewed or obstructed, generating a medium calibration body.

[0023] Optionally, the step of acquiring a preview image of the parallel calibration line and overlaying an angle reference line with a preset tilt angle onto the preview image to generate an angle comparison view includes: acquiring a real-time image of the parallel calibration line based on a calibrated test benchmark to generate a preview image; determining the reference origin of the angle reference line; drawing a 0-degree reference line parallel to the device reference edge with the reference origin as the starting point, and drawing multiple angle reference lines with different preset tilt angles on both sides of the 0-degree reference line to obtain an angle reference line group; assigning a differentiated identifier to each angle reference line in the angle reference line group; and overlaying the angle reference line group onto the preview image to generate an angle comparison view.

[0024] In one specific implementation, the above steps can be achieved through the following process: Based on the calibration test platform, the camera image acquisition function of the camera device under test 3 is activated, and the image is captured by aligning with the parallel calibration line on the calibration medium to obtain a preview interface; the center point of the lens of the camera device under test is determined, and this center point is used as the reference origin of the angle reference line; starting from the reference origin, a 0-degree reference line parallel to the lower edge of the camera device under test is drawn, and then multiple angle reference lines with different tilt angles are drawn on both sides of the 0-degree reference line at equal angular intervals to obtain an angle reference line group; each angle reference line in the angle reference line group is assigned a different color identifier, and all angle reference lines are superimposed and displayed on the preview interface to generate a multi-dimensional angle comparison view.

[0025] Optionally, the process of activating the camera image acquisition function of the camera device under test 3 and obtaining the viewfinder preview interface based on the calibration test platform includes: determining that the image acquisition area of ​​the camera device under test 3 covers the calibration medium 2 based on the calibration test platform; calling the camera driver module of the camera device under test 3 to activate the image sensor and start the image data stream; and processing the image data stream in real time to generate and display a viewfinder preview screen containing parallel calibration lines. Preferably, the specific implementation process of the image acquisition area adaptation calibration and parameter configuration is as follows: Based on the reference relationship of the calibration test platform and the parameters of calibration medium 2, the acquisition area and imaging parameters of the camera are precisely configured to generate an acquisition adaptation parameter set; specifically, the physical parameters such as the size specifications and the arrangement range of parallel calibration lines of calibration medium 2 are extracted from the calibration test platform, and combined with the hardware parameters such as the field of view and focal length of the camera, an acquisition area mapping model is established; the effective acquisition range to be covered by the camera is calculated through this model to ensure that the parallel calibration line group of calibration medium 2 falls completely within the acquisition area without edge clipping or exceeding the field of view; at the same time, according to the surface reflectivity of calibration medium 2 and the ambient light intensity, the imaging parameters such as the camera's exposure time and sensitivity are adjusted. The exposure time is set to the range to avoid blurring of calibration lines (e.g., 1 / 500 second to 1 / 200 second), and the sensitivity is set to the range to reduce noise without losing details (e.g., ISO 100 to ISO 400), finally forming an acquisition adaptation parameter set containing the acquisition range coordinates and imaging parameters. Preferably, in the specific technical implementation of camera driver activation and image data stream initiation: based on the acquisition adaptation parameter set, the camera driver module is called and the image sensor is activated to generate the raw image data stream; specifically, the imaging parameters in the acquisition adaptation parameter set are first parsed and converted into control commands that the camera driver module can recognize, including exposure control commands, sensitivity adjustment commands, acquisition resolution commands, etc.; the camera driver module is called and the control commands are sent, and after the driver module responds, the image sensor is activated and the image sensor is controlled to perform photoelectric conversion according to the set acquisition resolution (e.g., consistent with the screen resolution of the device under test); the image sensor converts the acquired optical signals into electrical signals, and after analog-to-digital conversion, the raw image data stream is generated. This data stream is transmitted in the form of continuous frames, and the frame rate is set to meet the requirements of real-time preview (e.g., 30 frames / second) to ensure that the preview screen has no stuttering or delay.Preferably, the specific implementation process of real-time optimization processing and preview image generation of the original image data stream is as follows: The original image data stream is specifically optimized to generate a preview image containing clear parallel calibration lines. Specifically, a designed frame data filtering algorithm is first used to filter out effective frame data with no motion blur and low noise from the original image data stream. This algorithm calculates the difference and variance of grayscale values ​​between adjacent frames to eliminate invalid frames caused by slight jitter or sudden changes in light. The effective frame data is then enhanced by first using an adaptive histogram equalization algorithm to improve the contrast between the calibration lines and the background, and then using a median filtering algorithm to remove residual noise while preserving the edge details of the calibration lines. Based on the parallel reference relationship of the calibration test platform, slight distortion correction is performed on the processed frame data to ensure that the parallel calibration lines are free of geometric distortion in the image. Finally, the optimized frame data is converted according to the screen display format and output to the display module of the device under test to generate a preview image containing clear and complete parallel calibration lines. This preview image can be directly used for subsequent angle reference line overlay and intersection state analysis.

[0026] Preferably, in a scenario, the acquisition and calibration of camera optical parameters are performed, and the specific implementation process is as follows: Based on the camera hardware specifications of the camera device 3 under test, core optical parameters are acquired and error calibration is performed to generate a precise optical parameter set; specifically, the original optical parameters such as focal length, sensor size, and pixel pitch are extracted from the camera's hardware configuration information. These parameters are the basis for calculating the lens center point; the original optical parameters are calibrated using a standard calibration board. The standard calibration board is placed at a preset distance, the calibration board image is acquired, and the pixel coordinates and actual physical coordinates of the feature points are extracted to establish a pixel-physical coordinate mapping relationship; based on this mapping relationship, the distortion errors (including radial distortion and tangential distortion) in the original optical parameters are corrected. For example, the distortion parameters are solved and compensated using a polynomial fitting algorithm, and finally, a precise optical parameter set after eliminating errors is obtained. This parameter set can ensure the accuracy of the lens center point calculation. Preferably, in the specific technical implementation of the viewfinder interface coordinate system construction and lens center mapping: based on the precise optical parameter set and the display characteristics of the viewfinder preview interface, a pixel coordinate system is constructed and mapped to the optical center point of the lens to generate candidate coordinates of the reference origin; specifically, firstly, according to the resolution parameters of the viewfinder preview interface (e.g., horizontal and vertical pixel counts), a two-dimensional pixel coordinate system is constructed, with the coordinate origin set at the upper left corner of the interface, the horizontal axis as the X-axis, and the vertical axis as the Y-axis; based on the focal length and sensor size in the precise optical parameter set, the physical coordinates of the lens optical center on the sensor are calculated, and then the physical coordinates are converted into pixel coordinates of the viewfinder interface through the pixel-physical coordinate mapping relationship; at the same time, considering the offset between the camera installation position and the screen display area, multiple calibration images at different positions are collected, the offset compensation value is calculated, and the converted pixel coordinates are corrected to obtain the candidate coordinates of the reference origin of the lens center point in the viewfinder interface, which can initially reflect the screen position of the lens optical center. Preferably, the specific implementation process for verifying and finally determining the candidate coordinates of the reference origin is as follows: The candidate coordinates of the reference origin are verified and fine-tuned in multiple dimensions to generate the reference origin of the angle reference line. Specifically, the designed origin verification algorithm is used to verify the candidate coordinates of the reference origin by acquiring calibration line images at different tilt angles. This algorithm first draws a virtual reference line starting from the candidate coordinates, and then calculates the consistency of the angle between the virtual reference line and the calibration line imaging features. If the angle consistency parameter does not reach the preset threshold, it indicates that there is a deviation in the candidate coordinates. At this time, based on the angle deviation data, the candidate coordinates are fine-tuned using a gradient descent algorithm, with the adjustment step size set to a small pixel unit (e.g., 1 pixel). The above verification and fine-tuning process is repeated until the consistency of the angle between the virtual reference line and the calibration lines at different tilt angles meets the requirements. The finally determined coordinates are the reference origin of the angle reference line. This reference origin is highly consistent with the optical center of the lens, ensuring that the subsequent drawing of the angle reference line conforms to the actual optical imaging law.

[0027] Optionally, the step of drawing a 0-degree baseline parallel to the equipment reference edge, starting from the reference origin, and drawing multiple angle reference lines with different preset tilt angles on both sides of the 0-degree baseline to obtain an angle reference line group includes: obtaining parameters of the equipment reference edge; determining the extension direction of the 0-degree baseline based on the parameters to keep the 0-degree baseline parallel to the equipment reference edge; using the 0-degree baseline as a reference, setting a preset angle interval, and planning drawing paths for multiple angle reference lines on both sides of the 0-degree baseline; starting from the reference origin, drawing angle reference lines with different tilt angles sequentially according to the planned drawing paths, so that all angle reference lines originate from the same reference origin; verifying the angle between each angle reference line and the 0-degree baseline to ensure that the angle meets the preset tilt angle requirements, and generating an angle reference line group.

[0028] In one specific implementation, the above steps can be achieved through the following process: obtaining the device edge parameters of the camera device 3 under test, determining the extension direction of the 0-degree baseline based on the device edge parameters, and ensuring that the 0-degree baseline is parallel to the lower edge of the camera device 3 under test; using the 0-degree baseline as a reference, setting a fixed angle interval, and planning drawing paths for multiple tilt angle reference lines in the positive and negative directions of the 0-degree baseline respectively; using the center point of the lens as the reference origin, drawing angle reference lines with different tilt angles sequentially according to the planned drawing paths, ensuring that each angle reference line originates from the same reference origin; verifying the angle relationship between each angle reference line and the 0-degree baseline, ensuring that the angle meets the preset tilt angle requirements, and forming a complete set of angle reference lines.

[0029] Preferably, the specific implementation process for obtaining the device edge parameters of the camera device 3 under test and determining the extension direction of the 0-degree baseline is as follows: Feature extraction and digital conversion are performed on the device edge area in the viewfinder. Based on the conversion result, the extension direction of the 0-degree baseline is established to generate baseline digital parameters. Specifically, firstly, the continuous pixel information of the lower edge of the camera device 3 under test in the viewfinder is collected using contour scanning technology to form a set of device edge pixel coordinates. This set of coordinates directly reflects the physical extension trend of the lower edge of the device. The designed anti-interference straight line fitting algorithm is used to process the set of device edge pixel coordinates. This algorithm eliminates the influence of interference pixels such as screen border shadows and reflections through weight allocation, retains the linear characteristics of effective edge pixels, and then outputs the fitted straight line parameters of the lower edge of the device (including slope k and intercept b). Based on the fitted straight line parameters, the extension direction of the 0-degree baseline is determined, ensuring that the slope of the 0-degree baseline is consistent with the slope of the fitted straight line of the lower edge of the device, ensuring that the 0-degree baseline and the lower edge of the camera device 3 under test remain parallel in physical space, and generating baseline digital parameters containing the extension direction and starting pixel coordinates. Preferably, in the specific technical implementation of setting fixed angle intervals and planning tilt angle reference line paths: based on the baseline digital parameters and measurement accuracy requirements, angle intervals are set and tilt angle reference line paths on both sides of the 0-degree baseline are planned to generate a reference line path planning set; specifically, according to the common angle range of camera assembly misalignment (e.g., -5° to 5°), fixed angle intervals (e.g., 1°, which can be adjusted to smaller intervals according to actual needs) are set on the positive direction (side with the same direction as the extension direction of the lower edge of the device) and the negative direction (side with the opposite direction to the extension direction of the lower edge of the device) of the 0-degree baseline. Define the target angle values ​​for multiple tilt angle reference lines; combine the reference origin pixel coordinates corresponding to the lens center point with the reference line digital parameters to establish an angle-pixel coordinate mapping model. This model takes the target angle value as input, and through trigonometric function operations and screen resolution adaptation conversion, outputs the endpoint pixel coordinates of each tilt angle reference line, ensuring that the reference lines are fully displayed in the viewfinder and do not exceed the effective visible area; integrate the reference origin coordinates, endpoint coordinates, target angle values, extension directions, and other information of each tilt angle reference line to form a reference line path planning set, providing accurate trajectory basis for subsequent drawing.Preferably, the specific implementation process of drawing angle reference lines starting from the reference origin is as follows: Based on the reference line path planning set and the coordinates of the reference origin, a pixel-level precise drawing operation is performed to generate an initial angle reference line group; specifically, the image drawing interface is called, and the 0-degree reference line and each tilt angle reference line are drawn sequentially according to the end coordinates in the reference line path planning set, using the unified reference origin coordinates as the starting point; during the drawing process, a continuous pixel filling technique is used to ensure that the lines of the reference lines are smooth and without jagged edges, and the line width is set to a range that balances recognizability and does not obstruct parallel calibration lines (e.g., 2 pixels), while a temporary identifier is assigned to each reference line to distinguish different target angles; after the drawing is completed, the pixel coordinates of the initial angle reference line group are verified to confirm that the starting point of each reference line is strictly aligned with the reference origin, and the end coordinates are consistent with the preset values ​​of the reference line path planning set, without any offset or misalignment, thus forming the initial angle reference line group. Preferably, in the specific technical implementation of verifying the angle relationship between each angle reference line and the 0-degree baseline and forming a complete angle reference line group: the initial angle reference line group is verified and corrected for angle accuracy to ensure that the angle meets the preset requirements in order to generate a complete angle reference line group; specifically, the designed vector angle calculation algorithm is used to verify the initial angle reference line group. This algorithm first extracts the pixel coordinate sequence of each tilted angle reference line and the 0-degree baseline, converts them into direction vectors respectively, and then calculates the cosine value of the angle between the two reference line direction vectors through vector dot product operation, thereby deriving the actual angle; the actual angle is then calculated. The angle is compared with the preset target angle value. If the deviation exceeds the preset allowable range (e.g., ±0.03°), the endpoint pixel coordinates of the corresponding tilt angle reference line are adjusted in reverse based on the deviation value, and the drawing operation is re-executed. The above verification and correction process is repeated until the actual angle between all tilt angle reference lines and the 0-degree baseline meets the preset target angle requirements. Finally, all reference lines are marked and fixed, and the target angle and color mapping relationship corresponding to each reference line are clarified to form a complete angle reference line group. This reference line group can be directly superimposed on the viewfinder preview interface to provide accurate reference for subsequent angle comparison.

[0030] Optionally, assigning a differentiated identifier to each angle reference line in the angle reference line group and overlaying the angle reference line group onto the viewfinder preview image to generate an angle comparison view includes: assigning a unique identifier to the 0-degree baseline and assigning distinct differentiated identifiers to each of the other angle reference lines; binding the differentiated identifiers to the corresponding angle reference lines to establish an identifier-angle association mapping relationship; overlaying the angle reference line group with the bound differentiated identifiers onto the viewfinder preview image; adjusting the display parameters of the angle reference lines to avoid obstructing the imaging of the parallel calibration lines, and generating an angle comparison view.

[0031] In one specific implementation, the above steps can be achieved through the following process: assigning a unique color identifier to the 0-degree baseline, and then assigning differentiated color identifiers to the angle reference lines with different tilt angles on both sides, so that the colors are not repeated; binding the color identifiers with the corresponding angle reference lines to establish a color-angle association mapping relationship; superimposing all the angle reference lines after binding the color identifiers onto the viewfinder preview interface according to the preset display position; adjusting the display transparency of the angle reference lines to avoid obstructing the imaging of the parallel calibration lines, so as to generate a multi-dimensional angle comparison view.

[0032] Preferably, a unique color identifier is assigned to the 0-degree baseline, and then differentiated color identifiers are assigned to the angle reference lines with different tilt angles on both sides to ensure that the colors are not repeated. The specific implementation process is as follows: Based on the functional attributes and visual recognition requirements of the angle reference lines, differentiated color assignments are performed on the 0-degree baseline and the tilt angle reference lines on both sides to generate a set of unique color identifiers. Specifically, the core baseline function of the 0-degree baseline is first defined, and a unique color with high visual priority (e.g., red) is assigned to it. The RGB parameters of this color have been tested for human visual sensitivity to ensure that it can be quickly recognized in different lighting environments and forms a high contrast with the color of the parallel calibration line. For the tilt angle reference lines above and below the 0-degree baseline, differentiated colors are assigned according to the increasing / decreasing rule of the target angle value. The colors of adjacent angles on the same side are clearly distinguished in hue or saturation (e.g., green for 1° above and blue for 2° below, cyan for -1° below and purple for -2° below) to avoid visual confusion. In this embodiment, the differentiated colors correspond one-to-one with the angles, allowing operators to quickly distinguish different angle ranges visually and determine the angle range in which the parallel calibration line on the calibration medium displayed on the viewfinder falls. This adapts to non-professional operation scenarios on the production line, shortening the personnel training cycle. Simultaneously, the highly recognizable color design ensures clear differentiation even in complex lighting conditions on the production line, reducing human interpretation errors and providing accurate data support for process optimization. Furthermore, the color markings are intuitive and clear, enabling rapid location of the baseline and target angle ranges, meeting the rapid detection needs of the production line and facilitating efficient statistical analysis of skew angle data in mass production.

[0033] Optionally, the step of extracting the imaging features of the parallel calibration lines in the angle comparison view and comparing and analyzing the imaging features with the angle reference lines to obtain the camera assembly tilt angle includes: extracting image features from the angle comparison view to identify the image baseline corresponding to the parallel calibration lines; comparing the spatial position of the image baseline with each angle reference line to determine their relative intersection state; and determining the angle range in which the image baseline is located based on the relative intersection state to obtain the camera assembly tilt angle.

[0034] In one specific implementation, the above steps can be achieved through the following process: performing image feature extraction processing on the multi-dimensional angle comparison view to identify the image baseline corresponding to the parallel calibration line in the multi-dimensional angle comparison view; comparing the spatial position of the image baseline with each angle reference line to determine the relative intersection state of the image baseline with each angle reference line; determining the color-coded angle range where the image baseline is located based on the relative intersection state to obtain the camera assembly tilt angle.

[0035] Optionally, the step of extracting image features from the angle comparison view and identifying the image baseline corresponding to the parallel calibration line includes: preprocessing the angle comparison view to enhance the contour features of the parallel calibration line; detecting a set of line segments representing the parallel calibration line from the preprocessed image using a line detection algorithm; and selecting line segments that meet preset constraints from the set of line segments as the image baseline corresponding to the parallel calibration line.

[0036] In one specific implementation, the above steps can be achieved through the following process: binarizing and edge detection processing of the multi-dimensional angle comparison view to enhance the contour features of the parallel calibration line; detecting a set of line segments representing the parallel calibration line from the processed image based on the Hough transform algorithm; selecting line segments that meet the preset length and direction constraints from the set of line segments and using them as the image baseline corresponding to the parallel calibration line.

[0037] Preferably, the specific implementation process of binarizing and edge detection processing of the multi-dimensional angle comparison view to enhance the contour features of the parallel calibration lines is as follows: Based on the grayscale distribution characteristics of the multi-dimensional angle comparison view, adaptive binarization and edge enhancement processing are performed to generate a contour-enhanced image; specifically, the multi-dimensional angle comparison view is first converted to grayscale, transforming the color image into a single-channel grayscale image to reduce the interference of color information on feature extraction; the designed adaptive threshold binarization algorithm is used to dynamically determine the binarization threshold of each pixel by calculating the grayscale mean and variance of the local region of the image, avoiding contour breakage or noise retention problems caused by fixed thresholds, and converting the grayscale image into a black and white binary image, so that the parallel calibration lines are initially separated from the background and angle reference lines; then, the subtle breaks of the parallel calibration lines in the binary image are filled by morphological dilation operation, followed by erosion operation to remove small noise points, and finally, the Canny edge detection algorithm is used to extract the image edges. By setting reasonable high and low thresholds (e.g., high threshold of 150 and low threshold of 50), the complete contour of the parallel calibration lines is preserved, the excessive response of the angle reference line edges is suppressed, and a contour-enhanced image is generated. Preferably, in the specific technical implementation of detecting the set of line segments representing parallel calibration lines from the processed image based on the Hough transform algorithm: A directional Hough transform is performed on the contour-enhanced image to filter and extract line segments that conform to the directional characteristics of the parallel calibration lines, thereby generating an initial set of line segments; specifically, for the preset extension direction of the parallel calibration lines (parallel to the lower edge of the camera device 3 under test), the parameter configuration of the traditional Hough transform algorithm is optimized, limiting the angle search range to ±5° within the preset direction, reducing the detection of lines in irrelevant directions, and improving computational efficiency; a Hough space accumulation matrix is ​​constructed, where each row of the matrix represents the distance of a line. The parameters (vertical distance from the image origin to the line) and columns representing the angle parameters of the line (angle with a preset direction) are calculated by voting and accumulating the edge pixels of the contour-enhanced image. The line parameters corresponding to the Hough space points whose accumulated values ​​exceed a preset threshold are converted into line equations in the image pixel coordinates. The detected line equations are deduplicated. The angle and distance between any two lines are calculated. Duplicate lines with an angle less than a preset angle (e.g., 0.5°) and a distance less than a preset number of pixels (e.g., 3 pixels) are merged. Finally, an initial set of line segments containing multiple line segment parameters (starting coordinates, ending coordinates, direction angle) is generated.Preferably, the specific implementation process of selecting line segments that meet the preset length and direction constraints from the set of line segments and using them as the image baseline corresponding to the parallel calibration line is as follows: Based on the preset constraints of the initial set of line segments and the parallel calibration line, multi-dimensional screening and verification are performed to generate the image baseline; specifically, firstly, a length constraint threshold is set, which is determined based on the preset display length of the parallel calibration line in the image (e.g., 80% of the effective horizontal length of the image), and line segments with lengths greater than the threshold are selected from the initial set of line segments, eliminating short-distance noise lines; then, based on the preset direction of the parallel calibration line (and the image baseline corresponding to the camera device under test 3), the line segments are selected. The bottom edge is parallel), and a directional constraint range is set (e.g., ±1° of the preset direction). Straight line segments whose directional angle falls within this range are filtered out, and straight line segments corresponding to the angle reference line are further excluded. Finally, a straight line consistency verification algorithm is used to calculate the parallelism and spacing consistency between the filtered straight line segments. Straight line segments with a parallelism error less than a preset value (e.g., 0.3°) and a spacing variation coefficient less than a preset threshold (e.g., 0.1) are retained. These straight line segments are the image baselines representing the parallel calibration lines, ensuring that they can accurately reflect the posture of the parallel calibration lines in physical space and provide accurate features for subsequent analysis of the intersection state with the angle reference line.

[0038] Optionally, the step of comparing the spatial positions of the image baseline and each angle reference line to determine their relative intersection state includes: establishing an image pixel coordinate system, obtaining the coordinate parameters of the image baseline and the coordinate equations of each angle reference line; calculating whether there is an intersection point between the image baseline and each angle reference line based on the coordinate parameters and coordinate equations; if there is an intersection point, determining that the image baseline and the corresponding angle reference line are in an intersecting state; if there is no intersection point, determining that they are in a non-intersecting state, and recording all intersection state results.

[0039] In one specific implementation, the above steps can be achieved through the following process: establishing a coordinate system in units of screen pixels, obtaining the pixel coordinate sequence of the image baseline and the pixel coordinate equations of each angle reference line; calculating whether there is an intersection point between the two in the coordinate system based on the pixel coordinate sequence of the image baseline and the pixel coordinate equations of each angle reference line; if there is an intersection point, determining that the image baseline and the angle reference line are in an intersecting state; if there is no intersection point, determining that they are in a non-intersecting state, and recording all intersection state results.

[0040] Preferably, the specific implementation process of establishing a coordinate system based on screen pixels and obtaining the pixel coordinate sequence of the image baseline and the pixel coordinate equations of each angle reference line is as follows: Based on the screen display characteristics of the multi-dimensional angle comparison view, a unified pixel coordinate system is constructed, and the coordinate parameters of the image baseline and angle reference lines are extracted to generate a set of line coordinate parameters; specifically, taking the upper left corner of the viewfinder preview interface as the origin, the horizontal direction to the right is the positive X-axis direction, and the vertical direction downwards is the positive Y-axis direction, a two-dimensional pixel coordinate system is constructed. The coordinate value of each pixel in the coordinate system is its absolute pixel position on the screen (for example, a pixel with coordinates (1400, 600) represents that it is located at 1400 pixels on the X-axis and 600 pixels on the Y-axis). At 600 pixels); for the image baseline, extract its continuous pixel coordinate sequence in the coordinate system, and traverse the contour pixels of the image baseline using an edge tracking algorithm to ensure that the coordinate sequence completely covers the entire line without any breaks or redundant coordinates; for each angle reference line, based on the starting point (reference origin) and ending point pixel coordinates when it was drawn, derive the pixel coordinate equation of each reference line (e.g., ax+by+c=0) using a linear fitting algorithm, and solve the equation parameters using the least squares method to ensure that the equation can accurately describe the pixel extension trajectory of the reference line; integrate the pixel coordinate sequence of the image baseline with the pixel coordinate equations of all angle reference lines to generate a line coordinate parameter set containing two types of line coordinate information. Preferably, in the specific technical implementation of calculating whether there is an intersection point between the image baseline and each angle reference line in the coordinate system based on the pixel coordinate sequence of the image baseline and the pixel coordinate equations of each angle reference line: based on the line coordinate parameter set, the existence of an intersection point between the image baseline and each angle reference line is determined by combining point-by-point verification with equation solving, so as to generate intermediate results for intersection point determination; specifically, the designed line segment range constraint algorithm is first used to determine the effective coverage range of the image baseline and each angle reference line in the pixel coordinate system, excluding the case where two line segments have no physical overlap range (for example, one line segment is in the 100-500 pixel range on the X-axis, and the other is in the 600-1000 pixel range, and it is directly determined that there is no overlap). (Intersection points); For line combinations with overlapping coverage areas, on the one hand, the pixel coordinate sequence of the image baseline is substituted one by one into the pixel coordinate equation of the angle reference line, and the difference between the left and right sides of the equation is calculated. If the absolute value of the difference corresponding to a certain pixel point is less than a preset error threshold (e.g., 1), then the pixel point is determined to be a potential intersection point. On the other hand, by solving the fitted straight line equation of the image baseline and the pixel coordinate equation of the angle reference line, the theoretical intersection point coordinates are obtained, and then it is verified whether the theoretical intersection point falls within the effective pixel range of both line segments. Combining the potential intersection point detection results and the theoretical intersection point verification results, an intermediate result (existence or non-existence) for the intersection point determination of each angle reference line and the image baseline is generated.Preferably, if an intersection point exists, the image baseline and the angle reference line are determined to be in an intersecting state; if no intersection point exists, they are determined to be in a non-intersecting state. The specific implementation process is as follows: Based on the intermediate results of the intersection point determination, combined with the effective range of the lines and the pixel continuity constraint, the intersection state of the image baseline and each angle reference line is determined to generate an intersection state determination result set; specifically, if the intermediate results of the intersection point determination show that there is a potential intersection point and the theoretical intersection point falls within the effective range of the two line segments, the continuity of the potential intersection point is further verified. If multiple consecutive pixels meet the equation difference threshold requirement, it indicates that the two lines truly intersect in this area and are determined to be in an intersecting state; if the intermediate results of the intersection point determination show that there is no potential intersection point, or the theoretical intersection point does not fall within the effective range, or the potential intersection point is discontinuous (only isolated pixel error), it is determined to be in a non-intersecting state; for each angle reference line, the above determination process is repeated to ensure that the relative relationship between each reference line and the image baseline is accurately determined, and an intersection state determination result set containing "angle reference line identifier - intersection state" is generated. Preferably, in the specific technical implementation of recording all intersection state results: based on the intersection state judgment result set, a state record index is established and the data is solidified to generate an intersection state master table; specifically, each record in the intersection state judgment result set is associated with the corresponding angle reference line attribute (color identifier, preset tilt angle) to construct a four-dimensional record structure of "angle reference line identifier - color identifier - preset angle - intersection state"; an ordered storage method is adopted, and the preset angles of the angle reference lines are sorted from smallest to largest (e.g., arranged sequentially from -2°, -1°, 0°, 1°, 2°) to ensure the orderliness of the records; the integrity of the stored intersection state data is checked to see if there are any missing angle reference line judgment results. If so, the judgment is returned for re-judgment. If the data is complete, the final intersection state master table is generated. This master table can be directly used for the derivation of the angle range of the subsequent image baseline.

[0041] Optionally, determining the angle range of the image baseline based on the relative intersection state to obtain the camera assembly tilt angle includes: establishing a mapping relationship between the differentiated identifiers of the angle reference lines and the preset tilt angle; determining the identifier area traversed by the image baseline based on the relative intersection state of the image baseline and each angle reference line; querying the mapping relationship based on the identifier area to determine the numerical range to which the camera assembly tilt angle belongs, and obtaining the camera assembly tilt angle.

[0042] In one specific implementation, the above steps can be achieved through the following process: establishing a mapping table between the color markings of the angle reference lines and the preset tilt angles; determining the color marking area traversed by the image baseline based on the relative intersection state of the image baseline and each angle reference line; querying the mapping table based on the color marking area to determine the numerical range to which the camera assembly tilt angle belongs, so as to obtain the camera assembly tilt angle.

[0043] Preferably, the specific implementation process of establishing the mapping relationship table between the color identifier of the angle reference line and the preset tilt angle is as follows: Based on the color-angle mapping index and the preset tilt angle of the angle reference line, a structured mapping relationship table is constructed to generate a precise color-angle mapping table; specifically, the core data in the color-angle mapping index is extracted, including the color identifier (RGB parameter), unique identifier, and preset tilt angle value of each angle reference line, and these data are structured according to the association logic of "color identifier-unique identifier-preset angle"; a two-dimensional table structure is used to construct the mapping relationship table. The first column of the table stores the RGB parameter of the color identifier (presented in the form of a combination of decimal values, for example, red is (255,0,0)), the second column stores the unique identifier of the corresponding angle reference line, and the third column stores the preset tilt angle value (for example, 0°, 1°, -1°, etc.); to improve query efficiency, the RGB parameter of the color identifier is hash-encoded to generate a unique color hash value and used as the index key of the mapping relationship table, and a hash index is constructed to ensure that the corresponding preset tilt angle can be quickly located by the color identifier in the future, and finally a precise color-angle mapping table containing the index key and complete association data is generated. Preferably, in the specific technical implementation of determining the color-marked areas traversed by the image baseline based on the relative intersection states of the image baseline and each angle reference line: based on the spatial arrangement order of the intersection state summary table and the angle reference lines, the color-marked areas traversed by the image baseline are located through state combination analysis to generate area determination results; specifically, the intersection state summary table is first sorted from smallest to largest according to the preset tilt angle values ​​of the angle reference lines (e.g., -2°, -1°, 0°, 1°, 2°), clarifying the arrangement order of the angle reference lines corresponding to each color mark in the image space (distributed from bottom to top or from top to bottom according to increasing / decreasing angle values); using a set The algorithm for state combination analysis analyzes the sorted intersection states line by line. If the image baseline intersects with two adjacent angle reference lines and does not intersect with other angle reference lines on both sides, then the image baseline is determined to cross the color-marked area corresponding to these two adjacent reference lines. If the image baseline intersects with only one angle reference line and does not intersect with adjacent angle reference lines, then it is determined to cross the transition area between that reference line and the adjacent reference line. If the image baseline does not intersect with any angle reference lines, then it is determined to be located in the color-marked area corresponding to the 0° baseline, generating a region determination result that includes the crossing of color marks and adjacent color marks.Preferably, the specific implementation process for determining the numerical range of the camera assembly tilt angle based on the color-marked area query mapping table is as follows: Based on the area determination result and the color-angle precise mapping table, the tilt angle range is determined through query and logical deduction to generate the camera tilt angle range result; specifically, according to the color markings in the area determination result, the corresponding preset tilt angle value is quickly queried in the color-angle precise mapping table using a hash index; if the image baseline crosses the color-marked areas of two adjacent angle reference lines, the preset tilt angle values ​​of these two reference lines are extracted, with the smaller angle value as the lower limit and the larger angle value as the upper limit, to form the angle range ( For example, if the image baseline crosses the color area corresponding to 1° and 2°, the interval is 1°-2°; if the image baseline crosses the transition area between a single angle reference line and an adjacent reference line, the preset tilt angle value of that reference line is used as the benchmark, and the interval is determined by combining the angle interval (for example, if it only intersects with the 0° reference line and does not intersect with 1° or -1°, the interval is 0°-1° or -1°-0°); if the image baseline is located in the color mark area corresponding to the 0° baseline, the tilt angle is determined to be in the 0° interval; finally, the rationality of the derived angle interval is checked to ensure that the interval range conforms to the common angle range of camera assembly tilt, and the final camera tilt angle interval result is generated after the check is passed. Preferably, in the specific technical implementation of verifying and correcting the camera assembly tilt angle range results: based on the angle range results and the actual posture characteristics of the image baseline, multi-dimensional verification and fine-tuning are performed to generate accurate angle range results; specifically, the fitted straight line equation of the image baseline is extracted, the cosine value of the angle between it and the angle reference line corresponding to the 0° baseline is calculated, and the approximate angle value is derived; the approximate angle value is compared with the determined angle range. If the approximate angle value falls within the range, the determined range result is reasonable; if the approximate angle value exceeds the range, the region determination result and mapping query process are re-examined to correct any possible sorting errors or query deviations; at the same time, combined with the spacing consistency parameter of the parallel calibration lines, if the spacing consistency parameter is low, it indicates that the image baseline may be distorted. In this case, the error tolerance range of the angle range is appropriately expanded to ensure the reasonableness of the result; after verification and correction, accurate angle range results are generated, which can be directly used for production line process optimization and statistical analysis.

[0044] In one specific implementation, the hardware consists of a support structure 1, a calibration medium, and a camera device under test. The support structure 1 is an adjustable bracket, and the calibration medium is A4 paper printed with uniformly spaced horizontal lines. The camera device under test can be a smart tablet, mobile phone, computer, or other instrument with a camera. Underlined lines are created on the A4 paper by using consecutive spaces to print uniformly distributed horizontal lines (i.e., parallel calibration lines). The line spacing of the parallel calibration lines needs to be adjusted to the optimal level based on the camera's viewfinder effect (e.g., 6-point line spacing is used as an example). Since there is a blank area in the header after printing on A4 paper, the blank area is trimmed along the edge of the first parallel calibration line to ensure the complete presentation of the parallel calibration line group. Fix the cut A4 paper to the near end of the bracket. The fixing method can be liquid glue, tape, etc. During the fixing process, it is necessary to ensure that the lower edge L1 of the bracket, the lower edge L2 of the camera device under test, and the parallel calibration line L3 on the A4 paper are parallel to each other to avoid affecting the measurement accuracy due to the reference offset. The angle α between the bracket and the horizontal support surface (such as a table) can be flexibly adjusted according to the framing effect and sharpness of the camera device under test. After the adjustment is completed, fix the bracket angle with the locking structure to prevent the angle from drifting during the measurement process.

[0045] The software is integrated into the camera device under test. Its core function is to generate and overlay angle reference lines in the camera's viewfinder preview interface. The specific configuration is as follows: Angle reference line parameter preset: Set the reference origin of the angle reference line to the center point of the lens of the camera device under test, and take the pixel coordinates corresponding to the center point of the lens (e.g., (1400, 600), the specific value needs to be adapted to the device screen resolution) as the starting point; set the extension direction of the 0-degree reference line to be parallel to the lower edge L2 of the camera device under test, and use red as the exclusive color identifier for the 0-degree reference line; set 1° and 2° tilt angle reference lines above the 0-degree reference line in sequence with a fixed angle interval of 1°, and set -1° and -2° tilt angle reference lines below the 0-degree reference line in sequence. Each tilt angle reference line uses a different color identifier (e.g., 1° is green, 2° is blue, -1° is dark green, and -2° is dark blue) to ensure that the colors are not repeated and have good recognition.

[0046] Angle reference line drawing logic configuration: Based on screen resolution and A4 paper placement, the drawing path of each angle reference line is planned to ensure that each angle reference line starts from the reference origin and extends to the effective display area of ​​the viewfinder preview interface; through pixel-precise driving technology, 5 angle reference lines are drawn according to the planned path. The endpoint pixel coordinates of each angle reference line need to be calculated and determined according to the preset tilt angle (for example, the endpoint coordinates of the 1° reference line are (1382, 1582), and the endpoint coordinates of the -1° reference line are (1418, 1618). The specific coordinate values ​​need to be adapted to the device resolution). The drawing of all angle reference lines follows the principle of absolute pixel coordinate positioning to ensure that the tilt angle accuracy meets the preset requirements.

[0047] After completing the test system setup, perform the following steps to measure the camera assembly tilt angle: Place the camera device under test on the bracket, ensuring that the lower edge of the camera device is aligned with the lower edge of the bracket. Secure the camera device under test using the elastic clamping structure to ensure that the device does not shift or deform. Activate the camera of the camera device under test and initially view the image to verify the clarity of the parallel calibration lines. If the image is blurry, fine-tune the bracket angle or the camera focal length until the parallel calibration lines are clearly visible in the viewfinder.

[0048] Activate the camera image acquisition function of the camera device under test, align it with the parallel calibration line on the A4 paper to frame the image, and generate a view preview interface; call the built-in drawing module of the device, draw the angle reference line group in the view preview interface according to the preset parameters and display it superimposed. During the superposition process, adjust the display transparency of the angle reference line (e.g., 30%-50%) to ensure that the angle reference line is clearly distinguishable and does not obstruct the imaging of the parallel calibration line, and finally generate a multi-dimensional angle comparison view containing the parallel calibration line and the angle reference line group.

[0049] In one implementation, if the image baseline is inserted obliquely upwards into the 0° red baseline and the 1° green reference line, and does not intersect with the 2° blue reference line, then the skew angle is determined to be between 1° and 2°. If the image baseline is inserted diagonally upwards into the 0° red baseline and does not intersect with the 1° green reference line or the 2° blue reference line, then the skew angle is determined to be between 0° and 1°; Figure 6 As shown.

[0050] If the image baseline does not intersect any angle reference line and remains parallel to the 0° red baseline, the skew angle is determined to be 0°. If the image baseline is inserted downwards at an angle into the 0° red baseline and does not intersect with the -1° dark green reference line or the -2° dark blue reference line, then the skew angle is determined to be between -1° and 0°. If the image baseline is inserted downwards at an angle into the 0° red baseline and the -1° dark green reference line, and does not intersect with the -2° dark blue reference line, then the skew angle is determined to be between -2° and -1°. For cases where the skew angle is greater than 2° or less than -2°, the number and range of angle reference lines can be expanded according to the above logic, and the angle range can be determined by intersection state analysis.

[0051] The technical solution in this application can be flexibly adjusted according to the actual application scenario. Specific alternative solutions are as follows: Replacement for support structure 1: In addition to the adjustable angle bracket, an auxiliary support structure 1 adapted to the horizontal support surface can be added to the bottom of the bracket, or a rotatable bracket with a pivot can be used to make it easier to adjust the angle between the bracket and the horizontal support surface more precisely.

[0052] The calibration medium is not limited to A4 paper. A3 paper, PMMA plastic board, and other flat carriers can also be used. It is only necessary to form clear and uniform parallel calibration lines on the carrier. The parallel calibration lines can be prepared by printing, etching, or other processes.

[0053] In this embodiment, the angle interval of the angle reference lines is set to 1°. In practical applications, it can be adjusted to a smaller interval such as 0.5° according to the measurement accuracy requirements, and the number of angle reference lines can be increased accordingly to improve the precision of angle interval determination.

[0054] like Figure 8 As shown, this application also provides a camera assembly tilt angle measuring device, comprising: Reference alignment unit: used to perform reference alignment and fixing operations on support structure 1, calibration medium 2 and camera device under test 3, so that the lower edge of camera device under test 3, the lower edge of positioning support structure 1 and the parallel calibration line on calibration medium 2 are kept parallel to each other, so as to obtain a calibration test platform. Through the calibration test platform, reference alignment parameters can be obtained, the parallel reference relationship between the reference edge of the device and the parallel calibration line on the calibration medium can be established, and the test reference calibration can be completed. View generation unit: used to start the camera device under test 3 to frame the parallel calibration line based on the calibration test platform, and overlay multiple angle reference lines originating from the same reference origin and having different preset tilt angles on the obtained frame preview interface to generate a multi-dimensional angle comparison view. Angle Analysis Unit: Used to extract the imaging features of parallel calibration lines based on multi-dimensional angle comparison views, and to perform intersection state analysis between the imaging features of parallel calibration lines and angle reference lines to obtain the camera assembly tilt angle.

[0055] This application also provides a computer device, comprising a processor and a memory. The memory stores at least one instruction or at least one program, which is loaded and executed by the processor to implement the camera assembly tilt angle measurement method. The memory can be used to store software programs and modules. The processor executes various functional applications and the camera assembly tilt angle measurement method by running the software programs and modules stored in the memory. The memory mainly includes a program storage area and a data storage area. The program storage area can store the operating system, application programs required for the functions, etc.; the data storage area can store data created according to the use of the device, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory may also include a memory controller to provide the processor with access to the memory.

[0056] The methods and embodiments provided in this application can be executed in electronic devices such as computer terminals, servers, or similar computing devices, or in mobile terminal devices such as the Android system. Figure 9 This is a hardware structure block diagram of the electronic device for measuring the camera assembly tilt angle provided in this application embodiment. As shown in Figure 9, the electronic device 900 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 910 (CPUs 910 may include, but are not limited to, microprocessors such as MCUs or programmable logic devices such as FPGAs), a memory 930 for storing data, and one or more storage media 920 (e.g., one or more mass storage devices) for storing application programs 923 or data 922. The memory 930 and storage media 920 may be temporary or persistent storage. The program stored in the storage media 920 may include one or more modules, each module may include a series of instruction operations on the electronic device. Furthermore, the central processing unit 910 may be configured to communicate with the storage media 920 and execute the series of instruction operations in the storage media 920 on the electronic device 900. Electronic device 900 may also include one or more power supplies 960, one or more wired or wireless network interfaces 950, one or more input / output interfaces 940, and / or one or more operating systems 921.

[0057] The input / output interface 940 can be used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the electronic device 900. In one example, the input / output interface 940 includes a network interface controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the input / output interface 940 may be a radio frequency (RF) module used for wireless communication with the Internet.

[0058] Embodiments of this application also provide a computer-readable storage medium, which can be disposed in an electronic device to store at least one instruction or at least one program related to implementing a camera assembly tilt angle measurement method in the method embodiment. The at least one instruction or the at least one program is loaded and executed by the processor to implement the camera assembly tilt angle measurement method provided in the above method embodiment.

[0059] Optionally, in this embodiment, the storage medium may be located at at least one of the multiple network servers in a computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0060] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the camera assembly tilt angle measurement method provided in the various alternative implementations described above.

[0061] It should be understood that this application is not limited to the processes and structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A camera assembly skew angle measurement method, characterized by, include: Obtain the reference alignment parameters, establish the parallel reference relationship between the equipment reference edge and the parallel calibration line on the calibration medium, and complete the test reference calibration. Acquire a viewfinder preview image of the parallel calibration line, and overlay an angle reference line with a preset tilt angle onto the viewfinder preview image to generate an angle comparison view; The imaging features of the parallel calibration lines in the angle comparison view are extracted, and the imaging features are compared and analyzed with the angle reference lines to obtain the camera assembly tilt angle.

2. The camera assembly skew angle measurement method of claim 1, wherein, The process of obtaining reference alignment parameters, establishing a parallel reference relationship between the device reference edge and the parallel calibration line on the calibration medium, and completing the test reference calibration includes: Obtain the configuration parameters of the calibration medium and generate a calibration medium with equally spaced parallel calibration lines; Obtain equipment positioning parameters, establish the alignment relationship between the equipment reference edge and the positioning reference edge, and complete the initial positioning of the equipment; Obtain the position parameters of the calibration medium, adjust the relative orientation of the parallel calibration line and the equipment reference edge and keep them parallel to complete the reference alignment; Lock the parameters of the equipment and calibration medium that have completed the benchmark alignment to complete the test benchmark calibration.

3. The camera assembly skew angle measurement method of claim 1, wherein, The process of acquiring a preview image of the parallel calibration line, overlaying an angle reference line with a preset tilt angle onto the preview image, and generating an angle comparison view includes: Based on the calibrated test benchmark, real-time images of parallel calibration lines are acquired to generate a viewfinder preview image; Determine the reference origin of the angle reference line; Starting from the reference origin, draw a 0-degree reference line parallel to the equipment reference edge, and draw multiple angle reference lines with different preset tilt angles on both sides of the 0-degree reference line to obtain an angle reference line group. Assign a differentiating identifier to each angle reference line in the angle reference line group, and overlay the angle reference line group onto the viewfinder preview image to generate an angle comparison view.

4. The camera assembly skew angle measurement method of claim 3, wherein, Starting from the reference origin, a 0-degree reference line parallel to the equipment reference edge is drawn, and multiple angle reference lines with different preset tilt angles are drawn on both sides of the 0-degree reference line to obtain an angle reference line group, including: Obtain the parameters of the equipment reference edge, and determine the extension direction of the 0-degree reference line based on the parameters, so that the 0-degree reference line remains parallel to the equipment reference edge; Using the 0-degree baseline as a reference, set a preset angle interval, and plan the drawing paths of multiple angle reference lines on both sides of the 0-degree baseline. Starting from the reference origin, draw angle reference lines with different tilt angles in sequence according to the planned drawing path, so that all angle reference lines originate from the same reference origin. Verify the angle between each angle reference line and the 0-degree baseline, ensuring the angle meets the preset tilt angle requirements, and generate an angle reference line group.

5. The camera assembly skew angle measurement method of claim 3, wherein, Assigning a differentiated identifier to each angle reference line in the angle reference line group, and overlaying the angle reference line group onto the viewfinder preview image to generate an angle comparison view, includes: Assign a unique identifier to the 0-degree baseline and assign distinct identifiers to each of the other reference lines. Bind the differentiated identifiers to the corresponding angle reference lines to establish an identifier-angle association mapping relationship; Overlay the angle reference line group with the bound differentiation labels onto the viewfinder preview image; Adjust the display parameters of the angle reference line to avoid obscuring the image of the parallel calibration line and generate an angle comparison view.

6. The method for measuring the tilt angle of a camera assembly according to claim 1, characterized in that, The step of extracting the imaging features of the parallel calibration lines in the angle comparison view, comparing and analyzing the imaging features with the angle reference lines to obtain the camera assembly tilt angle includes: Image features are extracted from the angle comparison view to identify the image baseline corresponding to the parallel calibration line; The spatial position of the image baseline is compared with that of each angle reference line to determine their relative intersection state. Based on the relative intersection state, the angle range of the image baseline is determined, and the camera assembly tilt angle is obtained.

7. The method for measuring the tilt angle of a camera assembly according to claim 6, characterized in that, The step of extracting image features from the angle comparison view and identifying the image baseline corresponding to the parallel calibration line includes: Image preprocessing is performed on the angle comparison view to enhance the contour features of the parallel calibration lines; The set of line segments representing parallel calibration lines is detected from the preprocessed image using a line detection algorithm. Line segments that meet the preset constraints are selected from the set of line segments and used as the image baselines corresponding to the parallel calibration lines.

8. The method for measuring the tilt angle of a camera assembly according to claim 6, characterized in that, The step of comparing the spatial positions of the image baseline and the reference lines at each angle to determine their relative intersection status includes: Establish an image pixel coordinate system, and obtain the coordinate parameters of the image baseline and the coordinate equations of the reference lines at each angle; Based on the coordinate parameters and coordinate equations, calculate whether there are intersections between the image baseline and the reference lines at each angle; If an intersection point exists, the image baseline and the corresponding angle reference line are determined to be intersecting. If there is no intersection, it is determined to be a non-intersecting state, and the results of all intersecting states are recorded.

9. The method for measuring the tilt angle of a camera assembly according to claim 6, characterized in that, The step of determining the angle range of the image baseline based on the relative intersection state to obtain the camera assembly tilt angle includes: Establish a mapping relationship between the differentiated identifiers of the angle reference lines and the preset tilt angles; Based on the relative intersection of the image baseline and the reference lines at each angle, determine the marked area traversed by the image baseline; Based on the mapping relationship of the identified area, the numerical range to which the camera assembly tilt angle belongs is determined, and the camera assembly tilt angle is obtained.

10. A camera assembly tilt angle measuring device, characterized in that, The apparatus capable of applying the camera assembly tilt angle measurement method as described in any one of claims 1-9 includes: Reference alignment unit: used to perform reference alignment and fixing operations on the support structure, calibration medium and camera device under test, so that the lower edge of the camera device under test, the positioning lower edge of the support structure and the parallel calibration lines on the calibration medium are kept parallel to each other, so as to obtain a calibration test platform; View generation unit: used to start the camera device under test based on the calibration test platform to frame the parallel calibration line, and overlay multiple angle reference lines originating from the same reference origin and having different preset tilt angles on the obtained frame preview interface to generate a multi-dimensional angle comparison view. The angle analysis unit is used to extract the imaging features of the parallel calibration lines based on the multi-dimensional angle comparison view, and to perform intersection state analysis between the imaging features of the parallel calibration lines and the angle reference lines to obtain the camera assembly tilt angle.

11. A computer device, characterized in that, The device includes a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the camera assembly tilt angle measurement method as described in any one of claims 1-9.

12. A computer program product or computer program, characterized in that, The computer program product or computer program includes computer instructions that, when executed by a processor, implement the camera assembly tilt angle measurement method as described in any one of claims 1-9.