Multi-angle adaptive distortion rate calculation method and device, equipment and storage medium
Through the multi-angle adaptive distortion rate calculation method, the corner points and edge curves of the checkerboard image are identified and processed, and the straight lines are translated to calculate the distortion rate, which solves the accuracy problem of traditional methods in non-horizontal images and large distortion lenses. A more accurate distortion rate calculation is achieved.
Patent Information
- Application Number
- CN202411184934.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-08-27
AI Technical Summary
The traditional distortion rate calculation method is mainly applicable to horizontally placed checkerboard images, and the effect is poor when processing non-horizontal checkerboard images or lenses with large distortions, resulting in limited accuracy and reliability of image processing results.
Using multi-angle adaptive distortion rate calculation method, by identifying the corner points of the target checkerboard image, reshaping it into a corner point matrix, fitting the edge curve, determining the vertices where the edge curve intersects, and shifting the straight line to obtain a new vertex, and calculating Distortion rate, suitable for shooting situations at different angles.
It realizes the accurate solution to the distortion rate when the checkerboard image is rotated horizontally by two-dimensionally, improves the accuracy and applicability of the distortion rate calculation, and can flexibly deal with shooting situations at different angles.
Smart Images

Figure CN119172523A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of machine vision industrial detection technology, and specifically to a multi-angle adaptive distortion rate calculation method, device, equipment and storage medium. Background Art
[0002] Lens distortion refers to the phenomenon that straight objects in an image appear to bend or distort when formed due to imperfections in lens design and manufacturing as well as optical properties.
[0003] In the field of machine vision, accurate image processing and analysis are crucial for applications such as industrial inspection and automated production. Therefore, the correction of lens distortion and the calculation of distortion rate become a key link to ensure the accuracy and reliability of image processing results.
[0004] Traditional methods for calculating distortion rates are usually only applicable to horizontal checkerboard images and work better for lenses with smaller distortion. This method evaluates the distortion rate by calculating the minimum bounding rectangle of all corner points. However, this method may have limitations when processing non-horizontal checkerboard images or lenses with larger distortion. Summary of the invention
[0005] The present application provides a multi-angle adaptive distortion rate calculation method, device, equipment and storage medium, which have high applicability and can flexibly respond to shooting conditions at different angles, thereby achieving more accurate distortion rate calculation.
[0006] In a first aspect, an embodiment of the present application provides a multi-angle adaptive distortion rate calculation method, and the multi-angle adaptive distortion rate calculation method includes:
[0007] Identify the corner points of the target checkerboard image, and reshape it into a corresponding corner point matrix according to the number of rows and columns of the identified corner points;
[0008] Fitting edge curves according to edge points of the corner point matrix, determining first vertices where the edge curves intersect, connecting two adjacent first vertices to form a fitting straight line, and determining the maximum deviation point of the edge points relative to the fitting straight line;
[0009] Each of the fitting straight lines is translated to the maximum offset point, a second vertex formed by the intersection of the translated straight lines is obtained, and the distortion rate is calculated according to the positions of the first vertex and the second vertex.
[0010] In combination with the first aspect, in one implementation, fitting an edge curve according to edge points of the corner point matrix to determine a first vertex where the edge curves intersect includes:
[0011] Extracting the corner points of the first row, first column, last row and last column in the corner point matrix, and fitting four corresponding edge curves respectively;
[0012] The intersection points where two of the four edge curves intersect each other are taken as the first vertices.
[0013] In combination with the first aspect, in one implementation, translating each of the fitted straight lines to a maximum offset point, obtaining a second vertex formed by the intersection of the translated straight lines, and calculating the distortion rate according to positions of the first vertex and the second vertex, includes:
[0014] The four fitted straight lines are translated to their respective maximum offset points, the straight line equations are regenerated, and the intersection points of the four translated straight lines are taken as the second vertices;
[0015] The coordinates of the center point are calculated according to the coordinates of the second vertex, and the distortion rates of the upper left corner, lower left corner, upper right corner and lower right corner are determined according to the ratio of the distance from the first vertex to the second vertex to the distance from the second vertex to the center point.
[0016] In combination with the first aspect, in one implementation, the calculating the coordinates of the center point according to the coordinates of the second vertex, and determining the distortion rates of the upper left corner, the lower left corner, the upper right corner, and the lower right corner according to the ratio of the distance from the first vertex to the second vertex to the distance from the second vertex to the center point, respectively, include:
[0017] The average value of the horizontal coordinates and the average value of the vertical coordinates of the four second vertices are taken as the coordinates of the center point O;
[0018] According to the formula: DistLT = |AA'| / |OA'|, calculate the distortion rate of the upper left corner;
[0019] According to the formula: DistLT = |AA'| / |OA'|, calculate the distortion rate of the lower left corner;
[0020] According to the formula: DistLT = |AA'| / |OA'|, calculate the distortion rate of the upper right corner;
[0021] According to the formula: DistLT = |AA'| / |OA'|, calculate the distortion rate of the upper right corner;
[0022] Among them, A, B, C, and D are first vertices, and A', B', C', and D' are second vertices.
[0023] In combination with the first aspect, in one implementation, before identifying the corner points of the target checkerboard image, the method further includes:
[0024] Collect chessboard images at multiple angles to calculate the distortion correction parameters of the camera module;
[0025] A checkerboard image is corrected according to the distortion correction parameters to obtain a target checkerboard image.
[0026] In combination with the first aspect, in one implementation, collecting checkerboard images at multiple angles to calculate distortion correction parameters of the camera module includes:
[0027] Keeping the central optical axis of the lens unchanged, the camera module is translated and / or rotated around the center point to capture chessboard images at multiple angles;
[0028] The distortion correction parameters of the camera module are calculated based on the checkerboard images at multiple angles.
[0029] In combination with the first aspect, in one implementation, a checkerboard image is collected when the camera module is translated upward, translated downward, translated leftward, translated rightward, rotated clockwise around the center point, and rotated counterclockwise around the center point, and 10 checkerboard images are collected in each manner;
[0030] The camera distortion correction parameters are calculated based on 60 checkerboard images in 6 ways.
[0031] In a second aspect, an embodiment of the present application provides a multi-angle adaptive distortion rate calculation device, the multi-angle adaptive distortion rate calculation device comprising:
[0032] A recognition module is used to identify the corner points of the target checkerboard image and reshape it into a corresponding corner point matrix according to the number of rows and columns of the identified corner points;
[0033] A fitting module is configured to fit an edge curve according to the edge points of the corner point matrix, determine a first vertex where the edge curve intersects, connect two adjacent first vertices to form a fitting straight line, and determine a maximum deviation point of the edge point relative to the fitting straight line;
[0034] The calculation module is used to translate each of the fitting straight lines to the maximum offset point, obtain a second vertex formed by the intersection of the translated straight lines, and calculate the distortion rate according to the positions of the first vertex and the second vertex.
[0035] In a third aspect, an embodiment of the present application provides a multi-angle adaptive distortion rate calculation device, wherein the multi-angle adaptive distortion rate calculation device comprises a processor, a memory, and a multi-angle adaptive distortion rate calculation program stored in the memory and executable by the processor, wherein when the multi-angle adaptive distortion rate calculation program is executed by the processor, the steps of the above-mentioned multi-angle adaptive distortion rate calculation method are implemented.
[0036] In a fourth aspect, a computer-readable storage medium is provided, on which a multi-angle adaptive distortion rate calculation program is stored, wherein when the multi-angle adaptive distortion rate calculation program is executed by a processor, the steps of the multi-angle adaptive distortion rate calculation method described above are implemented.
[0037] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:
[0038] The multi-angle adaptive distortion rate calculation method in the present application identifies the corner points of the target checkerboard image, and reshapes it into a corresponding corner point matrix according to the number of rows and columns of the identified corner points; fits the edge curve according to the edge points of the corner point matrix, determines the first vertex where the edge curve intersects, connects two adjacent first vertices to form a fitting straight line, and determines the maximum deviation point of the edge point relative to the fitting straight line; translates each of the fitting straight lines to the maximum offset point, obtains the second vertex formed by the intersection of the translated straight lines, and calculates the distortion rate according to the positions of the first vertex and the second vertex.
[0039] This application uses curve fitting and translation based on the maximum deviation point to calculate the distortion rate. It can accurately solve the distortion rate when the checkerboard image undergoes horizontal two-dimensional rotation. This application has high applicability and can flexibly respond to shooting conditions at different angles, thereby achieving more accurate distortion rate calculation. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 This is a flow chart of an embodiment of a method for calculating a multi-angle adaptive distortion rate according to the present application;
[0041] Figure 2 A schematic diagram of a multi-angle chessboard image acquisition method for this application;
[0042] Figure 3 Process diagram for distortion correction and distortion rate calculation for this application;
[0043] Figure 4 Schematic diagram of edge curve and fitting straight line when calculating distortion rate for this application;
[0044] Figure 5 This is a structural block diagram of an embodiment of a multi-angle adaptive distortion rate calculation device of the present application;
[0045] Figure 6 This is a schematic diagram of the hardware structure of the multi-angle adaptive distortion rate calculation device involved in the embodiment of the present application. DETAILED DESCRIPTION
[0046] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0047] The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices. The terms "first", "second" and "third" are used to distinguish different objects, etc., and do not represent a sequence, nor do they limit "first", "second" and "third" to different types.
[0048] In the description of the embodiments of the present application, "exemplary", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a specific way.
[0049] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; the “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two.
[0050] In some processes described in the embodiments of the present application, multiple operations or steps that appear in a specific order are included, but it should be understood that these operations or steps may not be executed in the order in which they appear in the embodiments of the present application or in parallel, and the sequence number of the operation is only used to distinguish the different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed in sequence or in parallel, and these operations or steps may be combined.
[0051] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0052] In a first aspect, an embodiment of the present application provides a multi-angle adaptive distortion rate calculation method.
[0053] In one embodiment, referring to Figure 1 , Figure 1 This is a flow chart of an embodiment of a method for calculating a multi-angle adaptive distortion rate according to the present invention. Figure 1As shown, the multi-angle adaptive distortion rate calculation method includes:
[0054] S1, identify the corner points of the target chessboard image, and reshape it into a corresponding corner point matrix according to the number of rows and columns of the identified corner points;
[0055] It is worth mentioning that to reshape the identified corner points into a corner point matrix of corresponding size, you need to first ensure that there is an array containing all corner point coordinates, that is, a two-dimensional array (horizontal and vertical coordinates) containing all corner point coordinates. After determining the number of rows and columns of the chessboard, you can start reshaping. In addition, to calculate the distortion rate, you can directly collect the chessboard image and then perform the calculation. In the actual production process, for example, for fisheye lenses, the camera module needs to be calibrated first to obtain its internal parameters and distortion parameters, and then use the calibrated parameters to correct the chessboard image, and finally calculate the distortion rate to determine whether it meets the index requirements.
[0056] To this end, before step S1, the following steps are also included:
[0057] Collect chessboard images at multiple angles to calculate the distortion correction parameters of the camera module;
[0058] A checkerboard image is corrected according to the distortion correction parameters to obtain a target checkerboard image.
[0059] Specifically, the camera module includes a camera and a lens. The method adopted in this embodiment is to keep the central optical axis of the lens unchanged, and collect checkerboard images at multiple angles by translating the camera module and / or rotating it around the center point; the distortion correction parameters of the camera module are calculated based on the checkerboard images at multiple angles.
[0060] See also Figure 2 As shown, a specific implementation method is given. Figure 2 In the figure, the image was translated to the left, right, up, and down, and 10 checkerboard images were collected in each direction. In addition, it was rotated clockwise and counterclockwise around the center, and 10 checkerboard images were collected in each rotation direction.
[0061] Then import these 60 checkerboard images into MATLAB, and use the detectCheckerboardPoints function (MATLAB internal function) in MATLAB's camera calibration toolbox to detect checkerboard corner points. Checkerboard corner points are a commonly used marker point for camera calibration and other geometric transformation tasks in computer vision, which are the intersection points of black and white on the checkerboard.
[0062] For the detectCheckerboardPoints function:
[0063] [imagePoints,boardSize,imagesUsed]=detectCheckerboardPoints(images);
[0064] boardSize: This is a two-element vector [rows, columns], indicating the number of rows and columns of the inner corner points of the chessboard;
[0065] imagePoints: stores the coordinates of the corner points detected in each image;
[0066] In addition, you need to set the world coordinates of the chessboard:
[0067] Define the actual world coordinates of the corner points on the chessboard;
[0068] squareSize=50%; the actual side length of each square on the photographed chess and card grid, in millimeters;
[0069] worldPoints=generateCheckerboardPoints(boardSize,squareSize);
[0070] In this embodiment, when performing camera calibration, in MATLAB:
[0071] Use the estimateCameraParameters function to estimate the camera intrinsic parameters and distortion parameters;
[0072] [cameraParams,imagesUsed,estimationErrors]=estimateCameraParameters(ima gePoints,worldPoints);
[0073] Use the undistortImage function to correct the distorted image;
[0074] undistortedImage=undistortImage(distortedImage,cameraParams);
[0075] The calibration parameters refer to cameraParams, which includes the following parameters:
[0076] Radial distortion parameter (cameraParams.RadialDistortion): used to correct the stretching or contraction of the image in the radial direction.
[0077] Tangential distortion parameter (cameraParams.TangentialDistortion): used to correct the tangential distortion caused by the incomplete parallelism or poor alignment between the lens and the image sensor.
[0078] Camera internal parameters, including:
[0079] Focal length (cameraParams.FocalLength): describes the focal length of the camera lens;
[0080] Principal point (cameraParams.PrincipalPoint): The principal point of the image, usually the center of the image;
[0081] Intrinsic corner matrix (cameraParams.IntrinsicMatrix): Contains information about focal length and principal point.
[0082] S2, fitting an edge curve according to the edge points of the corner point matrix, determining a first vertex where the edge curve intersects, connecting two adjacent first vertices to form a fitting straight line, and determining a maximum deviation point of the edge point relative to the fitting straight line;
[0083] In specific implementation, this embodiment extracts the corner points of the first row, first column, last row and last column in the corner point matrix, and fits four corresponding edge curves respectively; the intersection points of the four edge curves are taken as the first vertices. The corner points of the first row, first column, last row and last column correspond to the outermost corner points, and the outermost edge curves are generated by these corner points. For specific curves, see Figure 4 shown.
[0084] It can be understood that there are 4 intersection points where two of the four edge curves intersect each other, and connecting two adjacent first vertices to form a fitting straight line, there are 4 fitting straight lines in total, and the shape is similar to a rectangle. Then, by calculating the vertical distance, the maximum deviation point from the fitting straight line can be found.
[0085] S3, translating each of the fitting straight lines to the maximum offset point, obtaining a second vertex formed by the intersection of the translated straight lines, and calculating the distortion rate according to the positions of the first vertex and the second vertex.
[0086] In specific implementation, the method adopted in this embodiment is:
[0087] The four fitted straight lines are translated to their respective maximum offset points, and the straight line equations are regenerated. The intersection points of the four translated straight lines are taken as the second vertices. The coordinates of the center point are calculated according to the coordinates of the second vertex. The distortion rates of the upper left corner, lower left corner, upper right corner and lower right corner are determined according to the ratio of the distance from the first vertex to the second vertex to the distance from the second vertex to the center point.
[0088] See also Figure 3 As shown, it is a process diagram of distortion correction and distortion rate calculation of the present application. After obtaining the distortion correction parameters, the checkerboard image can be corrected, and then the distortion rate can be calculated to evaluate whether the camera meets the requirements.
[0089] It is worth noting that in the prior art, the distortion rate is evaluated by calculating the minimum enclosing rectangle of all corner points. This method may have limitations when processing non-horizontal checkerboard images or lenses with large distortion. This is mainly because the shape of the non-horizontal checkerboard image may have problems when determining the minimum enclosing rectangle, resulting in inaccurate distortion rate calculation. In this embodiment, the problem of the minimum enclosing rectangle can be well solved by determining the vertex and the maximum offset point, so that it can flexibly cope with shooting conditions at different angles, thereby achieving more accurate distortion rate calculation.
[0090] The following is a specific example to further illustrate:
[0091] See also Figure 4 As shown, Figure 4 The upper left corner (A), lower left corner (B), lower right corner (C) and upper right corner (D) are the positions of the four first vertices.
[0092] By fitting a straight line for every two adjacent vertices, we can get straight lines AB, AD, BC, and CD. By calculating the vertical distances from all edge curves to the fitted straight lines, we can find the four maximum deviation points maxDitance.
[0093] Translate the fitted straight line to the maximum offset point and redefine the straight line equation. 9. Calculate the intersection points of the translated straight line to obtain the four new intersection points of the rectangle (A', B', C' and D').
[0094] Among them, A'=[X1,Y1], B'=[X2,Y2], C'=[X3,Y3], D'=[X4,Y4], A=[x1,y1], B=[x2,y2], C=[x3,y3], D=[x4,y4];
[0095] The coordinates of point O:
[0096] O=[(X1+X2+X3+X4) / 4,(Y1+Y2+Y3+Y4) / 4];
[0097] Thus, the distortion rate of the upper left corner is: DistLT = |AA'| / |OA'|, where |AA'| is the distance between the second vertex and the first vertex A, and |OA'| is the distance from the image calculation point A' to the center O. The following parameters are similar.
[0098] Distortion rate of the lower left corner: DistLB = |BB'| / |OB'|;
[0099] Distortion rate of the lower right corner: DistRB = |CC'| / |OC'|;
[0100] Distortion rate in the upper right corner: DistRT = |DD'| / |OD'|.
[0101] At this point, the distortion rate of the checkerboard image is determined.
[0102] In summary, the multi-angle adaptive distortion rate calculation method in the present application identifies the corner points of the target checkerboard image, and reshapes it into a corresponding corner point matrix according to the number of rows and columns of the identified corner points; fits the edge curve according to the edge points of the corner point matrix, determines the first vertex where the edge curve intersects, connects two adjacent first vertices to form a fitting straight line, and determines the maximum deviation point of the edge point relative to the fitting straight line; translates each of the fitting straight lines to the maximum offset point, obtains the second vertex formed by the intersection of the translated straight lines, and calculates the distortion rate according to the positions of the first vertex and the second vertex.
[0103] This application uses curve fitting and translation based on the maximum deviation point to calculate the distortion rate. It can accurately solve the distortion rate when the checkerboard image undergoes horizontal two-dimensional rotation. This application has high applicability and can flexibly respond to shooting conditions at different angles, thereby achieving more accurate distortion rate calculation.
[0104] In a second aspect, an embodiment of the present application also provides a multi-angle adaptive distortion rate calculation device.
[0105] In one embodiment, referring to Figure 5 , Figure 5 This is a functional module diagram of an embodiment of a multi-angle adaptive distortion rate calculation device of the present application. Figure 5 As shown, the multi-angle adaptive distortion rate calculation device includes an identification module, a fitting module and a calculation module.
[0106] Among them, the recognition module is used to identify the corner points of the target chessboard image, and reshape it into a corresponding corner point matrix according to the number of rows and columns of the identified corner points;
[0107] A fitting module is configured to fit an edge curve according to the edge points of the corner point matrix, determine a first vertex where the edge curve intersects, connect two adjacent first vertices to form a fitting straight line, and determine a maximum deviation point of the edge point relative to the fitting straight line;
[0108] The calculation module is used to translate each of the fitting straight lines to the maximum offset point, obtain a second vertex formed by the intersection of the translated straight lines, and calculate the distortion rate according to the positions of the first vertex and the second vertex.
[0109] Furthermore, in one embodiment, the fitting module fits the edge curve according to the edge points of the corner point matrix to determine the first vertex where the edge curve intersects, including:
[0110] Extracting the corner points of the first row, first column, last row and last column in the corner point matrix, and fitting four corresponding edge curves respectively;
[0111] The intersection points where two of the four edge curves intersect each other are taken as the first vertices.
[0112] Further, in one embodiment, the calculation module translates each of the fitting straight lines to a maximum offset point, obtains a second vertex formed by the intersection of the translated straight lines, and calculates the distortion rate according to the positions of the first vertex and the second vertex, including:
[0113] The four fitted straight lines are translated to their respective maximum offset points, the straight line equations are regenerated, and the intersection points of the four translated straight lines are taken as the second vertices;
[0114] The coordinates of the center point are calculated according to the coordinates of the second vertex, and the distortion rates of the upper left corner, lower left corner, upper right corner and lower right corner are determined according to the ratio of the distance from the first vertex to the second vertex to the distance from the second vertex to the center point.
[0115] Further, in one embodiment, the calculation module calculates the coordinates of the center point according to the coordinates of the second vertex, and determines the distortion rates of the upper left corner, the lower left corner, the upper right corner, and the lower right corner according to the ratio of the distance from the first vertex to the second vertex to the distance from the second vertex to the center point, including:
[0116] The average value of the horizontal coordinates and the average value of the vertical coordinates of the four second vertices are taken as the coordinates of the center point O;
[0117] According to the formula: DistLT = |AA'| / |OA'|, calculate the distortion rate of the upper left corner;
[0118] According to the formula: DistLT = |AA'| / |OA'|, calculate the distortion rate of the lower left corner;
[0119] According to the formula: DistLT = |AA'| / |OA'|, calculate the distortion rate of the upper right corner;
[0120] According to the formula: DistLT = |AA'| / |OA'|, calculate the distortion rate of the upper right corner;
[0121] Among them, A, B, C, and D are first vertices, and A', B', C', and D' are second vertices.
[0122] Furthermore, in one embodiment, a collection module is further included, and before the recognition module recognizes the corner points of the target chessboard image, the collection module is also used to:
[0123] Collect chessboard images at multiple angles to calculate the distortion correction parameters of the camera module;
[0124] A checkerboard image is corrected according to the distortion correction parameters to obtain a target checkerboard image.
[0125] Furthermore, in one embodiment, the acquisition module acquires checkerboard images at multiple angles to calculate the distortion correction parameters of the camera module, including:
[0126] Keeping the central optical axis of the lens unchanged, the camera module is translated and / or rotated around the center point to capture chessboard images at multiple angles;
[0127] The distortion correction parameters of the camera module are calculated based on the checkerboard images at multiple angles.
[0128] Further, in one embodiment, the acquisition module is used to: acquire chessboard images when the camera module is translated upward, translated downward, translated leftward, translated rightward, rotated clockwise around the center point, and rotated counterclockwise around the center point, and 10 chessboard images are acquired in each manner;
[0129] The camera distortion correction parameters are calculated based on 60 checkerboard images in 6 ways.
[0130] Among them, the functional implementation of each module in the above-mentioned multi-angle adaptive distortion rate calculation device corresponds to the various steps in the above-mentioned multi-angle adaptive distortion rate calculation method embodiment, and its functions and implementation processes are no longer repeated here one by one.
[0131] In a third aspect, an embodiment of the present application provides a multi-angle adaptive distortion rate calculation device, which may be a personal computer (PC), a laptop computer, a server, or other device with data processing capabilities.
[0132] Reference Figure 6 , Figure 6 The hardware structure diagram of the multi-angle adaptive distortion rate calculation device involved in the embodiment of the present application is shown in FIG. In the embodiment of the present application, the multi-angle adaptive distortion rate calculation device may include a processor, a memory, a communication interface, and a communication bus.
[0133] The communication bus may be of any type and is used to interconnect the processor, the memory, and the communication interface.
[0134] The communication interface includes an input / output (I / O) interface, a physical interface, and a logical interface, etc., which are used to interconnect the devices inside the multi-angle adaptive distortion rate calculation device, and an interface used to interconnect the multi-angle adaptive distortion rate calculation device with other devices (such as other computing devices or user devices). The physical interface can be an Ethernet interface, an optical fiber interface, an ATM interface, etc.; the user device can be a display, a keyboard, etc.
[0135] The memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.
[0136] The processor may be a general-purpose processor, and the general-purpose processor may call the multi-angle adaptive distortion rate calculation program stored in the memory, and execute the multi-angle adaptive distortion rate calculation method provided in the embodiment of the present application. For example, the general-purpose processor may be a central processing unit (CPU). The method executed when the multi-angle adaptive distortion rate calculation program is called may refer to the various embodiments of the multi-angle adaptive distortion rate calculation method of the present application, and will not be repeated here.
[0137] Those skilled in the art will understand that Figure 6 The hardware structure shown in the figure does not constitute a limitation on the present application, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0138] In a fourth aspect, an embodiment of the present application also provides a readable storage medium.
[0139] The readable storage medium of the present application stores a multi-angle adaptive distortion rate calculation program, wherein when the multi-angle adaptive distortion rate calculation program is executed by a processor, the steps of the multi-angle adaptive distortion rate calculation method as described above are implemented.
[0140] Among them, the method implemented when the multi-angle adaptive distortion rate calculation program is executed can refer to the various embodiments of the multi-angle adaptive distortion rate calculation method of the present application, and will not be repeated here.
[0141] It should be noted that the serial numbers of the above-mentioned embodiments of the present application are only for description and do not represent the advantages or disadvantages of the embodiments.
[0142] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD) as described above, and includes a number of instructions for a terminal device to execute the methods described in each embodiment of the present application.
[0143] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A multi-angle adaptive distortion rate calculation method, characterized in that: The multi-angle adaptive distortion rate calculation method comprises: Identify the corner points of the target checkerboard image, and reshape it into a corresponding corner point matrix according to the number of rows and columns of the identified corner points; Fitting edge curves according to edge points of the corner point matrix, determining first vertices where edge curves intersect, connecting two adjacent first vertices to form a fitting straight line, and determining the maximum deviation point of edge points relative to the fitting straight line; Each of the fitting straight lines is translated to the maximum offset point, a second vertex formed by the intersection of the translated straight lines is obtained, and the distortion rate is calculated according to the positions of the first vertex and the second vertex.
2. The multi-angle adaptive distortion rate calculation method according to claim 1, characterized in that: The step of fitting an edge curve according to the edge points of the corner point matrix to determine a first vertex where the edge curves intersect includes: Extracting the corner points of the first row, first column, last row and last column in the corner point matrix, and fitting four corresponding edge curves respectively; The intersection points where two of the four edge curves intersect each other are taken as the first vertices.
3. The multi-angle adaptive distortion rate calculation method according to claim 2, characterized in that: The step of translating each of the fitting straight lines to the maximum offset point, obtaining a second vertex formed by the intersection of the translated straight lines, and calculating the distortion rate according to the positions of the first vertex and the second vertex includes: The four fitted straight lines are translated to their respective maximum offset points, the straight line equations are regenerated, and the intersection points of the four translated straight lines are taken as the second vertices; The coordinates of the center point are calculated according to the coordinates of the second vertex, and the distortion rates of the upper left corner, lower left corner, upper right corner and lower right corner are determined according to the ratio of the distance from the first vertex to the second vertex to the distance from the second vertex to the center point.
4. The multi-angle adaptive distortion rate calculation method according to claim 3, characterized in that: The step of calculating the coordinates of the center point according to the coordinates of the second vertex, and determining the distortion rates of the upper left corner, the lower left corner, the upper right corner, and the lower right corner according to the ratio of the distance from the first vertex to the second vertex to the distance from the second vertex to the center point, includes: The average value of the horizontal coordinates and the average value of the vertical coordinates of the four second vertices are taken as the coordinates of the center point O; According to the formula: DistLT = |AA'| / |OA'|, calculate the distortion rate of the upper left corner; According to the formula: DistLT = |AA'| / |OA'|, calculate the distortion rate of the lower left corner; According to the formula: DistLT = |AA'| / |OA'|, calculate the distortion rate of the upper right corner; According to the formula: DistLT = |AA'| / |OA'|, calculate the distortion rate of the upper right corner; Among them, A, B, C, and D are first vertices, and A', B', C', and D' are second vertices.
5. The multi-angle adaptive distortion rate calculation method according to claim 1, characterized in that: Before identifying the corner points of the target chessboard image, the method further includes: Collect chessboard images at multiple angles to calculate the distortion correction parameters of the camera module; A checkerboard image is corrected according to the distortion correction parameters to obtain a target checkerboard image.
6. The multi-angle adaptive distortion rate calculation method according to claim 5, characterized in that: The step of collecting checkerboard images at multiple angles to calculate distortion correction parameters of the camera module includes: Keeping the central optical axis of the lens unchanged, the camera module is translated and / or rotated around the center point to capture chessboard images at multiple angles; The distortion correction parameters of the camera module are calculated based on the checkerboard images at multiple angles.
7. The multi-angle adaptive distortion rate calculation method according to claim 6, characterized in that: Collect chessboard images when the camera module moves upward, downward, left, right, rotates clockwise around the center point, and rotates counterclockwise around the center point. Each method collects 10 chessboard images. The camera distortion correction parameters are calculated based on 60 checkerboard images in 6 ways.
8. A multi-angle adaptive distortion rate calculation device, characterized in that: The multi-angle adaptive distortion rate calculation device comprises: A recognition module is used to identify the corner points of the target checkerboard image and reshape it into a corresponding corner point matrix according to the number of rows and columns of the identified corner points; A fitting module is configured to fit an edge curve according to the edge points of the corner point matrix, determine a first vertex where the edge curve intersects, connect two adjacent first vertices to form a fitting straight line, and determine a maximum deviation point of the edge point relative to the fitting straight line; The calculation module is used to translate each of the fitting straight lines to the maximum offset point, obtain a second vertex formed by the intersection of the translated straight lines, and calculate the distortion rate according to the positions of the first vertex and the second vertex.
9. A multi-angle adaptive distortion rate calculation device, characterized in that: The multi-angle adaptive distortion rate calculation device includes a processor, a memory, and a multi-angle adaptive distortion rate calculation program stored in the memory and executable by the processor, wherein when the multi-angle adaptive distortion rate calculation program is executed by the processor, the steps of the multi-angle adaptive distortion rate calculation method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a multi-angle adaptive distortion rate calculation program, wherein when the multi-angle adaptive distortion rate calculation program is executed by a processor, the steps of the multi-angle adaptive distortion rate calculation method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Camera distortion measurement method and test device
CN108924544A
Method and device for detecting module TV distortion by using checkerboard test table
CN110049314A
Camera lens distortion parameter estimation device and method
CN111429533A
Optical imaging module calibration method, distortion correction method and related equipment
CN114078165A
Image correction method and device, display equipment, storage medium and program product
CN116664437A
