Camera calibration method, device, electronic device and storage medium
By obtaining the detection box information in the image, determining the linear parameter group and finding the camera parameter group, the limitations of the camera calibration method in the prior art in application scenarios are solved, and camera parameter determination without calibration and motion control is realized, improving the The efficiency and accuracy of calibration are achieved.
Patent Information
- Application Number
- CN202110807725.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-16
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2041-07-16
AI Technical Summary
The existing camera calibration methods have limitations in application scenarios, especially in scenarios where calibration objects are not suitable for placing them or the camera movement cannot be controlled, making it difficult to achieve accurate camera parameter determination.
By obtaining the detection frame information of at least two targets in the image captured by the camera, a linear parameter group is determined, and the camera parameter group is searched using the pre-established correspondence between the linear parameter group and the camera parameter group, and then determining the target camera parameter group is achieved without need Calibration and camera calibration without controlling camera movement.
It improves the efficiency and accuracy of camera calibration, expands the application scenario, and can complete the fast and accurate determination of camera parameters without placing the calibrator and controlling the camera movement.
Smart Images

Figure CN113658265B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a camera calibration method, device, electronic device and storage medium. Background Art
[0002] In the image measurement process and machine vision applications, in order to determine the correspondence between the three-dimensional geometric position of points on the surface of spatial objects and the pixels in the image, it is usually necessary to establish a geometric model of camera imaging. The parameters of the geometric model are the camera parameters. The process of solving the camera parameters is called camera calibration.
[0003] There are two main types of existing camera calibration methods. The first type of camera calibration method relies on the placement of calibration objects, and the manufacturing accuracy of the calibration objects will affect the calibration results. At the same time, some application scenarios (for example, security monitoring scenarios) are not suitable for the placement of calibration objects, which limits the application of this method. The second type of camera calibration method mainly uses the camera's motion information to calibrate the camera. This method does not require calibration objects, but requires controlling the camera to do certain special movements. This method is not suitable for scenarios where the motion information is unknown or the camera movement cannot be controlled (for example, security monitoring scenarios). From the above analysis, it can be seen that the application scenarios of existing camera calibration methods are limited. Summary of the invention
[0004] In view of this, an object of the embodiments of the present application is to provide a camera calibration method, device, electronic device and storage medium to solve the above-mentioned problems.
[0005] In a first aspect, an embodiment of the present application provides a camera calibration method, the method comprising: obtaining information of a detection frame of an area where at least two targets are located in a first image; wherein the first image is an image captured by a camera at a first moment; the information of each detection frame comprises: a position and a size of the corresponding detection frame in the first image; determining a first linear parameter group based on the information of the detection frames of the at least two targets; wherein the first linear parameter group is used to characterize a linear relationship between a position and a size of the detection frame in the first image; when the first linear parameter group exists in a correspondence relationship between a predetermined linear parameter group and a camera parameter group, finding a first camera parameter group corresponding to the first linear parameter group from the correspondence relationship; wherein the first camera parameter group comprises: a mounting height of the camera, a pitch angle of the camera, and a focal length of the camera; and determining a target camera parameter group based on the first camera parameter group.
[0006] In the above implementation process, information of detection frames of at least two targets in a first image captured by a camera is obtained, and the information of each detection frame includes: the position and size of the corresponding detection frame in the first image; according to the information of the detection frames of the at least two targets, a first linear parameter group characterizing the linear relationship between the position and the size of the detection frame in the first image is determined, and then a first camera parameter group corresponding to the first linear parameter group is quickly found from the correspondence between the predetermined linear parameter group and the camera parameter group, and the target camera parameter group is determined according to the first camera parameter group. The whole process can complete the camera calibration without placing a calibration object or controlling the camera movement.
[0007] Based on the first aspect, in a possible design, the method also includes: obtaining multiple different camera parameter groups; the types of parameters corresponding to any two camera parameter groups in the multiple different camera parameter groups are the same; for each camera parameter group, using the camera parameter group and the size and position information of at least two virtual targets, generating a detection frame simulation diagram; wherein the detection frame simulation diagram includes: detection frames of the at least two virtual targets; determining a linear parameter group according to the positions and sizes of at least two detection frames in the detection frame simulation diagram in the detection frame simulation diagram; and establishing a corresponding relationship between the linear parameter group and the camera parameter group.
[0008] In the above implementation process, after obtaining multiple different camera parameter groups, for each camera parameter group, a detection frame simulation diagram is generated using the camera parameter group and the size and position information of at least two virtual targets in the world coordinate system; then, based on the positions and sizes of at least two detection frames in the detection frame simulation diagram, a linear parameter group that characterizes the linear relationship between the position and size of the detection frame in the detection frame simulation diagram is determined, and a corresponding relationship between the linear parameter group and the camera parameter group is established, thereby ensuring that the camera parameter group of the camera can be quickly found based on the corresponding relationship.
[0009] Based on the first aspect, in a possible design, for each camera parameter group, a detection frame simulation image is generated using the camera parameter group and the size and position information of at least two virtual targets, including: generating the size of the at least two virtual targets according to the size distribution of real targets of the same type as the virtual targets; generating the position information of the at least two virtual targets; for each camera parameter group, generating the detection frame simulation image according to the camera parameter group and the size and position information of the at least two virtual targets.
[0010] In the above implementation process, the sizes of at least two virtual targets are generated according to the size distribution of real targets of the same type as the virtual targets; for each camera parameter group, a detection frame simulation diagram is generated according to the camera parameter group and the position sizes and position information of at least two virtual targets generated. Since the size of the virtual target is generated according to the size distribution of real targets of the same type as the virtual target, the generated detection frame distribution diagram is more meaningful for reference.
[0011] Based on the first aspect, in a possible design, a plurality of different camera parameter groups are obtained, including: based on a target sampling interval, discretely taking values of each camera parameter within a value range to obtain the plurality of camera parameter groups.
[0012] In the above implementation process, based on the target sampling interval, each camera parameter is discretely valued within a value range, thereby ensuring that a plurality of different camera parameter groups can be obtained.
[0013] Based on the first aspect, in a possible design, the method further includes: when the first linear parameter group does not exist in the corresponding relationship, for each linear parameter group in the corresponding relationship, when the difference between the value of the corresponding parameter in the linear parameter group and the first linear parameter group is less than a target threshold, determining that the linear parameter group is a second linear parameter group; from the corresponding relationship, searching for a second camera parameter group corresponding to the second linear parameter group; and determining the target camera parameter group according to the second camera parameter group.
[0014] For any two linear parameter groups, if the difference between the values of corresponding parameters in the two linear parameter groups (parameters of the same category in the two linear parameter groups) is relatively small, then the difference between the values of corresponding parameters in the camera parameter groups corresponding to the two linear parameter groups will also be relatively small. Therefore, in the above implementation process, when the first linear parameter group does not exist in the corresponding relationship, a second linear parameter group whose differences with the values of corresponding parameters in the first linear parameter group are all less than the target threshold is determined from the corresponding relationship, and then a second camera parameter group corresponding to the second linear parameter group is found from the corresponding relationship, and then the target camera parameter group is determined according to the second camera parameter group. Therefore, when the first linear parameter group does not exist in the corresponding relationship, the camera calibration can also be completed relatively accurately.
[0015] Based on the first aspect, in a possible design, when the number of the second linear parameter groups is at least two, finding out the second camera parameter group corresponding to the second linear parameter group from the corresponding relationship includes: for each second linear parameter group, finding out the second camera parameter group corresponding to the second linear parameter group from the corresponding relationship; correspondingly, determining the target camera parameter group according to the second camera parameter group includes: acquiring information of a detection frame of an area where the target is located in a second image; the second image is an image captured by the camera at a second moment; a difference between the first moment and the second moment is less than a target time difference; for each second camera parameter group, determining a final moving speed of the target captured by the camera from the first moment to the second moment based on the second camera parameter group, information of the detection frame of the target in the first image, and information of the detection frame of the target in the second image; when it is determined that the final moving speed is within a normal moving speed range, determining that the second camera parameter group is qualified; and determining the target camera parameter group according to the qualified second camera parameter group.
[0016] In the above implementation process, when the number of the second linear parameter groups is at least two, for each second linear parameter group, the second camera parameter group corresponding to the second linear parameter group is found from the corresponding relationship. In order to eliminate unqualified camera parameter groups from all the found second camera parameter groups to improve the accuracy of the camera calibration result, the present application takes into account that in most cases, the normal moving speed of the target is within the normal moving speed range, and then obtains the information of the detection frame of the target area in the second image captured by the camera at the second moment, wherein the difference between the first moment and the second moment is less than the target time difference; then for each second camera parameter group, based on the second camera parameter group and the information of the detection frame of the target in the first image and the second image, the final moving speed of the target captured by the camera from the first moment to the second moment is determined, and when it is determined that the final moving speed is within the normal moving speed range, the second camera parameter group is determined to be qualified, and then the target camera parameter group is determined according to the qualified second camera parameter group to ensure the accuracy of the camera calibration.
[0017] Based on the first aspect, in a possible design, determining a final moving speed of the target captured by the camera from the first moment to the second moment based on the second camera parameter group, information of the detection frame of the target in the first image, and information of the detection frame of the target in the second image includes: determining at least one detection frame information group of the target from the information of the detection frame of the target in the first image and the information of the detection frame of the target in the second image; each detection frame information group includes: information of two detection frames corresponding to the target; for each detection frame information in each detection frame information group, determining, based on the second camera parameter group and the information of the detection frame, position information of the target corresponding to the detection frame in the world coordinate system; determining a moving speed of the corresponding target between the first moment and the second moment according to the position information of the target corresponding to each detection frame corresponding to the detection frame information group in the world coordinate system; and obtaining the final moving speed according to the moving speed of the at least one target.
[0018] In the above implementation process, a detection frame information group of at least one target is determined from the detection frame information of the target in the first image and the second image, and for the information of each detection frame in each detection frame information group, based on the second camera parameter group and the information of the detection frame, the position information of the target corresponding to the detection frame in the world coordinate system is determined, and then the moving speed of the corresponding target between the first moment and the second moment is determined according to the position information of each detection frame corresponding to the detection frame information group; the final moving speed is determined according to the moving speed of at least one target to ensure the accuracy of the final moving speed.
[0019] Based on the first aspect, in a possible design, determining the target camera parameter group based on the qualified second camera parameter group includes: when the number of qualified second camera parameter groups is at least two, averaging the values of corresponding parameters in at least two qualified second camera parameter groups to obtain the target camera parameter group.
[0020] In the above implementation process, the target camera parameter group is obtained by averaging the values of corresponding parameters in at least two qualified second camera parameter groups, so as to improve the accuracy of the camera calibration result.
[0021] In a second aspect, an embodiment of the present application provides a camera calibration device, the device comprising: a first acquisition unit, used to acquire information of a detection frame of an area where at least two targets are located in a first image; wherein the first image is an image captured by a camera at a first moment; the information of each detection frame comprises: a position and a size of the corresponding detection frame in the first image; a first determination unit, used to determine a first linear parameter group according to the information of the detection frames of the at least two targets; wherein the first linear parameter group is used to characterize the linear relationship between the position and the size of the detection frame in the first image; a first search unit, used to find a first camera parameter group corresponding to the first linear parameter group from a correspondence relationship between a predetermined linear parameter group and a camera parameter group when the first linear parameter group exists in the correspondence relationship between the linear parameter group and the camera parameter group; wherein the first camera parameter group comprises: the installation size of the camera, the pitch angle of the camera and the focal length of the camera; a first target determination unit, used to determine a target camera parameter group according to the first camera parameter group.
[0022] Based on the second aspect, in a possible design, the device also includes: a camera parameter acquisition unit, used to acquire multiple different camera parameter groups; the types of parameters corresponding to any two camera parameter groups in the multiple different camera parameter groups are the same; a simulation image generation unit, used to generate a detection frame simulation image for each camera parameter group using the camera parameter group and at least two virtual target size and position information; wherein the detection frame simulation image includes: detection frames of the at least two virtual targets; a linear parameter group determination unit, used to determine a linear parameter group according to the positions and sizes of at least two detection frames in the detection frame simulation image in the detection frame simulation image; and a correspondence establishment unit, used to establish a correspondence between the linear parameter group and the camera parameter group.
[0023] Based on the second aspect, in a possible design, the simulation image generation unit includes: a size generation unit, used to generate the size of the at least two virtual targets according to the size distribution of real targets of the same type as the virtual targets; a position information generation unit, used to generate the position information of the at least two virtual targets; a simulation image generation subunit, used to generate the detection frame simulation image for each camera parameter group according to the camera parameter group, the size and position information of the at least two virtual targets.
[0024] Based on the second aspect, in a possible design, the camera parameter acquisition unit is specifically used to discretely take values of each camera parameter within a value range based on a target sampling interval to obtain the multiple different camera parameter groups.
[0025] Based on the second aspect, in a possible design, the device also includes: a second determination unit, used to, when the first linear parameter group does not exist in the corresponding relationship, for each linear parameter group in the corresponding relationship, determine that the linear parameter group is a second linear parameter group when the difference between the values of the corresponding parameters in the linear parameter group and the first linear parameter group is less than a target threshold; a second search unit, used to search out a second camera parameter group corresponding to the second linear parameter group from the corresponding relationship; and a second target determination unit, used to determine the target camera parameter group based on the second camera parameter group.
[0026] Based on the second aspect, in a possible design, when the number of the second linear parameter groups is at least two, the second search unit is specifically configured to search, for each second linear parameter group, from the corresponding relationship, for a second camera parameter group corresponding to the second linear parameter group;
[0027] Correspondingly, the second target determination unit includes:
[0028] a second acquisition unit, configured to acquire information of a detection frame of an area where a target is located in a second image; the second image is an image captured by the camera at a second moment; the difference between the first moment and the second moment is less than a target time difference; a speed determination unit, configured to determine, for each second camera parameter group, a final moving speed of the target captured by the camera from the first moment to the second moment based on the second camera parameter group, information of a detection frame of the target in the first image, and information of a detection frame of the target in the second image; a screening unit, configured to determine that the second camera parameter group is qualified when it is determined that the final moving speed is within a normal moving speed range; a second target determination subunit, configured to determine the target camera parameter group based on qualified second camera parameter groups.
[0029] Based on the second aspect, in a possible design, the speed determination unit includes: an information group determination unit, used to determine at least one detection frame information group of the target from the information of the detection frame of the target in the first image and the information of the detection frame of the target in the second image; each detection frame information group includes: information of two detection frames corresponding to the target; a position determination unit, used to determine, for each detection frame in each detection frame information group, the position information of the target corresponding to the detection frame in the world coordinate system based on the second camera parameter group and the information of the detection frame; a moving speed determination unit, used to determine the moving speed of the corresponding target between the first moment and the second moment according to the position information of the target corresponding to each detection frame corresponding to the detection frame information group in the world coordinate system; a speed subunit, used to obtain the final moving speed according to the moving speed of the at least one target.
[0030] Based on the second aspect, in a possible design, the second target determination unit is further used to, when the number of qualified second camera parameter groups is at least two, respectively average the values of corresponding parameters in at least two qualified second camera parameter groups to obtain a target camera parameter group.
[0031] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory connected to the processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the electronic device executes the method described in the first aspect.
[0032] In a fourth aspect, an embodiment of the present application provides a storage medium, wherein a computer program is stored in the storage medium. When the computer program is executed on a computer, the computer executes the method described in the first aspect.
[0033] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the embodiments of the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0035] Figure 1 A flowchart of a camera calibration method provided in an embodiment of the present application.
[0036] Figure 2 A schematic diagram of a detection frame simulation diagram provided in an embodiment of the present application.
[0037] Figure 3 A schematic diagram of the structure of a camera calibration device provided in an embodiment of the present application.
[0038] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0039] Icons: 300 - camera calibration device; 310 - first acquisition unit; 320 - first determination unit; 330 - first search unit; 340 - first target determination unit; 400 - electronic device; 401 - processor; 402 - memory; 403 - communication interface. DETAILED DESCRIPTION
[0040] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application.
[0041] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0042] Computer vision is an important branch of artificial intelligence. Specifically, it enables machines to recognize the world. Computer vision technology usually includes face recognition, liveness detection, fingerprint recognition and anti-counterfeiting verification, biometric recognition, face detection, pedestrian detection, target detection, pedestrian recognition, image processing, image recognition, image semantic understanding, image retrieval, video processing, video content recognition, behavior recognition, 3D reconstruction, virtual reality, augmented reality, simultaneous localization and mapping (SLAM), computational photography, robot navigation and positioning, etc. With the research and progress of artificial intelligence technology, this technology has been applied in many fields, such as security, urban management, traffic management, building management, park management, face access, face attendance, logistics management, warehouse management, robots, intelligent marketing, computational photography, mobile phone imaging, cloud services, smart homes, wearable devices, unmanned driving, automatic driving, smart medical care, face payment, face unlocking, identity verification, cameras, mobile Internet, live broadcasting, intelligent temperature measurement and other fields.
[0043] Please refer to Figure 1 , Figure 1 This is a flowchart of a camera calibration method provided in an embodiment of the present application. Figure 1 The process shown is described in detail, and the method includes steps: S11-S14.
[0044] S11: Obtain information of detection frames of at least two target areas in a first image; wherein the first image is an image captured by a camera at a first moment; and the information of each detection frame includes: the position and size of the corresponding detection frame in the first image.
[0045] S12: Determine a first linear parameter group according to the information of the detection frames of the at least two targets; wherein the first linear parameter group is used to characterize the linear relationship between the position and size of the detection frame in the first image.
[0046] S13: When the first linear parameter group exists in the predetermined correspondence between the linear parameter group and the camera parameter group, find out the first camera parameter group corresponding to the first linear parameter group from the correspondence; wherein the first camera parameter group includes: the installation height of the camera, the pitch angle of the camera and the focal length of the camera.
[0047] S14: Determine a target camera parameter group according to the first camera parameter group.
[0048] The above method is introduced in detail below.
[0049] To facilitate subsequent understanding, here we first define the image coordinate system, camera coordinate system, and world coordinate system involved in the camera calibration method.
[0050] Specifically, the origin of the image coordinate system may be the center of the image captured by the camera or a vertex of the captured image, one of the x-axis and the y-axis of the image coordinate system is parallel to the upper edge of the image, and the other of the x-axis and the y-axis of the image coordinate system is parallel to the lower edge;
[0051] The origin of the camera coordinate system is the center of the camera, the z-axis of the camera coordinate system is consistent with the shooting direction of the camera, and the x-axis and y-axis of the camera coordinate system are determined according to the right-hand screw rule;
[0052] The origin of the world coordinate system is the projection point of the center of the camera on the road surface where the target is located, the z-axis of the world coordinate system is perpendicular to the road surface where the target is located, and the xy-axis of the world coordinate system overlaps with the road surface where the target is located.
[0053] S11: Obtain information of detection frames of at least two target areas in a first image; wherein the first image is an image captured by a camera at a first moment; and the information of each detection frame includes: the position and size of the corresponding detection frame in the first image.
[0054] Among them, in this embodiment, the camera is a surveillance camera set at an arbitrary position, and the target can be pedestrians, animals, vehicles, buildings, etc.; in this embodiment, the target is a pedestrian, and the detection frame can be a rectangle or a square; the shape of the detection frame is determined according to the shape of the target, usually a quadrilateral.
[0055] The position and size of the detection frame in the first image are determined according to an image processing algorithm or an object detection model. It is understandable that the position and size of the detection frame in the first image represent the position and size of the corresponding object in the image coordinate system.
[0056] In one example, the position of the detection frame is determined according to the lower edge of the detection frame. For a detection frame of a specific type of object, the aspect ratio of the detection frame is determined, and the long side, short side, diagonal, area, etc. of the detection frame can be used as the size of the detection frame.
[0057] As an implementation method, S11 can be implemented as follows: acquire a first image, detect targets in the first image using an image processing algorithm or a pre-trained target detection model, and determine information about a detection box that represents the position and size of an area where at least two targets are located in the first image.
[0058] Among them, the training of the target detection model is a well-known technology in the art, so it will not be described here in detail.
[0059] As another implementation, the information of the detection frames of the areas where the at least two objects are located in the first image is directly obtained from a third party.
[0060] S12: Determine a first linear parameter group according to the information of the detection frames of the at least two targets; wherein the first linear parameter group is used to characterize the linear relationship between the position and size of the detection frame in the first image.
[0061] In the actual implementation process, S12 can be implemented as follows: for each detection box in the information of the detection boxes of at least two targets, the position and size of the detection box are input into the linear relationship expression b=k×u+d to obtain a group of linear relationship equations, and the group of linear relationship equations are solved jointly to obtain a first linear parameter group.
[0062] S12 may also be implemented in the following manner: performing linear fitting on the linear relationship expression b=k×u+d according to the information of each detection frame in the information of the detection frames of at least two targets to obtain a first linear parameter group.
[0063] Wherein, b is the size of the detection frame in the image captured by the camera (in S12, the image is the first image), u is the position of the detection frame in the image captured by the camera (in S12, the image is the first image), k is the slope of the straight line, and d is the intercept of the straight line. The first linear parameter group includes the value of parameter k and the value of parameter d; k and d can be collectively referred to as linear parameters.
[0064] In one example, u is determined with the center of the image as the origin of the image coordinate system.
[0065] The linear relationship between the size of the detection frame in the first image and the position of the detection frame in the first image is determined as follows:
[0066] Get the initial relationship expression, where the initial relationship expression represents the relationship between the position, size and camera parameters of the detection box corresponding to the target in the image captured by the camera, the position of the target in the world coordinate system, and the actual size of the target. When the xy axis of the world coordinate system overlaps with the plane where the target is located (for example, when the target is a pedestrian, the world coordinate system overlaps with the road where the pedestrian is located), the following initial expression can be obtained:
[0067]
[0068] c is the actual size of the target, f is the focal length of the camera, α is the pitch angle of the camera in the world coordinate system defined above, h is the camera installation height, b is the size of the detection frame corresponding to the target in the image taken by the camera, and u is the position of the detection frame corresponding to the target in the image taken by the camera.
[0069] In one example, u is determined with the center of the image as the origin of the image coordinate system.
[0070] It is worth mentioning that camera calibration is to determine the values of camera parameters, which include: camera focal length f, camera pitch angle α, and camera mounting height h.
[0071] Taking the image size of 1080P as an example, the value range of u is [-540,540]. Within this range, the relationship between b and u can be approximated as a linear relationship from the above initial relationship expression, and the linear parameter groups k and d used to characterize the linear parameters are associated with the camera parameters.
[0072] After the first linear parameter group is acquired, S13 is executed.
[0073] S13: When the first linear parameter group exists in the predetermined correspondence between the linear parameter group and the camera parameter group, find out the first camera parameter group corresponding to the first linear parameter group from the correspondence; wherein the first camera parameter group includes: the installation height of the camera, the pitch angle of the camera and the focal length of the camera.
[0074] Among them, each linear parameter group in the corresponding relationship includes: the value of parameter k and the value of parameter d, and each linear parameter group is different; each camera parameter group in the corresponding relationship includes: the value of parameter f, the value of parameter α and the value of parameter h, and each camera parameter group is different.
[0075] In the actual implementation process, S13 can be implemented as follows: compare the value of parameter k in the first linear parameter group with each value of parameter k in the corresponding relationship, and compare the value of parameter d in the first linear parameter group with each value of parameter d in the corresponding relationship to determine whether there is a first linear parameter group in the linear parameter group of the corresponding relationship, in which the value of parameter k is the same as the value of k in the first linear parameter group, and the value of parameter d is the same as the value of d in the first linear parameter group. When it is determined that there is a first linear parameter group in the corresponding relationship, find out the first camera parameter group corresponding to the first linear parameter group from the corresponding relationship.
[0076] S14: Determine a target camera parameter group according to the first camera parameter group.
[0077] In actual implementation, S14 may be implemented in the following manner: directly determining the first camera parameter group as the target camera parameter group.
[0078] The target camera parameter group is the camera parameter group corresponding to the camera that took the first image.
[0079] According to an embodiment of the present invention, since it is found that the size and position of the detection frame in the image taken by the camera conform to a linear relationship, a first linear parameter group characterizing the linear relationship between the position and size of the detection frame in the image taken by the camera can be determined according to the size and position of the detection frames of at least two targets in the image taken by the camera, and then a camera parameter group corresponding to the first linear parameter group is quickly found from the correspondence between the predetermined linear parameter group and the camera parameter group, and a target camera parameter group representing the camera parameters is determined according to the found camera parameter group. The entire process does not require the placement of calibration objects or the control of camera movement, and the camera calibration can be completed only by relying on the image taken by the camera, thereby greatly improving the efficiency and accuracy of camera calibration.
[0080] As an implementation manner, in order to obtain the correspondence between the predetermined linear parameter group and the camera parameter group, the method further includes steps A1-A4.
[0081] A1: Acquire a plurality of different camera parameter groups; parameters corresponding to any two of the plurality of different camera parameter groups are of the same type.
[0082] Among them, each camera parameter group in multiple different camera parameter groups includes: the value of the camera's focal length f, the value of the camera's pitch angle α and the value of the camera's mounting height h, and at least one of the focal length f, the camera's pitch angle α, and the camera's mounting height h in each camera parameter group is different from the value of the corresponding parameter in other camera parameter groups.
[0083] As an implementation manner, A1 includes: based on a target sampling interval, discretely taking values of each camera parameter within a value range to obtain the multiple different camera parameter groups.
[0084] Among them, the target sampling interval and the value range corresponding to each camera parameter are set according to actual needs and are not restricted here. When the value range of each camera parameter is certain, the smaller the sampling interval is, the more camera parameter groups are obtained after discrete values are taken for each camera parameter within the corresponding value range.
[0085] As another implementation, A1 may be implemented in the following manner: directly obtaining a plurality of different camera parameter groups from a third party, or obtaining a plurality of different camera parameter groups that are pre-stored.
[0086] After obtaining a plurality of different camera parameter groups, step A2 is performed.
[0087] A2: For each camera parameter group, a detection frame simulation diagram is generated using the camera parameter group and the size and position information of at least two virtual targets; wherein the detection frame simulation diagram includes: detection frames of the at least two virtual targets.
[0088] As an implementation manner, A2 includes steps A21-A23.
[0089] A21: Generate sizes of the at least two virtual targets according to the size distribution of real targets of the same type as the virtual target.
[0090] The size of the virtual object may be the size of the virtual object in the world coordinate system.
[0091] In the actual implementation process, A21 can be implemented as follows: obtain the size distribution of multiple real targets of the same type as the virtual target, and randomly sample the value range formed by the minimum size and the maximum size according to the minimum size and the maximum size in the size distribution to obtain the sizes of at least two virtual targets.
[0092] As an implementation mode, A21 can be implemented as follows: obtaining the sizes of multiple real targets of the same type as the virtual target, randomly selecting the sizes of at least two real targets from the sizes of the multiple real targets, and using the sizes of the at least two selected real targets as the sizes of at least two virtual targets.
[0093] As another implementation, A21 can be implemented as follows: obtaining the sizes of multiple real targets of the same type as the virtual target, determining the average size of the multiple real targets based on the sizes of the multiple real targets, and generating the sizes of at least two virtual targets, wherein the sizes of each virtual target obey a normal distribution with the average size as the mean.
[0094] The number of the multiple real targets may be 100, 1000, 2000, etc., and there is no limit to this.
[0095] A22: Generate location information of the at least two virtual targets.
[0096] In actual implementation, A22 may randomly generate position information of at least two virtual targets in the following manner.
[0097] As an implementation manner, A22 may be implemented as follows: generating position information of at least two virtual targets based on at least two predetermined position information.
[0098] The position information may be the position of the virtual target in the world coordinate system, or the position of the virtual target in the image coordinate system.
[0099] There is no restriction on the execution order of A21 and A22.
[0100] A23: For each camera parameter group, generate the detection frame simulation image according to the camera parameter group and the size and position information of the at least two virtual targets.
[0101] In the actual implementation process, when the position information of the virtual target is the position of the virtual target in the world coordinate system, A23 can be implemented as follows: for each virtual target's size and position information, a three-dimensional model of the virtual target is generated at the corresponding position, and then, based on the three-dimensional model of the virtual target and the camera parameter group, the projection of the three-dimensional model of the virtual target in the image coordinate system of the camera corresponding to the camera parameter group is determined (the projection is determined, and the size and position of the virtual target in the image coordinate system are also determined), and then a detection frame simulation image is generated based on the projections of the three-dimensional models of at least two virtual targets; wherein the detection frame simulation image includes detection frames corresponding to at least two virtual targets, such as Figure 2 shown.
[0102] As an implementation mode, when the position information of the virtual target is the position of the virtual target in the image coordinate system of the camera corresponding to the camera parameter group, A23 can be implemented as follows: for the size and position information of each virtual target, the size of the detection frame corresponding to the virtual target in the image coordinate system of the camera corresponding to the camera parameter group is determined according to the aforementioned initial relationship expression using the camera parameter group and the size and position information of the virtual target; and then a detection frame simulation diagram is generated according to the position and size of the detection frames corresponding to at least two virtual targets in the image coordinate system.
[0103] It is understandable that generating a detection frame simulation image does not necessarily mean generating an image. As long as the size and position information of the detection frame corresponding to the area where the virtual target is located in the image coordinate system is determined, the detection frame simulation image is considered to be generated. Of course, the pixel values representing the detection frame and the background can also be displayed to generate an image so that the user can check whether the size and position of the virtual target are reasonable.
[0104] After generating the detection frame simulation diagram, execute step A3.
[0105] A3: Determine a linear parameter group according to the positions and sizes of at least two detection frames in the detection frame simulation image.
[0106] It can be understood that the coordinate system where the detection frame simulation image is located is the image coordinate system of the camera corresponding to the camera parameter group corresponding to it.
[0107] The specific implementation of A3 can refer to step S12, so it will not be described here in detail.
[0108] After the linear parameter group is determined, step A4 is performed.
[0109] A4: Establish a corresponding relationship between the linear parameter group and the camera parameter group.
[0110] The embodiment of the present invention establishes the correspondence between the linear parameter group and the camera parameter group in advance by detecting the simulation graph. When the camera parameter group needs to be determined, it can be directly determined by looking up the linear parameter group table, which greatly improves the efficiency of camera parameter estimation.
[0111] As an embodiment, the method further includes steps B1-B3.
[0112] B1: When the first linear parameter group does not exist in the corresponding relationship, for each linear parameter group in the corresponding relationship, when the difference between the values of the corresponding parameters in the linear parameter group and the first linear parameter group is less than the target threshold, determine that the linear parameter group is the second linear parameter group.
[0113] In the actual implementation process, B1 can be implemented as follows: when the first linear parameter group does not exist in the corresponding relationship, for each linear parameter group in the corresponding relationship, the value of the parameter k in the linear parameter group is subtracted from the value of the parameter k in the first linear parameter group to obtain a first difference; and the value of the parameter d in the linear parameter group is subtracted from the value of the parameter d in the first linear parameter group to obtain a second difference. When it is determined that both the first difference and the second difference are less than the target threshold, the linear parameter group is determined to be the second linear parameter group; otherwise, the linear parameter group is determined not to be the second linear group.
[0114] B2: From the corresponding relationship, find out a second camera parameter group corresponding to the second linear parameter group.
[0115] When the number of the second linear parameter group is one, B2 may be implemented as follows: for the second linear parameter group, according to the position of the second linear parameter group in the corresponding relationship, find out the second camera parameter group corresponding to the second linear parameter group from the corresponding relationship.
[0116] As an implementation manner, when the number of the second linear parameter groups is at least two, B2 may be implemented as follows: for each second linear parameter group, a second camera parameter group corresponding to the second linear parameter group is found from the corresponding relationship.
[0117] B3: Determine the target camera parameter group according to the second camera parameter group.
[0118] When there is only one second camera parameter group, B3 may be implemented in the following manner: directly determining the second camera parameter group as the target camera parameter group.
[0119] As an implementation manner, when the number of the second linear parameter groups is at least two, B3 includes steps B31-B34.
[0120] B31: Obtain information of a detection frame of the target area in the second image; the second image is an image captured by the camera at a second moment; and the difference between the first moment and the second moment is less than the target time difference.
[0121] The first moment may be before or after the second moment.
[0122] The target time difference may be in the range of 0.3 seconds to 2 seconds, and the target time difference is determined according to the average normal moving speed of the target and the shooting range that the camera can cover.
[0123] It is worth mentioning that the first image and the second image include the same object.
[0124] Among them, the specific implementation of B31 is the same as S11, and will not be described in detail. It can be understood that the second image is shot with the same camera, shooting angle, and size as the first image.
[0125] After obtaining the information of the detection frame of the target area in the second image, step B32 is performed.
[0126] B32: For each second camera parameter group, based on the second camera parameter group, information about the detection frame of the target in the first image, and information about the detection frame of the target in the second image, determine a final moving speed of the target captured by the camera from the first moment to the second moment.
[0127] As an implementation method, B32 includes steps B321-B324.
[0128] B321: Determine at least one detection frame information group of the target from the detection frame information of the target in the first image and the detection frame information of the target in the second image; each detection frame information group includes: information of two detection frames corresponding to the target.
[0129] In the actual implementation process, B321 can be implemented as follows: for the detection frame information of the target in the first image, according to the position of the detection frame of the target in the first image, the image of the target is determined from the first image, and then according to the image of the target and / or the position of the detection frame of the target in the first image, the target tracking technology is used to determine whether there is an image of the target in the second image. If so, the detection frame information of the target in the first image and the detection frame information of the target in the second image are divided into the detection frame information group of the target until at least one detection frame information group of the target is determined.
[0130] B322: For each detection frame information in each detection frame information group, based on the second camera parameter group and the detection frame information, determine the position information of the target corresponding to the detection frame in the world coordinate system.
[0131] It can be understood that when the camera parameters are determined, the position information of the target corresponding to the detection frame in the world coordinate system can be uniquely determined according to the position and size of the detection frame in the image coordinate system.
[0132] In the actual implementation process, B322 can be implemented as follows: for each detection frame in each detection frame information group (each detection frame information group includes information of two detection frames, and the two detection frames correspond to the first image and the second image taken at the first moment and the second moment, respectively), based on the second camera parameter group and the position and size of the detection frame in its corresponding image, determine the position information of the target corresponding to the detection frame in the world coordinate system.
[0133] After determining the position information of the target corresponding to the detection frame information group in the world coordinate system at the first moment and the second moment, execute step B323.
[0134] B323: Determine the moving speed of the corresponding target between the first moment and the second moment according to the position information of the target corresponding to each detection frame corresponding to the detection frame information group in the world coordinate system.
[0135] In the actual implementation process, B323 can be implemented as follows: according to the position information of the targets corresponding to the two detection frames corresponding to the corresponding targets in the world coordinate system, the moving distance of the corresponding targets is determined; according to the first moment and the second moment, the time difference between the first moment and the second moment is determined; and then by taking the quotient of the moving distance and the time difference, the moving speed of the corresponding target between the first moment and the second moment is obtained.
[0136] After determining the moving speed of at least one target between the first moment and the second moment, execute step B324.
[0137] B324: Obtain the final moving speed according to the moving speed of the at least one target.
[0138] When the at least one target includes only one target, B324 may directly determine the moving speed of the target as the final moving speed in the following manner.
[0139] When the number of the at least one target is at least two, B324 may average the moving speeds of the at least two determined targets between the first moment and the second moment to obtain a final moving speed in the following manner.
[0140] After the final moving speed is determined, step B33 is executed.
[0141] B33: When it is determined that the final moving speed is within the normal moving speed range, determine that the second camera parameter set is qualified.
[0142] The normal moving speed range is determined according to the target type. For example, the moving speed of a vehicle type target is 20km / h-120km / h.
[0143] In most cases, the target's moving speed is within the normal moving speed range. If the calculated target moving speed is not within the normal moving speed range, it is most likely because the camera parameters are unreasonable. Therefore, in the actual implementation process, B33 can be implemented as follows to determine whether the final moving speed is within the normal moving speed range. If it is determined that the final moving speed is within the normal moving speed range, then the second camera parameter group is determined to be qualified; otherwise, the second camera parameter group is determined to be unqualified.
[0144] After determining the qualified second camera parameter group, execute step B34.
[0145] B34: Determine the target camera parameter group according to the qualified second camera parameter group.
[0146] When the number of the qualified second camera parameter groups is determined to be one, B34 may be implemented in the following manner: the qualified second camera parameter group is directly determined as the final camera parameter group of the camera.
[0147] As an implementation manner, when it is determined that the number of qualified second camera parameter groups is at least two, B34 may be implemented as follows: averaging the values of corresponding parameters in at least two qualified second camera parameter groups to obtain a target camera parameter group.
[0148] Specifically, when it is determined that the number of qualified second camera parameter groups is at least two, the values of parameter f in the at least two qualified second camera parameter groups are averaged to obtain the value of parameter f in the target camera parameter group, the values of parameter α in the at least two qualified second camera parameter groups are averaged to obtain the value of parameter α in the target camera parameter group, and the values of parameter h in the at least two qualified second camera parameter groups are averaged to obtain the value of parameter h in the target camera parameter group.
[0149] In this way, when there are multiple camera parameter groups determined according to the corresponding relationship, unreasonable camera parameter groups can be filtered out by the target speed indicator, and the final camera parameter group can be determined by the reasonable camera parameter group, which greatly improves the accuracy of camera parameter estimation.
[0150] Please refer to Figure 3 , Figure 3 is a structural block diagram of a camera calibration device 300 provided in an embodiment of the present application. Figure 3 The structural block diagram shown is used to illustrate that the device shown includes:
[0151] The first acquisition unit 310 is used to obtain information about detection frames of areas where at least two targets are located in a first image; wherein the first image is an image captured by the camera at a first moment; and the information about each detection frame includes: the position and size of the corresponding detection frame in the first image.
[0152] The first determination unit 320 is used to determine a first linear parameter group according to the information of the detection frames of the at least two targets; wherein the first linear parameter group is used to characterize the linear relationship between the position and size of the detection frame in the first image.
[0153] The first search unit 330 is used to search for a first camera parameter group corresponding to the first linear parameter group from the correspondence between the predetermined linear parameter group and the camera parameter group when the first linear parameter group exists in the correspondence between the predetermined linear parameter group and the camera parameter group; wherein the first camera parameter group includes: the installation size of the camera, the pitch angle of the camera, and the focal length of the camera.
[0154] The first target determining unit 340 is configured to determine a target camera parameter group according to the first camera parameter group.
[0155] As an embodiment, the device also includes: a camera parameter acquisition unit, used to acquire multiple different camera parameter groups; the types of parameters corresponding to any two camera parameter groups in the multiple different camera parameter groups are the same; a simulation image generation unit, used to generate a detection frame simulation image for each camera parameter group using the camera parameter group and the size and position information of at least two virtual targets; wherein the detection frame simulation image includes: detection frames of the at least two virtual targets; a linear parameter group determination unit, used to determine a linear parameter group according to the position and size of at least two detection frames in the detection frame simulation image in the detection frame simulation image; and a correspondence establishment unit, used to establish a correspondence between the linear parameter group and the camera parameter group.
[0156] As an embodiment, the simulation image generation unit includes: a size generation unit, used to generate the size of the at least two virtual targets according to the size distribution of real targets of the same type as the virtual targets; a position information generation unit, used to generate the position information of the at least two virtual targets; a simulation image generation subunit, used to generate the detection frame simulation image according to the size and position information of the at least two virtual targets for each camera parameter group.
[0157] As an implementation manner, the camera parameter acquisition unit is specifically configured to discretely take values of each camera parameter within a value range based on a target sampling interval to obtain the multiple different camera parameter groups.
[0158] As an embodiment, the device also includes: a second determination unit, which is used to, when the first linear parameter group does not exist in the corresponding relationship, determine that for each linear parameter group in the corresponding relationship, the linear parameter group is a second linear parameter group when the difference between the value of the corresponding parameter in the linear parameter group and the first linear parameter group is less than a target threshold; a second search unit, which is used to search out a second camera parameter group corresponding to the second linear parameter group from the corresponding relationship; and a second target determination unit, which is used to determine the target camera parameter group based on the second camera parameter group.
[0159] As an implementation manner, when the number of the second linear parameter groups is at least two, the second search unit is specifically configured to search, for each second linear parameter group, from the corresponding relationship, for a second camera parameter group corresponding to the second linear parameter group;
[0160] Correspondingly, the second target determination unit includes:
[0161] a second acquisition unit, configured to acquire information of a detection frame of an area where a target is located in a second image; the second image is an image captured by the camera at a second moment; and a difference between the first moment and the second moment is less than a target time difference; a speed determination unit, configured to determine, for each second camera parameter group, a final moving speed of the target captured by the camera from the first moment to the second moment based on the second camera parameter group, information of a detection frame of the target in the first image, and information of a detection frame of the target in the second image; a screening unit, configured to determine that the second camera parameter group is unqualified when it is determined that the final moving speed is not within a normal moving speed range; otherwise, the second camera parameter group is determined to be qualified; a second target determination subunit, configured to determine the target camera parameter group according to the qualified second camera parameter group.
[0162] As an embodiment, the speed determination unit includes: an information group determination unit, used to determine a detection frame information group of at least one target from the detection frame information of the target in the first image and the detection frame information of the target in the second image; each detection frame information group includes: information of two detection frames corresponding to the target; a position determination unit, used to determine, for each detection frame information in each detection frame information group, the position information of the target corresponding to the detection frame in the world coordinate system based on the second camera parameter group and the detection frame information; a moving speed determination unit, used to determine the moving speed of the corresponding target between the first moment and the second moment according to the position information of the target corresponding to each detection frame corresponding to the detection frame information group in the world coordinate system; a speed subunit, used to obtain the final moving speed according to the moving speed of the at least one target.
[0163] As an implementation manner, the second target determination unit is further configured to, when the number of qualified second camera parameter groups is at least two, respectively average the values of corresponding parameters in at least two qualified second camera parameter groups to obtain a target camera parameter group.
[0164] For the process of each functional unit realizing its own function in this embodiment, please refer to the above Figure 1-2 The contents represented in the illustrated embodiments will not be repeated here.
[0165] Please refer to Figure 4, Figure 4 This is a schematic diagram of the structure of an electronic device 400 provided in an embodiment of the present application. The electronic device 400 may be a personal computer, a tablet computer, a smart phone, a personal digital assistant (PDA), etc.
[0166] The electronic device 400 may include: a memory 402, a processor 401, a communication interface 403 and a communication bus, and the communication bus is used to realize the connection and communication of these components.
[0167] The memory 402 is used to store various data such as computing program instructions corresponding to the camera calibration method and device provided in the embodiment of the present application, wherein the memory 402 can be, but is not limited to, a random access memory, a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc.
[0168] The processor 401 is used to read and run computer program instructions corresponding to the camera calibration method and device stored in the memory to obtain information of detection frames of areas where at least two targets are located in a first image; wherein the first image is an image captured by the camera at a first moment; the information of each detection frame includes: the position and size of the corresponding detection frame in the first image; according to the information of the detection frames of the at least two targets, a first linear parameter group is determined; wherein the first linear parameter group is used to characterize the linear relationship between the position and size of the detection frame in the first image; when the first linear parameter group exists in the correspondence relationship between the predetermined linear parameter group and the camera parameter group, a first camera parameter group corresponding to the first linear parameter group is found from the correspondence relationship; wherein the first camera parameter group includes: the installation height of the camera, the pitch angle of the camera and the focal length of the camera; and a target camera parameter group is determined according to the first camera parameter group.
[0169] Among them, the processor 401 may be an integrated circuit chip with signal processing capabilities. The above-mentioned processor 401 may be a general-purpose processor, including a CPU, a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The various methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0170] The communication interface 403 is used to receive or send data.
[0171] In addition, an embodiment of the present application further provides a storage medium, in which a computer program is stored. When the computer program is run on a computer, the computer executes the method provided by any embodiment of the present application.
[0172] In summary, the camera calibration method, device, electronic device and storage medium proposed in each embodiment of the present application are used to obtain information about detection frames of areas where at least two targets are located in a first image captured by a camera, and the information about each detection frame includes: the position and size of the corresponding detection frame in the first image; according to the information about the detection frames of at least two targets, a first linear parameter group characterizing the linear relationship between the position and size of the detection frame in the first image is determined, and then a first camera parameter group corresponding to the first linear parameter group is quickly found from the correspondence between the predetermined linear parameter group and the camera parameter group, and the target camera parameter group is determined according to the first camera parameter group. The whole process does not require the placement of calibration objects or the control of camera movement to complete the camera calibration.
[0173] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based device that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0174] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
Claims
1. A camera calibration method, characterized in that: The method comprises: Acquire information of detection frames of at least two target areas in a first image; wherein the first image is an image captured by a camera at a first moment; and the information of each detection frame includes: a position and a size of the corresponding detection frame in the first image; Determine a first linear parameter group according to the information of the detection frames of the at least two targets; wherein the first linear parameter group is used to characterize the linear relationship between the position and size of the detection frame in the first image; When the first linear parameter group exists in the predetermined correspondence between the linear parameter group and the camera parameter group, a first camera parameter group corresponding to the first linear parameter group is found from the correspondence; wherein the first camera parameter group includes: the installation height of the camera, the pitch angle of the camera, and the focal length of the camera; A target camera parameter group is determined according to the first camera parameter group.
2. The method according to claim 1, characterized in that The method further comprises: Acquire a plurality of different camera parameter groups; the types of parameters corresponding to any two camera parameter groups in the plurality of different camera parameter groups are the same; For each camera parameter group, a detection frame simulation diagram is generated using the camera parameter group and the size and position information of at least two virtual targets; wherein the detection frame simulation diagram includes: detection frames of the at least two virtual targets; Determine a linear parameter group according to positions and sizes of at least two detection frames in the detection frame simulation image in the detection frame simulation image; A corresponding relationship between the linear parameter group and the camera parameter group is established.
3. The method according to claim 2, characterized in that For each camera parameter group, a detection frame simulation diagram is generated using the camera parameter group and size and position information of at least two virtual targets, including: generating sizes of the at least two virtual objects according to size distribution of real objects of the same type as the virtual objects; generating position information of the at least two virtual targets; For each camera parameter group, the detection frame simulation image is generated according to the camera parameter group and the size and position information of the at least two virtual targets.
4. The method according to claim 2 or 3, characterized in that: Get multiple different camera parameter groups, including: Based on the target sampling interval, each camera parameter is discretely valued within a value range to obtain the multiple different camera parameter groups.
5. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: When the first linear parameter group does not exist in the corresponding relationship, for each linear parameter group in the corresponding relationship, when the difference between the value of the corresponding parameter in the linear parameter group and the first linear parameter group is less than the target threshold, determine that the linear parameter group is the second linear parameter group; From the corresponding relationship, searching for a second camera parameter group corresponding to the second linear parameter group; The target camera parameter group is determined according to the second camera parameter group.
6. The method according to claim 5, characterized in that When the number of the second linear parameter groups is at least two, searching for a second camera parameter group corresponding to the second linear parameter group from the corresponding relationship includes: For each second linear parameter group, searching for a second camera parameter group corresponding to the second linear parameter group from the corresponding relationship; Correspondingly, determining the target camera parameter group according to the second camera parameter group includes: Acquire information of a detection frame of a target area in a second image; the second image is an image captured by the camera at a second moment; and the difference between the first moment and the second moment is less than a target time difference; For each second camera parameter group, determining a final moving speed of the target captured by the camera from the first moment to the second moment based on the second camera parameter group, information about the detection frame of the target in the first image, and information about the detection frame of the target in the second image; When it is determined that the final moving speed is within the normal moving speed range, determining that the second camera parameter set is qualified; The target camera parameter group is determined according to the qualified second camera parameter group.
7. The method according to claim 6, characterized in that Determining a final moving speed of the target captured by the camera from the first moment to the second moment based on the second camera parameter group, information about the detection frame of the target in the first image, and information about the detection frame of the target in the second image includes: Determine at least one detection frame information group of the target from the detection frame information of the target in the first image and the detection frame information of the target in the second image; each detection frame information group includes: information of two detection frames corresponding to the target; For each detection frame information in each detection frame information group, based on the second camera parameter group and the detection frame information, determine the position information of the target corresponding to the detection frame in the world coordinate system; Determine, according to the position information of the target corresponding to each detection frame corresponding to the detection frame information group in the world coordinate system, the moving speed of the corresponding target between the first moment and the second moment; The final moving speed is obtained according to the moving speed of the at least one target.
8. The method according to claim 6 or 7, characterized in that: The determining the target camera parameter group according to the qualified second camera parameter group comprises: When the number of qualified second camera parameter groups is at least two, the values of corresponding parameters in the at least two qualified second camera parameter groups are averaged to obtain the target camera parameter group.
9. A camera calibration device, characterized in that: The device comprises: A first acquisition unit is used to acquire information of detection frames of at least two target areas in a first image; wherein the first image is an image captured by a camera at a first moment; and the information of each detection frame includes: a position and a size of the corresponding detection frame in the first image; A first determining unit, configured to determine a first linear parameter group according to information of the detection frames of the at least two targets; wherein the first linear parameter group is used to characterize a linear relationship between a position and a size of the detection frame in the first image; A first search unit is configured to search for a first camera parameter group corresponding to the first linear parameter group from the correspondence between the predetermined linear parameter group and the camera parameter group when the first linear parameter group exists in the correspondence between the predetermined linear parameter group and the camera parameter group; wherein the first camera parameter group includes: the installation size of the camera, the pitch angle of the camera, and the focal length of the camera; The first target determining unit is configured to determine a target camera parameter group according to the first camera parameter group.
10. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer program instructions, and when the computer program instructions are read and executed by the processor, the method according to any one of claims 1 to 8 is executed.
11. A storage medium, characterized in that: The storage medium stores computer program instructions, and when the computer program instructions are read and executed by a computer, the method according to any one of claims 1 to 8 is executed.
