Calibration method and device of camera deployed and controlled by AI algorithm, and storage medium
By constructing algorithm configuration models and detection areas, combining camera real-time picture and calibration index data, the camera parameters are calculated and adjusted, and the calibration efficiency and difficulty in adapting to algorithm specification updates in camera AI layout and compliance detection in the prior art is solved, and efficient and accurate camera calibration and adaptability are achieved.
Patent Information
- Application Number
- CN202510378930.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-28
- Publication Date
- 2025-05-02
- 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.
By constructing an algorithm configuration model, we determine the weight values corresponding to different algorithm installation specification data sets and different indicators, draw frame images based on the camera's real-time picture, detect target objects and delineate detection areas, combine and judge the best control AI algorithm, calculate the distance between the target objects and the camera, etc., and comprehensively determine the adjustment parameters (height, horizontal angle, upturn angle) to achieve adaptive calibration.
It improves the calibration efficiency of camera AI layout and compliance detection, can flexibly adapt to the update and adjustment of algorithm specifications, reduces labor costs and time consumption, and realizes accurate adaptive adjustment of the camera.
Smart Images

Figure CN119922408A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of compliance detection of camera AI control, and in particular to calibration methods, devices and storage media for cameras controlled by AI algorithms. Background Art
[0002] With the rapid development of emerging information technology, AI algorithm control technology has been widely used in many fields such as urban management and security monitoring. By utilizing advanced artificial intelligence video analysis technology, efficient and accurate monitoring and control in various complex scenarios have been achieved. Therefore, the adoption of AI analysis technology in current urban management has become a mainstream trend. The core preliminary work of the smart urban management platform is to accurately adjust the camera layout, configure the algorithm and effectively generate alarms according to the algorithm installation standards.
[0003] However, due to the significant differences in the installation conditions of various AI algorithms, including the basic parameter configuration of the camera, shooting direction, lighting conditions, scene selection, and adaptability to the surrounding environment, in actual applications, the cameras need to be adjusted one by one in strict accordance with the specifications. This process is not only cumbersome and complicated, but also requires professionals with knowledge of algorithm specifications to perform manually, resulting in high labor costs and low efficiency. More importantly, with the continuous updating and adjustment of algorithm specifications, the existing system is often difficult to respond quickly, and there is a clear risk of lag.
[0004] Currently, no effective solution has been proposed for the problems of low calibration efficiency and difficulty in adapting to algorithm specification updates in camera AI control compliance detection in related technologies. Summary of the invention
[0005] The embodiments of the present application provide a calibration method, device, system, electronic device and storage medium for an AI algorithm-controlled camera, so as to at least solve the problems of low calibration efficiency and difficulty in adapting to algorithm specification updates in camera AI control compliance detection in related technologies.
[0006] In a first aspect, an embodiment of the present application provides a calibration method for an AI algorithm controlled camera, comprising: Create an algorithm configuration model based on the preset calibration indicator weight ratio and the preset algorithm installation specification data set; Obtain a scene image taken by the camera to be debugged and calibration index data of the camera to be debugged; detect a target object from the scene image, and define a detection area from the scene image based on the object category corresponding to the target object; obtain a target control AI algorithm type based on the position of the detection area and the object category; Based on the calibration index data and the actual size of the target object, the distance between the target object and the camera is calculated; the target control AI algorithm type is substituted into the algorithm configuration model to obtain a target installation specification data set; Based on the target installation specification data set and the distance between the target object and the camera, the distance to be adjusted and the weight of each target object are calculated; Based on the distance to be adjusted and the weight of each target object, a weighted average value to be adjusted is calculated, and based on the weighted average value to be adjusted, the camera to be debugged is calibrated.
[0007] In some embodiments, the step of defining a detection area from the scene image includes: Based on the calibration index weight ratio and the calibration index data, determining whether the camera to be debugged is suitable for the control AI algorithm; If the camera to be debugged is suitable for the control AI algorithm, continue to detect the target object from the scene image; If the camera to be debugged is not suitable for the control AI algorithm, the calibration is stopped.
[0008] In some embodiments, judging whether the camera to be debugged is suitable for the control AI algorithm based on the calibration index weight ratio and the calibration index data includes: Calculating a calibration indicator threshold based on the calibration indicator weight ratio and a preset installation specification data set; Calculating a calibration indicator score based on the calibration indicator threshold, the calibration indicator data, and the calibration indicator weight ratio; Based on the comparison result between the calibration index score and the preset requirement score, it is determined whether the camera to be debugged is suitable for the control AI algorithm.
[0009] In some 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: Calculating a ratio of the target object to the actual size based on the calibration index data and the actual size of the target object; Based on the ratio of the target object to the actual size, the distance between the target object and the camera is calculated.
[0010] In some embodiments, the weighted average value to be adjusted includes a weighted distance value, a weighted pitch angle value, and a weighted horizontal angle value; and the weighted average value to be adjusted is calculated based on the distance to be adjusted and the weight of each target object, including: Calculating the weighted distance value based on the distance to be adjusted and the weight of each target object; The weighted elevation angle value is calculated based on the distance between the target object and the camera and the installation height of the camera to be debugged, and the weighted horizontal angle value is calculated based on the distance between the target object and the camera.
[0011] In some embodiments, the weighted pitch angle value is calculated based on the distance between the target object and the camera and the installation height of the camera to be debugged, including: Calculating the pitch angle 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; The weighted pitch angle value is calculated based on the pitch angles of each target object and the proportion weight of each target object.
[0012] In some embodiments, the calculating the weighted horizontal angle value based on the distance between the target object and the camera includes: Based on the horizontal position of the center point of the detection area and the horizontal position of the camera to be debugged, obtaining the horizontal distance between the target object and the camera; Calculating a horizontal deviation angle of the target object based on the horizontal distance and the distance between the target object and the camera; The weighted horizontal angle value is calculated based on the horizontal offset angle and the proportion weight of each of the target objects.
[0013] In some embodiments, the weighted average value to be adjusted includes a weighted distance value, a weighted pitch angle value, and a weighted horizontal angle value; and calibrating the camera to be debugged based on the weighted average value to be adjusted includes: Calculating a target height based on the weighted distance value, the installation height of the camera to be debugged and the height adjustment weight; Calculating a target pitch angle based on the weighted pitch angle value and the pitch angle adjustment weight; Calculate the target horizontal angle based on the weighted horizontal angle value and the horizontal angle adjustment weight; wherein the height adjustment weight, the pitch angle adjustment weight and the horizontal angle adjustment weight sum to one; The camera to be debugged is calibrated based on the target height, the target pitch angle and the target horizontal angle.
[0014] In a second aspect, an embodiment of the present application provides a calibration device for an AI algorithm controlled camera, comprising: The algorithm configuration model module is used to create an algorithm configuration model based on the preset calibration indicator weight ratio and the overall algorithm installation specification data set; An algorithm type judgment module is used to obtain a scene image taken by the camera to be debugged and calibration index data of the camera to be debugged; detect a target object from the scene image, and delineate a detection area from the scene image based on the object category corresponding to the target object; and obtain a target control AI algorithm type based on the position of the detection area and the object category; An algorithm calculation module, used 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; and to obtain a target installation specification data set based on the target control AI algorithm type; The algorithm calculation module is also used to calculate the distance to be adjusted and the weight of each target object based on the target installation specification data set and the distance between the target object and the camera; The calibration module is used to calculate the weighted average value to be adjusted based on the distance to be adjusted and the weight of each target object, and calibrate the camera to be debugged based on the weighted average value to be adjusted.
[0015] In a third aspect, an embodiment of the present application provides a storage medium on which a computer program is stored, which, when executed by a processor, implements the calibration method of the AI algorithm-controlled camera as described in the first aspect above.
[0016] 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.
[0017] 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
[0018] 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: Figure 1It 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; Figure 2 is a flowchart of a calibration method for an AI algorithm controlled camera according to an embodiment of the present application; 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; 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; 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
[0019] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated 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 intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within 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 ordinary technicians in the field related to the contents disclosed in the present application, some changes such as design, manufacturing or production based on the technical contents disclosed in the present application are only conventional technical means, and should not be understood as insufficient contents disclosed in the present application.
[0020] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.
[0021] Unless otherwise defined, the technical terms or scientific terms involved in this application should be understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the" and the like involved in this application do not indicate a quantity limitation, and may indicate the singular or plural. The terms "include", "comprise", "have" and any of their variations involved in this application are intended to cover non-exclusive inclusions; for example, a process, method, system, product or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units that are not listed, or may also include other steps or units inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application means greater than or equal to two. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: A exists alone, A and B exist at the same time, and B exists alone. The terms "first", "second", "third" and the like involved in the present application are merely used to distinguish similar objects and do not represent a specific ordering of the objects.
[0022] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. Taking running on a terminal as an example, Figure 1 1 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. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown) processor 102 (processor 102 may include but is not limited to a microprocessor M CU or programmable logic device FPGA and other processing devices) and a memory 104 for storing data. Optionally, the terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is for illustration only and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0023] 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 control 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, to implement the above method. 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 memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0024] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0025] This embodiment provides a calibration method for an AI algorithm controlled camera. Figure 2 is a flow chart of a calibration method for an AI algorithm controlled camera according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps: Step S201, creating an algorithm configuration model based on a preset calibration index weight ratio and a preset algorithm installation specification data set; Among them, the preset algorithm installation specification data set refers to the data set used to determine the installation specifications of different algorithms. These data sets contain the specifications and standards that various algorithms need to follow during the installation process, including but not limited to the basic parameter configuration of the camera, shooting direction, lighting conditions, scene selection, and adaptability to the surrounding environment. 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.) based on the actual situation. These weight ratios reflect the importance of each indicator in the algorithm configuration.
[0026] Collect and organize the algorithm installation specification data sets of different algorithms, and then determine the calibration indicator weight ratios corresponding to different calibration indicators. Use machine learning or deep learning technology to calculate the thresholds corresponding to each calibration indicator based on the algorithm installation specification data set and the calibration indicator weight ratio, so as to build an algorithm configuration model. The algorithm configuration model is used to receive camera scene images as input, calculate the calibration indicator data values, and compare them with the thresholds and calibration indicator weight ratios corresponding to each calibration indicator to determine whether the camera is suitable for the control AI algorithm. At the same time, the model is also used to obtain the target control AI algorithm type based on the location of the target object in the detection area and the object category, and calculate the best solution for camera adjustment.
[0027] This step realizes the automation and intelligence of camera configuration by building an algorithm configuration model, improves configuration efficiency, and the setting of weight ratios and the collection of algorithm installation specification data sets enable the model to flexibly adjust the configuration plan according to actual needs, improving the model's adaptability to different algorithms and scenarios.
[0028] Step S202, obtaining a scene image taken by the camera to be debugged and calibration index data of the camera to be debugged; detecting the target object from the scene image, and demarcating a detection area from the scene image based on the object category corresponding to the target object; obtaining the target control AI algorithm type based on the position and object category of the detection area; Among them, the scene pictures taken by the camera in real time are used, and the calibration index data of the camera to be debugged is collected to obtain the resolution, frame rate, light, occlusion, and focal length data values. The target detection algorithm is used to detect the target object from the scene picture, and the detection area is defined according to the category of the target object (such as human body, bicycle, etc.). Combined judgment is made based on the location of the detection area and the category of the object, and the preset algorithm mapping relationship is used to obtain the target control AI algorithm type that best matches the target area. The specific judgment formula is as follows:
[0029] In the above formula, I is the input scene image, D(I) is the target object detection result on scene image I, R(D(I)) is the detection area set defined according to the target object detection result, C(r) is the center point of the target object r in the detection area, T is the category set, and A best It is the most matching target control AI algorithm type determined.
[0030] This step uses image recognition and target detection technology to achieve rapid processing of scene images and accurate detection of target objects. It also intelligently selects the most suitable control AI algorithm based on different monitoring scenes and target object categories by accurately defining the detection area and intelligently selecting the algorithm, thereby improving the accuracy of target object recognition and control.
[0031] Step S203, based on the calibration index data and the actual size of the target object, calculate the distance between the target object and the camera; substitute the target control AI algorithm type into the algorithm configuration model to obtain the target installation specification data set; Among them, the distance between the target object and the camera is calculated by geometric calculation or deep learning model using the known calibration index data and the actual size of the target object, and the target control AI algorithm type is used as input and substituted into the algorithm configuration model. The model outputs an installation specification data set that matches the target algorithm type based on 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 an installation specification data set that matches the target control AI algorithm type, providing a basis for the precise configuration of the camera.
[0032] Step S204, 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 weight of each target object; Among them, the ideal distance between the camera and the target object is obtained according to the target installation specification data set, and the distance that the camera should be adjusted is calculated based on the distance between the target object and the camera (actual distance). The weight is assigned to each target object based on the importance of the target object (such as the human body may be more important than a bicycle) and the number of factors. This step provides a specific adjustment target for the camera calibration by calculating the distance to be adjusted, and assigns a weight to each target object, so that the camera calibration can pay more attention to important target objects, improving the pertinence and effect of the calibration.
[0033] Step S205, based on the distance to be adjusted and the weight of each target object, the weighted average value to be adjusted is calculated, and based on the weighted average value to be adjusted, the camera to be debugged is calibrated.
[0034] Among them, the weighted average formula is used to calculate the weighted average value that should be adjusted, combined with the distance to be adjusted and the weight of each target object. According to the weighted average value to be adjusted, the height, horizontal angle, pitch angle and other parameters of the camera are adjusted to achieve accurate calibration of the camera. This step calculates the weighted average value, comprehensively considers the importance and distance factors of each target object, makes the calibration result more accurate and reliable, and improves the accuracy and efficiency of the deployment.
[0035] Through the above steps, the algorithm configuration model is constructed according to the preset calibration index weight ratio and the algorithm installation specification data set, which can accurately calculate the threshold of each detection index, ensure the accuracy and applicability of the subsequent calibration process, and avoid the errors and inconveniences caused by manual configuration in traditional methods; by obtaining the scene pictures and calibration index data taken by the camera to be debugged, the intelligent recognition of the target object is realized, and the detection area is delineated from the scene picture according to the category of the target object, and the optimal deployment AI algorithm type is obtained based on the position and object category of the detection area, 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; calculate the distance between the target object and the camera, and obtain the target installation specification data set. By comparing the actual size of the target object and the display size in the picture, the distance between the target object and the camera can be accurately calculated, and the selected deployment AI algorithm type is substituted into the algorithm configuration model to obtain the corresponding installation specification data set. The one-step automated processing greatly reduces manual intervention and improves the efficiency of calibration. Based on the target installation specification data set and the distance between the target object and the camera, the distance to be adjusted and the weight of each target object are calculated, fully considering the importance and positional relationship of different targets 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 weight of each target object, the weighted average value to be adjusted is calculated, and the camera to be debugged is calibrated based on this value. The calibration result not only includes parameters such as the camera's height, horizontal angle, and pitch angle, but also ensures that these parameters match the actual needs of the monitoring scene and target object, realizing the automated calibration of the camera's AI deployment compliance detection, successfully solving the problems of inefficiency and poor adaptability in traditional camera calibration methods, improving the efficiency and accuracy of the calibration operations required for AI algorithm deployment, and reducing labor costs and time consumption, providing strong technical support for the construction of a smart urban management platform.
[0036] In some of the embodiments, defining a detection area from a scene image includes: Based on the calibration index weight ratio and calibration index data, determine whether the camera to be debugged is suitable for the deployment of the AI algorithm; If the camera to be debugged is suitable for the AI control algorithm, continue to detect the target object from the scene image; If the camera to be debugged is not suitable for the control AI algorithm, the calibration will be stopped.
[0037] Among them, based on the data values and corresponding weights of calibration indicators such as resolution R, frame rate F, light L, occlusion O, focal length Z, etc., the data value of each indicator is compared with the threshold calculated by the algorithm configuration model, and combined with the corresponding weight value to obtain the score of each indicator, such as the score of resolution R. The total score of all indicators is calculated and compared with the preset value (depending on the application requirements). If the total score meets the preset conditions (such as exceeding a certain threshold), it is judged that the camera to be debugged is suitable for the control AI algorithm; otherwise, it is not suitable. If it is suitable for the control AI algorithm, continue to detect the target object from the scene image, and then continue to calibrate; if it is not suitable for the control AI algorithm, stop the calibration process to avoid invalid or inefficient control operations when the conditions are not met. This embodiment uses an algorithm configuration model to accurately calculate the threshold of each calibration indicator, and further combines the weight value and indicator data value to judge whether the camera is suitable for the deployment control AI algorithm. After confirming that the camera is suitable for the deployment control AI algorithm, further target object detection and optimal algorithm judgment can ensure the accuracy and effectiveness of the deployment control. For cameras that are not suitable for the deployment control AI algorithm, the calibration process is stopped in time to avoid wasting computing resources and time, thereby achieving a rapid evaluation of whether the camera is suitable for the deployment control AI algorithm, thereby improving the efficiency and accuracy of the deployment control.
[0038] In some embodiments, 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 the calibration index threshold based on the calibration index weight ratio and the preset installation specification data set; Calculate the calibration indicator score based on the calibration indicator threshold, calibration indicator data and calibration indicator weight ratio; Based on the comparison results of the calibration index score and the preset requirement score, determine whether the camera to be debugged is suitable for the deployment of the AI control algorithm.
[0039] Among them, the thresholds of each calibration indicator are calculated through the installation specification data set preset in the algorithm configuration model. These thresholds represent the standard values of each calibration indicator when the camera is suitable for the control AI algorithm in a specific scenario. For each calibration indicator, its ratio to the corresponding threshold is calculated and multiplied by the corresponding weight value to obtain the score of the indicator. The scores of all calibration indicators are added together to obtain the total score of the calibration indicator. The total score of the calibration indicator is compared with the preset requirement score. The preset requirement score is set according to the actual application requirements and represents the minimum calibration level required for the camera to be suitable for the control AI algorithm. If the total score of the calibration indicator is higher than or equal to the preset requirement score, the camera to be debugged is judged to be suitable for the control AI algorithm; otherwise, it is judged to be unsuitable. The specific formula is as follows: , ; ; Where i represents any calibration index; M Represents the algorithm configuration model, including thresholds and weight values; score i Indicates the score corresponding to each calibration indicator; V i Indicates the data value corresponding to each calibration indicator; R: resolution data value, F: frame rate data value, L: light data value, O: occlusion data value, Z: focal length data value.
[0040] M algos represents the installation specification dataset of different algorithms, M weights Indicates the weight values corresponding to different indicators. M thresholds Represents the calculated threshold value, the formula for calculating the threshold value M thresholds = f ( M algos , M weights ).
[0041] This embodiment can more accurately evaluate whether a camera is suitable for the AI control algorithm by comprehensively considering the weight ratios and thresholds of different calibration indicators, avoid misjudgments that may be caused by single indicator judgment, and improve the accuracy and reliability of judgment. By adaptively adjusting the standard data sets and calibration indicator weight ratios according to different algorithm installations, the flexibility and scalability of the camera control system are enhanced, making it suitable for a variety of complex control scenarios, and achieving rapid evaluation of whether a camera is suitable for the AI control algorithm, reducing the time and cost of manual judgment.
[0042] In some embodiments, calculating the distance between the target object and the camera based on the calibration indicator data and the actual size of the target object includes: Based on the calibration index data and the actual size of the target object, the ratio value of the target object to the actual size is calculated; Calculate the distance between the target object and the camera based on the ratio of the target object to its actual size.
[0043] Among them, the target object in the picture is detected by using an image detection algorithm based on the real-time picture or frame picture obtained from the camera. For each detected target object, the ratio of the size of the target object in the picture to the actual size is calculated according to the preset database of the actual size of the target object (such as the standard size of the human body, bicycle, car, etc.). 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 of the target object to the actual size, combined with the calibration index data such as the focal length and resolution of the camera, the actual distance between the target object and the camera is calculated using the geometric relationship or the relevant formula in the algorithm configuration model. It may be necessary to consider multiple factors, such as the installation height of the camera, the tilt angle, the orientation of the target object, etc., to ensure the accuracy of the calculation result. This embodiment can more accurately determine the position and dynamics of the target object by accurately calculating the distance between the target object and the camera, thereby improving the precision and accuracy of the AI algorithm deployment. According to the actual size of different target objects and the size ratio value in the image, the calculation parameters and algorithm configuration are automatically adjusted to adapt to the deployment requirements of different scenes and target objects. By automatically processing the recognition and distance calculation of multiple target objects at the same time, it supports the deployment requirements of multiple targets in complex scenes, reduces the need for manual intervention and manual adjustment of the camera, thereby simplifying the deployment process and improving work efficiency.
[0044] In some embodiments, the weighted average value to be adjusted includes a weighted distance value, a weighted pitch angle value, and a weighted horizontal angle value; and the weighted average value to be adjusted is calculated based on the distance to be adjusted and the weight of each target object, including: Calculate the weighted distance value based on the distance to be adjusted and the weight 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, the weighted pitch angle value is calculated, and based on the distance between the target object and the camera, the weighted horizontal angle value is calculated.
[0045] Each target object has its own weight, which is usually determined based on the importance of the target object, its position in the scene, or other related factors. The weighted distance value A of the distance to be adjusted is calculated by combining the weight of each target object and the distance to be adjusted. The formula is as follows: ; Where n is the number of targets; the calculated ratio value P(i) is ;O i represents the type of the i-th target object; is the function for calculating the distance; O is other configuration parameters, which may include target type, camera parameters, etc.; M d and Mw Represents the algorithm configuration model M Part of the function used to calculate the distance and weight that should be adjusted.
[0046] Given the distance A between the center point of each target and the camera and the camera installation height H, the algorithm configuration model is combined M , calculate the pitch angle that should be adjusted for each target object, and then calculate the weighted pitch angle value B based on the weight of each target object.
[0047] Calculate the horizontal offset angle between the center point of each target and the camera, and use the algorithm to configure the model M , calculate the horizontal angle that should be adjusted for each target object, and then calculate the weighted horizontal angle value C based on the proportion weight of each target object.
[0048] This embodiment can handle multiple target objects by comprehensively considering the distance, pitch angle and horizontal angle to be adjusted for each target object, and assigning appropriate weights to each target object, so as to calculate a more accurate camera adjustment plan, thereby improving the accuracy of deployment and control, which is particularly suitable for deployment and control needs in complex scenes; and compared with manual adjustment of the camera, the camera parameters are automatically calculated and adjusted, thereby greatly reducing labor costs and time consumption.
[0049] In some of the embodiments, the weighted pitch angle value is calculated based on the distance between the target object and the camera and the installation height of the camera to be debugged, including: Based on the distance between the target object and the camera and the installation height of the camera to be debugged, calculate the elevation angle of each target object; The weighted pitch angle value is calculated based on the pitch angle of each target object and the weight of each target object.
[0050] The image information of the target object is obtained by extracting frames from the real-time camera image, and the coordinates of the center point of the target object are determined using the image detection algorithm. According to 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 pitch angle of each target object is calculated using geometric principles. The specific formula is: , where A i is the distance between the i-th target and the camera, θ i Indicates the pitch angle that should be adjusted for the i-th target object calculated by the algorithm configuration model.
[0051] Determine the weight values corresponding to the pitch angles of different target objects, and use the weighted average formula to calculate the weighted pitch angle value B. The formula is as follows: ; in, M wiIndicates the weight of the pitch angle of the i-th target.
[0052] This embodiment is based on precise pitch angle calculation and adjustment, which can ensure that the camera monitors the target object at the optimal angle, reduce monitoring blind spots, and improve monitoring quality. In addition, by automatically calculating the pitch angle and weighted pitch angle values of the target object, the adjustment plan of the camera can be quickly determined without manual measurement and adjustment one by one, which greatly improves the deployment and debugging efficiency of the monitoring system.
[0053] In some embodiments, the weighted horizontal angle value is calculated based on the distance between the target object and the camera, including: 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; Calculate the horizontal deviation angle of the target object based on the horizontal distance and the distance between the target object and the camera; The weighted horizontal angle value is calculated based on the horizontal offset angle and the weight of each target object.
[0054] Among them, the horizontal position of the center point of each target object in the detection area is determined by the image detection algorithm , get the horizontal position of the camera to be debugged (i.e. the coordinates of its installation position or reference point), calculate the straight-line distance between the center point of each target object and the horizontal position of the camera, i.e. the horizontal distance . Then the horizontal deviation angle of each target object can be calculated by the following formula: ; Then, based on the horizontal offset angle and the weight of each target object, the weighted horizontal angle value is calculated. The formula is as follows: ; This embodiment can more reasonably allocate and adjust the position and direction resources of the camera by accurately calculating the weighted horizontal angle value, avoid unnecessary waste of resources and duplication of work, and improve resource utilization efficiency; by accurately calculating the horizontal offset angle between the target object and the camera, and performing weighted averaging processing based on the weight of each target object, it can more accurately reflect the overall offset of the camera relative to the target object, which helps to more accurately adjust the position and direction of the camera in subsequent steps, thereby improving the accuracy of deployment.
[0055] In some embodiments, the weighted average value to be adjusted includes a weighted distance value, a weighted elevation angle value, and a weighted horizontal angle value; based on the weighted average value to be adjusted, calibrating the camera to be debugged includes: Calculate the target height based on the weighted distance value, the installation height of the camera to be debugged and the height adjustment weight; The target pitch angle is calculated based on the weighted pitch angle value and the pitch angle adjustment weight; Calculate the target horizontal angle based on the weighted horizontal angle value and the horizontal angle adjustment weight; wherein the height adjustment weight, the pitch angle adjustment weight and the horizontal angle adjustment weight sum to one; The camera to be debugged is calibrated based on the target height, target pitch angle and target horizontal angle.
[0056] Among them, based on the weighted distance value A, the weighted pitch angle value B and the weighted horizontal angle value C, and combined with the corresponding adjustment weights, after calculating the target height, target pitch angle and target horizontal angle, the camera to be debugged is adjusted accordingly. The formula is as follows: Height adjustment formula: ; Pitch angle adjustment formula: ; Horizontal angle adjustment formula: ; M H Adjust weights for height, M B Adjust weights for pitch angles, M C Adjust the weights for horizontal angles, and .
[0057] This embodiment can obtain the ideal parameters of the camera after adjustment by accurately calculating the weighted distance value, weighted pitch angle value and weighted horizontal angle value, and combining the corresponding adjustment weights, ensuring that the camera can accurately cover the target area when deployed, reducing blind spots and improving monitoring effects; and compared to the traditional manual adjustment method, this embodiment can automatically and accurately complete the camera calibration work, and the automated 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, and can quickly respond and calculate the best camera adjustment plan whether facing new algorithm specifications or changes in target objects.
[0058] The embodiments of the present application are described and illustrated below through preferred embodiments.
[0059] 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 a calibration method for an AI algorithm controlled camera according to a preferred embodiment of the present application, such as Figure 4 As shown, the specific steps of this preferred embodiment are as follows: S401, create an algorithm configuration model M, determine different algorithm installation specification data sets and weight values corresponding to different indicators, and calculate thresholds. An example of a certain type of algorithm camera specification data is as follows: (I) Basic settings of camera parameters: Resolution: 1080P is recommended, no less than 720P, no higher than 4K; Frame rate: no higher than 25fps, no lower than 15fps, recommended value is 20fps; Bitrate: 720P is recommended to be set to 4096Kbps~6144Kbps, 1080P is recommended to be set to 6144Kpbs~8192Kbps, higher resolution can set higher bitrate; Video encoding: If H.265 is supported, set it to H.265.
[0060] (2) Camera shooting direction: The camera is shooting at a slightly downward angle. The specific requirements are as follows: Installation height: 5-10 M ; Monitoring distance: 5-10 M ; Monitoring width: 3-5 M ; Looking down angle: left and right angles are less than 8°; pitch angles are 10°-20°.
[0061] (III) Lighting requirements: During the day, the illumination should be between 60 and 1000 lux under normal lighting conditions (excluding heavy rain, fog, etc.); There needs to be street lights at night (excluding insufficient light, etc.), and try to eliminate the effects of reflections, excessive light, backlight, etc.
[0062] set up M algos represents the installation specification dataset of different algorithms, M weights Indicates the weight values corresponding to different indicators. M thresholds Indicates the calculated threshold value. The formula for calculating the threshold value is as follows: M thresholds = f ( M algos , M weights ); S402, obtain the camera scene image, configure the model through the algorithm, calculate the resolution, frame rate, light, occlusion, focal length data values, compare the threshold and weight value, calculate the score, and determine whether it is suitable for the deployment of the AI algorithm. The formula is as follows: Setting I: Camera scene picture, M : Algorithm configuration model, including threshold and weight values.
[0063] R: resolution data value, F: frame rate data value, L: light data value, O: occlusion data value, Z: focal length data value.
[0064] For each indicator, calculate its ratio to the threshold and multiply it by the corresponding weight value.
[0065] , ; The total score of all indicators is calculated and compared with a preset value (depending on application requirements) to determine whether it is suitable for the deployment of the AI algorithm.
[0066] ; S403, detect the target object based on the image detection algorithm, define the detection area according to the target object classification, calculate the center point, and determine the best deployment AI algorithm category based on the detection area orientation and target object category combination.
[0067] ; Where I is the input image, D(I) is the target object detection result on image I, R(D(I)) is the set of detection areas defined according to the detection results, C(r) is the center point of the target object in the detection area r, T is the category set, It is a collection of the best control AI algorithm categories.
[0068] S404, according to the calculated AI algorithm type, substitute it into the algorithm configuration model, calculate the ratio of the target object to the actual size based on the resolution, focal length, and the size of the reference target object (such as a human body, a bicycle, a car, a trash can, a telephone pole, etc.), calculate the distance between each target object and the camera according to the ratio, determine the installation direction and tilt direction of the camera, calculate the distance that the target object should be adjusted and the weight 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 the weight; ; Where n is the number of targets, and the calculated ratio value P(i) is , O i Represents the type of the i-th target object.
[0069] The function for calculating the distance is , O is other configuration parameters, which may include target type, camera parameters, etc. d and M w Represents the algorithm configuration model MPart of the function used to calculate the distance and weight that should be adjusted.
[0070] S405, calculating the pitch angle of each target object according to the distance A between the center point of the target object and the camera and the camera installation height H, calculating the pitch angle and the weight of the target object to be adjusted according to the algorithm configuration model, and calculating the weighted average value B of the pitch angle to be adjusted according to the pitch angle and the weight; ; in, M wi represents the weight of the pitch angle of the ith target. The pitch angle of each target can be calculated by Calculate, where A i is the distance between the i-th target and the camera, θ i Indicates the pitch angle that should be adjusted for the i-th target object calculated by the algorithm configuration model.
[0071] S406, calculating the horizontal offset angle between the center point of the target object and the camera, calculating the horizontal angle and the weight of the target object to be adjusted according to the algorithm configuration model, and calculating the weighted average value C of the horizontal angle to be adjusted according to the horizontal angle and the weight; ; in, M wi represents the weight of the horizontal offset angle of the i-th target. The horizontal offset angle of each target can be obtained by Calculate the coordinates of the center point of the target object: , the coordinates of the camera are , is the distance between the target and the camera.
[0072] S407, based on the values of H, A, B, C and their weights, calculate the height, horizontal angle, and pitch angle of the camera to be finally adjusted.
[0073] Height adjustment formula: ; Pitch angle adjustment formula: ; Horizontal angle adjustment formula: ; in, M H , M B , M C Represent the weights of height, pitch angle, and horizontal angle respectively, and .
[0074] This embodiment also provides a calibration device for an AI algorithm-controlled camera, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated here. As used below, the terms "module", "unit", "subunit", etc. can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0075] 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, such as Figure 5 As shown, the device comprises: The algorithm configuration model module 10 is used to create an algorithm configuration model based on a preset calibration indicator weight ratio and a full algorithm installation specification data set; The algorithm type judgment module 20 is used to 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 delineate the detection area from the scene picture based on the object category corresponding to the target object; obtain the target control AI algorithm type based on the position and object category of the detection area; The algorithm calculation module 30 is used 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; based on the target control AI algorithm type, obtain the target installation specification data set; The algorithm calculation module 30 is also used to calculate the distance to be adjusted and the weight of each target object based on the target installation specification data set and the distance between the target object and the camera; The calibration module 40 is used to calculate the weighted average value to be adjusted based on the distance to be adjusted and the weight of each target object, and calibrate the camera to be debugged based on the weighted average value to be adjusted.
[0076] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0077] In addition, in combination with the calibration method of the AI algorithm-controlled camera in the above embodiment, the embodiment of the present application can provide a storage medium for implementation. The storage medium stores a computer program; when the computer program is executed by the processor, any calibration method of the AI algorithm-controlled camera in the above embodiment is implemented.
[0078] Those skilled in the art should understand that the technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, 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, they should be considered to be within the scope of this specification.
[0079] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, 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 attached claims.
Claims
1. A calibration method for an AI algorithm controlled camera, characterized in that: include: Create an algorithm configuration model based on the preset calibration indicator weight ratio and the preset algorithm installation specification data set; Obtaining a scene image captured by the camera to be debugged and calibration index data of the camera to be debugged; Detecting a target object from the scene image, and demarcating a detection area from the scene image based on an object category corresponding to the target object; Based on the location of the detection area and the category of the object, the target control AI algorithm type is obtained; Calculating the distance between the target object and the camera based on the calibration index data and the actual size of the target object; Substituting the target deployment AI algorithm type into the algorithm configuration model to obtain a target installation specification data set; Based on the target installation specification data set and the distance between the target object and the camera, the distance to be adjusted and the weight of each target object are calculated; Based on the distance to be adjusted and the weight of each target object, a weighted average value to be adjusted is calculated, and based on the weighted average value to be adjusted, the camera to be debugged is calibrated.
2. The calibration method of the AI algorithm controlled camera according to claim 1, characterized in that: Delimiting the detection area from the scene image includes: Based on the calibration index weight ratio and the calibration index data, determining whether the camera to be debugged is suitable for the control AI algorithm; If the camera to be debugged is suitable for the control AI algorithm, continue to detect the target object from the scene image; If the camera to be debugged is not suitable for the control AI algorithm, the calibration is stopped.
3. The calibration method of the AI algorithm controlled camera according to claim 2, characterized in that: The determining whether the camera to be debugged is suitable for the control AI algorithm based on the calibration index weight ratio and the calibration index data includes: Calculating a calibration indicator threshold based on the calibration indicator weight ratio and a preset installation specification data set; Calculating a calibration indicator score based on the calibration indicator threshold, the calibration indicator data, and the calibration indicator weight ratio; Based on the comparison result between the calibration index score and the preset requirement score, it is determined whether the camera to be debugged is suitable for the control AI algorithm.
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: Calculating a ratio of the target object to the actual size based on the calibration index data and the actual size of the target object; Based on the ratio of the target object to the actual size, the distance between the target object and the camera is calculated.
5. The calibration method of the AI algorithm controlled camera according to claim 1, characterized in that: The weighted average value to be adjusted includes a weighted distance value, a weighted pitch angle value, and a weighted horizontal angle value; and the weighted average value to be adjusted is calculated based on the distance to be adjusted and the weight of each target object, including: Calculating the weighted distance value based on the distance to be adjusted and the weight of each target object; The weighted elevation angle value is calculated based on the distance between the target object and the camera and the installation height of the camera to be debugged, and the weighted horizontal angle value is calculated 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 pitch angle value based on the distance between the target object and the camera and the installation height of the camera to be debugged includes: Calculating the pitch angle 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; The weighted pitch angle value is calculated based on the pitch angles of each target object and the proportion weight of each target object.
7. The calibration method of the AI algorithm controlled camera according to claim 5, characterized in that: The calculating the weighted horizontal angle value based on the distance between the target object and the camera includes: Based on the horizontal position of the center point of the detection area and the horizontal position of the camera to be debugged, obtaining the horizontal distance between the target object and the camera; Calculating a horizontal deviation angle of the target object based on the horizontal distance and the distance between the target object and the camera; The weighted horizontal angle value is calculated based on the horizontal offset angle and the proportion weight of each of the target objects.
8. The calibration method of the AI algorithm controlled camera according to claim 1, characterized in that: The weighted average value to be adjusted includes a weighted distance value, a weighted pitch angle value and a weighted horizontal angle value; The step of calibrating the camera to be debugged based on the weighted average value to be adjusted includes: Calculating a target height based on the weighted distance value, the installation height of the camera to be debugged and the height adjustment weight; Calculating a target pitch angle based on the weighted pitch angle value and the pitch angle adjustment weight; Calculate the target horizontal angle based on the weighted horizontal angle value and the horizontal angle adjustment weight; wherein the height adjustment weight, the pitch angle adjustment weight and the horizontal angle adjustment weight sum to one; The camera to be debugged is calibrated based on the target height, the target pitch angle and the target horizontal angle.
9. A calibration device for an AI algorithm controlled camera, characterized in that: include: The algorithm configuration model module is used to create an algorithm configuration model based on the preset calibration indicator weight ratio and the overall algorithm installation specification data set; An algorithm type determination module is used to obtain a scene image taken by the camera to be debugged and calibration index data of the camera to be debugged; Detecting a target object from the scene image, and demarcating a detection area from the scene image based on the object category corresponding to the target object; acquiring a target control AI algorithm type based on the position of the detection area and the object category; An algorithm calculation module, used 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; Based on the target deployment AI algorithm type, obtain a target installation specification data set; The algorithm calculation module is also used to calculate the distance to be adjusted and the weight of each target object based on the target installation specification data set and the distance between the target object and the camera; The calibration module is used to calculate the weighted average value to be adjusted based on the distance to be adjusted and the weight of each target object, and calibrate the camera to be debugged based on the weighted average value to be adjusted.
10. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the calibration method for an AI algorithm-controlled camera according to any one of claims 1 to 8 when running.
Citation Information
Patent Citations
Display device and camera tracking method in multi-person scene
CN112866773A
Camera shooting method and system capable of automatically zooming and focusing
CN116320745A
Universal scene-oriented material installation detection method, system and equipment and medium
CN117788790A
Video processing method and device based on scene understanding and intelligent analysis system
CN118470614A
Camera distribution planning method and device, electronic device and storage medium
CN118537810A