Optical center calibration method and device

CN114241056BActive Publication Date: 2025-10-21NANCHANG OFILM HUAGUANG TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111382569.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-19
Publication Date
2025-10-21
Estimated Expiration
2041-11-19

AI Technical Summary

Technical Problem

In the prior art, the optical center testing method of the camera module results in a large optical center error due to the small difference between the corner brightness value and the center brightness value.

Method used

By shooting a checkerboard test chart, the coordinates of the centroid points of multiple preset patterns in the target image are obtained. The two different pixel value patterns of the checkerboard test chart are used to significantly enhance the brightness value difference, thereby determining the optical center.

Benefits of technology

The error of the optical center is reduced and the positioning accuracy of the optical center is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114241056B_ABST
    Figure CN114241056B_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses an optical center calibration method and device, which is applied to the technical field of lenses and can solve the problem that the error of the optical center is large because the difference between the corner brightness value and the center brightness value of part of cameras is not large. The method comprises the following steps: capturing a checkerboard test card by a target lens to obtain a target image; determining the coordinates of a plurality of mass center points corresponding to a plurality of preset patterns in the target image; and determining the optical center of the target lens according to the coordinates of the plurality of mass center points.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of lens technology, and in particular to a method and device for calibrating an optical center. Background Art

[0002] Due to the optical properties of camera modules, images may appear dark around the edges and bright in the center. The coordinates of the brightest spot at the center are called the optical center. Currently, the method for testing the optical center of a camera module essentially involves capturing an image of a white card with the camera. This image is binarized to form a circular or quasi-circular circle, and the center of this circle is calculated as the camera's optical center. However, the brightness values ​​at the corners of some cameras are not much different from the brightness values ​​at the center. This results in an excessively large circular spot after binarization, leading to a large error in the optical center. Summary of the Invention

[0003] The embodiments of the present invention provide an optical center calibration method and device to solve the problem in the prior art that the brightness values ​​of the corners and the center of some cameras are not much different, resulting in a large optical center error.

[0004] In a first aspect, an optical center calibration method is provided, the method comprising: photographing a checkerboard test chart through a target lens to obtain a target image;

[0005] Determining the coordinates of a plurality of centroid points corresponding to a plurality of preset patterns in the target image;

[0006] The optical center of the target lens is determined according to the coordinates of the multiple centroid points.

[0007] With this solution, the optical center calibration device can determine the optical center of a target lens by using the coordinates of multiple centroid points corresponding to multiple preset patterns in a target image obtained by photographing a checkerboard test chart. In this solution, because the checkerboard test chart includes two patterns with different pixel values, the difference in brightness values ​​of the target image obtained by photographing the checkerboard test chart is more pronounced. Consequently, the error in the optical center with the maximum imaging brightness value, obtained based on multiple centroid points in the target image, is minimized.

[0008] As an optional implementation manner, in the first aspect of the embodiments of the present invention, determining the optical center of the target lens according to the coordinates of the multiple centroid points includes:

[0009] Determining a plurality of target centroid points located in a center row and a center column according to the coordinates of the plurality of centroid points;

[0010] determining the optical center of the target lens according to the brightness values ​​of the plurality of target centroid points;

[0011] The brightness value of each centroid point is the average brightness value of the pixels within the preset area where the centroid point is located.

[0012] With this solution, the optical center calibration device can obtain a target image by photographing a checkerboard test chart, then calculate the coordinates of multiple centroids corresponding to multiple preset patterns in the target image. The target centroids located in the center row and center column are then selected to determine the optical center of the target lens. In this solution, because the checkerboard test chart includes two patterns with different pixel values, the difference in brightness values ​​of the target image obtained by photographing the checkerboard test chart is more pronounced. This reduces the error in the optical center with the maximum imaging brightness value, as determined by the centroids located in the center row and center column of the target image, and reduces the computational effort.

[0013] As an optional implementation manner, in the first aspect of the embodiments of the present invention, determining the optical center of the target lens according to the brightness values ​​of the multiple target centroid points includes:

[0014] Determine, based on the coordinates of the multiple target centroids, the N centroids closest to each target centroid, where N is an integer greater than or equal to 3;

[0015] Determine the brightness coordinate function corresponding to each target centroid point based on the N centroid points closest to each target centroid point;

[0016] Substituting the coordinates of the plurality of target mass center points into corresponding brightness coordinate functions respectively to obtain brightness values ​​corresponding to the plurality of target mass center points respectively;

[0017] The optical center of the target lens is determined according to the brightness values ​​respectively corresponding to the multiple target centroid points.

[0018] With this solution, the optical center calibration device can obtain a target image by photographing a checkerboard test chart, then calculate the coordinates of multiple centroids corresponding to multiple preset patterns in the target image. At least three centroids located closest to the target centroid located in the center row and center column are selected to determine a brightness coordinate function, thereby obtaining the brightness value of the target centroid. The brightness values ​​of each target centroid are then compared to determine the optical center of the target lens. In this solution, because the checkerboard test chart includes patterns of two different pixel values, the difference in brightness values ​​of the target image obtained by photographing the checkerboard test chart is more pronounced. Consequently, the error in the optical center with the maximum imaging brightness value obtained based on multiple centroids in the target image is smaller.

[0019] As an optional implementation manner, in the first aspect of the embodiments of the present invention, determining the optical center of the target lens according to the brightness values ​​corresponding to the multiple target centroid points includes:

[0020] Determine the column coordinate of the target mass center point with the largest brightness value among the multiple target mass center points located in the center row as the abscissa of the optical center;

[0021] The row coordinate of the target mass center point with the largest brightness value among the multiple target mass center points located in the center column is determined as the vertical coordinate of the optical center.

[0022] As an optional implementation manner, in the first aspect of the embodiments of the present invention, determining the optical center of the target lens according to the multiple brightness values ​​corresponding to the multiple target centroid points includes:

[0023] Performing curve fitting based on the column coordinates of multiple target centroid points located in the center row and the brightness value of each target centroid point located in the center row to obtain a center row brightness fitting curve;

[0024] Performing curve fitting based on the row coordinates of multiple target centroid points located in the center column and the brightness value of each target centroid point located in the center column to obtain a center column brightness fitting curve;

[0025] The column coordinate corresponding to the maximum brightness value in the center row brightness fitting curve is determined as the abscissa of the optical center, and the row coordinate corresponding to the maximum brightness value in the center column brightness fitting curve is determined as the ordinate of the optical center.

[0026] Through the two optional embodiments described above, the optical center calibration device can obtain a target image by photographing a checkerboard test chart, then calculate the coordinates of multiple centroids corresponding to multiple preset patterns in the target image, select at least three centroids closest to the target centroid located in the center row and center column to determine a brightness coordinate function, thereby obtaining the brightness value of the target centroid. The optical center of the target lens can then be determined by comparing the brightness values ​​of multiple target centroids and taking the maximum value, or by performing curve fitting on the brightness values ​​of multiple target centroids and taking the maximum value. In this solution, because the checkerboard test chart includes two patterns with different pixel values, the difference in brightness values ​​of the target image obtained by photographing the checkerboard test chart is more obvious, thereby reducing the error in the optical center with the maximum imaging brightness value obtained based on multiple centroids in the target image.

[0027] As an optional implementation manner, in the first aspect of the embodiments of the present invention, determining the coordinates of multiple centroid points corresponding to multiple preset patterns in the target image includes:

[0028] Determining, by a preset algorithm, a plurality of contours of the plurality of preset patterns in the target image, wherein pixel values ​​of the plurality of preset patterns are first pixel values, and each preset pattern has a contour;

[0029] Determine the centroid coordinates corresponding to each preset pattern according to the multiple contours.

[0030] With this solution, the optical center calibration device can obtain a target image by photographing a checkerboard test chart, then calculate the corresponding contours and centroid coordinates for multiple preset patterns within the chart to determine the optical center of the target lens. In this solution, because the checkerboard test chart includes two patterns with different pixel values, the difference in brightness values ​​of the target image after processing the image obtained by photographing the checkerboard test chart is more pronounced. This reduces the error in the optical center with the maximum imaging brightness value, as determined based on multiple centroid points in the target image.

[0031] As an optional implementation manner, in the first aspect of the embodiments of the present invention, photographing a checkerboard test chart through a target lens to obtain a target image includes:

[0032] Shooting the checkerboard test chart through the target lens to obtain a first image;

[0033] performing grayscale processing and binarization processing on the first image to obtain a second image;

[0034] performing pixel value inversion processing on the second image to obtain a third image;

[0035] amplifying the pattern of the second pixel value in the third image according to a preset ratio to obtain a fourth image;

[0036] Adjusting the pixel values ​​of the target area in the fourth image to the second pixel values ​​to obtain the target image;

[0037] The target area is an area in the fourth image whose distance from the image boundary is less than a preset distance.

[0038] Through this solution, the optical center calibration device can obtain an image by photographing a checkerboard test chart, then perform grayscale processing, binarization, pixel value inversion, and partial image magnification on the image. The device then calculates the corresponding contours and centroid coordinates for multiple preset patterns within the chart to determine the optical center of the target lens. In this solution, because the checkerboard test chart includes two patterns with different pixel values, the difference in brightness values ​​of the target image after processing the image obtained by photographing the checkerboard test chart is more pronounced. This reduces the error in the optical center with the maximum imaging brightness value obtained based on multiple centroid points in the target image.

[0039] As an optional implementation manner, in the first aspect of the embodiments of the present invention, determining the optical center of the target lens according to the coordinates of the multiple centroid points includes:

[0040] Obtaining brightness values ​​of the multiple centroid points;

[0041] Determining the brightness value of each pixel in the target image by surface interpolation according to the coordinates and brightness values ​​of the multiple centroid points;

[0042] The optical center of the target lens is determined according to the brightness value of each pixel.

[0043] Through this scheme, another method for determining the optical center is proposed, that is, surface interpolation is performed based on the coordinates and brightness value of the centroid point to obtain the brightness value of each pixel in the target image, so that the optical center calibration device can determine the optical center. This scheme does not require determining the center row and center column, and the steps are relatively simple.

[0044] In a second aspect, an optical center calibration device is provided, the optical center calibration device comprising: an acquisition module for photographing a checkerboard test chart through a target lens to obtain a target image;

[0045] a processing module, configured to determine coordinates of a plurality of centroid points corresponding to a plurality of preset patterns in the target image;

[0046] The processing module is further configured to determine the optical center of the target lens according to the coordinates of the multiple centroid points.

[0047] In a third aspect, an optical center calibration device is provided, comprising:

[0048] a memory storing executable program code;

[0049] a processor coupled to the memory;

[0050] The processor calls the executable program code stored in the memory to execute the optical center calibration method in the first aspect of the embodiment of the present invention.

[0051] In a fourth aspect, a computer-readable storage medium is provided, which stores a computer program that causes a computer to execute the optical center calibration method of the first aspect of the embodiment of the present invention. The computer-readable storage medium includes ROM / RAM, a magnetic disk, or an optical disk.

[0052] According to a fifth aspect, a computer program product is provided. When the computer program product is run on a computer, the computer is caused to execute part or all of the steps of any one of the methods according to the first aspect.

[0053] In a sixth aspect, an application publishing platform is provided, which is used to publish a computer program product, wherein when the computer program product runs on a computer, the computer is enabled to execute part or all of the steps of any one method of the first aspect.

[0054] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0055] In an embodiment of the present invention, an optical center calibration device can determine the optical center of a target lens by capturing a target image using a checkerboard test chart. The device then calculates the coordinates of multiple centroids corresponding to multiple preset patterns in the target image. In this solution, because the checkerboard test chart includes two patterns with different pixel values, the difference in brightness between the target images captured using the checkerboard test chart is more pronounced. Consequently, the error in the optical center with the maximum imaging brightness value, determined based on the multiple centroids in the target image, is minimized. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0057] Figure 1 This is a schematic diagram of the process of an optical center calibration method provided by an embodiment of the present invention. Figure 1 ;

[0058] Figure 2 Schematic diagram of a checkerboard test chart for an optical center calibration method provided by an embodiment of the present invention;

[0059] Figure 3 This is an image diagram of an optical center calibration method provided by an embodiment of the present invention. Figure 1 ;

[0060] Figure 4 This is an image diagram of an optical center calibration method provided by an embodiment of the present invention. Figure 2 ;

[0061] Figure 5 1 is a schematic diagram of a centroid point of an optical center calibration method provided by an embodiment of the present invention;

[0062] Figure 6 This is a schematic diagram of the process of an optical center calibration method provided by an embodiment of the present invention. Figure 2 ;

[0063] Figure 7 This is an image diagram of an optical center calibration method provided by an embodiment of the present invention. Figure 3 ;

[0064] Figure 8 This is an image diagram of an optical center calibration method provided by an embodiment of the present invention. Figure 4 ;

[0065] Figure 9 This is a schematic diagram of the structure of an optical center calibration device provided by an embodiment of the present invention. Figure 1 ;

[0066] Figure 10 This is a schematic diagram of the structure of an optical center calibration device provided by an embodiment of the present invention. Figure 2 . DETAILED DESCRIPTION

[0067] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0068] The terms "first," "second," and the like in the description and claims of the present invention are used to distinguish between different objects, rather than to describe a specific order of objects. For example, "first image" and "second image" are used to distinguish between different images, rather than to describe a specific order of images.

[0069] The terms "including" and "having" and any variations thereof in the embodiments of the present invention are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus that includes 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 these processes, methods, products or apparatus.

[0070] It should be noted that, in the embodiments of the present invention, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present invention should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0071] In related technologies, due to the optical properties of camera modules, images will appear dark around the edges and bright in the center. The coordinates of the brightest point in the center are called the optical center. Currently, the method for testing the optical center of a camera module is to capture an image of a white card with the camera. The captured image is binarized to form a circular or quasi-circular circle, and the center of this circle is calculated as the optical center of the camera. However, the brightness values ​​of some camera corners are not much different from the brightness values ​​of the center. This results in an excessively large circular spot after binarization, resulting in a large error in the optical center.

[0072] To address the aforementioned issues, embodiments of the present invention provide a method and apparatus for optical center calibration. This apparatus can obtain a target image by photographing a checkerboard test chart, then calculate the coordinates of multiple centroid points corresponding to multiple preset patterns in the target image to determine the optical center of the target lens. In this solution, because the checkerboard test chart includes two patterns with different pixel values, the difference in brightness values ​​of the target image obtained by photographing the checkerboard test chart is more pronounced. Consequently, the error in the optical center with the maximum imaging brightness value, obtained based on multiple centroid points in the target image, is minimized.

[0073] The optical center calibration device involved in an embodiment of the present invention can be a terminal device equipped with a lens, which can detect the lens to obtain the optical center of the lens; the optical center calibration device can also be a device in the terminal device, which can detect the optical center of the lens set in the terminal device.

[0074] The terminal device may be a mobile phone, tablet computer, laptop computer, PDA, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. The wearable device may be a smart watch, smart bracelet, watch phone, smart anklet, smart earring, smart necklace, smart headset, etc., which is not limited in the embodiment of the present invention.

[0075] The optical center calibration method provided in the embodiments of the present invention may be executed by the aforementioned optical center calibration device, or by a functional module and / or functional entity within the optical center calibration device that is capable of implementing the optical center calibration method. The specific implementation may be determined based on actual usage requirements and is not limited by the embodiments of the present invention. The optical center calibration method provided in the embodiments of the present invention is exemplified below using the optical center calibration device as an example.

[0076] Example 1

[0077] like Figure 1 As shown, an embodiment of the present invention provides an optical center calibration method, which may include the following steps:

[0078] 101. Shoot the checkerboard test chart through the target lens to obtain the target image.

[0079] In an embodiment of the present invention, the optical center calibration device can use a target lens to shoot a checkerboard test chart to obtain a target image to detect the optical center of the target lens.

[0080] The target image may be in a variety of formats, such as bmp, jpg, png, and raw, and the formats may be converted to each other.

[0081] It should be noted that the checkerboard test chart is a test chart comprising a plurality of identical rectangular grids, each rectangular grid can be a rectangle or a square; Figure 2 As shown, the checkerboard test chart 21 may only include grids 211 and 212 of two colors, the grids 211 and 212 of two colors are arranged crosswise, and the color of each rectangular grid is different from the four adjacent grids.

[0082] For example, the optical center calibration device uses the target lens to shoot Figure 2 The checkerboard test chart 21 shown in FIG. Figure 3 The target image 31 is shown.

[0083] 102. Determine coordinates of multiple centroid points corresponding to multiple preset patterns in the target image.

[0084] In an embodiment of the present invention, the optical center calibration device can determine a plurality of preset patterns in the target image according to the target image, and determine the coordinates of a plurality of centroid points corresponding to the plurality of preset patterns.

[0085] Each preset pattern has a centroid point.

[0086] It should be noted that, since the target image is obtained by shooting a checkerboard test chart with a target lens, the target image also includes multiple identical rectangular grid patterns. Therefore, the preset pattern is the rectangular grid pattern with the same pixel value among the multiple rectangular grid patterns.

[0087] For example, Figure 4 As shown, the optical center calibration device can screen the rectangular grid pattern in the target image 31 to obtain a plurality of rectangular grid patterns with pixel values ​​of preset pixel values, namely Figure 4 A rectangular grid pattern 41 is marked with a white frame.

[0088] In an embodiment of the present invention, after obtaining a target image, the optical center calibration device can determine a pixel coordinate system based on the pixel values ​​of the target image. The coordinates of each pixel in the target image are the pixel row and column numbers in which the pixel is located. Since the dimensions of the checkerboard test chart are known, that is, the dimensions of each color rectangular grid in the checkerboard test chart are known, the optical center calibration device can determine the coordinates of each centroid based on the position of the preset pattern in which the centroid is located in the target image.

[0089] Among them, the centroid point is the central pixel point of the preset pattern, the row coordinate of the centroid point is the average value of the row coordinates of each pixel point in the preset pattern, and the column coordinate of the centroid point is the average value of the column coordinates of each pixel point in the preset pattern.

[0090] 103. Determine the optical center of the target lens based on the coordinates of multiple center of mass points.

[0091] In an embodiment of the present invention, the optical center calibration device can determine the coordinates of the optical center of the target lens according to the coordinates of multiple centroid points.

[0092] The optical center may be used to represent the point with the maximum imaging brightness value of the target lens, or the point indicated by the average coordinate value of multiple points with the same imaging brightness value.

[0093] It should be noted that due to the optical characteristics of the lens, the surroundings will be dark and the center will be bright when imaging. In this case, the point with the highest central brightness value is the optical center. If there are multiple points with the same brightness value, and this brightness value is greater than the brightness values ​​of other points, then the point indicated by the average coordinate value of the multiple points with the same brightness value is the optical center.

[0094] Optionally, the optical center calibration device can further calculate the image center, which is the coordinate of the position halfway between the length and width of the image. Due to errors in lens design and assembly, the optical center and the image center may not coincide. Therefore, the optical center calibration device measures the quality of the lens by comparing the deviation between the optical center and the image center with a deviation threshold.

[0095] It should be noted that the smaller the deviation between the optical center and the image center, the better the quality of the lens.

[0096] For example, assuming that the deviation threshold is 50 pixels, the coordinates of the optical center are (99, 101), and the coordinates of the image center are (80, 80), then the deviation between the optical center and the image center can be calculated as Since 28.32<50, the lens is of qualified quality.

[0097] Optionally, the optical center of the target lens is determined based on the coordinates of multiple centroid points. Specifically, the following implementations may be included but are not limited to:

[0098] Implementation method 1: Obtain the brightness values ​​of multiple centroid points; determine the brightness value of each pixel in the target image through surface interpolation based on the coordinates and brightness values ​​of the multiple centroid points; determine the optical center of the target lens based on the brightness value of each pixel.

[0099] In this optional implementation, the optical center calibration device can obtain the brightness value of each centroid point after obtaining the coordinates of multiple centroid points, and then the optical center calibration device can perform surface interpolation on the coordinates and brightness values ​​of each straight line point to determine the brightness value of each pixel point in the target image; then, the optical center calibration device can determine the pixel point with the largest brightness value as the optical center, or, if there are multiple pixel points with the same brightness value, and the brightness value is greater than the brightness values ​​of other pixel points, then the pixel point indicated by the average value of the coordinates of the multiple pixel points with the same brightness value is the optical center.

[0100] It should be noted that since the optical center calibration device can only obtain the coordinates of a small number of centroid points, in order to obtain the coordinates of a large number of pixel points, the optical center calibration device can use the surface interpolation method. The commonly used surface interpolation functions include griddata function, gridfit function, RegularizeData3D function, etc.

[0101] Implementation method 2: Determine multiple target centroid points located in the center row and center column based on the coordinates of multiple centroid points; determine the optical center of the target lens based on the brightness values ​​of the multiple target centroid points.

[0102] In this optional implementation, after obtaining the coordinates of multiple centroids, the optical center calibration device can determine the target centroid located in the center row and center column according to the coordinates of each centroid.

[0103] It should be noted that since the rectangular grids on the checkerboard test chart are arranged in an array, the multiple preset patterns in the target image are also arranged in an array, so the multiple centroid points in the target image are also arranged in an array. The optical center calibration device can select all the centroid points located in the centermost row and all the centroid points located in the middlemost column from the multiple centroid points as target centroid points.

[0104] For example, Figure 5 As shown, multiple centroid points 51 in the target image are arranged in an array of 15 rows and 15 columns. Then the optical center calibration device can determine the centroid point 51 in the 8th row and 8th column as the target centroid point 52, that is, Figure 5 The center of mass point in the dashed box.

[0105] Furthermore, determining the optical center of the target lens based on the brightness values ​​of multiple target centroid points can specifically include: determining N centroid points closest to each target centroid point based on the coordinates of the multiple target centroid points, where N is an integer greater than or equal to 3; determining a brightness coordinate function corresponding to each target centroid point based on the N centroid points closest to each target centroid point; substituting the coordinates of the multiple target centroid points into the corresponding brightness coordinate function to obtain brightness values ​​corresponding to the multiple target centroid points respectively; and determining the optical center of the target lens based on the brightness values ​​corresponding to the multiple target centroid points respectively.

[0106] In this optional implementation, the optical center calibration device needs to perform the same processing on all target centroid points. The following description will be made using any target centroid point.

[0107] The optical center calibration device determines at least three center-of-mass points closest to the target center-of-mass point from all center-of-mass points, then obtains the brightness values ​​of the at least three center-of-mass points and determines a brightness coordinate function based on the coordinates and brightness values ​​of the at least three center-of-mass points. The optical center calibration device then substitutes the coordinates of the target center-of-mass point into the brightness coordinate function to obtain the brightness value corresponding to the target center-of-mass point. After the optical center calibration device performs the same processing as described above on all target center-of-mass points, it obtains multiple brightness values ​​corresponding to multiple target center-of-mass points. The optical center calibration device can then determine the optical center of the target lens based on the multiple brightness values.

[0108] Optionally, the optical center calibration device determines at least three center points closest to the target center point from all center points. Specifically, the optical center calibration device can calculate the distance between all center points adjacent to the target center point and the target center point, and then compare multiple distances to obtain at least three closest center points.

[0109] It should be noted that in the actual detection process, when the target lens shoots the checkerboard test chart, there may be a certain shooting angle, that is, the target lens may not be facing the checkerboard test chart. In this way, the multiple rectangular grid patterns in the target image obtained by the optical center calibration device will not be arranged in an array, and each row and column will be curved. In this way, the arrangement of the preset pattern and the center of mass point will also be curved. Therefore, the distance between the target center of mass point and the adjacent center of mass point will be different. Then the optical center calibration device needs to calculate the distance from each center of mass point to the target center of mass point and then compare them.

[0110] It should be noted that after the optical center calibration device determines at least three center points closest to the target center point, it can generate the three-dimensional coordinates of the center point based on the coordinates and brightness values ​​of the center point, and then determine at least one plane equation based on the three-dimensional coordinates of at least three center points. The plane equation is the brightness coordinate function.

[0111] For example, three points that are not on a straight line can determine a plane. That is, assuming that the coordinates of the target center of mass are (x0, y0), the three-dimensional coordinates of the three center of mass points closest to the target center of mass are point A (x1, y1, z1), point B (x2, y2, z2), and point C (x3, y3, z3), and z1, z2, and z3 are the brightness values ​​of the three center of mass points respectively. Assume that the plane equation through point A is: a(x-x1)+b(y-y1)+c(z-z1)=0; Substituting the coordinates of points B and C, we get: a(x2-x1)+b(y2-y1)+c(z2-z1)=0, a(x3-x1)+b(y3-y1)+c(z3-z1)=0; solving this set of equations simultaneously, we can get: Therefore, by substituting a, b and c into the original equation, the final plane equation can be obtained; at this time, by substituting the coordinates of the target center of mass point (x0, y0) into the plane equation, the brightness value z0 of the target center of mass point can be obtained.

[0112] It should be noted that, since each centroid point is the center point of the preset pattern where the centroid point is located, the optical center calibration device can determine the average value of the brightness value of each pixel point in the preset pattern as the brightness value of the centroid point, or the optical center calibration device can also determine the median of the brightness value of each pixel point in the preset pattern as the brightness value of the centroid point, or the optical center calibration device can also determine the average value of the brightness value of each pixel point within a certain range around the centroid point as the brightness value of the centroid point, and the range cannot exceed the preset pattern where the centroid point is located.

[0113] It should be noted that the number of brightness coordinate functions is determined according to the number of centroid points closest to each target centroid point determined by the optical center calibration device.

[0114] Optionally, since three centroids can determine a brightness coordinate function, when N is 3, the target centroid corresponds to one brightness coordinate function; when N is 4, the target centroid corresponds to four brightness coordinate functions; when N is a larger value, the target centroid corresponds to more brightness coordinate functions.

[0115] Correspondingly, when N is 3, that is, when the target centroid corresponds to one brightness coordinate function, the brightness value obtained by substituting the coordinates of the target centroid into the brightness coordinate function is the brightness value of the target centroid; when N is 4, that is, when the target centroid corresponds to four brightness coordinate functions, the coordinates of the target centroid are respectively substituted into the four brightness coordinate functions to obtain four brightness values, and the average of the four brightness values ​​is the brightness value of the target centroid, or the median of the four brightness values ​​is the brightness value of the target centroid; when N is a larger value, that is, when the target centroid corresponds to more brightness coordinate functions, the coordinates of the target centroid are respectively substituted into more brightness coordinate functions to obtain more brightness values, and the average of more brightness values ​​is the brightness value of the target centroid, or the median of more brightness values ​​is the brightness value of the target centroid.

[0116] Furthermore, the optical center of the target lens is determined based on the brightness values ​​corresponding to the multiple target centroid points. Specifically, the following implementations may be included but are not limited to:

[0117] Implementation method 1: The column coordinates of the target centroid point with the largest brightness value among the multiple target centroid points located in the center row are determined as the horizontal coordinate of the optical center; the row coordinates of the target centroid point with the largest brightness value among the multiple target centroid points located in the center column are determined as the vertical coordinate of the optical center.

[0118] In this optional implementation, after the optical center calibration device obtains the brightness value of each target center point, it can compare the brightness values ​​of all target center points in the center row, and determine the column coordinates of the target center point with the largest brightness value as the horizontal coordinate of the optical center; then compare the brightness values ​​of all target center points in the center column, and determine the row coordinates of the target center point with the largest brightness value as the vertical coordinate of the optical center.

[0119] For example, assuming that there are 7 target centroids in both the center row and the center column, the three-dimensional coordinates of the target centroids in the center row are (650, 2930, 58.89), (650, 2934, 60.13), (632, 2976, 62.04), (661, 3001, 68.37), (642, 3016, 66.26), (656, 3082, 60.99), and (670, 3099, 55.12), and the three-dimensional coordinates of the target centroids in the center column are (590, 3063, 7 7.85), (599, 2988, 68.48), (628, 3005, 60.48), (661, 3001, 68.37), (669, 3105, 58.47), (682, 3023, 75.48), (699, 3054, 61.18); after comparison, it can be obtained that the column coordinates of the centroid point with the largest brightness value located in the center row are 3001, and the row coordinates of the centroid point with the largest brightness value located in the center column are 590, so the optical center of the target lens is (3001, 590).

[0120] Furthermore, if there are at least two target centroid points in the center row with the same brightness value, and the brightness value is greater than the brightness value of other target centroid points in the center row, then the optical center calibration device can determine the column coordinate average of the at least two target centroid points as the horizontal coordinate of the optical center; if there are at least two target centroid points in the center column with the same brightness value, and the brightness value is greater than the brightness value of other target centroid points in the center column, then the optical center calibration device can determine the row coordinate average of the at least two target centroid points as the vertical coordinate of the optical center.

[0121] For example, assuming that there are 7 target centroids in both the center row and the center column, the three-dimensional coordinates of the target centroids in the center row are (650, 2930, 68.37), (650, 2934, 60.13), (632, 2976, 62.04), (661, 3001, 68.37), (642, 3016, 66.26), (656, 3082, 60.99), (670, 3099, 55.12), and the three-dimensional coordinates of the target centroids in the center column are (590, 3063, 77.85), (599, 2988, 68.48), (628, 3005, 60.48), (661, 30 01, 68.37), (669, 3105, 58.47), (682, 3023, 75.48), (699, 3054, 77.85); after comparison, it can be obtained that the maximum brightness value at the center row is 68.37, and the brightness values ​​of the two centroids are both 68.37. The average value of the column coordinates of the two centroids is (2930+3001) / 2=2965.5; the maximum brightness value at the center column is 77.85, and the brightness values ​​of the two centroids are both 77.85. The average value of the row coordinates of the two centroids is (590+699) / 2=644.5. Therefore, the optical center of the target lens is (2965.5, 644.5).

[0122] Implementation method 2: Perform curve fitting based on the column coordinates of multiple target centroid points located in the center row and the brightness value of each target centroid point located in the center row to obtain a center row brightness fitting curve; perform curve fitting based on the row coordinates of multiple target centroid points located in the center column and the brightness value of each target centroid point located in the center column to obtain a center column brightness fitting curve; determine the column coordinate corresponding to the maximum brightness value in the center row brightness fitting curve as the horizontal coordinate of the optical center, and determine the row coordinate corresponding to the maximum brightness value in the center column brightness fitting curve as the vertical coordinate of the optical center.

[0123] In this implementation, after the optical center calibration device obtains the brightness value of each target centroid point, it can perform curve fitting on the target centroid point of the center row and the target centroid point of the center column. That is, for the target centroid point of the center row, a center row brightness fitting curve is drawn based on the brightness value and column coordinates of the target centroid point; for the target centroid point of the center column, a center column brightness fitting curve is drawn based on the brightness value and row coordinates of the target centroid point. Then, the highest point of the center row brightness fitting curve, that is, the point with the largest brightness value, is determined as the horizontal coordinate of the optical center, and the row coordinate corresponding to the highest point of the center column brightness fitting curve, that is, the point with the largest brightness value, is determined as the vertical coordinate of the optical center.

[0124] It should be noted that, when performing curve fitting, the optical center calibration device may select polynomial fitting, where the degree of the polynomial is greater than or equal to 2.

[0125] An embodiment of the present invention provides an optical center calibration method. This device can determine the optical center of a target lens by capturing a target image using a checkerboard test chart. The device then calculates the coordinates of multiple centroids corresponding to multiple preset patterns in the target image to determine the optical center of the target lens. In this scheme, because the checkerboard test chart includes two patterns with different pixel values, the difference in brightness values ​​between the target images captured using the checkerboard test chart is more pronounced. Consequently, the error in the optical center with the maximum imaging brightness value, obtained based on multiple centroids in the target image, is minimized.

[0126] Example 2

[0127] like Figure 6 As shown, an embodiment of the present invention provides an optical center calibration method, which may further include the following steps:

[0128] 601. Shoot a checkerboard test chart through a target lens to obtain a first image.

[0129] 602. Perform grayscale processing and binarization processing on the first image to obtain a second image.

[0130] In an embodiment of the present invention, the optical center calibration device can first perform grayscale processing on the first image obtained by shooting, that is, convert the RGB value of the first image into a YUV value, and only retain the value of the Y channel; and then perform binarization processing, that is, binarize the grayscale image according to a given threshold, and set the pixel value of the pixel point with a grayscale value greater than the threshold to 255, and set the pixel value of the pixel point with a grayscale value less than the threshold to 0.

[0131] YUV is an optional color encoding method primarily used to optimize color signal transmission. Its greatest advantage over RGB signal transmission is that it requires significantly less bandwidth (RGB requires the simultaneous transmission of three independent color signals). "Y" is a baseband signal representing brightness (luminance), or grayscale values. "U" and "V" represent chrominance, describing the color and saturation of an image and specifying the color of a pixel. U and V are orthogonally modulated signals. The YUV color model is derived from the RGB model. Its characteristic is the separation of brightness and chrominance, making it more suitable for image processing.

[0132] Optionally, there is a certain conversion relationship between RGB values ​​and YUV values.

[0133] The usual conversion relationship is shown in the following formula: Y = 0.299*R + 0.587*G + 0.114*B, U = -0.147*R - 0.289*G + 0.436*B, V = 0.615*R - 0.515*G - 0.100*B, R = Y + 1.140*V, G = Y - 0.394*U - 0.581*V, B = Y + 2.032*U.

[0134] Optionally, the above-mentioned binarization process can be performed using a threshold function. The threshold specified in the binarization process is to be able to distinguish the rectangular grid patterns of different colors from the background, that is, to correctly binarize the image; if the threshold is given too large or too small, the image will not be able to separate all the black blocks from the background. Therefore, the threshold will be determined according to the specific configuration of the lens.

[0135] 603. Perform pixel value inversion processing on the second image to obtain a third image.

[0136] In an embodiment of the present invention, the optical center calibration device obtains a second image after grayscale processing and binarization processing. Since there are only two types of pixel points with pixel values ​​of 0 and 255 in the second image, the optical center calibration device can perform pixel value inversion processing on the second image to obtain a third image; the pixel value inversion processing is to convert the pixel values ​​of the pixel points with pixel values ​​of zero in the second image into 255, and convert the pixel values ​​of the pixel points with pixel values ​​of 255 in the second image into zero.

[0137] 604. Amplify the pattern of the second pixel value in the third image according to a preset ratio to obtain a fourth image.

[0138] In an embodiment of the present invention, the optical center calibration device obtains a third image after pixel value inversion processing, and can enlarge the pattern in the third image whose pixel value is the second pixel value according to a preset ratio, so that the pattern in the third image whose pixel value is the first pixel value is reduced, thereby obtaining a fourth image.

[0139] It should be noted that, in the embodiment of the present invention, the second pixel value is 255 and the first pixel value is zero, that is, the optical center calibration device can enlarge the white rectangular grid pattern in the third image and reduce the black rectangular grid pattern in the third image.

[0140] It can be understood that in the third image, at least one of the four vertices of each black rectangular lattice pattern is shared with other black rectangular lattice patterns. Therefore, after the black rectangular lattice patterns are reduced, each black rectangular lattice pattern does not share vertices with other black rectangular lattice patterns, and each black rectangular lattice pattern is independent.

[0141] For example, Figure 7 As shown, in Figure 7 In the figure, Figure (a) is the third image after grayscale processing, binarization processing and pixel value inversion processing. The optical center calibration device enlarges each white rectangular grid pattern in the third image to reduce the black rectangular grid pattern, and the fourth image shown in Figure (b) can be obtained. In the fourth image shown in Figure (b), each black rectangular grid pattern is not connected to other black rectangular grid patterns.

[0142] 605. Adjust the pixel values ​​of the target area in the fourth image to the second pixel values ​​to obtain the target image.

[0143] In an embodiment of the present invention, after obtaining the fourth image, the optical center calibration device may adjust the pixel value of each pixel point in the target area of ​​the fourth image to the second pixel value, thereby obtaining the target image.

[0144] The target area is an area in the fourth image whose distance from the image boundary is less than a preset distance.

[0145] In this embodiment of the present invention, the second pixel value is 255.

[0146] For example, Figure 8 As shown, in Figure 8 In the figure, Figure (a) is the fourth image after a portion of the pattern is magnified. The optical center calibration device adjusts the pixel values ​​of multiple pixel points located at the four boundaries in the fourth image to 255, and the target image shown in Figure (b) can be obtained.

[0147] 606. Determine multiple contours of multiple preset patterns in the target image using a preset algorithm.

[0148] In an embodiment of the present invention, after the optical center calibration device obtains the target image, it can use a preset algorithm to calculate the contours of multiple preset patterns, and each preset pattern has a contour.

[0149] The preset algorithm may be a findContours function, and the pixel values ​​of the plurality of preset patterns are first pixel values.

[0150] In this embodiment of the present invention, the first pixel value is zero.

[0151] 607. Determine the centroid coordinates corresponding to each preset pattern based on the multiple contours.

[0152] In an embodiment of the present invention, after the optical center calibration device obtains the contours of multiple preset patterns, it can use a preset algorithm to calculate the centroid coordinates corresponding to each preset pattern, that is, calculate the centroid coordinates for each contour.

[0153] The centroid point is the center point of the contour where it is located, and the preset algorithm can be a moments function.

[0154] Optionally, the optical center calibration device can also filter the sizes of all contours in the target image after determining the coordinates of the center of mass point corresponding to each preset pattern, delete the contours and their center of mass points that are not within the preset contour range, and only retain the contours and their center of mass points that are within the preset contour range.

[0155] 608. Determine the optical center of the target lens according to the coordinates of the multiple centroid points.

[0156] An embodiment of the present invention provides an optical center calibration method. The optical center calibration device can obtain an image by photographing a checkerboard test chart. The image is then subjected to grayscale processing, binarization, pixel value inversion, and partial image magnification. The coordinates of the corresponding contours and centroid points of multiple preset patterns are then calculated to determine the optical center of a target lens. In this scheme, because the checkerboard test chart includes two patterns with different pixel values, the difference in brightness values ​​of the target image after processing the image obtained from the checkerboard test chart is more pronounced. Consequently, the error in the optical center with the maximum imaging brightness value obtained based on multiple centroid points in the target image is minimized.

[0157] Example 3

[0158] like Figure 9 As shown, an embodiment of the present invention provides an optical center calibration device, which includes:

[0159] An acquisition module 901 is configured to capture a checkerboard test chart through a target lens to obtain a target image;

[0160] A processing module 902 is configured to determine the coordinates of a plurality of centroid points corresponding to a plurality of preset patterns in a target image;

[0161] The processing module 902 is further configured to determine the optical center of the target lens according to the coordinates of the multiple centroid points.

[0162] Optionally, the processing module 902 is specifically configured to determine a plurality of target centroid points located in a center row and a center column according to the coordinates of the plurality of centroid points;

[0163] The processing module 902 is specifically configured to determine the optical center of the target lens according to the brightness values ​​of the plurality of target centroid points;

[0164] The brightness value of each centroid point is the average brightness value of the pixels within the preset area where the centroid point is located.

[0165] Optionally, the processing module 902 is specifically configured to determine, based on the coordinates of the multiple target centroids, N centroids closest to each target centroid, where N is an integer greater than or equal to 3;

[0166] The processing module 902 is specifically configured to determine a brightness coordinate function corresponding to each target centroid point based on the N centroid points closest to each target centroid point;

[0167] The processing module 902 is specifically configured to substitute the coordinates of the plurality of target centroids into corresponding brightness coordinate functions to obtain brightness values ​​corresponding to the plurality of target centroids;

[0168] The processing module 902 is specifically configured to determine the optical center of the target lens according to the brightness values ​​corresponding to the plurality of target centroid points.

[0169] Optionally, the processing module 902 is specifically configured to determine the column coordinates of the target mass point with the largest brightness value among the multiple target mass points located in the center row as the horizontal coordinate of the optical center;

[0170] The processing module 902 is specifically configured to determine the row coordinate of the target mass center point with the largest brightness value among the multiple target mass center points located in the center column as the vertical coordinate of the optical center.

[0171] Optionally, the processing module 902 is specifically configured to perform curve fitting based on the column coordinates of the plurality of target centroid points located in the center row and the brightness value of each target centroid point located in the center row to obtain a center row brightness fitting curve;

[0172] Processing module 902 is specifically configured to perform curve fitting based on the row coordinates of multiple target centroid points located in the center column and the brightness value of each target centroid point located in the center column to obtain a center column brightness fitting curve;

[0173] The processing module 902 is specifically configured to determine the column coordinate corresponding to the maximum brightness value in the center row brightness fitting curve as the abscissa of the optical center, and determine the row coordinate corresponding to the maximum brightness value in the center column brightness fitting curve as the ordinate of the optical center.

[0174] Optionally, the processing module 902 is specifically configured to determine, by a preset algorithm, multiple contours of multiple preset patterns in the target image, where pixel values ​​of the multiple preset patterns are first pixel values, and each preset pattern has one contour;

[0175] The processing module 902 is specifically configured to determine the coordinates of the centroid point corresponding to each preset pattern according to the multiple contours.

[0176] Optionally, the acquisition module 901 is specifically configured to capture a checkerboard test chart through a target lens to obtain a first image;

[0177] The processing module 902 is specifically configured to perform grayscale processing and binarization processing on the first image to obtain a second image;

[0178] The processing module 902 is specifically configured to perform pixel value inversion processing on the second image to obtain a third image;

[0179] The processing module 902 is specifically configured to amplify the pattern of the second pixel value in the third image according to a preset ratio to obtain a fourth image;

[0180] The processing module 902 is specifically configured to adjust the pixel values ​​of the target area in the fourth image to the second pixel values ​​to obtain the target image;

[0181] The target area is an area in the fourth image whose distance from the image boundary is less than a preset distance.

[0182] Optionally, the acquisition module 901 is specifically configured to acquire brightness values ​​of the plurality of centroid points;

[0183] The processing module 902 is specifically configured to determine the brightness value of each pixel in the target image by surface interpolation according to the coordinates and brightness values ​​of the multiple centroid points;

[0184] The processing module 902 is specifically configured to determine the optical center of the target lens according to the brightness value of each pixel.

[0185] In the embodiment of the present invention, each module can implement the optical center calibration method provided by the above method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described here.

[0186] like Figure 10 As shown, an embodiment of the present invention further provides an optical center calibration device, which may include:

[0187] A memory 1001 storing executable program code;

[0188] a processor 1002 coupled to the memory 1001;

[0189] The processor 1002 calls the executable program code stored in the memory 1001 to execute the optical center calibration method performed by the optical center calibration device in each of the above method embodiments.

[0190] An embodiment of the present invention provides a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute part or all of the steps of the method in the above method embodiments.

[0191] An embodiment of the present invention further provides a computer program product, wherein when the computer program product is run on a computer, the computer is caused to execute part or all of the steps of the method in the above method embodiments.

[0192] An embodiment of the present invention further provides an application publishing platform, wherein the application publishing platform is used to publish a computer program product, wherein when the computer program product runs on a computer, the computer executes part or all of the steps of the method in the above method embodiments.

[0193] It should be understood that references to "one embodiment" or "an embodiment" throughout this specification mean that specific features, structures, or characteristics associated with the embodiment are included in at least one embodiment of the present invention. Therefore, the phrases "in one embodiment" or "in an embodiment" appearing throughout this specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. Those skilled in the art should also be aware that the embodiments described in this specification are all optional embodiments, and the actions and modules involved are not necessarily required for the present invention.

[0194] In various embodiments of the present invention, it should be understood that the size of the serial numbers of the above-mentioned processes does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0195] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one place or distributed across multiple network units. Some or all of these units may be selected based on actual needs to achieve the objectives of this embodiment.

[0196] In addition, the functional units in the embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0197] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-accessible memory. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several requests for causing a computer device (which can be a personal computer, server, or network device, specifically a processor in the computer device) to execute some or all of the steps of the above-mentioned methods of various embodiments of the present invention.

[0198] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program. The program can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium capable of carrying or storing data.

Claims

1. An optical center calibration method, characterized in that: The optical center calibration method includes: Shoot the checkerboard test chart through the target lens to obtain the target image; Determining the coordinates of a plurality of centroid points corresponding to a plurality of preset patterns in the target image; determining the optical center of the target lens according to the coordinates of the multiple centroid points; Determining the optical center of the target lens according to the coordinates of the multiple centroid points includes: Determining a plurality of target centroid points located in a center row and a center column according to the coordinates of the plurality of centroid points; Determine the column coordinate of the target mass center point with the largest brightness value among the multiple target mass center points located in the center row as the abscissa of the optical center; The row coordinate of the target mass center point with the largest brightness value among the multiple target mass center points located in the center column is determined as the vertical coordinate of the optical center.

2. The method according to claim 1, characterized in that The brightness value of each centroid point is the average brightness value of the pixels within the preset area where the centroid point is located.

3. The method according to claim 2, characterized in that Determining the optical center of the target lens according to the brightness values ​​of the multiple target centroid points includes: Determine, based on the coordinates of the multiple target centroids, the N centroids closest to each target centroid, where N is an integer greater than or equal to 3; Determine the brightness coordinate function corresponding to each target centroid point based on the N centroid points closest to each target centroid point; Substituting the coordinates of the plurality of target mass center points into corresponding brightness coordinate functions respectively to obtain brightness values ​​corresponding to the plurality of target mass center points respectively; The optical center of the target lens is determined according to the brightness values ​​respectively corresponding to the multiple target centroid points.

4. The method according to claim 3, characterized in that The determining the optical center of the target lens according to the multiple brightness values ​​corresponding to the multiple target centroid points includes: Performing curve fitting based on the column coordinates of multiple target centroid points located in the center row and the brightness value of each target centroid point located in the center row to obtain a center row brightness fitting curve; Performing curve fitting based on the row coordinates of multiple target centroid points located in the center column and the brightness value of each target centroid point located in the center column to obtain a center column brightness fitting curve; The column coordinate corresponding to the maximum brightness value in the center row brightness fitting curve is determined as the abscissa of the optical center, and the row coordinate corresponding to the maximum brightness value in the center column brightness fitting curve is determined as the ordinate of the optical center.

5. The method according to claim 1, wherein The determining the coordinates of a plurality of centroid points corresponding to a plurality of preset patterns in the target image includes: Determining, by a preset algorithm, a plurality of contours of the plurality of preset patterns in the target image, wherein pixel values ​​of the plurality of preset patterns are first pixel values, and each preset pattern has a contour; Determine the centroid coordinates corresponding to each preset pattern according to the multiple contours.

6. The method according to claim 1, characterized in that The method of shooting a checkerboard test chart through a target lens to obtain a target image includes: Shooting the checkerboard test chart through the target lens to obtain a first image; performing grayscale processing and binarization processing on the first image to obtain a second image; performing pixel value inversion processing on the second image to obtain a third image; amplifying the pattern of the second pixel value in the third image according to a preset ratio to obtain a fourth image; Adjusting the pixel values ​​of the target area in the fourth image to the second pixel values ​​to obtain the target image; The target area is an area in the fourth image whose distance from the image boundary is less than a preset distance.

7. The method according to claim 6, characterized in that Determining the optical center of the target lens according to the coordinates of the multiple centroid points includes: Obtaining brightness values ​​of the multiple centroid points; Determining the brightness value of each pixel in the target image by surface interpolation according to the coordinates and brightness values ​​of the multiple centroid points; The optical center of the target lens is determined according to the brightness value of each pixel.

8. An optical center calibration device, characterized in that: include: An acquisition module is used to shoot a checkerboard test chart through a target lens to obtain a target image; a processing module, configured to determine coordinates of a plurality of centroid points corresponding to a plurality of preset patterns in the target image; The processing module is further configured to determine the optical center of the target lens based on the coordinates of the multiple centroid points; The processing module is further configured to determine a plurality of target centroid points located in a center row and a center column based on the coordinates of the plurality of centroid points; The processing module is further configured to determine the column coordinate of the target mass point with the largest brightness value among the multiple target mass points located in the center row as the horizontal coordinate of the optical center; The processing module is further configured to determine the row coordinate of the target mass center point with the largest brightness value among the multiple target mass center points located in the center column as the vertical coordinate of the optical center.

9. An optical center calibration device, characterized in that: include: a memory storing executable program code; and a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the optical center calibration method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Camera parameter calibration method, device, apparatus and system

    CN109215082A

  • Camera calibration method and device, camera and computer readable storage medium

    CN110599548A