Calibration Method, Device and Storage Medium for AI Algorithm-Controlled Cameras
By building an algorithm configuration model and adaptive calibration method, the problem of low calibration efficiency in camera AI layout and compliance detection is solved, efficient and accurate camera calibration is achieved, adapting to algorithm specification updates, and labor costs are reduced.
Patent Information
- Application Number
- CN202510378930.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-28
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2045-03-28
AI Technical Summary
In the prior art, the calibration efficiency of camera AI layout and compliance detection is low and difficult to adapt to algorithm specification updates, resulting in high labor costs and low efficiency.
By constructing an algorithm configuration model, different algorithm installation specification data sets and index weight values are determined, target objects are detected based on the real-time picture of the camera and detection areas are demarcated, the distance between the target objects and the camera and the adjustment parameters are calculated, and adaptive calibration is achieved.
It improves the calibration efficiency of camera AI layout and compliance detection, can flexibly adapt to algorithm specification updates, reduce labor costs and time consumption, and ensure the accuracy and applicability of calibration.
Smart Images

Figure CN119922408B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of compliance detection for AI deployment of cameras, and particularly to a calibration method, device, and storage medium for cameras deployed with AI algorithms. Background Art
[0002] With the rapid development of emerging information technologies, AI algorithm deployment technology has been widely applied in multiple fields such as urban management and security monitoring. By leveraging advanced artificial intelligence video analysis technology, efficient and precise monitoring and deployment in various complex scenarios have been achieved. Therefore, the adoption of AI analysis technology in current urban management has become a mainstream trend, and the core preliminary work of the intelligent urban management platform lies in accurately adjusting the camera layout according to the algorithm installation standards, configuring the algorithm, and effectively generating alarms.
[0003] However, due to significant differences in the installation conditions of various AI algorithms, covering multiple aspects such as the basic parameter configuration of cameras, shooting orientation, lighting conditions, scene selection, and adaptability to the surrounding environment, in practical applications, it is necessary to strictly adjust the cameras one by one according to the specifications. This process is not only cumbersome and complex but also requires professional personnel with algorithm specification knowledge to execute manually, resulting in high labor costs and low efficiency. More critically, with the continuous update and adjustment of algorithm specifications, the existing system often struggles to respond promptly, presenting an obvious risk of lag.
[0004] Currently, for the problems of low calibration efficiency and difficulty in adapting to algorithm specification updates in the compliance detection of camera AI deployment in related technologies, no effective solutions have been proposed. Summary of the Invention
[0005] Embodiments of the present application provide a calibration method, device, system, electronic device, and storage medium for cameras deployed with AI algorithms to at least solve the problems of low calibration efficiency and difficulty in adapting to algorithm specification updates in the compliance detection of camera AI deployment in related technologies.
[0006] In a first aspect, embodiments of the present application provide a calibration method for cameras deployed with AI algorithms, including:
[0007] Create an algorithm configuration model based on a preset calibration index weight ratio and a preset algorithm installation specification dataset;
[0008] Obtain a scene picture captured by a camera to be debugged and calibration index data of the camera to be debugged; detect a target object from the scene picture, and delimit a detection area from the scene picture based on the object category corresponding to the target object; obtain a target deployment AI algorithm type based on the position of the detection area and the object category;
[0009] Calculate the distance between the target object and the camera based on the calibration index data and the actual size of the target object; substitute the target deployment AI algorithm type into the algorithm configuration model to obtain a target installation specification data set;
[0010] Based on the target installation specification data set and the distance between the target object and the camera, calculate the distance to be adjusted and the proportion weights of each target object;
[0011] Based on the distance to be adjusted and the proportion weights of each target object, calculate the weighted average to be adjusted, and calibrate the camera to be debugged based on the weighted average to be adjusted.
[0012] In some embodiments, the step of demarcating a detection area from the scene picture includes:
[0013] Based on the calibration index weight ratio and the calibration index data, determine whether the camera to be debugged is suitable for the deployment AI algorithm;
[0014] If the camera to be debugged is suitable for the deployment AI algorithm, continue to detect target objects from the scene picture;
[0015] If the camera to be debugged is not suitable for the deployment AI algorithm, stop the calibration.
[0016] In some embodiments, the step of determining whether the camera to be debugged is suitable for the deployment AI algorithm based on the calibration index weight ratio and the calibration index data includes:
[0017] Calculate a calibration index threshold based on the calibration index weight ratio and a preset installation specification data set;
[0018] Calculate a calibration index score based on the calibration index threshold, the calibration index data, and the calibration index weight ratio;
[0019] Based on the comparison result between the calibration index score and a preset required score, determine whether the camera to be debugged is suitable for the deployment AI algorithm.
[0020] In some embodiments, the step of calculating the distance between the target object and the camera based on the calibration index data and the actual size of the target object includes:
[0021] Calculate a ratio value of the target object to the actual size based on the calibration index data and the actual size of the target object;
[0022] Calculate the distance between the target object and the camera based on the ratio value of the target object to the actual size.
[0023] In some of these embodiments, the weighted average to be adjusted includes a weighted distance value, a weighted elevation angle value, and a weighted horizontal angle value; calculating the weighted average to be adjusted based on the distance to be adjusted and the proportion weights of the respective target objects includes:
[0024] Calculating the weighted distance value based on the distance to be adjusted and the proportion weights of the respective target objects;
[0025] Calculating the weighted elevation angle value based on the distance between the target object and the camera and the installation height of the camera to be debugged, and calculating the weighted horizontal angle value based on the distance between the target object and the camera.
[0026] In some of these embodiments, calculating the weighted elevation angle value based on the distance between the target object and the camera and the installation height of the camera to be debugged includes:
[0027] Calculating the elevation angles of the respective target objects based on the distance between the target object and the camera and the installation height of the camera to be debugged;
[0028] Calculating the weighted elevation angle value based on the elevation angles of the respective target objects and the proportion weights of the respective target objects.
[0029] In some of these embodiments, calculating the weighted horizontal angle value based on the distance between the target object and the camera includes:
[0030] Obtaining the horizontal distance between the target object and the camera based on the horizontal position of the center point of the detection area and the horizontal position of the camera to be debugged;
[0031] Calculating the horizontal offset angle of the target object based on the horizontal distance and the distance between the target object and the camera;
[0032] Calculating the weighted horizontal angle value based on the horizontal offset angle and the proportion weights of the respective target objects.
[0033] In some of these embodiments, the weighted average to be adjusted includes a weighted distance value, a weighted elevation angle value, and a weighted horizontal angle value; calibrating the camera to be debugged based on the weighted average to be adjusted includes:
[0034] Calculating the target height based on the weighted distance value, the installation height of the camera to be debugged, and the height adjustment weight;
[0035] Calculating the target elevation angle based on the weighted elevation angle value and the elevation angle adjustment weight;
[0036] Calculate a target horizontal angle based on the weighted horizontal angle value and the horizontal angle adjustment weight; wherein, the sum of the height adjustment weight, the pitch angle adjustment weight, and the horizontal angle adjustment weight is one.
[0037] Calibrate the camera to be debugged based on the target height, the target pitch angle, and the target horizontal angle.
[0038] In a second aspect, an embodiment of the present application provides a calibration device for an AI algorithm surveillance camera, including:
[0039] An algorithm configuration model module, configured to create an algorithm configuration model based on a preset calibration index weight ratio and an entire algorithm installation specification data set.
[0040] An algorithm type determination module, configured to obtain a scene picture captured by the camera to be debugged and calibration index data of the camera to be debugged; detect a target object from the scene picture, and delimit a detection area from the scene picture based on the object category corresponding to the target object; obtain a target surveillance AI algorithm type based on the position of the detection area and the object category.
[0041] An algorithm calculation module, configured to calculate the distance between the target object and the camera based on the calibration index data and the actual size of the target object; obtain a target installation specification data set based on the target surveillance AI algorithm type.
[0042] The algorithm calculation module is further configured to calculate an adjustment distance to be adjusted and the proportion weight of each target object based on the target installation specification data set and the distance between the target object and the camera.
[0043] A calibration module, configured to calculate an adjustment weighted average based on the adjustment distance to be adjusted and the proportion weight of each target object, and calibrate the camera to be debugged based on the adjustment weighted average.
[0044] In a third aspect, an embodiment of the present application provides a storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the calibration method for an AI algorithm surveillance camera as described in the first aspect above.
[0045] Compared with the related art, the calibration method, device and storage medium for AI algorithm-controlled cameras provided in the embodiments of the present application construct an algorithm configuration model, determine different algorithm installation specification data sets and weight values corresponding to different indicators, detect target objects and delineate detection areas based on frame images of the camera's real-time screen, combine and judge the best AI control algorithm, calculate the ratio of the target object to the actual size, distance, etc., comprehensively determine the adjustment parameters (height, horizontal angle, pitch angle), and realize adaptive calibration, which solves the problems of low calibration efficiency and difficulty in adapting to algorithm specification updates in camera AI control compliance detection in related technologies, realizes precise adaptive adjustment of the camera, greatly improves the calibration efficiency of camera AI control compliance detection, and can flexibly adapt to the update and adjustment of algorithm specifications, reducing labor costs and time consumption.
[0046] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0048] Figure 1 It is a hardware structure block diagram of a terminal of the calibration method of the AI algorithm controlled camera according to an embodiment of the present invention;
[0049] Figure 2 is a flowchart of a calibration method for an AI algorithm controlled camera according to an embodiment of the present application;
[0050] Figure 3 This is a schematic diagram of the installation and deployment of the camera to be debugged according to the preferred embodiment of the present application;
[0051] Figure 4 It is a flowchart of a calibration method of an AI algorithm controlled camera according to a preferred embodiment of the present application;
[0052] Figure 5 It is a structural block diagram of a calibration device for an AI algorithm-controlled camera according to an embodiment of the present application. DETAILED DESCRIPTION
[0053] In order to make the objectives, technical solutions and advantages of the present application more clear and understandable, the present application will be described and explained below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments provided in the present application without creative efforts belong to the scope of protection of the present application. In addition, it can also be understood that although the efforts made in this development process may be complex and lengthy, for those of ordinary skill in the art related to the content disclosed in the present application, some design, manufacturing or production changes based on the technical content disclosed in the present application are only conventional technical means and should not be understood as the content disclosed in the present application being insufficient.
[0054] Reference to "embodiment" in the present application means that a specific feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The phrase appears in various places in the specification and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in the present application can be combined with other embodiments without conflict.
[0055] Unless otherwise defined, the technical terms or scientific terms involved in the present application should have the ordinary meaning understood by those of ordinary skill in the technical field to which the present application belongs. The terms "a", "an", "one kind", "the" and the like involved in the present application do not indicate a quantity limitation and can represent a single or plural number. The terms "including", "comprising", "having" and any variations thereof involved in the present application are intended to cover non-exclusive inclusion; for example, a process, method, system, product or device including a series of steps or modules (units) is not limited to the listed steps or units, but may further include steps or units not listed, or may further include other steps or units inherent to these processes, methods, products or devices. The terms "connected", "coupled" and the like involved in the present application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The term "plurality" involved in the present application means greater than or equal to two. "And / or" describes the association relationship of associated objects and indicates that three relationships may exist. For example, "A and / or B" may represent: A exists alone, A and B exist simultaneously, and B exists alone. The terms "first", "second", "third", etc. involved in the present application are only used to distinguish similar objects and do not represent a specific order for the objects.
[0056] The method embodiment provided in this embodiment can be executed on a terminal, a computer, or a similar computing device. Taking running on a terminal as an example,Figure 1 is the hardware structure block diagram of the terminal of the calibration method of the AI algorithm controlled camera according to an embodiment of the present invention. As Figure 1 shown, the terminal may include one or more ( Figure 1 only one is shown in the figure) processors 102 (the processor 102 may include but is not limited to a microprocessor M processing devices such as CU or a field programmable gate array FPGA, etc.) and a memory 104 for storing data. Optionally, the above terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those of ordinary skill in the art can understand that Figure 1 the structure shown is only schematic and does not limit the structure of the above terminal. For example, the terminal may further include more or fewer components than Figure 1 shown in the figure, or have a different configuration from Figure 1 shown in the figure.
[0057] The memory 104 can be used to store computer programs. For example, software programs and modules of application software, such as the computer program corresponding to the calibration method of the AI algorithm controlled camera in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above method is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely set relative to the processor 102, and these remote memories can be connected to the terminal through a network. Examples of the above network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0058] The transmission device 106 is used to receive or send data via a network. Specific examples of the above network may include a wireless network provided by a communication provider of the terminal. In one instance, the transmission device 106 includes a network adapter (Network Interface Controller, abbreviated as NIC), which can be connected to other network devices through a base station and thus can communicate with the Internet. In one instance, the transmission device 106 may be a radio frequency (RadioFrequency, abbreviated as RF) module, which is used to communicate with the Internet wirelessly.
[0059] This embodiment provides a calibration method for an AI algorithm controlled camera, Figure 2 is the flowchart of the calibration method of the AI algorithm controlled camera according to an embodiment of the present application. As Figure 2 shown, the process includes the following steps:
[0060] Step S201: Create an algorithm configuration model based on a preset calibration index weight ratio and a preset algorithm installation specification dataset.
[0061] The preset algorithm installation specification dataset refers to a data set used to determine different algorithm installation specifications. These data sets contain the specification standards that various algorithms need to follow during installation, including but not limited to requirements in multiple aspects such as the basic parameter configuration of the camera, shooting orientation, lighting conditions, scene selection, and surrounding environment adaptability. The calibration index weight ratio is the weight ratio set by the staff for each calibration index (such as resolution, frame rate, light, occlusion, focal length, etc.) according to the actual situation. These weight ratios reflect the importance of each index in the algorithm configuration.
[0062] Collect and organize the algorithm installation specification datasets of different algorithms, then determine the calibration index weight ratios corresponding to different calibration indexes, and use machine learning or deep learning techniques to calculate the thresholds corresponding to each calibration index based on the algorithm installation specification dataset and the calibration index weight ratio, so as to construct an algorithm configuration model. The algorithm configuration model is used to receive the camera scene picture as input, judge whether the camera is suitable for deploying the AI algorithm by calculating the calibration index data value and comparing it with the thresholds and calibration index weight ratios corresponding to each calibration index. At the same time, this model is also used to obtain the target deployment AI algorithm type according to the position and object category of the target object in the detection area, and calculate the best camera adjustment plan.
[0063] In this step, by constructing an algorithm configuration model, the automation and intelligence of camera configuration are realized, the configuration efficiency is improved, and the setting of the weight ratio and the collection of the algorithm installation specification dataset enable the model to flexibly adjust the configuration plan according to actual needs, improving the adaptability of the model to different algorithms and scenarios.
[0064] Step S202: Obtain the scene picture taken by the camera to be debugged and the calibration index data of the camera to be debugged; detect the target object from the scene picture, and delimit the detection area from the scene picture based on the object category corresponding to the target object; obtain the target deployment AI algorithm type based on the position and object category of the detection area.
[0065] Among them, use the scene picture taken by the camera in real time, and collect the calibration index data of the camera to be debugged to obtain the data values of resolution, frame rate, light, occlusion, and focal length. Use the target detection algorithm to detect the target object from the scene picture, and delimit the detection area according to the category of the target object (such as human body, bicycle, etc.). Combine the position and object category of the detection area for combined judgment, and use the preset algorithm mapping relationship to obtain the target deployment AI algorithm type that best matches the target area. The specific judgment formula is as follows:
[0066] In the above formula, I is the input scene picture, D(I) is the detection result of the target object on the scene picture I, R(D(I)) is the set of detection regions delimited according to the detection result of the target object, C(r) is the center point of the target object r in the detection region, T is the category set, and A best is the most matching target deployment AI algorithm type judged.
[0067] In this step, through image recognition and target detection technologies, rapid processing of the scene picture and accurate detection of the target object are achieved. And by precisely delimiting the detection regions and intelligently selecting algorithms, according to different monitoring scenarios and target object categories, the most suitable deployment AI algorithm is intelligently selected, improving the accuracy of target object recognition and deployment.
[0068] Step S203: Calculate the distance between the target object and the camera based on the calibration index data and the actual size of the target object; substitute the target deployment AI algorithm type into the algorithm configuration model to obtain the target installation specification data set;
[0069] Among them, using the known calibration index data and the actual size of the target object, calculate the distance between the target object and the camera through geometric calculation or deep learning model, and use the target deployment AI algorithm type as the input and substitute it into the algorithm configuration model. The model outputs the installation specification data set matching the target algorithm type according to the preset algorithm installation specification data set. This step provides key parameters for subsequent camera calibration by calculating the distance between the target object and the camera, and obtains the installation specification data set matching the target deployment AI algorithm type, providing a basis for the precise configuration of the camera.
[0070] Step S204: Calculate the distance to be adjusted and the proportion weights of each target object based on the target installation specification data set and the distance between the target object and the camera;
[0071] Among them, obtain the ideal distance between the camera and the target object according to the target installation specification data set, combine the distance between the target object and the camera (actual distance), calculate the distance that the camera should be adjusted, and allocate proportion weights to each target object in combination with factors such as the importance of the target object (for example, a human body may be more important than a bicycle), quantity, etc. This step provides specific adjustment targets for camera calibration by calculating the distance to be adjusted, and allocates proportion weights to each target object, enabling the camera calibration to pay more attention to important target objects and improving the pertinence and effect of calibration.
[0072] Step S205: Calculate the weighted average value to be adjusted based on the distance to be adjusted and the proportion weights of each target object, and calibrate the camera to be debugged based on the weighted average value to be adjusted.
[0073] Among them, using the weighted average formula, combining the distance to be adjusted and the proportion weights of each target object, the weighted average value to be adjusted is calculated. According to the weighted average value to be adjusted, parameters such as the height, horizontal angle, and pitch angle of the camera are adjusted to achieve precise calibration of the camera. In this step, by calculating the weighted average value, the importance and distance factors of each target object are comprehensively considered, making the calibration result more accurate and reliable, and improving the accuracy and efficiency of the deployment.
[0074] Through the above steps, an algorithm configuration model is constructed based on the preset calibration index weight ratio and the algorithm installation specification dataset, which can accurately calculate the thresholds of each detection index, ensuring the accuracy and applicability of the subsequent calibration process, and avoiding the errors and inconveniences brought by manual configuration in traditional methods; by obtaining the scene pictures and calibration index data taken by the camera to be debugged, intelligent recognition of target objects is achieved. According to the categories of target objects, detection areas are delimited from the scene pictures, and based on the positions and object categories of the detection areas, the best deployment AI algorithm type is obtained, which not only improves the accuracy and efficiency of the deployment, but also enables the system to automatically adapt to different monitoring scenarios and algorithm requirements; the distance between the target object and the camera is calculated, and the target installation specification dataset is obtained. By comparing the actual size of the target object and its displayed size in the picture, the distance between the target object and the camera can be accurately calculated. Substitute the selected deployment AI algorithm type into the algorithm configuration model to obtain the corresponding installation specification dataset. This automated process greatly reduces manual intervention and improves the efficiency of calibration; based on the target installation specification dataset and the distance between the target object and the camera, the distance to be adjusted and the proportion weights of each target object are calculated, fully considering the importance and positional relationship of different target objects in the camera's field of view, providing a more refined adjustment plan for subsequent calibration; according to the distance to be adjusted and the proportion weights of each target object, the weighted average value to be adjusted is calculated, and based on this value, the camera to be debugged is calibrated. The calibration result not only includes parameters such as the height, horizontal angle, and pitch angle of the camera, but also ensures that these parameters match the actual requirements of the monitoring scene and target objects, realizing the automatic calibration of the camera AI deployment compliance detection, successfully solving the problems of low efficiency and poor adaptability in traditional camera calibration methods, improving the efficiency and accuracy of the calibration operations required for AI algorithm deployment, reducing labor costs and time consumption, and providing strong technical support for the construction of the intelligent urban management platform.
[0075] In some of these embodiments, delimiting the detection area from the scene picture includes:
[0076] Based on the calibration index weight ratio and the calibration index data, determine whether the camera to be debugged is suitable for the deployment AI algorithm;
[0077] If the camera to be debugged is suitable for deploying the AI algorithm, continue to detect the target object from the scene picture;
[0078] If the camera to be debugged is not suitable for deploying the AI algorithm, stop the calibration.
[0079] Among them, based on calibration index data values such as resolution R, frame rate F, light L, occlusion O, focal length Z, etc. and corresponding weights, compare the data value of each index with the threshold calculated by the algorithm configuration model, and combine the corresponding weight values to obtain the score of each index. For example, the score of resolution R. Calculate the total score of all indexes and compare it with a preset value (depending on application requirements). If the total score meets the preset condition (such as exceeding a certain threshold), it is determined that the camera to be debugged is suitable for deploying the AI algorithm; otherwise, it is not suitable. If it is suitable for deploying the AI algorithm, continue to detect the target object from the scene picture, so as to continue the calibration; if it is not suitable for deploying the AI algorithm, stop the calibration process to avoid invalid or inefficient deployment operations under unsatisfied conditions. In this embodiment, the threshold of each calibration index is accurately calculated by the algorithm configuration model, and further combined with the weight value and the index data value to judge whether the camera is suitable for deploying the AI algorithm. After confirming that the camera is suitable for deploying the AI algorithm, through further target object detection and best algorithm judgment, the accuracy and effectiveness of the deployment can be ensured. For cameras that are not suitable for deploying the AI algorithm, the calibration process is stopped in time to avoid wasting computing resources and time, realizing a rapid evaluation of whether the camera is suitable for deploying the AI algorithm, thereby improving the efficiency and accuracy of the deployment.
[0080] In some embodiments, based on the calibration index weight ratio and the calibration index data, to judge whether the camera to be debugged is suitable for deploying the AI algorithm, it includes:
[0081] Based on the calibration index weight ratio and the preset installation specification data set, calculate the calibration index threshold;
[0082] Based on the calibration index threshold, the calibration index data and the calibration index weight ratio, calculate the calibration index score;
[0083] Based on the comparison result between the calibration index score and the preset required score, judge whether the camera to be debugged is suitable for deploying the AI algorithm.
[0084] Among them, by configuring the preset installation specification dataset in the algorithm model, the thresholds of each calibration index are calculated. These thresholds represent the standard values of each calibration index when the camera is suitable for deploying the AI algorithm in a specific scenario. For each calibration index, calculate the ratio of it to the corresponding threshold and multiply by the corresponding weight value to obtain the score of this index. Add up the scores of all calibration indexes to get the total score of the calibration indexes. Compare the total score of the calibration indexes with the preset required score. The preset required score is set according to the actual application requirements and represents the minimum calibration level required for the camera to be suitable for deploying the AI algorithm. If the total score of the calibration indexes is higher than or equal to the preset required score, it is judged that the camera to be debugged is suitable for deploying the AI algorithm; otherwise, it is judged as not suitable. The specific formula is as follows:
[0085] , ;
[0086] ;
[0087] Among them, i represents any one calibration index; M represents the algorithm configuration model, including thresholds and weight values; score i represents the score corresponding to each calibration index; V i represents the data value corresponding to each calibration index; R: resolution data value, F: frame rate data value, L: light data value, O: occlusion data value, Z: focal length data value.
[0088] M algos represents the installation specification dataset of different algorithms, M weights represents the weight values corresponding to different indexes, M thresholds represents the calculated threshold, and the formula for calculating the threshold M thresholds = f ( M algos , M weights ).
[0089] In this embodiment, by comprehensively considering the weight ratios and thresholds of different calibration indexes, it is possible to more accurately evaluate whether the camera is suitable for deploying the AI algorithm, avoiding misjudgments that may be caused by single-index judgments, improving the accuracy and reliability of the judgment. By making adaptive adjustments according to different algorithm installation specification datasets and calibration index weight ratios, the flexibility and scalability of the camera deployment system are enhanced, suitable for a variety of complex deployment scenarios, realizing a rapid evaluation of whether the camera is suitable for deploying the AI algorithm, and reducing the time and cost of manual judgment.
[0090] In some of these embodiments, calculating the distance between the target object and the camera based on the calibration index data and the actual size of the target object includes:
[0091] Calculating the ratio value of the target object to the actual size based on the calibration index data and the actual size of the target object;
[0092] Calculating the distance between the target object and the camera based on the ratio value of the target object to the actual size.
[0093] Among them, according to the obtained real-time camera footage or extracted frame pictures, the target objects in the footage are detected using an image detection algorithm. For each detected target object, according to a preset database of the actual sizes of target objects (such as the standard sizes of humans, bicycles, cars, etc.), the ratio value of the size of the target object in the footage to the actual size is calculated. The pixel size of the target object in the image can be measured and compared with the actual size to obtain the ratio value. Based on the calculated ratio value of the target object to the actual size, combined with calibration index data such as the focal length and resolution of the camera, relevant formulas in the geometric relationship or algorithm configuration model are used to calculate the actual distance between the target object and the camera. Multiple factors may need to be considered, such as the installation height of the camera, the tilt angle, and the orientation of the target object, to ensure the accuracy of the calculation results. In this embodiment, by accurately calculating the distance between the target object and the camera, the position and dynamics of the target object can be judged more accurately, thereby improving the accuracy and precision of the AI algorithm layout; according to the actual sizes of different target objects and the ratio values of the sizes in the image, the calculation parameters and algorithm configurations are automatically adjusted to meet the layout requirements of different scenarios and target objects. And by automatically processing the recognition and distance calculation of multiple target objects simultaneously, it supports the multi-target layout requirements in complex scenarios, reduces the need for manual intervention and manual adjustment of the camera, simplifies the layout process, and improves work efficiency.
[0094] In some of these embodiments, the adjusted weighted average value includes a weighted distance value, a weighted pitch angle value, and a weighted horizontal angle value; calculating the adjusted weighted average value based on the adjusted distance and the proportion weights of each target object includes:
[0095] Calculating the weighted distance value based on the adjusted distance and the proportion weights of each target object;
[0096] Calculating the weighted pitch angle value based on the distance between the target object and the camera and the installation height of the camera to be debugged, and calculating the weighted horizontal angle value based on the distance between the target object and the camera.
[0097] Among them, each target object has its own proportion weight, and the proportion weights of each target object are usually determined based on the importance of the target object, its position in the scene, or other relevant factors. Combining the proportion weights of each target object and the distance to be adjusted, the weighted distance value A of the distance to be adjusted is calculated. The formula is as follows:
[0098] ;
[0099] Among them, n is the number of target objects; the calculated proportional value P(i) is ; O i represents the type of the i-th target object; is a function for calculating the distance; O is other configuration parameters, which may include target object types, camera parameters, etc.; M d and M w respectively represent the partial functions in the algorithm configuration model M for calculating the distance to be adjusted and the weight.
[0100] Given the distance A between the center point of each target object and the camera and the installation height H of the camera to be debugged, combining the algorithm configuration model M , the elevation and depression angles to be adjusted are calculated for each target object, and then based on the proportion weights of each target object, the weighted elevation and depression angle value B is calculated.
[0101] The horizontal offset angle between the center point of each target object and the camera is calculated, and using the algorithm configuration model M , the horizontal angle to be adjusted is calculated for each target object, and then based on the proportion weights of each target object, the weighted horizontal angle value C is calculated.
[0102] In this embodiment, by comprehensively considering the distance to be adjusted, the elevation and depression angles, and the horizontal angles of each target object, multiple target objects can be processed, and appropriate weights can be assigned to each target object, so as to calculate a more accurate camera adjustment scheme, thereby improving the accuracy of surveillance, and is particularly suitable for surveillance requirements in complex scenarios; and compared with manually adjusting the camera, the parameters of the camera are automatically calculated and adjusted, thus greatly reducing the labor cost and time consumption.
[0103] In some of these embodiments, calculating the weighted elevation and depression angle value based on the distance between the target object and the camera and the installation height of the camera to be debugged includes:
[0104] Calculating the elevation and depression angles of each target object based on the distance between the target object and the camera and the installation height of the camera to be debugged;
[0105] Calculating the weighted elevation and depression angle value based on the elevation and depression angles of each target object and the proportion weights of each target object.
[0106] Among them, the image information of the target object is obtained by extracting frames from the real-time camera footage, and the center point coordinates of the target object are determined using an image detection algorithm. Based on the straight-line distance between the center point of the target object and the camera (i.e., the distance between the target object and the camera) and the installation height H of the camera, the elevation and depression angles of each target object are calculated using geometric principles. The specific formula is , where A i is the distance between the i-th target object and the camera, and θ i represents the elevation and depression angle that the i-th target object should be adjusted by as calculated by the algorithm configuration model.
[0107] The weight values corresponding to the elevation and depression angles of different target objects are determined, and the weighted elevation and depression angle value B is calculated using the weighted average formula. The formula is as follows:
[0108] ;
[0109] Among them, M wi represents the proportion weight of the elevation and depression angle of the i-th target object.
[0110] Based on the precise calculation and adjustment of the elevation and depression angles, this embodiment can ensure that the camera monitors the target object at the best angle, reduce the monitoring blind area, improve the monitoring quality, and can quickly determine the adjustment plan of the camera by automatically calculating the elevation and depression angles and the weighted elevation and depression angle values of the target object, without manual measurement and adjustment one by one, greatly improving the deployment and debugging efficiency of the monitoring system.
[0111] In some of these embodiments, based on the distance between the target object and the camera, the weighted horizontal angle value is calculated, including:
[0112] Based on the horizontal position of the center point of the detection area and the horizontal position of the camera to be debugged, the horizontal distance between the target object and the camera is obtained;
[0113] Based on the horizontal distance and the distance between the target object and the camera, the horizontal offset angle of the target object is calculated;
[0114] Based on the horizontal offset angle and the proportion weight of each target object, the weighted horizontal angle value is calculated.
[0115] Among them, the horizontal position of the center point of each target object within the detection area is determined by an image detection algorithm , the horizontal position of the camera to be debugged is obtained (i.e., the coordinates of its installation position or reference point), and the straight-line distance between the center point of each target object and the horizontal position of the camera is calculated, which is the horizontal distance . Then the horizontal offset angle of each target object can be calculated by the following formula:
[0116] ;
[0117] Based on the horizontal offset angle and the proportion weights of each target object, calculate the weighted horizontal angle value. The formula is as follows:
[0118] ;
[0119] In this embodiment, by accurately calculating the weighted horizontal angle value, the position and direction resources of the camera can be more reasonably allocated and adjusted, avoiding unnecessary resource waste and repetitive labor, and improving the resource utilization efficiency; by accurately calculating the horizontal offset angle between the target object and the camera and performing weighted average processing in combination with the proportion weights of each target object, the overall offset situation of the camera relative to the target object can be more accurately reflected, which helps to more precisely adjust the position and direction of the camera in the subsequent steps, thereby improving the accuracy of the deployment.
[0120] In some of these embodiments, the adjusted weighted average value includes a weighted distance value, a weighted elevation angle value, and a weighted horizontal angle value; based on the adjusted weighted average value, calibrate the camera to be debugged, including:
[0121] Based on the weighted distance value, the installation height of the camera to be debugged, and the height adjustment weight, calculate the target height;
[0122] Based on the weighted elevation angle value and the elevation angle adjustment weight, calculate the target elevation angle;
[0123] Based on the weighted horizontal angle value and the horizontal angle adjustment weight, calculate the target horizontal angle; wherein, the sum of the height adjustment weight, the elevation angle adjustment weight, and the horizontal angle adjustment weight is one;
[0124] Based on the target height, the target elevation angle, and the target horizontal angle, calibrate the camera to be debugged.
[0125] Among them, after calculating the target height, the target elevation angle, and the target horizontal angle based on the weighted distance value A, the weighted elevation angle value B, the weighted horizontal angle value C, and in combination with the corresponding adjustment weights, perform corresponding adjustments on the camera to be debugged. The formula is as follows:
[0126] Height adjustment formula: ;
[0127] Elevation angle adjustment formula: ;
[0128] Horizontal angle adjustment formula: ;
[0129] M H is the height adjustment weight, M B is the elevation angle adjustment weight,M C is the horizontal angle adjustment weight, and .
[0130] In this embodiment, by accurately calculating the weighted distance value, weighted elevation angle value, and weighted horizontal angle value, and combining the corresponding adjustment weights, the ideal parameters after the camera adjustment can be obtained, ensuring that the camera can accurately cover the target area during deployment, reducing blind spots, and improving the monitoring effect. Moreover, compared with the traditional manual adjustment method, this embodiment can automatically and accurately complete the camera calibration work. Automatic calibration can not only reduce labor costs and time consumption, but also improve the efficiency and accuracy of calibration. In addition, the present invention can be flexibly adjusted according to different algorithm installation specifications and target object types. Whether facing new algorithm specifications or changes in target objects, it can quickly respond and calculate the best camera adjustment plan.
[0131] The following describes and illustrates the embodiments of the present application through preferred embodiments.
[0132] Figure 3 is a schematic diagram of the installation and deployment of the camera to be debugged according to the preferred embodiment of the present application, Figure 4 is a flowchart of the calibration method for the AI algorithm deployed camera according to the preferred embodiment of the present application. As Figure 4 shown, the specific steps of this preferred embodiment are as follows:
[0133] S401. Create an algorithm configuration model M, determine the dataset of different algorithm installation specifications and the weight values corresponding to different metrics, and calculate the threshold. An example of the specification data of a certain type of algorithm camera is as follows:
[0134] (I) Basic settings of camera parameters:
[0135] Resolution: It is recommended to be 1080P, not lower than 720P, and not higher than 4K;
[0136] Frame rate: Not higher than 25fps, not lower than 15fps, and the recommended value is 20fps;
[0137] Bit rate: For 720P, it is recommended to be set to 4096Kbps - 6144Kbps; for 1080P, it is recommended to be set to 6144Kpbs - 8192Kbps; for higher resolutions, higher bit rates can be set;
[0138] Video encoding: If H.265 is supported, set it to H.265.
[0139] (II) Camera shooting direction:
[0140] The camera shoots at a slightly downward angle. The specific requirements are as follows:
[0141] Installation height: 5 - 10 M ;
[0142] Monitoring distance: 5 - 10 M ;
[0143] Monitoring width: 3 - 5 M ;
[0144] Overhead angle: Horizontal deviation angle less than 8°; Pitch angle 10° - 20°.
[0145] (III) Lighting requirements:
[0146] During the day, it is required to be under normal lighting conditions, and the lighting range is between 60 and 1000 lux (excluding heavy rain, heavy fog, etc.);
[0147] At night, street lights, etc. are required (excluding insufficient light, etc.), and try to exclude the influence of reflection, too strong light, backlight, etc.
[0148] Settings M algos Represents the installation specification dataset for different algorithms, M weights Represents the weight values corresponding to different indicators, M thresholds Represents the calculated threshold, and the formula for calculating the threshold is as follows:
[0149] M thresholds = f ( M algos , M weights );
[0150] S402. Obtain the camera scene picture, configure the model through the algorithm, calculate the resolution, frame rate, light, occlusion, and focal length data values, compare with the threshold and weight values, calculate the score, and determine whether it is suitable for deploying the AI algorithm. The formula is as follows:
[0151] Set I: Camera scene picture, M : Algorithm configuration model, including threshold and weight values.
[0152] R: Resolution data value, F: Frame rate data value, L: Light data value, O: Occlusion data value, Z: Focal length data value.
[0153] For each indicator, calculate the ratio of it to the threshold and multiply by the corresponding weight value.
[0154] , ;
[0155] Calculate the total score of all metrics and compare it with a preset value (depending on the application requirements) to determine whether it is suitable for deploying the AI algorithm for surveillance.
[0156] ;
[0157] S403: Detect the target object based on the image detection algorithm, delimit the detection area according to the classification of the target object, calculate the center point, and determine the best AI algorithm category for surveillance based on the combination of the orientation of the detection area and the category of the target object.
[0158] ;
[0159] Where I is the input image, D(I) is the detection result of the target object on image I, R(D(I)) is the set of detection areas delimited according to the detection result, C(r) is the center point of the target object in detection area r, T is the set of categories, is the set of the best AI algorithm categories for surveillance determined.
[0160] S404: Substitute the calculated AI algorithm type into the algorithm configuration model. Based on the resolution, focal length, and the size of the target object for reference (such as human body, bicycle, car, trash can, utility pole, etc.), calculate the ratio value of the target object to the actual size. According to the ratio value, calculate the distance between each target object and the camera, determine the installation direction and tilt direction of the camera, calculate the distance to be adjusted for the target object and the weight ratio of each area according to the algorithm configuration model, and calculate the weighted average value A of the distance to be adjusted according to the distance and weight;
[0161] ;
[0162] Where n is the number of target objects, and the calculated ratio value P(i) is , O i represents the type of the i-th target object.
[0163] The function for calculating the distance is , O are other configuration parameters, which may include the type of target object, camera parameters, etc. M d and M w respectively represent the partial functions in the algorithm configuration model M used to calculate the distance to be adjusted and the weight.
[0164] S405: Calculate the elevation and depression angles of each target object according to the distance A between the center point of the target object and the camera and the installation height H of the camera. Calculate the elevation and depression angles to be adjusted for the target object and the weight ratio according to the algorithm configuration model, and calculate the weighted average value B of the elevation and depression angles to be adjusted according to the elevation and depression angles and the weight;
[0165] ;
[0166] Among them, M wi represents the proportion weight of the elevation angle of the \(i\)-th target object. The elevation angles of each target object can be obtained through calculation, where \(A\) i is the distance between the \(i\)-th target object and the camera, and \(\theta\) i represents the elevation angle that the \(i\)-th target object should be adjusted as calculated by the algorithm configuration model.
[0167] S406. Calculate the horizontal offset angle between the center point of the target object and the camera, calculate the horizontal angle and proportion weight that the target object should be adjusted according to the algorithm configuration model, and calculate the weighted average value \(C\) of the horizontal angle to be adjusted according to the horizontal angle and the weight;
[0168] ;
[0169] Among them, M wi represents the proportion weight of the horizontal offset angle of the \(i\)-th target object. The horizontal offset angles of each target object can be obtained through calculation. The coordinates of the center point of the target object are , and the coordinates of the camera are , is the distance between the target object and the camera.
[0170] S407. Based on the values of \(H\), \(A\), \(B\), \(C\) and the proportion weights, calculate the final height, horizontal angle, and elevation angle that the camera should be adjusted.
[0171] Height adjustment formula: ;
[0172] Elevation angle adjustment formula: ;
[0173] Horizontal angle adjustment formula: ;
[0174] Among them, M H , M B , M C respectively represent the weights of height, elevation angle, and horizontal angle, and .
[0175] This embodiment also provides a calibration device for an AI algorithm controlled camera. This device is used to implement the above-mentioned embodiments and preferred implementation manners, and those that have been described will not be repeated here. As used hereinafter, terms such as "module", "unit", "sub-unit", etc. can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0176] Figure 5 is a structural block diagram of a calibration device for an AI algorithm controlled camera according to an embodiment of the present application. As Figure 5 shown, the device includes:
[0177] An algorithm configuration model module 10, configured to create an algorithm configuration model based on a preset calibration index weight ratio and an entire algorithm installation specification data set;
[0178] An algorithm type determination module 20, configured to obtain a scene picture captured by a camera to be debugged and calibration index data of the camera to be debugged; detect a target object from the scene picture, and delimit a detection area from the scene picture based on the object category corresponding to the target object; obtain a target controlled AI algorithm type based on the position and object category of the detection area;
[0179] An algorithm calculation module 30, configured to calculate the distance between the target object and the camera based on the calibration index data and the actual size of the target object; obtain a target installation specification data set based on the target controlled AI algorithm type;
[0180] The algorithm calculation module 30 is further configured to calculate an adjustment distance to be adjusted and a proportion weight of each target object based on the target installation specification data set and the distance between the target object and the camera;
[0181] A calibration module 40, configured to calculate an adjustment weighted average value based on the adjustment distance to be adjusted and the proportion weight of each target object, and calibrate the camera to be debugged based on the adjustment weighted average value.
[0182] It should be noted that the above-mentioned each module can be a functional module or a program module, and can be implemented either by software or by hardware. For the modules implemented by hardware, the above-mentioned each module can be located in the same processor; or the above-mentioned each module can also be located in different processors in any combination form.
[0183] In addition, in combination with the calibration method of the AI algorithm controlled camera in the above-mentioned embodiment, an embodiment of the present application can provide a storage medium to implement. A computer program is stored on the storage medium; when the computer program is executed by a processor, any one of the calibration methods of the AI algorithm controlled camera in the above-mentioned embodiment is implemented.
[0184] Those skilled in the art should understand that the technical features of the above-described embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered to be within the scope described in this specification.
[0185] The above-described embodiments only represent several implementation manners of the present application, and the description thereof is relatively specific and detailed, but it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the appended claims.
Claims
1. A calibration method for an AI algorithm-controlled camera, characterized in that, Including: Create an algorithm configuration model based on a preset calibration index weight ratio and a preset algorithm installation specification data set; wherein, the algorithm installation specification data set refers to a data set used to determine different algorithm installation specifications; Obtain a scene picture captured by a camera to be debugged and calibration index data of the camera to be debugged; detect a target object from the scene picture, and delimit a detection area from the scene picture based on the object category corresponding to the target object; obtain a target deployment AI algorithm type based on the position of the detection area and the object category; Calculate the distance between the target object and the camera based on the calibration index data and the actual size of the target object; substitute the target deployment AI algorithm type into the algorithm configuration model to obtain a target installation specification data set; Calculate an adjustment distance to be adjusted and the proportion weights of each target object based on the target installation specification data set and the distance between the target object and the camera; calculate an adjusted weighted average based on the adjustment distance to be adjusted and the proportion weights of each target object, and calibrate the camera to be debugged based on the adjusted weighted average, including: The adjusted weighted average includes a weighted distance value, a weighted pitch angle value, and a weighted horizontal angle value; Calculate a target height based on the weighted distance value, the installation height of the camera to be debugged, and a height adjustment weight; Calculate a target pitch angle based on the weighted pitch angle value and a pitch angle adjustment weight; Calculate a target horizontal angle based on the weighted horizontal angle value and a horizontal angle adjustment weight; wherein, the sum of the height adjustment weight, the pitch angle adjustment weight, and the horizontal angle adjustment weight is one; Calibrate the camera to be debugged based on the target height, the target pitch angle, and the target horizontal angle.
2. The calibration method of the AI algorithm-controlled camera according to claim 1, wherein, The delimiting the detection area from the scene picture includes: Judge whether the camera to be debugged is suitable for the deployment AI algorithm based on the calibration index weight ratio and the calibration index data; If the camera to be debugged is suitable for the deployment AI algorithm, continue to detect the target object from the scene picture; If the camera to be debugged is not suitable for the deployment AI algorithm, stop the calibration.
3. The calibration method of the AI algorithm-controlled camera according to claim 2, wherein The judging whether the camera to be debugged is suitable for the deployment AI algorithm based on the calibration index weight ratio and the calibration index data includes: Calculate a calibration index threshold based on the calibration index weight ratio and a preset installation specification data set; Calculate a calibration index score based on the calibration index threshold, the calibration index data, and the calibration index weight ratio; Judge whether the camera to be debugged is suitable for the deployment AI algorithm based on the comparison result between the calibration index score and a preset required score.
4. The calibration method of the AI algorithm-controlled camera according to claim 1, characterized in that, The calculating the distance between the target object and the camera based on the calibration index data and the actual size of the target object includes: Calculate a ratio value of the target object to the actual size based on the calibration index data and the actual size of the target object; Calculate the distance between the target object and the camera based on the ratio value of the target object to the actual size.
5. The calibration method of the AI algorithm-controlled camera according to claim 1, characterized in that, The to-be-adjusted weighted average includes a weighted distance value, a weighted elevation angle value, and a weighted horizontal angle value; calculating the to-be-adjusted weighted average based on the to-be-adjusted distance and the proportion weights of the respective target objects includes: Calculating the weighted distance value based on the to-be-adjusted distance and the proportion weights of the respective target objects; Calculating the weighted elevation angle value based on the distance between the target object and the camera and the installation height of the to-be-debugged camera, and calculating the weighted horizontal angle value based on the distance between the target object and the camera.
6. The calibration method of the AI algorithm-controlled camera according to claim 5, characterized in that, Calculating the weighted elevation angle value based on the distance between the target object and the camera and the installation height of the to-be-debugged camera includes: Calculating the elevation angles of the respective target objects based on the distance between the target object and the camera and the installation height of the to-be-debugged camera; Calculating the weighted elevation angle value based on the elevation angles of the respective target objects and the proportion weights of the respective target objects.
7. The calibration method of the AI algorithm-controlled camera according to claim 5, wherein Calculating the weighted horizontal angle value based on the distance between the target object and the camera includes: Obtaining the horizontal distance between the target object and the camera based on the horizontal position of the center point of the detection area and the horizontal position of the to-be-debugged camera; Calculating the horizontal offset angle of the target object based on the horizontal distance and the distance between the target object and the camera; Calculating the weighted horizontal angle value based on the horizontal offset angle and the proportion weights of the respective target objects.
8. A calibration device for an AI algorithm-controlled camera, characterized in that, Including: An algorithm configuration model module, configured to create an algorithm configuration model based on a preset calibration index weight ratio and a preset algorithm installation specification data set; wherein, the algorithm installation specification data set refers to a data set used to determine different algorithm installation specifications; An algorithm type judgment module, configured to obtain a scene picture captured by the to-be-debugged camera and the calibration index data of the to-be-debugged camera; detecting target objects from the scene picture, and demarcating a detection area from the scene picture based on the object category corresponding to the target object; obtaining the target deployment AI algorithm type based on the position of the detection area and the object category; An algorithm calculation module, configured to calculate the distance between the target object and the camera based on the calibration index data and the actual size of the target object; obtaining a target installation specification data set based on the target deployment AI algorithm type; The algorithm calculation module is further configured to calculate a to-be-adjusted distance and the proportion weights of the respective target objects based on the target installation specification data set and the distance between the target object and the camera; A calibration module, configured to calculate a to-be-adjusted weighted average based on the to-be-adjusted distance and the proportion weights of the respective target objects, and calibrate the to-be-debugged camera based on the to-be-adjusted weighted average, including: The to-be-adjusted weighted average includes a weighted distance value, a weighted elevation angle value, and a weighted horizontal angle value; Calculating a target height based on the weighted distance value, the installation height of the to-be-debugged camera, and a height adjustment weight; Calculating a target elevation angle based on the weighted elevation angle value and an elevation angle adjustment weight; Calculate a target horizontal angle based on the weighted horizontal angle value and the horizontal angle adjustment weight; wherein, the sum of the height adjustment weight, the pitch angle adjustment weight, and the horizontal angle adjustment weight is one. Calibrate the camera to be debugged based on the target height, the target pitch angle, and the target horizontal angle.
9. A storage medium, characterized in that, A computer program is stored in the storage medium, wherein the computer program is configured to execute the calibration method of the AI algorithm controlled camera according to any one of claims 1 to 7 when running.
Citation Information
Patent Citations
Display device and camera tracking method in multi-person scene
CN112866773A
Video processing method and device based on scene understanding and intelligent analysis system
CN118470614A