Camera calibration method, vehicle, storage medium and electronic device
By using a multi-stage state machine and a fault-driven adaptive retry mechanism, the camera calibration process is dynamically adjusted, solving the problem of low efficiency in camera parameter calibration and achieving a significant improvement in automated fault tolerance and success rate.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHERY AUTOMOBILE CO LTD
- Filing Date
- 2026-03-30
- Publication Date
- 2026-06-02
Smart Images

Figure CN122134830A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of visual perception technology, and more specifically, to a camera calibration method, a vehicle, a storage medium, and an electronic device. Background Technology
[0002] Camera parameter calibration typically involves placing a calibration plate with known geometry within the camera's field of view, acquiring multiple frames of images, and then using traditional algorithms to calculate the camera's intrinsic and extrinsic parameters to establish a mapping between image pixel coordinates and real-world coordinates. Current technology relies on manually placing the calibration plate and controlling lighting conditions, and must be completed in a single, interference-free environment. If acquisition fails due to poor wiring contact, sudden changes in ambient light, calibration plate tilt, or image blur, the process must be interrupted, and manual preparation and repetition are required. Therefore, the parameter calibration efficiency of current technologies for cameras is relatively low.
[0003] There is currently no good solution to the above problems. Summary of the Invention
[0004] This application provides a camera calibration method, a vehicle, a storage medium, and an electronic device to at least solve the technical problem of low parameter calibration efficiency of cameras in related technologies.
[0005] According to one aspect of the embodiments of this application, a camera calibration method is provided, comprising: controlling a camera to acquire a target image; within a first preset time period, in response to a failure to compare the target image with a preset template image, generating a first fault code, wherein the first fault code is used to indicate that there is an image comparison anomaly between the target image and the preset template image; determining a first adaptive adjustment strategy based on the first fault code, wherein the first adaptive adjustment strategy includes: a second preset time period, the second preset time period being longer than the first preset time period; within the second preset time period, in response to a successful comparison between the target image and the preset template image, calibrating the parameters of the camera within a third preset time period to obtain a calibration result; and in response to the calibration result indicating that the camera parameters have been successfully calibrated, updating the camera parameters based on the calibration result.
[0006] Furthermore, the camera calibration method also includes: in response to a successful comparison between the target image and a preset template image, and the calibration result indicating that the camera parameter calibration has failed, generating a second fault code, wherein the second fault code is used to indicate that there is an out-of-tolerance problem in the camera parameter calibration; determining a second adaptive adjustment strategy based on the second fault code, wherein the second adaptive adjustment strategy includes: a fourth preset duration, the fourth preset duration being longer than a third preset duration; calibrating the camera parameters within the fourth preset duration to obtain a calibration result.
[0007] Further, determining that the target image and the preset template image failed to match within the first preset time period includes: determining that the target image and the preset template image failed to match in response to the similarity between the target image and the preset template image being less than a first threshold; or, determining that the target image and the preset template image failed to match in response to the comparison time between the target image and the preset template image being greater than the first preset time period.
[0008] Furthermore, the camera calibration method also includes: within a first preset time period or a second preset time period, in response to the similarity between the target image and the preset template image being greater than a first threshold, determining that the target image and the preset template image have been successfully matched.
[0009] Furthermore, the calibration result includes: calibration parameters, and within a third preset time period, determining that the camera parameter calibration has failed, including: determining that the camera parameter calibration has failed in response to the confidence level of the calibration parameters being less than a second threshold; or, determining that the camera parameter calibration has failed in response to the camera parameter calibration time period being greater than a third preset time period.
[0010] Furthermore, the camera calibration method also includes: within a third preset time period or a fourth preset time period, in response to the confidence level of the calibration parameters being greater than a second threshold, determining that the camera parameters have been successfully calibrated.
[0011] Furthermore, the camera calibration method also includes: displaying a first fault code or a second fault code through a preset interactive device; issuing a fault diagnosis prompt based on the first fault code or the second fault code, wherein the fault diagnosis prompt is used to prompt manual checking for any abnormalities in the hardware calibration facilities.
[0012] According to another aspect of the embodiments of this application, a camera calibration device is also provided, comprising: a control module for controlling a camera to acquire a target image; a generation module for generating a first fault code within a first preset time period in response to a failure to compare the target image with a preset template image, wherein the first fault code indicates an image comparison anomaly between the target image and the preset template image; a determination module for determining a first adaptive adjustment strategy based on the first fault code, wherein the first adaptive adjustment strategy includes: a second preset time period, the second preset time period being longer than the first preset time period; a calibration module for calibrating the parameters of the camera within a third preset time period within a second preset time period in response to a successful comparison between the target image and the preset template image, thereby obtaining a calibration result; and an update module for updating the parameters of the camera based on the calibration result in response to the calibration result indicating that the camera parameters have been successfully calibrated.
[0013] Furthermore, the calibration module is also used to generate a second fault code in response to a successful comparison between the target image and the preset template image, and the calibration result indicating that the camera parameter calibration has failed. The second fault code indicates that there is an out-of-tolerance problem in the camera parameter calibration. Based on the second fault code, a second adaptive adjustment strategy is determined, which includes a fourth preset duration, which is longer than a third preset duration. Within the fourth preset duration, the camera parameters are calibrated to obtain the calibration result.
[0014] Furthermore, the determining module is also used to determine that the comparison between the target image and the preset template image has failed in response to the similarity between the target image and the preset template image being less than a first threshold; or, in response to the comparison time between the target image and the preset template image being greater than a first preset time, to determine that the comparison between the target image and the preset template image has failed.
[0015] Furthermore, the determining module is also used to determine that the target image and the preset template image have been successfully matched within a first preset time period or a second preset time period, in response to the similarity between the target image and the preset template image being greater than a first threshold.
[0016] Furthermore, the calibration result includes: calibration parameters. The determination module is also used to determine that the camera parameter calibration has failed in response to the confidence level of the calibration parameters being less than a second threshold; or, in response to the parameter calibration duration of the camera being greater than a third preset duration, to determine that the camera parameter calibration has failed.
[0017] Furthermore, the determination module is also used to determine that the camera parameter calibration is successful within a third preset time period or a fourth preset time period, in response to the confidence level of the calibration parameters being greater than a second threshold.
[0018] Furthermore, the camera calibration device also includes: a display module, used to display a first fault code or a second fault code through a preset interactive device; and to issue a fault diagnosis prompt message based on the first fault code or the second fault code, wherein the fault diagnosis prompt message is used to prompt manual troubleshooting of whether there is any abnormality in the hardware calibration facility.
[0019] According to another aspect of the embodiments of this application, a vehicle is also provided, including: a memory storing an executable program; and a processor for running the executable program, wherein the executable program executes the camera calibration method described in any of the above embodiments when running on the processor.
[0020] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer-readable storage medium, and the computer program is configured to execute the camera calibration method described in any of the above claims when it is run on a computer or processor.
[0021] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the camera calibration method of any of the above claims.
[0022] According to another aspect of the embodiments of this application, a computer program product is also provided, including a computer program that, when executed by a processor, implements the camera calibration method described in any of the above claims.
[0023] According to another aspect of the embodiments of this application, a computer program product is also provided, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the camera calibration method described in any of the above claims.
[0024] According to another aspect of the embodiments of this application, a computer program is also provided, which, when executed by a processor, implements the camera calibration method of any of the above claims.
[0025] In this embodiment, the camera is first controlled to acquire a target image. Then, within a first preset time period, in response to the failure of the comparison between the target image and the preset template image, a first fault code is generated. The first fault code indicates that there is an image comparison anomaly between the target image and the preset template image. Next, a first adaptive adjustment strategy is determined based on the first fault code. The first adaptive adjustment strategy includes: a second preset time period, which is longer than the first preset time period. Within the second preset time period, in response to the successful comparison between the target image and the preset template image, the camera parameters are calibrated within a third preset time period to obtain a calibration result. Finally, in response to the calibration result indicating that the camera parameters have been successfully calibrated, the camera parameters are updated based on the calibration result. By constructing a multi-stage state machine and a fault-driven adaptive retry mechanism, the allowed time for image comparison and algorithm convergence is dynamically extended, and misjudgments caused by temporary environmental interference are intelligently avoided. This achieves the purpose of accurately identifying fault types and optimizing the parameter calibration process, thereby realizing the technical effect of automated fault tolerance and significantly improved success rate of the calibration process, and thus solving the technical problem of low parameter calibration efficiency of cameras in related technologies. Attached Figure Description
[0026] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0027] Figure 1 This is a flowchart of a camera calibration method according to an embodiment of this application;
[0028] Figure 2 This is an architecture block diagram of an optional vehicle-mounted camera adaptive calibration system according to an embodiment of this application;
[0029] Figure 3 This is an optional calibration process state transition diagram according to an embodiment of this application;
[0030] Figure 4 This is a logical flowchart of an optional fault diagnosis and adaptive retry strategy according to an embodiment of this application;
[0031] Figure 5 This is a schematic diagram of an optional camera calibration device according to an embodiment of this application. Detailed Implementation
[0032] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0033] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0034] According to an embodiment of this application, an embodiment of a camera calibration method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Also, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0035] This embodiment provides a camera calibration method. Figure 1 This is a flowchart of a camera calibration method according to an embodiment of this application, such as... Figure 1 As shown, the process includes the following steps:
[0036] Step S10: Control the camera to acquire target images;
[0037] In this embodiment, the camera refers to an onboard vision sensor installed on the vehicle, including digital cameras of the forward-looking, surround-view, or cabin monitoring types. For example, the camera collects real-time environmental image data of the vehicle's surroundings or interior for subsequent autonomous driving perception and calibration processing.
[0038] The target image refers to the current environment image captured in real time by the camera during the calibration process, including the calibration board (such as a checkerboard or feature markers) and the background scene. The target image is the raw input data used for feature matching and similarity comparison with the preset template image.
[0039] Controlling the camera to acquire target images can be understood as sending image acquisition commands to the camera through the vehicle-mounted calibration system, triggering the camera to capture real-time visual images containing calibration markers (such as calibration boards or feature patterns) under the current environmental conditions. The target image serves as the raw input data for the calibration process, and is subsequently used for feature matching and similarity analysis with preset template images to determine whether the camera's field of view correctly covers the calibration area and whether the image quality meets the calibration requirements.
[0040] As can be seen, by automatically controlling the camera to acquire target images through the above steps, the standardization and real-time nature of calibration data acquisition are achieved, avoiding subjective bias and delays caused by manual operation, and providing stable raw input data for subsequent image comparison and fault diagnosis, thereby improving the automation level and startup reliability of the calibration process.
[0041] Step S12: Within a first preset time period, in response to the failure of the comparison between the target image and the preset template image, a first fault code is generated, wherein the first fault code is used to indicate that there is an image comparison anomaly between the target image and the preset template image;
[0042] In this embodiment of the application, the first preset duration refers to the initial time threshold (e.g., 20 seconds) set by the system for the image comparison stage, which is used to determine whether the camera completes feature matching with the calibration template within a reasonable time.
[0043] The preset template image is a high-resolution image of the standard calibration board under ideal conditions that is stored in advance, serving as a reference benchmark for image comparison.
[0044] The first fault code is a structured error identifier (such as F001) automatically generated when the comparison fails. It is used to clearly indicate that "there is an abnormality in the matching between the target image and the preset template image". Matching failure caused by insufficient lighting, non-centering of the calibration board or signal interruption is not limited here.
[0045] Within the first preset time period, in response to the failure of the comparison between the target image and the preset template image, the generation of the first fault code can be understood as the continuous feature matching analysis of the target image captured by the camera and the preset template image within the first preset time period. If the preset similarity threshold is not reached within the set first preset time period, it is determined that the image comparison is abnormal and the generation of the first fault code is automatically triggered.
[0046] As can be seen, by automatically judging the comparison results between the target image and the preset template image within the first preset time period, and generating a first fault code when the comparison fails, accurate identification and standardized reporting of the cause of calibration failure are achieved. This step eliminates the fuzzy mode of relying on manual experience for judgment in the traditional way, and uniformly classifies fault problems such as "image blurriness", "calibration board not recognized", and "signal loss" into specific first fault codes (such as F001), thereby improving diagnostic efficiency and reproducibility. Furthermore, the first fault code serves as the input of the decision layer, providing a basis for triggering the subsequent adaptive retry strategy, thereby reducing the misjudgment rate and the operational threshold.
[0047] Step S14: Determine a first adaptive adjustment strategy based on the first fault code, wherein the first adaptive adjustment strategy includes: a second preset duration, the second preset duration being longer than the first preset duration;
[0048] In this embodiment, the first adaptive adjustment strategy is a dynamic optimization scheme automatically triggered based on the first fault code (such as F001, indicating an image comparison anomaly), thereby improving the calibration fault tolerance capability by extending the time threshold of the critical stage. The first adaptive adjustment strategy requires no manual intervention, intelligently selects based on historical fault types, realizes a dynamic optimization closed loop, improves the success rate of secondary calibration, and reduces the frequency of repetitive manual operations.
[0049] The second preset duration is a new time threshold in the first adaptive adjustment strategy. For example, the initial 20-second comparison duration is increased to 200 seconds to cope with temporary interferences such as light fluctuations, signal delays, or calibration board micro-movements. This is not limited here.
[0050] Determining the first adaptive adjustment strategy based on the first fault code can be understood as automatically determining the corresponding optimization scheme after identifying an image comparison anomaly (such as F001), without manual intervention or external commands. The first adaptive adjustment strategy dynamically adjusts the calibration parameters based on the fault type, such as extending the time window for image acquisition and matching, lowering the similarity threshold, or increasing the feature point sampling density, thereby adapting to the interference state of the current environment.
[0051] As can be seen, through the above steps, the first adaptive adjustment strategy is dynamically determined based on the first fault code, and the timeout threshold for image comparison is dynamically extended from the first preset duration (e.g., 20s) to a higher second preset duration (e.g., 200s). This significantly improves the system's fault tolerance in complex environments, thereby avoiding misjudgment failures caused by brief changes in illumination, signal jitter, or slight deviations in the calibration board. Compared to the traditional fixed threshold mode, this step implements a closed-loop adaptive mechanism, greatly improving the success rate of secondary calibration, reducing the frequency of manual intervention and technical dependence, and improving calibration efficiency and automation.
[0052] Step S16: Within the second preset time period, in response to the successful comparison between the target image and the preset template image, within the third preset time period, the parameters of the camera are calibrated to obtain the calibration result.
[0053] In this embodiment of the application, the third preset duration refers to the upper limit of the time set for the camera parameter calibration stage after the image comparison is successful (such as an initial 30 seconds), which is used to constrain the convergence process of the calibration algorithm and ensure that the parameter calibration process is completed within a controllable time.
[0054] The calibration result refers to the camera intrinsic parameters (such as focal length and principal point) and extrinsic parameters (such as rotation matrix and translation vector) calculated through the parameter calibration stage, which are used to establish a precise mapping relationship between image pixel coordinates and vehicle world coordinates.
[0055] Within the second preset time period, in response to the successful comparison between the target image and the preset template image, within the third preset time period, the camera parameters are calibrated. The calibration result can be understood as follows: within the second preset time period, after the target image and the preset template image are successfully compared, the parameter calibration stage begins, and within the third preset time period, the calculation of the camera's intrinsic and extrinsic parameters is performed to obtain the calibration result, including intrinsic parameters such as focal length, principal point coordinates, and distortion coefficients, as well as extrinsic parameters such as the camera's rotation matrix and translation vector relative to the vehicle coordinate system.
[0056] As can be seen, after the image comparison is successful within the second preset time period, the camera parameter calibration is then performed within the third preset time period to ensure that the parameter calibration process is completed within a controllable time. This ensures real-time performance while improving the calibration success rate, reducing invalid retries, and enhancing the system's stability under conditions such as changes in lighting and vibration interference, thus providing reliable visual input for the intelligent driving perception system.
[0057] Step S18: In response to the calibration result indicating that the camera parameters have been successfully calibrated, the camera parameters are updated based on the calibration result.
[0058] In this embodiment of the application, in response to the calibration result indicating that the camera parameters have been successfully calibrated, updating the camera parameters based on the calibration result can be understood as follows: after confirming that the intrinsic parameters (such as focal length, principal point coordinates, distortion parameters) and extrinsic parameters (such as the rotation and translation of the camera relative to the vehicle coordinate system) output by the calibration algorithm have reached the preset confidence threshold and there are no abnormal deviations, the parameters in the calibration result are automatically written into the non-volatile storage unit of the vehicle controller to complete the persistent update of the parameters.
[0059] Furthermore, once the calibration parameters are updated, the system automatically switches to the new calibration model to ensure that all subsequent image acquisition and spatial transformation are performed based on the latest calibration parameters, thereby improving the accuracy and stability of the camera's environmental perception in real driving scenarios.
[0060] As can be seen, the automatic updating of camera parameters after successful calibration achieves closed-loop optimization of the calibration results, avoiding delays and errors caused by manual refreshing or restarting. This step ensures that the camera uses high-precision intrinsic and extrinsic parameters in real time, thereby improving the accuracy of image-to-real-world coordinate transformation and enhancing the reliability of target detection and distance estimation. Simultaneously, automatic parameter writing and activation reduce human intervention, improving the automation and consistency of the calibration process, thus lowering the risk of system misjudgments caused by calibration failures.
[0061] Through the above steps, the camera is first controlled to acquire the target image. Then, within a first preset time period, in response to the failure of the comparison between the target image and the preset template image, a first fault code is generated. The first fault code indicates that there is an image comparison anomaly between the target image and the preset template image. Next, a first adaptive adjustment strategy is determined based on the first fault code. The first adaptive adjustment strategy includes: a second preset time period, which is longer than the first preset time period. Within the second preset time period, in response to the successful comparison between the target image and the preset template image, the camera parameters are calibrated within a third preset time period to obtain the calibration result. Finally, in response to the calibration result indicating that the camera parameters have been successfully calibrated, the camera parameters are updated based on the calibration result. By constructing a multi-stage state machine and a fault-driven adaptive retry mechanism, the allowed time for image comparison and algorithm convergence is dynamically extended, and misjudgments caused by temporary environmental interference are intelligently avoided. This achieves the goal of accurately identifying fault types and optimizing the parameter calibration process, thereby realizing the technical effect of automated fault tolerance and significantly improved success rate of the calibration process, and thus solving the technical problem of low parameter calibration efficiency of cameras in related technologies.
[0062] Furthermore, the camera calibration method also includes the following steps:
[0063] In response to the successful comparison between the target image and the preset template image, and the calibration result indicating that the camera parameter calibration failed, a second fault code is generated, which indicates that there is an out-of-tolerance problem in the camera parameter calibration.
[0064] A second adaptive adjustment strategy is determined based on the second fault code, wherein the second adaptive adjustment strategy includes: a fourth preset duration, the fourth preset duration being longer than the third preset duration;
[0065] Within the fourth preset time period, the camera parameters are calibrated to obtain the calibration results.
[0066] In this embodiment of the application, the second fault code is a code used to indicate "camera parameter calibration failure and out-of-tolerance problem", such as F102. Specifically, the meaning of the second fault code is that the external parameters (such as rotation angle, translation amount) or internal parameters (such as distortion coefficient) output by the calibration algorithm exceed the tolerance range allowed by vehicle engineering, indicating that the calibration result is unreliable.
[0067] The second adaptive adjustment strategy is an optimized retry strategy that is automatically triggered by the system based on the second fault code, in order to improve the algorithm's convergence probability.
[0068] The fourth preset duration is the maximum execution time of the calibration process determined in the second adaptive adjustment strategy. For example, it is extended from the initial 30 seconds (the third preset duration) to 300 seconds, giving the calibration process more time to iterate, thereby dealing with complex working conditions such as changes in illumination and slight deviations in the pose of the calibration board, and improving the success rate of secondary calibration.
[0069] In response to the successful comparison between the target image and the preset template image, and the calibration result indicating that the camera parameter calibration failed, the generation of the second fault code can be understood as determining whether the parameter calibration process was successful based on the confirmation that the image comparison was normal. If the calibration result indicates that the camera parameter calibration failed, the second fault code F102 is automatically generated, indicating that the fault cause of the parameter calibration failure is a calibration error.
[0070] Determining the second adaptive adjustment strategy based on the second fault code can be understood as extending the calibration time to improve the algorithm's convergence capability.
[0071] Within the fourth preset time period, the parameters of the camera are calibrated. The calibration result can be understood as automatically extending the original calibration timeout threshold (e.g., 30 seconds) to the fourth preset time period (e.g., 300 seconds), so that the calibration algorithm can repeatedly optimize the parameters within a longer time window, thereby improving the convergence success rate under complex working conditions.
[0072] As can be seen, through the above steps, when the image comparison is successful but the parameter calibration fails, a second fault code (such as F102) is generated, thereby accurately distinguishing between the two types of problems: "normal image acquisition" and "calibration algorithm output error". This avoids misjudging the problem as environmental interference and significantly improves the accuracy and traceability of fault diagnosis. Based on the second fault code, a second adaptive adjustment strategy is automatically determined, dynamically extending the calibration timeout threshold (fourth preset duration), for example, from the original 30 seconds to 300 seconds, giving the calibration algorithm sufficient optimization space, thereby greatly improving the convergence probability under complex working conditions such as light fluctuations and calibration board micro-movements. Then, recalibration is performed within the extended fourth preset duration, thereby realizing a dynamic closed loop in the calibration process, thus improving the success rate of secondary calibration and the automation of the calibration system.
[0073] Furthermore, within the first preset time period, if it is determined that the target image has failed to match the preset template image, the following steps are included:
[0074] In response to the similarity between the target image and the preset template image being less than a first threshold, it is determined that the comparison between the target image and the preset template image has failed; or,
[0075] If the comparison time between the target image and the preset template image is longer than the first preset time, it is determined that the comparison between the target image and the preset template image has failed.
[0076] In this embodiment, the first threshold is a similarity metric used to determine the degree of matching between the target image and the preset template image. It is typically a value between 0 and 1, representing the upper limit of normalized similarity between image features (such as corners, edges, and template matching scores). For example, when the calculated actual similarity between the target image and the preset template image is lower than the first threshold, it indicates that the image captured by the current camera does not match the standard calibration template sufficiently in terms of key features, failing to meet the geometric consistency requirements for calibration. The first threshold is pre-calibrated based on the complexity of the calibration board pattern, image resolution, and tolerance to environmental interference, ensuring that subsequent calibration processes are only initiated on high-quality images, thereby improving the overall reliability of the calibration process.
[0077] The determination that the comparison between the target image and the preset template image fails can be understood as follows: the similarity score between the target image and the preset template image is calculated by an image feature matching algorithm (such as template matching or feature point matching). If the similarity score is lower than the preset first threshold, it indicates that the calibration plate features in the target image are blurred, occluded, severely distorted, or have too large an angle deviation, and cannot provide a reliable geometric correspondence. Therefore, the comparison between the target image and the preset template image is determined to have failed, thereby avoiding calibration errors caused by low-quality data.
[0078] If the comparison time between the target image and the preset template image exceeds the first preset time, the failure to match the target image with the preset template image can be understood as setting a maximum waiting time for the image comparison process between the target image and the preset template image, i.e., the first preset time (e.g., 20 seconds). If a valid match cannot be completed within the first preset time (e.g., signal delay, insufficient frame rate, or congestion of computing resources), the image comparison process is actively terminated, and the failure to match the target image with the preset template image is determined. This ensures that the calibration process has real-time performance and recoverability, and provides clear triggering conditions for subsequent adaptive extension of the time or prompting manual intervention.
[0079] As can be seen, through the above steps, when the similarity between the target image and the preset template image is less than the first threshold, the image comparison is determined to have failed. This effectively filters out low-quality images caused by changes in lighting, occlusion, or installation misalignment, ensuring that the calibration process only starts when the image features are clear and the match is reliable. Furthermore, when the image comparison time exceeds the first preset time, the image comparison is determined to have failed, preventing the system from entering a long waiting period due to signal delay or communication anomalies, thus improving process response efficiency and real-time performance. By constructing a dual failure determination mechanism, the quality of the calibration input data is guaranteed, and the calibration system's fault tolerance to occasional interference is enhanced, making the calibration process more stable. This reduces the frequency of invalid retries and manual intervention due to image problems, significantly improving calibration efficiency.
[0080] Furthermore, the camera calibration method also includes the following steps:
[0081] Within a first preset time period or a second preset time period, in response to the similarity between the target image and the preset template image being greater than a first threshold, it is determined that the target image and the preset template image have been successfully matched.
[0082] In this embodiment, within a first preset time period or a second preset time period, determining that the target image and the preset template image have successfully matched within a first threshold can be understood as the calibration system continuously acquiring and analyzing the target image within a limited time window (within the first preset time period or the second preset time period). When the calculated feature matching similarity between the target image and the preset template image is consistently and stably higher than a preset threshold (e.g., ≥0.75), it indicates that the current target image is of reliable quality and meets the geometric consistency prerequisite required for calibration. This step, through the dual constraints of "time + similarity," avoids misjudgment due to instantaneous interference and prevents long periods of invalid waiting, ensuring the stability and authenticity of the comparison results. This provides a reliable input basis for subsequent calibration processes, effectively improving the overall calibration accuracy and the robustness of the calibration system.
[0083] As can be seen, within either the first or second preset time period, a successful comparison is determined when the similarity between the target image and the preset template image remains above the first threshold. This avoids misjudgments caused by transient interference (such as flash or jitter) and prevents the calibration system from waiting for extended periods, ensuring that the parameter calibration stage only begins when image quality is reliable and feature matching is stable. The dual-condition constraint mechanism in this step significantly improves the accuracy and robustness of the comparison results, reduces invalid calibration attempts, lowers the frequency of manual intervention, and comprehensively enhances the automation level and engineering reliability of the calibration process.
[0084] Furthermore, the calibration results include: calibration parameters; within the third preset time period, if the camera parameter calibration fails, the following steps are included:
[0085] If the confidence level of the calibration parameters is less than the second threshold, it is determined that the camera parameter calibration has failed; or,
[0086] If the camera parameter calibration time exceeds the third preset time, it is determined that the camera parameter calibration has failed.
[0087] In this embodiment of the application, the calibration parameters refer to a set of mathematical variables calculated by the calibration algorithm to describe the intrinsic parameters (such as focal length, principal point, distortion coefficient) and extrinsic parameters (such as rotation matrix and translation vector relative to the vehicle coordinate system) of the camera, which are used to establish a precise mapping relationship between image pixel coordinates and real-world three-dimensional coordinates.
[0088] The second threshold is a confidence level criterion used to evaluate the reliability of calibration parameters. It is typically a value between 0 and 1, calculated based on the reprojection error, residual distribution, and parameter stability of the calibration algorithm output. When the confidence level is below the second threshold, it indicates that the calibration parameters have significant errors or unstable convergence, possibly caused by calibration board identification errors, vibration interference, or sensor drift. Based on this, the calibration system determines that the parameter calibration has failed, avoiding the application of unreliable parameters to the perception system and ensuring the safety of autonomous driving.
[0089] The determination that the camera parameter calibration has failed can be understood as follows: After the calibration system calculates the camera's intrinsic parameters (such as focal length and distortion) and extrinsic parameters (such as mounting posture) through the calibration algorithm, it generates a confidence score based on indicators such as reprojection error and feature point matching consistency. If the confidence score is lower than the preset second threshold, it indicates that the calibration result error is too large or unstable and cannot meet the geometric accuracy requirements of autonomous driving perception. Therefore, the camera parameter calibration is determined to have failed to prevent erroneous parameters from causing misjudgment in perception and to ensure system safety.
[0090] If the calibration time of the camera parameters exceeds the third preset time, the camera parameter calibration failure is determined. This can be understood as setting a maximum time limit for the calibration algorithm execution, namely the third preset time (e.g., 30 seconds). If the calibration algorithm fails to converge or fails to obtain effective results through continuous iteration within the third preset time, the camera parameter calibration is determined to have failed. The reasons for failure include, but are not limited to, poor image quality, insufficient computing resources, or the algorithm getting stuck in a local optimum. By actively terminating the calibration process to avoid infinite waiting, the calibration process is ensured to have real-time response capability, providing clear triggering conditions for adaptive retry.
[0091] As can be seen, through the above steps, when the confidence level of the calibration parameters falls below the second threshold, the calibration process is deemed to have failed. This effectively intercepts low-precision calibration results caused by poor image quality or environmental interference, preventing erroneous parameters from entering the perception system and ensuring driving safety. When the calibration duration exceeds the third preset duration, the calibration process is deemed to have failed, preventing the algorithm from getting trapped in a local optimum and thus improving the process response efficiency. By constructing a dual-guarantee mechanism, the reliability and real-time performance of the calibration process are significantly enhanced, invalid execution and manual intervention are reduced, and a precise triggering basis is provided for the adaptive retry strategy, comprehensively improving the automation level of vehicle camera calibration.
[0092] Furthermore, the camera calibration method also includes the following steps:
[0093] Within the third or fourth preset time period, if the confidence level of the calibration parameters is greater than the second threshold, it is determined that the camera parameter calibration is successful.
[0094] In this embodiment, determining that the camera parameter calibration is successful within a third or fourth preset time period, in response to the confidence level of the calibration parameters exceeding a second threshold, can be understood as the calibration system not only completing parameter calculation within the third or fourth preset time period, but also ensuring that the calibration parameters meet the engineering requirements of high precision and high stability. The above steps, through a dual mechanism of "time constraint + confidence level verification," effectively avoid calibration failures caused by non-convergence of calculations or noise interference, ensuring that the output intrinsic and extrinsic parameters possess reliable geometric accuracy. This provides a solid foundation for subsequent perception fusion, significantly improves the consistency and security of the calibration results, and reduces risks caused by parameter errors.
[0095] As can be seen, within the third or fourth preset time period, when the confidence level of the calibration parameter remains higher than the second threshold, the parameter calibration is considered successful, thereby improving the reliability and engineering safety of the calibration results. By introducing a time window constraint, the risk of misjudgment caused by instantaneous fluctuations or brief convergence is eliminated, while the confidence threshold ensures that the output parameters have sufficiently low reprojection errors and high stability, avoiding low-quality parameter input to the perception system due to calibration board recognition deviations, sudden changes in illumination, or sensor drift. This step significantly reduces the probability of perception misjudgment caused by parameter errors, enhances the overall robustness of the autonomous driving system, and provides accurate and reliable judgment basis for the adaptive retry strategy.
[0096] Furthermore, the camera calibration method also includes the following steps:
[0097] The first or second fault code is displayed via a preset interactive device;
[0098] Based on the first or second fault code, a fault troubleshooting prompt message is issued. The fault troubleshooting prompt message is used to prompt manual troubleshooting of whether there is any abnormality in the hardware calibration facilities.
[0099] In this embodiment, the preset interactive device refers to a display and operation terminal in the vehicle calibration system specifically designed for human-machine interaction, such as a central control screen, instrument panel interface, handheld calibration terminal, or remote diagnostic tablet. The preset interactive device has a graphical interface display function, used to present calibration status, fault codes, and operation instructions in real time, ensuring that calibration personnel can obtain clear information without requiring a professional background.
[0100] Troubleshooting prompts are automatically generated by the system based on fault codes (such as F001 "Image Comparison Abnormality" or F102 "Calibration Out of Tolerance"). These prompts are presented in natural language or graphical form and are geared towards on-site operators. Examples include "Please check if the calibration board is placed flat in a uniformly lit area" or "Please ensure the camera lens is free of dirt and the wiring harness is securely connected." The core function of these prompts is to quickly locate common hardware problems (such as calibration board misalignment, insufficient lighting, loose cables, etc.), reducing reliance on technician experience and improving on-site troubleshooting efficiency and the operability of the calibration process.
[0101] Displaying the first or second fault code via a preset interactive device can be understood as presenting the fault code indicating calibration failure (such as the first fault code F001 and the second fault code F102) intuitively on the human-machine interface, enabling operators to quickly identify the fault type without relying on professional algorithm knowledge, thus achieving efficient information transmission.
[0102] The fault troubleshooting prompts issued based on the first or second fault code can be understood as automatically matching corresponding, easy-to-understand on-site operation instructions based on the first or second fault code, such as "Please adjust the calibration board angle" or "Please check if the camera lens is clean". This guides personnel to conduct targeted troubleshooting in a natural language or graphic manner, significantly reducing the operational threshold and improving the response speed and repair rate of problems.
[0103] As can be seen, displaying the first or second fault code via a preset interactive device and generating targeted troubleshooting prompts significantly improves the operability and efficiency of the calibration process. These steps transform complex algorithm anomalies into intuitive code and easy-to-understand operational guidelines, enabling non-professionals to quickly locate hardware problems (such as incorrect calibration board placement, lens contamination, or loose wiring harnesses). This drastically reduces manual troubleshooting time, decreases reliance on human experience, and minimizes recalibration due to misjudgments, thereby improving the overall calibration success rate and production line automation level.
[0104] Figure 2 This is an architecture block diagram of an optional vehicle-mounted camera adaptive calibration system according to an embodiment of this application, such as... Figure 2 As shown, the vehicle-mounted camera adaptive calibration system mainly includes: user layer, interface layer, application layer, execution and perception layer, fault diagnosis unit, vehicle-mounted camera, and strategy decision unit.
[0105] The user layer includes a user instruction module, which is used to receive calibration start instructions issued by calibration personnel.
[0106] The application layer includes a calibration control engine with a built-in state machine for controlling process switching, timer management, and policy invocation.
[0107] The execution and perception layer includes an image processing and comparison unit, which is responsible for acquiring camera images and performing feature matching and similarity calculation with preset calibration board template images.
[0108] The fault diagnosis unit is used to compare and analyze the results and the output of the calibration algorithm to determine the fault type (such as: no signal, image blur, matching timeout, calibration error, etc.).
[0109] The strategy decision unit is used to select the appropriate retry strategy from the strategy library based on the fault diagnosis results (such as: retry immediately, retry after extending the waiting time, or require manual intervention).
[0110] The interface layer includes a human-machine interface, which displays the real-time status, fault codes and detailed reasons to the calibration personnel, and receives secondary calibration instructions issued by the personnel.
[0111] Specifically, the vehicle-mounted camera adaptive calibration system uses the user command module as its entry point, receiving calibration start commands from calibration personnel or the upper-level control system as the trigger source for the entire process. The commands are parsed and scheduled by the calibration control engine, which acts as the system's central hub. This engine incorporates a multi-stage state machine and a timing management module, responsible for coordinating the timing logic and state transitions of each sub-module to ensure the calibration process executes in an orderly manner according to preset stages. The image processing and comparison unit is responsible for real-time acquisition of the vehicle-mounted camera image stream and performing feature point extraction, matching, and similarity calculation with pre-stored calibration board templates. This is the foundational layer for achieving visual calibration perception.
[0112] The output of the image processing and comparison unit is fed into the fault diagnosis unit, where anomalies are intelligently classified using multi-dimensional criteria (such as matching success rate, image clarity, signal-to-noise ratio, and algorithm convergence status). This accurately identifies different levels of faults, such as "image comparison anomalies" (e.g., F001) or "calibration errors" (e.g., F102), and generates structured fault codes. The fault diagnosis results trigger the strategy decision unit, which has an embedded dynamic strategy library. Based on historical fault types, environmental records, and system experience, the strategy unit adaptively selects retry strategies (such as extending the timeout threshold, enhancing image enhancement parameters, and prompting manual intervention) to achieve precise fault response.
[0113] Ultimately, all status information, fault codes, and operational suggestions are presented uniformly through a human-machine interface (HMI). This HMI supports voice prompts, graphical pop-ups, fault code lists, and graphical troubleshooting guides, as well as touch input, enabling operators to monitor system status in real time and intervene efficiently. The modules of the vehicle-mounted camera adaptive calibration system communicate via standardized interfaces, ensuring a two-way closed loop of data and control flow, guaranteeing high responsiveness, scalability, and environmental adaptability. This application... Figure 2 The vehicle-mounted camera adaptive calibration system in the article realizes full-link intelligence from perception, diagnosis, decision-making to interaction, providing system-level technical support for the automated calibration process of vehicle-mounted cameras.
[0114] Figure 3 This is an optional calibration process state transition diagram according to an embodiment of this application, such as... Figure 3As shown, the entire lifecycle state evolution logic of the calibration process from initialization to calibration completion is fully presented. The state machine model of this application reconstructs the traditional linear calibration process into a multi-stage closed-loop system with clear boundaries, timeout judgment, and intelligent jump, which includes five core states: standby state, image adaptation stage, parameter calibration stage, fault interruption state, and calibration success state. After the calibration system is powered on, it first enters the "standby state" to wait for the user to trigger the calibration command. At this time, all modules are in low-power standby and only listen for external events. After receiving the start command, the calibration system immediately jumps to the "image comparison stage". This stage is driven by the first timer (T1). The image processing unit continuously collects and compares the camera image with the calibration board template. If the similarity is continuously higher than the threshold θ1 within the T1 time limit, the image comparison is determined to be successful, and the state machine enters the "parameter calibration stage". If the image comparison timeout fails, the system automatically enters the "fault interruption state" and triggers the "image comparison abnormal" fault code (F001), while freezing the process and waiting for manual intervention.
[0115] Upon entering the "parameter calibration phase," the system starts the second timer (T2), calls the calibration algorithm (such as Zhang Zhengyou's method) to solve for intrinsic and extrinsic parameters, and evaluates the parameter confidence level in real time. If the algorithm converges within T2 and the confidence level is higher than θ2, the calibration is considered successful, the state machine enters the "calibration successful state," and triggers system parameter refresh and restart commands, completing the entire closed loop. If the calibration fails (e.g., insufficient parameter confidence or algorithm error), the calibration system re-enters the "fault interruption state" and reports the "calibration out of tolerance" fault code (F102) and the specific error value. When personnel complete the hardware troubleshooting according to the prompts and restart the calibration process, the system no longer uses the original parameters but activates the "adaptive strategy engine" based on historical fault codes.
[0116] For example, if the previous fault code was F001, the system will automatically extend T1 to T1' (e.g., from 20s to 200s) and increase the image preprocessing weights; if the fault code was F102, it will extend T2 to T2' (e.g., from 30s to 300s) and lower the convergence threshold to improve fault tolerance. This application's parameter dynamic adjustment mechanism based on state history gives the system a "learning" characteristic, where each failure becomes the basis for optimization in the next success. The state machine design of this application follows a closed-loop logic of "failure-diagnosis-adjustment-retry-success," avoiding the drawbacks of "infinite retries" or "rigid interruptions" in traditional calibration, thus achieving the technical effect of improving parameter calibration efficiency. Figure 3 The flowchart clearly defines the boundary conditions and triggering mechanisms of the calibration behavior, and constructs an scalable and reusable intelligent calibration paradigm. The technical solution of this application provides a standardized and highly robust system-level framework for the unified calibration of various types of cameras, such as forward-looking, surround-view, and in-cabin cameras.
[0117] Figure 4 This is a logical flowchart of an optional fault diagnosis and adaptive retry strategy according to an embodiment of this application, such as... Figure 4 As shown, this demonstrates how the system can automatically extract experience from a calibration failure and optimize subsequent execution strategies. Figure 4 The flowchart uses "first calibration failure" as the trigger point. First, the fault diagnosis unit receives the raw data stream from the image processing unit and the calibration algorithm module, including multi-dimensional indicators such as image similarity curve, number of feature matching points, reprojection error, number of algorithm iterations, and confidence score. The calibration system uses a hierarchical criterion mechanism to accurately classify the fault type: if the image similarity is consistently lower than θ1, the feature point matching failure rate is higher than the threshold, or the image brightness / contrast exceeds the reasonable range, it is judged as "image comparison abnormal" (F001), the root cause of which points to environmental interference (such as strong light, rain and fog), incorrect placement of the calibration board, lens dirt, or communication delay; if the image quality is qualified but the calibration algorithm does not converge, the external parameters exceed the allowable range (such as rotation angle error > 3°, translation error > 5cm), or the confidence score is lower than θ2, it is judged as "calibration error" (F102), the cause of which is mostly due to excessive initial parameter deviation, uneven distribution of feature points on the calibration board, or improper configuration of algorithm parameters.
[0118] After the diagnostic results are structured and coded, they are simultaneously pushed to the human-computer interaction interface for visualization and trigger the strategy decision unit to enter the adaptive retry decision channel. In the "adaptive retry" stage, the system no longer uses fixed parameters for simple repetition, but dynamically calls the optimal retry scheme from the built-in strategy library based on the fault code: For F001 type faults, the system automatically extends the timeout threshold T1 of the image adaptation stage to 5-10 times the original value (e.g., from 20s to 200s), and enables enhanced image preprocessing modules (e.g., adaptive histogram equalization, dynamic noise reduction) to cope with lighting fluctuations or weak signal environments; at the same time, it prompts the operator to "check whether the calibration board is centered, whether the lighting is uniform, and whether the lens is clean", and optionally enables the "delayed acquisition" mode, allowing the system to accumulate effective image samples within a longer time window. For F102 type faults, the system extends the calibration phase timeout threshold T2 by 3–10 times (e.g., from 30s to 300s), automatically adjusts the upper limit of the calibration algorithm's iteration count, and reduces the convergence accuracy requirement (e.g., from 0.1 pixels to 0.3 pixels). It also enables a "multiple initial solution sampling" mechanism to try multiple initial parameter combinations to avoid getting trapped in local minima. Simultaneously, it prompts users to "confirm that the calibration board is flat, away from metallic interference, and using a standard-sized board." Furthermore, the system establishes a "fault-strategy-success" historical log database, recording each fault type, parameter adjustments, retry count, and final result, forming a traceable diagnostic knowledge graph.
[0119] In subsequent calibrations, if the system detects a fault mode highly similar to historical records, the optimal strategy can be directly reused to achieve "experience transfer." If it is a new fault type, an "expert prompting mode" will be activated to guide operators to perform more in-depth hardware testing (such as replacing cables or calibrating image sensors). In addition, if three consecutive retries fail, the system will automatically upgrade to "manual intervention mode," lock the current parameters, and generate a complete diagnostic report for engineers to analyze offline. Figure 4 The flowchart in the document not only achieves a precise mapping between fault types and response strategies, but also, through a data-driven strategy evolution mechanism, makes the calibration system robust. Unlike the inefficient traditional model of "failure, manual troubleshooting, and blind retries," this application... Figure 4 The flowchart in the document constructs an automated, learnable, and optimizable fault-tolerant system, which greatly improves the robustness, efficiency, and intelligence of the calibration process. It is the key technical path for achieving "high reliability, high success rate, and low human intervention" in this application, and provides a complete and reliable intelligent decision-making paradigm for vehicle camera calibration to move from "experience-driven" to "data-driven".
[0120] The following combination Figure 3 and Figure 4 Here is a specific embodiment of this application:
[0121] S1: Initialization and Command Reception:
[0122] S101, the system is powered on and initialized. The calibration control engine enters standby mode, waiting for and receiving calibration commands.
[0123] S2: First Stage: Camera and Harness Adaptation (Image Comparison Stage):
[0124] S201, the calibration control engine starts the first timer (e.g., timeout threshold T1=20s).
[0125] S202, the image processing unit continuously acquires images and performs real-time comparisons.
[0126] S203, Comparison Successful: If the similarity is consistently higher than the threshold θ1 within T1, the adaptation is considered successful, and the engine state jumps to the calibration stage.
[0127] S204, Comparison Failure: If the similarity is still lower than θ1 after time T1, the fault diagnosis unit generates an "image comparison abnormality" fault code (e.g., F001) and reports it through the human-machine interface. The process is interrupted and waits for subsequent instructions.
[0128] S3: Second Stage: Camera Parameter Calibration Stage
[0129] S301, the calibration control engine starts the second timer (e.g., timeout threshold T2=30s).
[0130] S302, call the calibration algorithm (such as Zhang Zhengyou method) to calculate camera parameters.
[0131] S303, Calibration Successful: If the algorithm converges within T2 and the calculated parameter confidence level is higher than the threshold θ2, then the calibration is considered successful. The system restarts to make the new parameters take effect.
[0132] S304, Calibration Failure: If the algorithm reports an error or the parameter confidence is too low (e.g., external parameter out of tolerance), the fault diagnosis unit generates a fault code such as "calibration out of tolerance" (e.g., F102) and reports the specific value and possible cause, and the process is interrupted.
[0133] S4: Fault Handling and Adaptive Retry:
[0134] S401, calibration personnel can view the reported fault information through the human-machine interface and conduct preliminary troubleshooting (such as checking cables and adjusting the position of the calibration board).
[0135] S402, personnel issue a second calibration order.
[0136] S403, the strategy decision unit activates an adaptive retry strategy based on historical fault codes:
[0137] S404 If the first fault is F001 (image comparison abnormality), the strategy decision unit will dynamically adjust the timeout threshold of the next first stage, for example, extending it from T1=20s to T1'=200s, thereby giving the system more time to acquire and adapt images to cope with situations such as changes in lighting or unstable signals.
[0138] S405, After successful image matching, the calibration stage begins. At this time, the timeout threshold can also be adjusted accordingly (e.g., extended from T2=30s to T2'=300s) to ensure that the calibration algorithm has more iteration time and improves the convergence probability under complex conditions.
[0139] S406, the system re-executes steps S2 and S3 based on the new parameter set.
[0140] S5: The calibration process for the vehicle-mounted camera has been successfully completed.
[0141] After the second calibration of S501 is successful, the system restarts, and the entire adaptive calibration process is completed.
[0142] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0143] According to an embodiment of this application, a camera calibration device is provided. It should be noted that the device can be used to perform the above-described camera calibration method.
[0144] Figure 5 This is a schematic diagram of an optional camera calibration device according to an embodiment of this application, such as... Figure 5 As shown, the camera calibration device 500 includes: a control module 501 for controlling the camera to acquire target images; a generation module 502 for generating a first fault code within a first preset time period in response to a failure to compare the target image with a preset template image, wherein the first fault code indicates an image comparison anomaly between the target image and the preset template image; a determination module 503 for determining a first adaptive adjustment strategy based on the first fault code, wherein the first adaptive adjustment strategy includes a second preset time period, the second preset time period being longer than the first preset time period; a calibration module 504 for calibrating the camera parameters within a third preset time period within a second preset time period in response to a successful comparison between the target image and the preset template image, and obtaining a calibration result; and an update module 505 for updating the camera parameters based on the calibration result in response to the calibration result indicating successful calibration of the camera parameters.
[0145] Furthermore, the calibration module 504 is also used to generate a second fault code in response to a successful comparison between the target image and the preset template image, and the calibration result indicating that the camera parameter calibration has failed. The second fault code indicates that there is an out-of-tolerance problem in the camera parameter calibration. Based on the second fault code, a second adaptive adjustment strategy is determined. The second adaptive adjustment strategy includes: a fourth preset duration, which is longer than a third preset duration; within the fourth preset duration, the camera parameters are calibrated to obtain a calibration result.
[0146] Furthermore, the determining module 503 is also used to determine that the comparison between the target image and the preset template image has failed in response to the similarity between the target image and the preset template image being less than a first threshold; or, in response to the comparison time between the target image and the preset template image being greater than a first preset time, to determine that the comparison between the target image and the preset template image has failed.
[0147] Furthermore, the determining module 503 is also used to determine that the target image and the preset template image have been successfully matched within a first preset time period or a second preset time period, in response to the similarity between the target image and the preset template image being greater than a first threshold.
[0148] Furthermore, the calibration result includes: calibration parameters. The determination module 503 is also used to determine that the camera parameter calibration has failed in response to the confidence level of the calibration parameters being less than a second threshold; or, in response to the parameter calibration duration of the camera being greater than a third preset duration, to determine that the camera parameter calibration has failed.
[0149] Furthermore, the determination module 503 is also used to determine that the camera parameter calibration is successful within a third preset time period or a fourth preset time period, in response to the confidence level of the calibration parameter being greater than the second threshold.
[0150] Furthermore, the camera calibration device also includes: a display module, used to display a first fault code or a second fault code through a preset interactive device; and to issue a fault diagnosis prompt message based on the first fault code or the second fault code, wherein the fault diagnosis prompt message is used to prompt manual troubleshooting of whether there is any abnormality in the hardware calibration facility.
[0151] According to another aspect of the embodiments of this application, a vehicle is also provided, including: a memory storing an executable program; and a processor for running the executable program, wherein the executable program executes the camera calibration method described in any of the above embodiments when running on the processor.
[0152] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0153] Step S10: Control the camera to acquire target images;
[0154] Step S12: Within a first preset time period, in response to the failure of the comparison between the target image and the preset template image, a first fault code is generated, wherein the first fault code is used to indicate that there is an image comparison anomaly between the target image and the preset template image;
[0155] Step S14: Determine a first adaptive adjustment strategy based on the first fault code, wherein the first adaptive adjustment strategy includes: a second preset duration, the second preset duration being longer than the first preset duration;
[0156] Step S16: Within the second preset time period, in response to the successful comparison between the target image and the preset template image, within the third preset time period, the parameters of the camera are calibrated to obtain the calibration result.
[0157] Step S18: In response to the calibration result indicating that the camera parameters have been successfully calibrated, the camera parameters are updated based on the calibration result.
[0158] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer-readable storage medium, and the computer program is configured to execute the camera calibration method described in any of the above claims when it is run on a computer or processor.
[0159] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0160] Step S10: Control the camera to acquire target images;
[0161] Step S12: Within a first preset time period, in response to the failure of the comparison between the target image and the preset template image, a first fault code is generated, wherein the first fault code is used to indicate that there is an image comparison anomaly between the target image and the preset template image;
[0162] Step S14: Determine a first adaptive adjustment strategy based on the first fault code, wherein the first adaptive adjustment strategy includes: a second preset duration, the second preset duration being longer than the first preset duration;
[0163] Step S16: Within the second preset time period, in response to the successful comparison between the target image and the preset template image, within the third preset time period, the parameters of the camera are calibrated to obtain the calibration result.
[0164] Step S18: In response to the calibration result indicating that the camera parameters have been successfully calibrated, the camera parameters are updated based on the calibration result.
[0165] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the camera calibration method of any of the above claims.
[0166] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0167] Step S10: Control the camera to acquire target images;
[0168] Step S12: Within a first preset time period, in response to the failure of the comparison between the target image and the preset template image, a first fault code is generated, wherein the first fault code is used to indicate that there is an image comparison anomaly between the target image and the preset template image;
[0169] Step S14: Determine a first adaptive adjustment strategy based on the first fault code, wherein the first adaptive adjustment strategy includes: a second preset duration, the second preset duration being longer than the first preset duration;
[0170] Step S16: Within the second preset time period, in response to the successful comparison between the target image and the preset template image, within the third preset time period, the parameters of the camera are calibrated to obtain the calibration result.
[0171] Step S18: In response to the calibration result indicating that the camera parameters have been successfully calibrated, the camera parameters are updated based on the calibration result.
[0172] According to another aspect of the embodiments of this application, a computer program product is also provided, including a computer program that, when executed by a processor, implements the camera calibration method of any of the above claims, including:
[0173] Step S10: Control the camera to acquire target images;
[0174] Step S12: Within a first preset time period, in response to the failure of the comparison between the target image and the preset template image, a first fault code is generated, wherein the first fault code is used to indicate that there is an image comparison anomaly between the target image and the preset template image;
[0175] Step S14: Determine a first adaptive adjustment strategy based on the first fault code, wherein the first adaptive adjustment strategy includes: a second preset duration, the second preset duration being longer than the first preset duration;
[0176] Step S16: Within the second preset time period, in response to the successful comparison between the target image and the preset template image, within the third preset time period, the parameters of the camera are calibrated to obtain the calibration result.
[0177] Step S18: In response to the calibration result indicating that the camera parameters have been successfully calibrated, the camera parameters are updated based on the calibration result.
[0178] According to another aspect of the embodiments of this application, a computer program product is also provided, including a non-volatile computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the camera calibration method of any of the above claims, including:
[0179] Step S10: Control the camera to acquire target images;
[0180] Step S12: Within a first preset time period, in response to the failure of the comparison between the target image and the preset template image, a first fault code is generated, wherein the first fault code is used to indicate that there is an image comparison anomaly between the target image and the preset template image;
[0181] Step S14: Determine a first adaptive adjustment strategy based on the first fault code, wherein the first adaptive adjustment strategy includes: a second preset duration, the second preset duration being longer than the first preset duration;
[0182] Step S16: Within the second preset time period, in response to the successful comparison between the target image and the preset template image, within the third preset time period, the parameters of the camera are calibrated to obtain the calibration result.
[0183] Step S18: In response to the calibration result indicating that the camera parameters have been successfully calibrated, the camera parameters are updated based on the calibration result.
[0184] According to another aspect of the embodiments of this application, a computer program is also provided, which, when executed by a processor, implements the camera calibration method of any of the above claims, including:
[0185] Step S10: Control the camera to acquire target images;
[0186] Step S12: Within a first preset time period, in response to the failure of the comparison between the target image and the preset template image, a first fault code is generated, wherein the first fault code is used to indicate that there is an image comparison anomaly between the target image and the preset template image;
[0187] Step S14: Determine a first adaptive adjustment strategy based on the first fault code, wherein the first adaptive adjustment strategy includes: a second preset duration, the second preset duration being longer than the first preset duration;
[0188] Step S16: Within the second preset time period, in response to the successful comparison between the target image and the preset template image, within the third preset time period, the parameters of the camera are calibrated to obtain the calibration result.
[0189] Step S18: In response to the calibration result indicating that the camera parameters have been successfully calibrated, the camera parameters are updated based on the calibration result.
[0190] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0191] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0192] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0193] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0194] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0195] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A camera calibration method, characterized in that, include: Control the camera to capture target images; Within a first preset time period, in response to the failure of the comparison between the target image and the preset template image, a first fault code is generated, wherein the first fault code is used to indicate that there is an image comparison anomaly between the target image and the preset template image; A first adaptive adjustment strategy is determined based on the first fault code, wherein the first adaptive adjustment strategy includes: a second preset duration, the second preset duration being longer than the first preset duration; Within the second preset time period, in response to the successful comparison between the target image and the preset template image, within the third preset time period, the parameters of the camera are calibrated to obtain the calibration result; In response to the calibration result indicating that the camera parameters have been successfully calibrated, the camera parameters are updated based on the calibration result.
2. The method according to claim 1, characterized in that, The method further includes: In response to the successful comparison between the target image and the preset template image, and the calibration result indicating that the camera parameter calibration has failed, a second fault code is generated, wherein the second fault code is used to indicate that there is an out-of-tolerance problem in the parameter calibration of the camera; A second adaptive adjustment strategy is determined based on the second fault code, wherein the second adaptive adjustment strategy includes: a fourth preset duration, the fourth preset duration being longer than the third preset duration; Within the fourth preset time period, the parameters of the camera are calibrated to obtain the calibration result.
3. The method according to claim 1, characterized in that, Within the first preset time period, determining that the target image fails to match the preset template image includes: In response to the similarity between the target image and the preset template image being less than a first threshold, it is determined that the comparison between the target image and the preset template image has failed; or, If the comparison time between the target image and the preset template image is longer than the first preset time, it is determined that the comparison between the target image and the preset template image has failed.
4. The method according to claim 1, characterized in that, The method further includes: Within the first preset time period or the second preset time period, in response to the similarity between the target image and the preset template image being greater than a first threshold, it is determined that the target image and the preset template image have been successfully matched.
5. The method according to claim 2, characterized in that, The calibration result includes: calibration parameters. Within the third preset time period, if the parameter calibration of the camera is determined to have failed, it includes: If the confidence level of the calibration parameter is less than a second threshold, it is determined that the camera parameter calibration has failed; or, If the parameter calibration duration of the camera exceeds the third preset duration, it is determined that the parameter calibration of the camera has failed.
6. The method according to claim 5, characterized in that, The method further includes: Within the third preset time period or the fourth preset time period, in response to the confidence level of the calibration parameters being greater than the second threshold, it is determined that the camera parameter calibration is successful.
7. The method according to claim 2, characterized in that, The method further includes: The first fault code or the second fault code is displayed through a preset interactive device; Based on the first fault code or the second fault code, a fault troubleshooting prompt message is issued, wherein the fault troubleshooting prompt message is used to prompt manual troubleshooting of whether there is any abnormality in the hardware calibration facilities.
8. A vehicle, characterized in that, include: Memory, which stores executable programs; A processor for running the executable program, wherein the executable program, when running on the processor, performs the camera calibration method as described in any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the camera calibration method according to any one of claims 1 to 7 when run on a computer or processor.
10. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the camera calibration method as described in any one of claims 1 to 7.