Method for determining camera operating parameters, readable storage medium and electronic device
By acquiring the points to be detected in the checkerboard image and calculating the camera's operating parameters, the problem of low accuracy in existing distortion detection methods is solved, and accurate detection of the lens's field of view and focal length is achieved.
Patent Information
- Application Number
- CN202310897827.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-20
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2043-07-20
AI Technical Summary
Existing distortion detection methods have low accuracy and cannot simultaneously detect the field of view and focal length (EFL) in both the vertical and horizontal directions of the lens.
By acquiring a checkerboard image, multiple points to be detected are identified, and the camera's operating parameters, including the horizontal field of view, vertical field of view, focal length, and F-theta distortion, are calculated based on the corner information of the points to be detected.
It improves the accuracy of distortion detection and can simultaneously detect the field of view and focal length (EFL) in both the vertical and horizontal directions of the lens.
Smart Images

Figure CN116883513B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, and particularly relates to a camera operation parameter determination method, a readable storage medium and an electronic device. BACKGROUND
[0002] In the production process of an optical lens, performance detection of the lens is a crucial step. Through performance detection, the quality of the lens can be judged. In particular, for a short-focus human-eye-like lens, the distortion is often more serious due to a short focal length and a large field of view. Therefore, distortion detection of the human-eye-like lens is one of the important detection indexes in detection. However, the conventional distortion detection method has low accuracy and cannot simultaneously detect the field of view in the vertical direction and the horizontal direction and the focal length EFL of the lens. SUMMARY
[0003] The main purpose of the present application is to provide a camera operation parameter determination method, a readable storage medium and an electronic device, so as to at least solve the problem that the conventional distortion detection method has low accuracy and cannot simultaneously detect the field of view in the vertical direction and the horizontal direction and the focal length EFL of the lens.
[0004] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a camera operation parameter determination method is provided, which comprises: acquiring a checkerboard image, wherein a checkerboard calibration board exists from the image center to the edge of at least one of the checkerboard images, and the checkerboard image is an image obtained by a target camera shooting a plurality of checkerboard calibration boards arranged in a predetermined order; determining a plurality of to-be-detected points from the checkerboard image, wherein the to-be-detected points are corner points in the checkerboard image for calculating the operation parameters of the target camera; and determining the operation parameters of the target camera according to at least the corner point information of each to-be-detected point, wherein the corner point information of the to-be-detected point at least includes the corner point position of the to-be-detected point in the checkerboard image, and the operation parameters of the target camera at least include the horizontal field of view of the target camera, the vertical field of view of the target camera, the focal length of the target camera and the F-theta distortion of the target camera.
[0005] Optionally, the plurality of to-be-detected points are determined from the checkerboard image, including: obtaining a center angle point of the checkerboard image, the center angle point being an angle point of the checkerboard image closest to a center point of the checkerboard image; obtaining a photographing angle of the checkerboard image; in a case where the photographing angle is a target angle, determining the plurality of to-be-detected points from the checkerboard image according to the center angle point and all angle points of the checkerboard, the to-be-detected points including all the angle points of the checkerboard traversed along a target edge direction starting from the center angle point, the target angle corresponding to the target edge direction.
[0006] Optionally, the operation parameter of the target camera is an F-theta distortion variable, and the operation parameter of the target camera is determined according to at least the angle point information of each to-be-detected point, including: obtaining a theoretical image height of a target to-be-detected point, an actual image height of the target to-be-detected point, and a field of view angle of the target to-be-detected point, the actual image height of the target to-be-detected point being an image distance between the target to-be-detected point and the center angle point of the checkerboard image, the center angle point being an angle point of the checkerboard image closest to a center point of the checkerboard image; determining a first distortion variable of the target to-be-detected point according to the theoretical image height of the target to-be-detected point, the actual image height of the target to-be-detected point, and a first distortion formula image the actual image height of the target to-be-detected point, H theory the theoretical image height of the target to-be-detected point; determining an F-theta distortion variable of the target to-be-detected point according to the first distortion variable of the target to-be-detected point, the field of view angle of the target to-be-detected point, and a second distortion formula F-theta being the F-theta distortion variable of the target to-be-detected point, and θ being the field of view angle of the target to-be-detected point.
[0007] Optionally, the theoretical image height of the target to-be-detected point is obtained, including: obtaining a plurality of auxiliary calculation points, the auxiliary calculation points being the angle points of the checkerboard image located in a center region of the checkerboard image, the center region being a region with the center angle point as a center and a region area being a preset area; determining actual physical lengths of pixels in the center region according to a physical length formula P L being the actual physical length of one pixel in the center region, L unit being a unit length of one square in the checkerboard image, n being the number of the auxiliary calculation points, and D i being an image distance between one auxiliary calculation point and the center angle point; and calculating the theoretical image height according to the actual physical lengths of the pixels in the center region and a theoretical image height calculation formula Determine the theoretical image height of the target point to be detected, where H theory L is the theoretical image height of the target point to be detected. c The number of squares between the target detection point and the center corner point.
[0008] Optionally, obtaining the field of view of the target detection point includes: obtaining the number of grids between the target detection point and the center corner point, the length of a square in the checkerboard image, and the target object distance, wherein the target object distance is the vertical distance between the lens of the target camera and the real object in the checkerboard image; and calculating the field of view based on the number of grids between the target detection point and the center corner point, the unit length of a square in the checkerboard image, the target object distance, and a first field of view calculation formula. The field of view of the target point to be detected is obtained, where θ is the field of view of the target point to be detected, and L c L is the number of squares between the target detection point and the center corner point. unit WD represents the unit length of a square in the chessboard image, and WD represents the target object distance.
[0009] Optionally, the operating parameters of the target camera include the horizontal field of view and the vertical field of view of the target camera. The operating parameters of the target camera are determined at least based on the corner information of each of the points to be detected, including: obtaining the field of view of the target camera at the target angle, wherein the field of view of the target camera is a first field of view when the target angle is 0°, a second field of view when the target angle is 90°, a third field of view when the target angle is 180°, and a fourth field of view when the target angle is 270°; adding the first and third field of view to obtain the horizontal field of view of the target camera; and adding the second and fourth field of view to obtain the vertical field of view of the target camera.
[0010] Optionally, obtaining the field of view of the target camera at the target angle includes: obtaining a first detection point, which is the detection point closest to the target edge; obtaining the number of squares between the first detection point and the center corner point and the number of checkerboard calibration plates between the first detection point and the target edge, wherein the number of checkerboard calibration plates between the first detection point and the target edge is the ratio of a first calculated distance and a second calculated distance, where the first calculated distance is the distance between the first detection point and the target edge, and the second calculated distance is the distance between the first detection point and the detection point closest to the first detection point; and calculating the field of view according to the formulas for the number of squares between the first detection point and the center corner point, the number of checkerboard calibration plates between the first detection point and the target edge, and the second field of view. Determine the field of view of the target camera at the target angle, where θ FOV L represents the field of view of the target camera at the target angle. p N is the number of squares between the first detection point and the center corner point; N is the number of checkerboard calibration plates between the first detection point and the target edge; N is the ratio of the first distance and the second distance, where the first distance is the distance between the first detection point and the target edge, and the second distance is the distance between the first detection point and the nearest detection point, where the nearest detection point is the detection point closest to the first detection point; L unit WD is the unit length of a square in the checkerboard image, and WD is the vertical distance between the lens of the target camera and the real object in the checkerboard image.
[0011] Optionally, the operating parameters of the target camera include the focal length of the target camera. The operating parameters of the target camera are determined at least based on the corner information of each of the points to be detected, including: obtaining the field of view of a second point to be detected, where the second point to be detected is the point to be detected closest to the central corner; obtaining the true image height of the second point to be detected; and calculating the focal length based on the field of view of the second point to be detected, the true image height of the second point to be detected, and the focal length using a formula. Determine the focal length of the target camera, where EFL is the focal length of the target camera, and H... image θ is the true image height of the second point to be detected, and θ is the field of view angle of the second point to be detected.
[0012] According to another aspect of this application, a computer-readable storage medium is provided, the computer-readable storage medium including a stored program, wherein, when the program is executed, it controls the device where the computer-readable storage medium is located to perform any of the methods for determining camera operating parameters.
[0013] According to another aspect of this application, an electronic device is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including a method for performing any of the camera operating parameters described above.
[0014] Applying the technical solution of this application, the method for determining the camera operating parameters first acquires a checkerboard image. A checkerboard calibration plate exists from the image center of the checkerboard image to at least one edge of the checkerboard image. The checkerboard image is an image obtained by the target camera capturing multiple checkerboard calibration plates arranged in a predetermined order. Multiple points to be detected are determined from the checkerboard image. The operating parameters of the target camera are determined based on at least the corner information of each point to be detected. The corner information of each point to be detected includes at least the corner position of the point to be detected in the checkerboard image. The operating parameters of the target camera include at least the horizontal field of view, the vertical field of view, the focal length, and the F-theta distortion of the target camera. By acquiring accurate points to be detected and using the detection indicators for these points, the accuracy of distortion detection can be improved, and the vertical and horizontal field of view and focal length (EFL) of the lens can be detected simultaneously. This solves the problems of low accuracy in existing distortion detection methods and the inability to simultaneously detect the vertical and horizontal field of view and focal length (EFL) of the lens. Attached Figure Description
[0015] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0016] Figure 1 A hardware structure block diagram of a mobile terminal for performing a method for determining camera operating parameters according to an embodiment of this application is shown.
[0017] Figure 2 A flowchart illustrating a method for determining camera operating parameters according to an embodiment of this application is shown.
[0018] Figure 3 A schematic diagram of a checkerboard image provided according to an embodiment of this application is shown;
[0019] Figure 4 A schematic diagram of a first binarized image provided according to an embodiment of this application is shown;
[0020] Figure 5A schematic diagram of a first dilated image provided according to an embodiment of this application is shown;
[0021] Figure 6 A schematic diagram of a plurality of initial sub-images provided according to embodiments of the present application is shown;
[0022] Figures 7(a)-7(d) A schematic diagram of a checkerboard pattern image taken from different shooting angles according to embodiments of this application is shown;
[0023] Figure 8 A schematic diagram of a second binarized image after discretization processing is shown according to an embodiment of this application;
[0024] Figures 9(a)-9(b) A comparison image of the chessboard grid before and after removing interference blocks is shown, according to an embodiment of this application.
[0025] Figure 10 This illustration shows a schematic diagram of extracting overlapping regions from a chessboard grid image after dilation, according to an embodiment of this application.
[0026] Figure 11 A schematic diagram of an internal point arrangement according to an embodiment of this application is shown;
[0027] Figure 12 This illustration shows the world coordinates of the corner points of each chessboard grid in a chessboard grid image after arrangement, according to an embodiment of this application.
[0028] Figure 13 A structural block diagram of a camera operating parameter determination device provided according to an embodiment of this application is shown.
[0029] The above figures include the following reference numerals:
[0030] 102. Processor; 104. Memory; 106. Transmission device; 108. Input / output device. Detailed Implementation
[0031] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0032] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0033] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0034] As described in the background section, existing technologies cannot simultaneously detect the field of view and focal length (EFL) in the vertical and horizontal directions of a lens. To address the issues of low accuracy and inability to simultaneously detect the field of view and focal length (EFL) in the vertical and horizontal directions of existing distortion detection methods, embodiments of this application provide a method for determining camera operating parameters, a readable storage medium, and an electronic device.
[0035] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
[0036] The methods and embodiments provided in this application can be executed on a mobile terminal, computer terminal, or similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a hardware structure block diagram of a mobile terminal for a method of determining camera operating parameters according to an embodiment of the present invention. For example... Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0037] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the method for determining camera operating parameters in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory and 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 memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. The transmission device 106 is used to receive or send data via a network. Specific examples of the aforementioned networks may include wireless networks provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0038] This embodiment provides a method for determining camera operating parameters running on a mobile terminal, computer terminal, or similar computing device. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0039] Figure 2 This is a flowchart of a method for determining camera operating parameters according to an embodiment of this application. Figure 2 As shown, the method includes the following steps:
[0040] Step S201: Obtain a checkerboard image. The checkerboard image contains checkerboards from the image center to at least one edge of the checkerboard image. The checkerboard image is an image obtained by the target camera from multiple checkerboard calibration plates arranged in a predetermined order.
[0041] Specifically, a specific chessboard pattern such as Figure 3As shown, the checkerboard image is a checkerboard image acquired using a humanoid eyeglass lens and a corresponding industrial camera. The checkerboard image is composed of multiple checkerboard calibration plates. When acquiring images in different directions, it is necessary to ensure that a portion of the checkerboard calibration plate in that direction is outside the camera's field of view. This ensures that the edge of the acquired image also contains checkerboard patterns, making the obtained distortion data more comprehensive and thus making the distortion correction more accurate.
[0042] Prior to step S202, the above method further includes the following steps:
[0043] Step 2: Obtain the chessboard grid image
[0044] Step 2.1 Binarize the checkerboard image to obtain the first binarized image: Based on the pixel values of the image edges, set a binarization threshold to segment all white squares on the checkerboard calibration board as the foreground (i.e., the target region), and all black squares on the checkerboard calibration board as the background region. The first binarized image is shown below. Figure 4 As shown.
[0045] Step 2.2 Dilates the first binarized image using a dilation factor of a certain size to obtain the first dilated image, ensuring that each white square in the chessboard is connected to its adjacent white squares, as shown in the image. Figure 5 As shown.
[0046] Step 2.3 Obtain the area of all discrete regions in the image. Set a threshold based on the area of the white square in a complete checkerboard calibration board. Extract the checkerboard region based on the threshold. The area larger than the threshold is the target region, and the rest is the interference region. The discrete region is the boundary region between two adjacent checkerboard squares in the first dilated image.
[0047] Step 2.4 Obtain the bounding rectangle parameters of the extracted checkerboard calibration board region. Based on the parameters, crop the corresponding region from the original image; this region is the initial sub-image, such as... Figure 6 As shown.
[0048] Step 2.5 Obtain the center point of the checkerboard image. Based on the center point of the checkerboard image, calculate the shooting direction of the checkerboard image, such as... Figures 7(a)-7(d) As shown, Figure 7(a) is a chessboard image obtained at a shooting angle of 0°, Figure 7(b) is a chessboard image obtained at a shooting angle of 90°, Figure 7(c) is a chessboard image obtained at a shooting angle of 180°, and Figure 7(d) is a chessboard image obtained at a shooting angle of 270°.
[0049] Step 3: Remove the smaller squares at the edges of the chessboard to prevent them from interfering with subsequent processing.
[0050] When obtaining the corner points of the chessboard, only the points inside the chessboard are captured, and the small squares on the edges are not used for corner point detection and need to be removed. The specific steps for removing edge squares are as follows:
[0051] Step 3.1 Based on the overall grayscale of the chessboard region image, set a threshold to binarize the chessboard region image, obtaining a second binarized image, and ensuring that all squares in the chessboard can be completely captured.
[0052] Step 3.2 Erodes the second binarized image, making each square in the chessboard grid discrete from each other, as shown in the image. Figure 8 As shown.
[0053] Step 3.3 Calculate the center point of each block, and based on the center point of each block, obtain the four closest blocks to each block.
[0054] Step 3.4 calculates the average area and average perimeter of the four neighboring measurement blocks for each block; sets preset area and preset perimeter, and calculates whether the current block is a module with small edges based on the preset area and preset perimeter. If so, it is removed; otherwise, it is retained. The removal effect is as follows. Figures 9(a)-9(b) As shown in Figure 9(a), the chessboard grid image before removing interference blocks is shown in Figure 9(b), and the chessboard grid image after removing interference blocks is shown in Figure 9(b). The preset area is the average area of multiple measured blocks surrounding the target block multiplied by a preset area coefficient, and the preset perimeter is the average perimeter of multiple measured blocks surrounding the target block multiplied by a preset perimeter coefficient.
[0055] Step 4: Obtain the corner points of the chessboard
[0056] Step 4.1 After removing the smaller squares from the edge of the chessboard grid, set an expansion factor to expand them, ensuring that each small square overlaps with its adjacent squares, and extract the overlapping areas, such as... Figure 10 As shown.
[0057] Step 4.2 Calculate the center of each overlapping region, which is a corner point of the chessboard. The calculation method is as follows: add the X and Y coordinates of the points within the overlapping region and take the average value as the center point.
[0058] Step 5: Sort the corner points of the chessboard
[0059] Step 5.1 Select a corner point of the chessboard as a candidate point P, calculate the distance between point P and other corner points, and obtain the 4 points closest to point P.
[0060] Step 5.2 Repeat step 5.1 until all points have found the four points closest to that point.
[0061] Step 5.3 Based on the relative positions of the current corner point and its four nearest neighboring corner points, divide all corner points into interior points and edge points. The calculation method is as follows:
[0062] Step 5.3.1 Calculate the angle between the line connecting the current corner point and the four nearest points and the horizontal plane (if the angle is negative, add 360 degrees to convert it to the corresponding positive value), and then sort the four nearest points according to the angle size;
[0063] Step 5.3.2 Calculate the absolute value of the difference between the first and third angles, and the absolute value of the difference between the second and fourth angles, according to the angle order.
[0064] Step 5.3.3 If the absolute values are all around 180°, then it is an interior point; otherwise, it is an edge point.
[0065] Step 5.4 Sort the internal points;
[0066] Step 5.4.1 Construct two point set sequences: a sorted point set queue and an unsorted point set queue; first, store all internal points in the unsorted point set queue.
[0067] Step 5.4.2 Select any point from the unsorted point set queue as point (0,0) and mark it as point P. Add this point to the sorted sequence and delete it from the unsorted point set sequence.
[0068] Step 5.4.3: Using point P as the center point, traverse all points in the unsorted point set queue, find the nearest neighbor of point P, and sort the points according to their relative positions to point P. The sorting method is as follows: Figure 11 As shown, these points are added to the sorted point set queue, denoted as queue Q1, while these points are deleted from the unsorted point set queue.
[0069] Step 5.4.4 Treat each point in queue Q1 as point P, traverse all points in the unsorted point set queue, find the nearest neighbor of point P, sort according to the relative position of the nearest neighbor and point P, add these points to the sorted point set queue, generate a new queue Q2, and delete these points from the unsorted point set queue.
[0070] Step 5.4.5: Transfer queue Q2 to queue Q1 and repeat step 5.4.4 until the unsorted point set queue is empty, then stop the loop. After stopping, all internal points have been sorted.
[0071] Step 5.5: Sorting edge points;
[0072] Step 5.5.1 Following the queue order, treat each edge as a point P. Among the internal points, find the nearest internal point P1 to point P. This nearest point is restricted; point P must also be one of the four nearest points to point P1. Sort the points P according to their relative positions with point P1, until all edge points have been sorted.
[0073] Step 5.6 Corner point sorting: After the edge points are sorted, some corner points may remain and not be sorted. The method for sorting these remaining points is as follows:
[0074] Step 5.6.1: Find the distance between all corner points and edge points, and find the point that is closest to the edge point; sort the points according to their relative positions with the nearest edge point, delete the point from the corner point set, and add the point to the sorted edge points.
[0075] Step 5.6.2: Repeat step 5.6.1 until all corner points are sorted. The result after sorting the corner points is as follows: Figure 12 As shown.
[0076] The existing technology for detecting lens distortion typically involves capturing a checkerboard image using a lens and camera, extracting the checkerboard corners using an algorithm, and finally calculating the distortion based on the corner positions. However, in practice, due to lens parameters and environmental factors, sometimes it may be impossible to capture a complete checkerboard image or a checkerboard image pieced together from multiple checkerboards. In such cases, using conventional checkerboard detection methods can lead to inaccurate acquisition of checkerboard corners, resulting in inaccurate calculation of lens distortion. To address this issue, the above embodiment overcomes the problem of not being able to detect corners when the checkerboard image is incomplete or when multiple checkerboards are pieced together.
[0077] Furthermore, since the chessboard is composed of multiple smaller chessboards, the above embodiment first uses threshold segmentation and morphological operations to separate the smaller chessboards. Then, it uses threshold segmentation and morphological operations again to extract the corner points of the chessboard. After that, the corner points in the smaller chessboards are sorted according to their relative positions with the corner points in their neighborhoods. After all the corner points in the smaller chessboards are sorted, all the corner points are sorted uniformly according to their positions in the smaller chessboards. Finally, a specified corner point is selected to calculate the detection index. Moreover, the above embodiment does not require pre-setting information such as the number of rows and columns; the sorted corner points can be obtained simply by inputting an image. In addition, the proposed corner point sorting method solves the problem of difficulty in sorting corner points when the chessboard is pieced together or when the chessboard is incomplete in the image.
[0078] Step S202: Determine multiple points to be detected from the above checkerboard image. The points to be detected are corner points in the above checkerboard image used to calculate the operating parameters of the target camera.
[0079] Specifically, there are multiple checkerboard images, and each checkerboard image was captured from a different angle. The points to be detected in the checkerboard images are different depending on the angle of capture.
[0080] The specific implementation steps of step S202 are as follows:
[0081] Step S2021: Obtain the center corner point of the chessboard image. The center corner point is the chessboard corner point in the chessboard image that is closest to the center point of the chessboard image.
[0082] Step S2022: Obtain the shooting angle of the above chessboard image;
[0083] Step S2023: When the above-mentioned shooting angle is the target angle, based on the center corner point of the above-mentioned chessboard image and the corner points of all chessboard grids, a plurality of the above-mentioned detection points are determined from the above-mentioned chessboard image. The above-mentioned detection points include all the above-mentioned chessboard grid corner points traversed along the target edge direction starting from the above-mentioned center corner point. The above-mentioned target angle corresponds to the above-mentioned target edge direction.
[0084] Specifically, the points to be detected are points in a row or column along the shooting direction starting from the center corner. Since the shooting direction is different, the accuracy of the image in each direction will also be different. This can obtain more accurate points to be detected, so as to calculate more accurate operating parameters of the target camera in the subsequent calculation.
[0085] For example, when the shooting angle is 0°, the points to be detected are all the points from the center corner along the 0° direction (i.e., the left row) to the edge; when the shooting angle is 90°, the points to be detected are all the points from the center corner along the 90° direction (i.e., the top column) to the edge; when the shooting angle is 180°, the points to be detected are all the points from the center corner along the 180° direction (i.e., the right row) to the edge; and when the shooting angle is 270°, the points to be detected are all the points from the center corner along the 270° direction (i.e., the bottom column) to the edge.
[0086] Step S203: Determine the operating parameters of the target camera based at least on the corner information of each of the above-mentioned points to be detected. The corner information of the points to be detected includes at least the corner position of the points to be detected in the checkerboard image. The operating parameters of the target camera include at least the horizontal field of view of the target camera, the vertical field of view of the target camera, the focal length of the target camera, and the F-theta distortion of the target camera.
[0087] Specifically, the horizontal and vertical field of view angles can be calculated by measuring the distance between the edge corners and the center corner. After obtaining the target camera's operating parameters and distortion, the image can be corrected based on these parameters and distortion to obtain an image with less distortion.
[0088] The operating parameters of the target camera mentioned above are F-theta distortion variables. The specific implementation steps of step S203 are as follows:
[0089] Step S301: Obtain the theoretical image height of the target detection point, the true image height of the target detection point, and the field of view of the target detection point. The true image height of the target detection point is the image distance between the target detection point and the center corner point of the chessboard image. The center corner point is the chessboard corner point in the chessboard image that is closest to the center point of the chessboard image.
[0090] The specific steps for obtaining the theoretical image height of the target point to be detected are as follows:
[0091] Step S3011: Obtain multiple auxiliary calculation points. The auxiliary calculation points are the corner points of the chessboard located in the central region of the chessboard image. The central region is the region centered on the central corner point and with a preset area.
[0092] Step S3012, using the physical length formula Determine the actual physical length corresponding to each pixel in the central region mentioned above, where P L L represents the actual physical length corresponding to one pixel in the aforementioned central region. unit Let D be the unit length of a square in the chessboard image above, n be the number of auxiliary calculation points mentioned above, and D be the unit length of a square in the chessboard image above. i The image distance between one of the aforementioned auxiliary calculation points and the aforementioned central corner point;
[0093] Step S3013: Calculate the image height based on the actual physical length and theoretical image height of each pixel in the central region using the aforementioned formula. Determine the theoretical image height of the target point to be detected, where H theory L is the theoretical image height of the target point to be detected. c This refers to the number of squares between the target point to be detected and the central corner point.
[0094] Specifically, by calculating the theoretical image height, the deviation between the theoretical image height and the actual image height of the point to be detected can be obtained. Based on this deviation, the distortion of the image captured by the target camera at the point to be detected can be obtained, which lays the foundation for calculating the distortion of the target camera.
[0095] The specific steps for obtaining the field of view of the target point to be detected are as follows:
[0096] Step S3014: Obtain the number of grids between the target detection point and the center corner point, the length of a square in the chessboard image, and the target object distance. The target object distance is the vertical distance between the lens of the target camera and the real object in the chessboard image.
[0097] Step S3015: Based on the number of grids between the target detection point and the center corner point, the unit length of one square in the chessboard image, the target object distance, and the first field of view calculation formula... The field of view angle of the target point to be detected is obtained, where θ is the field of view angle of the target point to be detected, and L c L is the number of squares between the target point to be detected and the central corner point. unit WD represents the unit length of one square in the chessboard image above, and WD represents the target distance.
[0098] Specifically, by obtaining the field of view of each point to be tested, the field of view of the target camera at a shooting angle can be calculated, and then the horizontal and vertical field of view of the target camera can be obtained. Obtaining the field of view of each point to be tested first is to make the calculation results more accurate.
[0099] Step S302: Based on the theoretical image height of the target to be detected, the true image height of the target to be detected, and the first distortion formula... The first distorted variable of the target point to be detected is determined, where D1 is the first distorted variable of the target point to be detected, and H... image H is the true image height of the target point to be detected. theory The theoretical image height of the target to be detected mentioned above;
[0100] Step S303: Based on the first distortion of the target detection point, the field of view angle of the target detection point, and the second distortion formula... Determine the F-theta distortion of the target detection point, where F-theta is the F-theta distortion of the target detection point, and θ is the field of view angle of the target detection point.
[0101] Specifically, by calculating the F-theta distortion variable, accurate image distortion information can be obtained. The checkerboard image can then be accurately corrected based on the F-theta distortion variable to obtain a corrected image with less distortion.
[0102] The operating parameters of the target camera include the horizontal field of view and the vertical field of view. The specific implementation steps of step S203 are as follows:
[0103] Step S401: Obtain the field of view of the target camera when the shooting angle is the target angle. Wherein, when the target angle is 0°, the field of view of the target camera is the first field of view; when the target angle is 90°, the field of view of the target camera is the second field of view; when the target angle is 180°, the field of view of the target camera is the third field of view; and when the target angle is 270°, the field of view of the target camera is the fourth field of view.
[0104] The specific implementation steps of step S401 are as follows:
[0105] Step S4011: Obtain the first detection point, which is the detection point closest to the edge of the target.
[0106] Step S4012: Obtain the number of squares between the first detection point and the center corner point and the number of checkerboard calibration plates between the first detection point and the target edge. The number of checkerboard calibration plates between the first detection point and the target edge is the ratio of the first calculated distance and the second calculated distance. The first calculated distance is the distance between the first detection point and the target edge, and the second calculated distance is the distance between the first detection point and the detection point closest to the first detection point.
[0107] Step S4013: Based on the number of squares between the first detection point and the center corner point, the number of checkerboard calibration plates between the first detection point and the target edge, and the second field of view calculation formula... Determine the field of view of the target camera at the aforementioned target angle, where θ FOV Let L be the field of view of the target camera at the aforementioned target angle. p Let N be the number of squares between the first detection point and the center corner point, N be the number of checkerboard calibration plates between the first detection point and the target edge, and N be the ratio of the first distance to the second distance. The first distance is the distance between the first detection point and the target edge, and the second distance is the distance between the first detection point and the nearest detection point. The nearest detection point is the detection point closest to the first detection point. unit WD is the unit length of one square in the above checkerboard image, and WD is the vertical distance between the lens of the target camera and the real object in the above checkerboard image.
[0108] Specifically, the accuracy of photos taken from different shooting angles varies, such as... Figures 7(a)-7(d)As shown, the checkerboard image has a checkerboard calibration plate on only one edge, while the edges without checkerboard calibration plates cannot be determined. Therefore, it is necessary to take pictures from different shooting angles to obtain images from all angles. The operating parameters of the target camera at all angles can be calculated, which means that the accurate distortion of each point on the whole image can be obtained.
[0109] Step S402: Add the first field of view and the third field of view to obtain the horizontal field of view of the target camera;
[0110] Step S403: Add the second field of view and the fourth field of view to obtain the vertical field of view of the target camera.
[0111] Specifically, by adding the field of view angles in different directions, the field of view angles in the horizontal and vertical directions can be obtained, and thus the field of view angle of the target camera in all angles can be obtained.
[0112] The operating parameters of the target camera include its focal length. The specific implementation steps of step S203 are as follows:
[0113] Step S501: Obtain the field of view of the second detection point, wherein the second detection point is the detection point closest to the center corner point;
[0114] Step S502: Obtain the true image height of the second detection point mentioned above;
[0115] Step S503: Based on the field of view of the second point to be detected, the true image height of the second point to be detected, and the focal length calculation formula... Determine the focal length of the target camera, where EFL is the focal length of the target camera, and H... image θ is the true image height of the second point to be detected, and θ is the field of view of the second point to be detected.
[0116] Specifically, since the distortion is minimal and the data is most accurate at the center of the image, the most accurate focal length can be calculated by using the detection point closest to the center corner.
[0117] The method for determining the camera operating parameters described in this application first acquires a checkerboard image. A checkerboard calibration plate exists from the image center to at least one edge of the checkerboard image. The checkerboard image is obtained by the target camera capturing images of multiple checkerboard calibration plates arranged in a predetermined order. Multiple points to be detected are determined from the checkerboard image. The operating parameters of the target camera are determined based on at least the corner information of each point to be detected. The corner information includes at least the corner position of the point to be detected in the checkerboard image. The operating parameters of the target camera include at least the horizontal field of view, the vertical field of view, the focal length, and the F-theta distortion. By acquiring accurate points to be detected and using the detection indicators for these points, the accuracy of distortion detection can be improved, and the vertical and horizontal field of view and focal length (EFL) of the lens can be detected simultaneously. This solves the problems of low accuracy in existing distortion detection methods and the inability to simultaneously detect the vertical and horizontal field of view and focal length (EFL).
[0118] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0119] This application also provides a device for determining camera operating parameters. It should be noted that this device can be used to execute the method for determining camera operating parameters provided in this application. This device is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0120] The following describes the camera operating parameter determination device provided in the embodiments of this application.
[0121] Figure 13 This is a schematic diagram of a camera operating parameter determination device according to an embodiment of this application. Figure 13As shown, the device includes a first acquisition unit 10, a first determination unit 20, and a second determination unit 30. The first acquisition unit 10 is used to acquire a checkerboard image, wherein the checkerboard pattern exists from the image center to at least one edge of the checkerboard image. The checkerboard image is an image obtained by a target camera capturing multiple checkerboard calibration plates arranged in a predetermined order. The first determination unit 20 is used to determine multiple detection points from the checkerboard image. The detection points are corner points in the checkerboard image used to calculate the operating parameters of the target camera. The second determination unit 30 is used to determine the operating parameters of the target camera based at least on the corner point information of each detection point. The corner point information of the detection points includes at least the corner point position of the detection points in the checkerboard image. The operating parameters of the target camera include at least the horizontal field of view, the vertical field of view, the focal length, and the F-theta distortion of the target camera.
[0122] The camera operating parameter determination device of this application includes a first acquisition unit, a first determination unit, and a second determination unit. The first acquisition unit is used to acquire a checkerboard image. A checkerboard calibration plate exists from the image center of the checkerboard image to at least one edge of the checkerboard image. The checkerboard image is an image obtained by a target camera capturing multiple checkerboard calibration plates arranged in a predetermined order. The first determination unit is used to determine multiple points to be detected from the checkerboard image. The second determination unit is used to determine the operating parameters of the target camera based at least on the corner information of each point to be detected. The corner information of the points to be detected includes at least the corner position of the points to be detected in the checkerboard image. The operating parameters of the target camera include at least the horizontal field of view, the vertical field of view, the focal length, and the F-theta distortion of the target camera. By acquiring accurate points to be detected and based on the detection indicators of the points to be detected, the accuracy of distortion detection can be improved, and the vertical and horizontal field of view and focal length (EFL) of the lens can be detected simultaneously. This addresses the problem that existing distortion detection methods have low accuracy and cannot simultaneously detect the vertical and horizontal field of view and focal length (EFL) of the lens.
[0123] In one optional scheme, the first determining unit includes a first acquisition module, a second acquisition module, and a first determining module. The first acquisition module is used to acquire the center corner point of the chessboard image, where the center corner point is the chessboard corner point closest to the center point of the chessboard image. The second acquisition module is used to acquire the shooting angle of the chessboard image. The first determining module is used, when the shooting angle is a target angle, to determine multiple detection points from the chessboard image based on the center corner point and all chessboard corner points. The detection points include all chessboard corner points traversed along the target edge direction starting from the center corner point. The target angle corresponds to the target edge direction. This allows for more accurate detection points to be obtained, enabling subsequent calculations of more accurate target camera operating parameters.
[0124] For example, the second determining unit includes a third acquisition module, a second determining module, and a third determining module. The third acquisition module is used to acquire the theoretical image height of the target detection point, the true image height of the target detection point, and the field of view of the target detection point. The true image height of the target detection point is the image distance between the target detection point and the center corner point of the checkerboard image. The center corner point is the checkerboard corner point in the checkerboard image that is closest to the center point of the checkerboard image. The second determining module is used to determine the target detection point based on the theoretical image height, the true image height of the target detection point, and the first distortion formula. The first distorted variable of the target point to be detected is determined, where D1 is the first distorted variable of the target point to be detected, and H... image H is the true image height of the target point to be detected. theory The theoretical image height of the target detection point is given above; the third determining module is used to determine the first distortion of the target detection point, the field of view angle of the target detection point, and the second distortion formula. The F-theta distortion of the target detection point is determined, where F-theta is the F-theta distortion of the target detection point, and θ is the field of view angle of the target detection point. The field of view angle of the target camera at a certain shooting angle can be calculated, and then the horizontal and vertical field of view angles of the target camera can be obtained. Obtaining the field of view angle of each detection point first is to make the calculation results more accurate.
[0125] As an optional solution, the third acquisition module includes a first acquisition submodule, a first determination submodule, and a second determination submodule. The first acquisition submodule is used to acquire multiple auxiliary calculation points, which are the corner points of the chessboard located in the central region of the chessboard image. The central region is a region centered on the corner points and with a preset area. The first determination submodule is used to apply the physical length formula. Determine the actual physical length corresponding to each pixel in the central region mentioned above, where P L L represents the actual physical length corresponding to one pixel in the aforementioned central region. unit Let D be the unit length of a square in the chessboard image above, n be the number of auxiliary calculation points mentioned above, and D be the unit length of a square in the chessboard image above. i The first auxiliary calculation point is the image distance between the aforementioned auxiliary calculation point and the aforementioned central corner point; the second determining submodule is used to calculate the image distance based on the actual physical length and theoretical image height of each pixel in the aforementioned central region using the formula. Determine the theoretical image height of the target point to be detected, where H theory L is the theoretical image height of the target point to be detected. c This represents the number of squares between the target detection point and the central corner point. The deviation between the theoretical image height and the actual image height of the detection point can be obtained. Based on this deviation, the distortion of the image captured by the target camera at that detection point can be obtained, thus laying the foundation for calculating the distortion of the target camera.
[0126] For example, the third acquisition module includes a second acquisition submodule and a third determination submodule. The second acquisition submodule is used to acquire the number of grids between the target detection point and the center corner point, the length of a square in the checkerboard image, and the target object distance, wherein the target object distance is the vertical distance between the lens of the target camera and the real object in the checkerboard image. The third determination submodule is used to calculate based on the number of grids between the target detection point and the center corner point, the unit length of a square in the checkerboard image, the target object distance, and the first field of view angle using a calculation formula. The field of view angle of the target point to be detected is obtained, where θ is the field of view angle of the target point to be detected, and L c L is the number of squares between the target point to be detected and the central corner point. unit Let WD be the unit length of a square in the checkerboard image above, and WD be the target object distance. The field of view of the target camera at a certain shooting angle can be calculated, and then the horizontal and vertical field of view of the target camera can be obtained. Obtaining the field of view of each point to be measured first is to make the calculation results more accurate.
[0127] As an optional solution, the first determining module includes a fourth acquisition module, a first processing submodule, and a second processing submodule. The fourth acquisition module is used to acquire the field of view of the target camera when the shooting angle is the target angle. Specifically, when the target angle is 0°, the field of view of the target camera is the first field of view; when the target angle is 90°, the field of view of the target camera is the second field of view; when the target angle is 180°, the field of view of the target camera is the third field of view; and when the target angle is 270°, the field of view of the target camera is the fourth field of view. The first processing submodule is used to add the first field of view and the third field of view to obtain the horizontal field of view of the target camera. The second processing submodule is used to add the second field of view and the fourth field of view to obtain the vertical field of view of the target camera. By adding the field of view in different directions, the horizontal and vertical field of view can be obtained respectively, thus obtaining the field of view of the target camera at all angles.
[0128] For example, the fourth acquisition module includes a third acquisition submodule, a fourth acquisition submodule, and a fourth determination submodule. The third acquisition submodule is used to acquire a first detection point, which is the detection point closest to the target edge. The fourth acquisition submodule is used to acquire the number of squares between the first detection point and the center corner point and the number of checkerboard calibration plates between the first detection point and the target edge. The number of checkerboard calibration plates between the first detection point and the target edge is the ratio of a first calculated distance and a second calculated distance. The first calculated distance is the distance between the first detection point and the target edge, and the second calculated distance is the distance between the first detection point and the detection point closest to the first detection point. The fourth determination submodule is used to calculate the number of squares between the first detection point and the center corner point, the number of checkerboard calibration plates between the first detection point and the target edge, and the second field of view using a calculation formula. Determine the field of view of the target camera at the aforementioned target angle, where θ FOV Let L be the field of view of the target camera at the aforementioned target angle. p Let N be the number of squares between the first detection point and the center corner point, N be the number of checkerboard calibration plates between the first detection point and the target edge, and N be the ratio of the first distance to the second distance. The first distance is the distance between the first detection point and the target edge, and the second distance is the distance between the first detection point and the nearest detection point. The nearest detection point is the detection point closest to the first detection point. unitLet WD be the unit length of a square in the aforementioned checkerboard image, and WD be the vertical distance between the lens of the target camera and the actual object in the checkerboard image. Images captured from all angles can be obtained, and the operating parameters of the target camera at all angles can be calculated, thus providing the accurate distortion for each point in the entire image.
[0129] In an optional embodiment, the first determining module includes a fifth acquiring submodule, a sixth acquiring submodule, and a fifth determining submodule. The fifth acquiring submodule is used to acquire the field of view of the second detection point, wherein the second detection point is the detection point closest to the central corner point. The sixth acquiring submodule is used to acquire the true image height of the second detection point. The fifth determining submodule is used to calculate the focal length based on the field of view of the second detection point, the true image height of the second detection point, and the focal length using a formula. Determine the focal length of the target camera, where EFL is the focal length of the target camera, and H... image Let θ be the true image height of the second point to be detected, and θ be the field of view of the second point to be detected. The most accurate focal length can then be calculated.
[0130] The aforementioned camera operating parameter determination device includes a processor and a memory. The first acquisition unit and other components are stored as program units in the memory, and the processor executes these program units to achieve the corresponding functions. All of the aforementioned modules reside in the same processor; alternatively, the modules may be located in different processors in any combination.
[0131] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured. By adjusting kernel parameters, the low accuracy of existing distortion detection methods and their inability to simultaneously detect the vertical and horizontal field of view and focal length (EFL) of the lens can be addressed.
[0132] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0133] This invention provides a computer-readable storage medium including a stored program, wherein, when the program is executed, it controls the device containing the computer-readable storage medium to perform the method for determining camera operating parameters.
[0134] Specifically, the methods for determining camera operating parameters include:
[0135] Step S201: Obtain a checkerboard image. The checkerboard image contains checkerboards from the image center to at least one edge of the checkerboard image. The checkerboard image is an image obtained by the target camera from multiple checkerboard calibration plates arranged in a predetermined order.
[0136] Specifically, a specific chessboard pattern such as Figure 3 As shown, the checkerboard image is a checkerboard image acquired using a humanoid eyeglass lens and a corresponding industrial camera. The checkerboard image is composed of multiple checkerboard calibration plates. When acquiring images in different directions, it is necessary to ensure that a portion of the checkerboard calibration plate in that direction is outside the camera's field of view. This ensures that the edge of the acquired image also contains checkerboard patterns, making the obtained distortion data more comprehensive and thus making the distortion correction more accurate.
[0137] Step S202: Determine multiple points to be detected from the above checkerboard image. The points to be detected are corner points in the above checkerboard image used to calculate the operating parameters of the target camera.
[0138] Specifically, there are multiple checkerboard images, and each checkerboard image was captured from a different angle. The points to be detected in the checkerboard images are different depending on the angle of capture.
[0139] Step S203: Determine the operating parameters of the target camera based at least on the corner information of each of the above-mentioned points to be detected. The corner information of the points to be detected includes at least the corner position of the points to be detected in the checkerboard image. The operating parameters of the target camera include at least the horizontal field of view of the target camera, the vertical field of view of the target camera, the focal length of the target camera, and the F-theta distortion of the target camera.
[0140] Specifically, the horizontal and vertical field of view angles can be calculated by measuring the distance between the edge corners and the center corner. After obtaining the target camera's operating parameters and distortion, the image can be corrected based on these parameters and distortion to obtain an image with less distortion.
[0141] This invention provides a processor for running a program, wherein the program executes the method for determining camera operating parameters.
[0142] Specifically, the methods for determining camera operating parameters include:
[0143] Step S201: Obtain a checkerboard image. The checkerboard image contains checkerboards from the image center to at least one edge of the checkerboard image. The checkerboard image is an image obtained by the target camera from multiple checkerboard calibration plates arranged in a predetermined order.
[0144] Specifically, a specific chessboard pattern such as Figure 3 As shown, the checkerboard image is a checkerboard image acquired using a humanoid eyeglass lens and a corresponding industrial camera. The checkerboard image is composed of multiple checkerboard calibration plates. When acquiring images in different directions, it is necessary to ensure that a portion of the checkerboard calibration plate in that direction is outside the camera's field of view. This ensures that the edge of the acquired image also contains checkerboard patterns, making the obtained distortion data more comprehensive and thus making the distortion correction more accurate.
[0145] Step S202: Determine multiple points to be detected from the above checkerboard image. The points to be detected are corner points in the above checkerboard image used to calculate the operating parameters of the target camera.
[0146] Specifically, there are multiple checkerboard images, and each checkerboard image was captured from a different angle. The points to be detected in the checkerboard images are different depending on the angle of capture.
[0147] Step S203: Determine the operating parameters of the target camera based at least on the corner information of each of the above-mentioned points to be detected. The corner information of the points to be detected includes at least the corner position of the points to be detected in the checkerboard image. The operating parameters of the target camera include at least the horizontal field of view of the target camera, the vertical field of view of the target camera, the focal length of the target camera, and the F-theta distortion of the target camera.
[0148] Specifically, the horizontal and vertical field of view angles can be calculated by measuring the distance between the edge corners and the center corner. After obtaining the target camera's operating parameters and distortion, the image can be corrected based on these parameters and distortion to obtain an image with less distortion.
[0149] This invention provides a device including a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs at least the following steps:
[0150] Step S201: Obtain a checkerboard image. The checkerboard image contains checkerboards from the image center to at least one edge of the checkerboard image. The checkerboard image is an image obtained by the target camera from multiple checkerboard calibration plates arranged in a predetermined order.
[0151] Step S202: Determine multiple points to be detected from the above checkerboard image. The points to be detected are corner points in the above checkerboard image used to calculate the operating parameters of the target camera.
[0152] Step S203: Determine the operating parameters of the target camera based at least on the corner information of each of the above-mentioned points to be detected. The corner information of the points to be detected includes at least the corner position of the points to be detected in the checkerboard image. The operating parameters of the target camera include at least the horizontal field of view of the target camera, the vertical field of view of the target camera, the focal length of the target camera, and the F-theta distortion of the target camera.
[0153] The devices mentioned in this article can be servers, PCs, tablets, mobile phones, etc.
[0154] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program having at least the following method steps:
[0155] Step S201: Obtain a checkerboard image. The checkerboard image contains checkerboards from the image center to at least one edge of the checkerboard image. The checkerboard image is an image obtained by the target camera from multiple checkerboard calibration plates arranged in a predetermined order.
[0156] Step S202: Determine multiple points to be detected from the above checkerboard image. The points to be detected are corner points in the above checkerboard image used to calculate the operating parameters of the target camera.
[0157] Step S203: Determine the operating parameters of the target camera based at least on the corner information of each of the above-mentioned points to be detected. The corner information of the points to be detected includes at least the corner position of the points to be detected in the checkerboard image. The operating parameters of the target camera include at least the horizontal field of view of the target camera, the vertical field of view of the target camera, the focal length of the target camera, and the F-theta distortion of the target camera.
[0158] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0159] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0160] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0161] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0162] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0163] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0164] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0165] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0166] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0167] As can be seen from the above description, the embodiments of this application achieve the following technical effects:
[0168] 1) The method for determining the camera operating parameters described in this application first acquires a checkerboard image. A checkerboard calibration plate exists from the image center of the checkerboard image to at least one edge of the checkerboard image. The checkerboard image is an image obtained by the target camera capturing multiple checkerboard calibration plates arranged in a predetermined order. Multiple points to be detected are determined from the checkerboard image. The operating parameters of the target camera are determined based on at least the corner information of each point to be detected. The corner information of each point to be detected includes at least the corner position of the point to be detected in the checkerboard image. The operating parameters of the target camera include at least the horizontal field of view, the vertical field of view, the focal length, and the F-theta distortion of the target camera. By acquiring accurate points to be detected and using the detection indicators for these points, the accuracy of distortion detection can be improved, and the vertical and horizontal field of view and focal length (EFL) of the lens can be detected simultaneously. This solves the problem that existing distortion detection methods have low accuracy and cannot simultaneously detect the vertical and horizontal field of view and focal length (EFL).
[0169] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for determining camera operating parameters, characterized in that, include: A checkerboard image is acquired, wherein a checkerboard calibration plate exists from the image center of the checkerboard image to at least one edge of the checkerboard image, and the checkerboard image is an image obtained by a target camera of multiple checkerboard calibration plates arranged in a predetermined order; Multiple detection points are determined from the checkerboard image, and the detection points are corner points in the checkerboard image used to calculate the operating parameters of the target camera; The operating parameters of the target camera are determined based on at least the corner information of each of the points to be detected. The corner information of the points to be detected includes at least the corner positions of the points to be detected in the checkerboard image. The operating parameters of the target camera include at least the horizontal field of view, the vertical field of view, the focal length, and the F-theta distortion of the target camera. Determining multiple detection points from the chessboard image includes: acquiring the center corner point of the chessboard image, where the center corner point is the chessboard corner point closest to the center point of the chessboard image; acquiring the image capture angle of the chessboard image; and, if the image capture angle is a target angle, determining multiple detection points from the chessboard image based on the center corner point and all chessboard corner points, wherein the detection points include all chessboard corner points traversed along the target edge direction starting from the center corner point, and the target angle corresponds to the target edge direction. The operating parameters of the target camera are F-theta distortion variables. The operating parameters are determined at least based on the corner information of each of the points to be detected, including: obtaining the theoretical image height of the target point to be detected, the true image height of the target point to be detected, and the field of view of the target point to be detected. The true image height of the target point to be detected is the image distance between the target point to be detected and the center corner of the checkerboard image. The center corner is the checkerboard corner in the checkerboard image that is closest to the center point of the checkerboard image. The operating parameters are determined based on the theoretical image height of the target point to be detected, the true image height of the target point to be detected, and the first distortion formula. Determine the first distorted variable of the target detection point, where D1 is the first distorted variable of the target detection point, H image H is the true image height of the target point to be detected. theory The theoretical image height of the target detection point; based on the first distortion of the target detection point, the field of view angle of the target detection point, and the second distortion formula. Determine the F-theta distortion of the target detection point, where F-theta is the F-theta distortion of the target detection point, and θ is the field of view angle of the target detection point.
2. The determination method according to claim 1, characterized in that, Obtain the theoretical image height of the target point to be detected, including: Multiple auxiliary calculation points are obtained. The auxiliary calculation points are the corner points of the chessboard located in the central region of the chessboard image. The central region is a region centered on the central corner point and with a preset area. Using the physical length formula Determine the actual physical length corresponding to each pixel in the central region, where P L L is the actual physical length corresponding to one pixel in the central region. unit Let D be the unit length of a square in the chessboard image, n be the number of auxiliary calculation points, and D be the length of a square. i The image distance between one of the auxiliary calculation points and the central corner point; The calculation formula is based on the actual physical length and theoretical image height of each pixel in the central region. Determine the theoretical image height of the target point to be detected, where H theory L is the theoretical image height of the target point to be detected. c The number of squares between the target detection point and the center corner point.
3. The determination method according to claim 1, characterized in that, Obtaining the field of view of the target point to be detected includes: The number of grids between the target detection point and the center corner point, the length of a square in the chessboard image, and the target object distance are obtained. The target object distance is the vertical distance between the lens of the target camera and the real object in the chessboard image. The calculation formula is based on the number of grids between the target detection point and the center corner point, the unit length of a square in the chessboard image, the target object distance, and the first field of view. The field of view of the target point to be detected is obtained, where θ is the field of view of the target point to be detected, and L c L is the number of squares between the target detection point and the center corner point. unit WD represents the unit length of a square in the chessboard image, and WD represents the target object distance.
4. The determination method according to claim 1, characterized in that, The operating parameters of the target camera include the horizontal field of view and the vertical field of view of the target camera. The operating parameters of the target camera are determined at least based on the corner information of each of the points to be detected, including: The field of view of the target camera is obtained when the shooting angle is the target angle. Specifically, when the target angle is 0°, the field of view of the target camera is the first field of view; when the target angle is 90°, the field of view of the target camera is the second field of view; when the target angle is 180°, the field of view of the target camera is the third field of view; and when the target angle is 270°, the field of view of the target camera is the fourth field of view. The first field of view and the third field of view are added together to obtain the horizontal field of view of the target camera; The second field of view and the fourth field of view are added together to obtain the vertical field of view of the target camera.
5. The determination method according to claim 4, characterized in that, Obtaining the field of view of the target camera at the target angle includes: Obtain a first detection point, which is the detection point closest to the edge of the target. The number of squares between the first detection point and the center corner point and the number of checkerboard calibration plates between the first detection point and the target edge are obtained. The number of checkerboard calibration plates between the first detection point and the target edge is the ratio of the first calculated distance and the second calculated distance. The first calculated distance is the distance between the first detection point and the target edge, and the second calculated distance is the distance between the first detection point and the detection point closest to the first detection point. Based on the number of squares between the first detection point and the central corner point, the number of checkerboard calibration plates between the first detection point and the target edge, and the second field of view calculation formula... Determine the field of view of the target camera at the target angle, where θ FOV L represents the field of view of the target camera at the target angle. p N is the number of squares between the first detection point and the center corner point; N is the number of checkerboard calibration plates between the first detection point and the target edge; N is the ratio of the first distance and the second distance, where the first distance is the distance between the first detection point and the target edge, and the second distance is the distance between the first detection point and the nearest detection point, where the nearest detection point is the detection point closest to the first detection point; L unit WD is the unit length of a square in the checkerboard image, and WD is the vertical distance between the lens of the target camera and the real object in the checkerboard image.
6. The determination method according to claim 1, characterized in that, The operating parameters of the target camera include the focal length of the target camera. The operating parameters of the target camera are determined at least based on the corner information of each of the points to be detected, including: Obtain the field of view of the second detection point, which is the detection point closest to the central corner point; Obtain the true image height of the second point to be detected; Based on the field of view of the second point to be detected, the true image height of the second point to be detected, and the focal length, the calculation formula is as follows: Determine the focal length of the target camera, where EFL is the focal length of the target camera, and H... image θ is the true image height of the second point to be detected, and θ is the field of view angle of the second point to be detected.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein, when the program is executed, it controls the device on which the computer-readable storage medium is located to perform the method for determining camera operating parameters as described in any one of claims 1 to 6.
8. An electronic device, characterized in that, include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including a method for performing the determination of camera operating parameters as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Camera calibration method, electronic equipment and storage medium
CN115457147A