Camera imaging quality evaluation method, device, equipment and storage medium
By calculating the inverse of the perspective transformation matrix and generating test images, the problem of evaluating the imaging quality of a camera under perspective angles was solved, achieving accurate imaging quality evaluation and improving computational efficiency.
Patent Information
- Application Number
- CN202111529620.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-14
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2041-12-14
AI Technical Summary
Existing methods for evaluating camera image quality cannot effectively assess the image quality of a camera at different perspective angles, especially the image quality under the combined influence of depth of field and perspective angle.
By determining the camera's pose parameters and field of view, the inverse of the perspective transformation matrix is calculated. Combined with object distance, pixel size, and phase distance, a test image is generated. The camera's imaging quality is then evaluated based on the target image of the test image, eliminating the influence of perspective distortion.
It can accurately evaluate the imaging quality of the camera at perspective angles, reduces the amount of computation, and eliminates the impact of perspective distortion on imaging quality.
Smart Images

Figure CN114049349B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of display, and particularly relates to a camera imaging quality evaluation method and device, equipment and storage medium. BACKGROUND
[0002] Optical Character Recognition (OCR) technology is a technology for analyzing and recognizing image files containing text data to obtain text and layout information. Most of the OCR solutions of intelligent products on the market are applied to perspective angle scenes, i.e., the optical axis of the camera has an inclination angle with the vertical direction. In the perspective angle scene, the camera will produce perspective distortion when shooting a standard chart.
[0003] However, for the above scene, the plane of the photographed object covers a certain depth of field, and the imaging quality of the camera is affected by the depth of field and the perspective angle, so the existing camera imaging quality evaluation method cannot be used to evaluate it. SUMMARY
[0004] The present disclosure provides a camera imaging quality evaluation method, device, equipment and storage medium, which can evaluate the imaging quality of the camera under the perspective angle.
[0005] In a first aspect, the present disclosure provides a camera imaging quality evaluation method, comprising:
[0006] determining an inverse matrix of a perspective transformation matrix according to a pose parameter and a field of view angle of the camera, the pose parameter comprising an included angle between an optical axis of the camera and an object plane, the included angle being greater than 0 degrees and less than 90 degrees;
[0007] determining a line width on the object plane according to an object distance, a pixel size and a distance from the camera;
[0008] generating a test picture according to the inverse matrix and the line width;
[0009] evaluating the imaging quality of the camera according to a target image of the test picture, the target image being obtained by the camera based on the pose parameter and the object distance to shoot the test picture located on the object plane.
[0010] Optionally, the determining the inverse matrix of the perspective transformation matrix according to the pose parameter and the field of view angle of the camera comprises:
[0011] determining first coordinates of a plurality of first target points in the field of view in a first coordinate system according to the pose parameter and the field of view angle;
[0012] determining second coordinates of a plurality of second target points in a second coordinate system, wherein the second target points and corresponding first target points and an optical center of the camera are located on a same straight line, and the second target points are located in a plane perpendicular to an optical axis of the camera and passing through an intersection of the optical axis and the object plane;
[0013] determining the inverse matrix according to the target correspondence relationship, the first coordinates and the second coordinates.
[0014] Optionally, before determining the inverse matrix according to the target correspondence relationship, the first coordinates and the second coordinates, the method further comprises:
[0015] determining a first correspondence relationship between the first coordinates and third coordinates of the plurality of first target points in the second coordinate system;
[0016] determining a second correspondence relationship between the third coordinates and the second coordinates;
[0017] determining the target correspondence relationship according to the first correspondence relationship and the second correspondence relationship.
[0018] Optionally, the determining the line width on the object plane according to the object distance, the pixel size and the distance further comprises:
[0019] determining a spatial frequency of the camera according to the pixel size;
[0020] determining a line width on an image plane according to the spatial frequency;
[0021] determining the line width on the object plane according to the line width on the image plane, the object distance and the distance.
[0022] Optionally, the determining the spatial frequency of the camera according to the pixel size further comprises:
[0023] determining a Nyquist frequency of the camera according to the pixel size;
[0024] determining the spatial frequency according to one half of the Nyquist frequency and / or one fourth of the Nyquist frequency.
[0025] Optionally, the generating the test picture according to the inverse matrix and the line width further comprises:
[0026] determining a font size of the text according to the line width;
[0027] determining a standard image according to the font size and the text to be displayed;
[0028] generating the test picture by transforming the standard image according to the inverse matrix.
[0029] Optionally, the evaluating the imaging quality of the camera according to the target image of the test picture comprises:
[0030] determining the recognition rate of the camera to the target image at different spatial frequencies according to the target image of the test picture at different spatial frequencies;
[0031] evaluating the imaging quality of the camera according to the recognition rate of the camera to the target image at different spatial frequencies.
[0032] Optionally, the evaluating the imaging quality of the camera according to the target image of the test picture comprises:
[0033] determining the modulation transfer function of the camera at different spatial frequencies according to the target image of the test picture at different spatial frequencies;
[0034] evaluating the imaging quality of the camera according to the modulation transfer function of the camera at different spatial frequencies.
[0035] In a second aspect, the present disclosure provides a device for evaluating the imaging quality of a camera, comprising:
[0036] a determining module configured to determine an inverse matrix of a perspective transformation matrix according to a pose parameter and a field of view angle of the camera, the pose parameter comprising an included angle between an optical axis of the camera and an object plane, the included angle being greater than 0 degrees and less than 90 degrees, and determine a line width on the object plane according to an object distance, a pixel size and a distance between the camera and the object plane;
[0037] a picture generating module configured to generate a test picture according to the inverse matrix and the line width;
[0038] an evaluating module configured to evaluate the imaging quality of the camera according to a target image of the test picture, the target image being obtained by the camera based on the pose parameter and the object distance and the test picture being located on the object plane.
[0039] In a third aspect, the present disclosure provides an electronic device, comprising: a processor configured to execute a computer program stored in a memory, the computer program being executed by the processor to implement the steps of any of the methods provided in the first aspect.
[0040] In a fourth aspect, the present disclosure provides a computer readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the steps of any of the methods provided in the first aspect.
[0041] In a fifth aspect, the present disclosure provides a computer program product, when the computer program product is executed on a computer, the computer program product causes the computer to execute the steps of any of the methods provided in the first aspect.
[0042] In the technical solution provided by the present disclosure, the inverse matrix of the perspective transformation matrix is determined according to the pose parameters and the field of view angle of the camera, the pose parameters include the included angle between the optical axis of the camera and the object plane, and the included angle is greater than 0 degrees and less than 90 degrees; the line width on the object plane is determined according to the object distance, the pixel size and the distance of the camera; the test picture is generated according to the inverse matrix and the line width; the imaging quality of the camera is evaluated according to the target image of the test picture, the target image is obtained by the camera based on the pose parameters and the object distance to shoot the test picture located on the object plane, since the object plane is not perpendicular to the optical axis of the camera, the camera produces perspective deformation when shooting the test picture, therefore, the target image is the perspective distortion image of the test picture, and the test picture is the picture obtained based on the inverse transformation of the perspective deformation, that is, the test picture is the inverse perspective distortion image of the standard image, that is, the target image is the image obtained by inversely perspective distorting the standard image and then perspective distorting, therefore, the target image is the standard non-distortion image, which can eliminate the influence of perspective distortion on the imaging quality of the camera, and thus, the imaging quality of the camera under the perspective angle can be evaluated based on the target image. BRIEF DESCRIPTION OF DRAWINGS
[0043] The accompanying drawings, which are incorporated into and form a part of the specification, illustrate an embodiment consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure.
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the accompanying drawings required to be used in the embodiments or prior art description will be briefly introduced as follows, and obviously, other drawings can also be obtained by those skilled in the art without creative labor.
[0045] Figure 1 A schematic diagram of a perspective angle application scenario provided by the present disclosure;
[0046] Figure 2 A schematic diagram of a perspective distortion image provided by the present disclosure;
[0047] Figure 3 A schematic diagram of an imaging system of a camera provided by the present disclosure;
[0048] Figure 4 A flowchart of an imaging quality evaluation method of a camera provided by the present disclosure;
[0049] Figure 5 A flowchart of another imaging quality evaluation method of a camera provided by the present disclosure;
[0050] Figure 6 A schematic diagram of a camera field of view provided by the present disclosure;
[0051] Figure 7 Another schematic diagram of a camera field of view provided for the present disclosure;
[0052] Figure 8 Another schematic diagram of a camera field of view provided for the present disclosure;
[0053] Figure 9 Another schematic diagram of a camera field of view provided for the present disclosure;
[0054] Figure 10 Another schematic diagram of a camera field of view provided for the present disclosure;
[0055] Figure 11 Another schematic diagram of a camera field of view provided for the present disclosure;
[0056] Figure 12 Another schematic diagram of a camera field of view provided for the present disclosure;
[0057] Figure 13 Another schematic diagram of a camera field of view provided for the present disclosure;
[0058] Figure 14 Another schematic diagram of a camera field of view provided for the present disclosure;
[0059] Figure 15 Another schematic diagram of a camera field of view provided for the present disclosure;
[0060] Figure 16 Another schematic diagram of a camera field of view provided for the present disclosure;
[0061] Figure 17 Another schematic diagram of a camera field of view provided for the present disclosure;
[0062] Figure 18 Another schematic diagram of a camera field of view provided for the present disclosure; DETAILED DESCRIPTION
[0063] In order to enable a more complete understanding of the above-mentioned objects, features and advantages of the present disclosure, the schemes of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0064] In the following description, a lot of specific details are set forth in order to facilitate a thorough understanding of the present disclosure, but the present disclosure can also be implemented in other different manners from those described herein; obviously, the embodiments described in the specification are only some embodiments of the present disclosure, not all embodiments.
[0065] Figure 1 This is a schematic diagram illustrating an application scenario of perspective angle provided in this disclosure, exemplified by, for example... Figure 1 As shown, the object plane P is a horizontal plane, the distance between the camera 10 and the object plane P is H, the intersection point of the optical axis O of the camera 10 and the object plane P is O', and the angle α between the optical axis O and the vertical direction satisfies: 0° < α < 90°. Clearly, the angle θ between the optical axis O and the object plane P is greater than 0° and less than 90°. When the camera 10 photographs the object 20 on the object plane P, perspective distortion occurs, causing the image of the object 20 to exhibit perspective distortion, where objects appear larger when closer and smaller when farther away. Figure 2 As shown, in addition, since the photographed object 20 covers a certain depth of field, it may affect the imaging quality on both sides of the perspective distortion image. The specific analysis is as follows:
[0066] Figure 3 This is a schematic diagram of an imaging system for a camera provided in this disclosure, combined with... Figure 1 and Figure 3 As shown, the camera 10 includes a camera lens 11. The intersection of the optical axis O and the object 20 being photographed is O'. The distance between the intersection O' and the optical center of the camera lens 11 is the object distance L. The foreground depth of field of the camera lens 11 is ΔL1, and the background depth of field of the camera lens 11 is ΔL2. That is, the depth of field of the camera lens 11 is ΔL = ΔL1 + ΔL2. Within the depth of field ΔL, the camera 10 can clearly image the object 20 being photographed.
[0067] For example, if the angle between the photographed object 20 and the optical axis O is greater than 0° and less than 90°, and if, in the longitudinal field of view of the camera lens 11, the photographed object 20 does not exceed the upper limit object distance L-ΔL1 and the lower limit object distance L+ΔL2, that is, the photographed object 20 is within the depth of field ΔL, then the camera can clearly image the photographed object 20. If, in the longitudinal field of view of the camera lens 11, the photographed object 20 exceeds the upper limit object distance L-ΔL1 and / or the lower limit object distance L+ΔL2, that is, part of the photographed object 20 can cover the entire depth of field ΔL, such as... Figure 1 and Figure 3 As shown, the camera cannot clearly image the area of the photographed object 20 beyond the upper limit object distance L-ΔL1 and / or the lower limit object distance L+ΔL2. In other words, the imaging quality on both sides of the perspective distortion image of the photographed object 20 is poor.
[0068] In conclusion, during perspective imaging, cameras with a large depth of field can clearly image the subject, while cameras with a small depth of field cannot. Clearly, the image quality of a camera at perspective angles is affected not only by the depth of field but also by the perspective angle itself, thus making it impossible to evaluate the image quality of a camera at perspective angles.
[0069] Therefore, the present disclosure provides a camera imaging quality evaluation method, which comprises the following steps:
[0070] Figure 4 A flowchart of the camera imaging quality evaluation method is shown in Figure 4
[0071] S101, determining an inverse matrix of a perspective transformation matrix according to a pose parameter and a field of view angle of the camera.
[0072] The pose parameter comprises an included angle between an optical axis of the camera and an object plane, and the included angle is greater than 0 degrees and less than 90 degrees.
[0073] The pose parameter of the camera can comprise a distance between the camera and the object plane, and an included angle between the optical axis of the camera and the object plane, and the field of view angle of the camera comprises a longitudinal field of view angle and a transverse field of view angle. For example, as shown in Figure 1 The pose parameter of the camera comprises a distance H between the camera 10 and the object plane P, and an included angle θ between the optical axis O and the object plane P, and θ satisfies 0°<θ<90°, and the field of view angle comprises a longitudinal field of view angle β and a transverse field of view angle γ, wherein the longitudinal field of view angle β is coplanar with the included angle between the optical axis O and the object plane P, and the plane where the transverse field of view angle γ is located is perpendicular to the plane where the longitudinal field of view angle β is located.
[0074] For example, four first target points are selected in the field of view of the camera, for example, the four first target points can be four vertices of the field of view of the camera, the coordinates of the four first target points can be determined according to the distance H between the camera and the object plane, the angle θ between the optical axis of the camera and the object plane, the longitudinal field of view angle β and the transverse field of view angle γ, the perspective transformation matrix A can be determined according to the coordinates of the first target points and the perspective transformation formula, and the inverse matrix A -1 .
[0075] Based on the perspective transformation matrix A, the standard picture is processed to obtain a perspective distortion image with near small and far large, and the perspective distortion image is an image obtained by the camera shooting the standard picture. Then, based on the inverse matrix A -1 , the standard picture is processed to obtain an inverse perspective distortion image with near small and far large.
[0076] In S102, the line width on the object plane is determined according to the object distance, the pixel size and the distance of the camera.
[0077] The Nyquist frequency of the camera is determined according to the pixel size of the camera. The Nyquist frequency is also called the limit frequency. When the Nyquist frequency of the discrete system is higher than the highest frequency or bandwidth of the sampling signal, aliasing phenomenon can be avoided. That is, when the line width of the text strokes on the image plane is greater than the pixel size of the camera, the camera can present clear text strokes and different strokes will not be mixed. The spatial frequency can be determined according to the Nyquist frequency. In order to clearly present the text on the image plane, the spatial frequency needs to be less than the Nyquist frequency, for example, it can be one half or one fourth of the Nyquist frequency of the camera. According to the spatial frequency, the line width of the text strokes on the image plane corresponding to the spatial frequency is determined. According to the line width of the text strokes on the image plane and the imaging formula, the line width of the text strokes on the object plane of the camera can be determined.
[0078] In S103, the test picture is generated according to the inverse matrix and the line width.
[0079] According to the text to be displayed and the line width of the text strokes on the image plane determined in the above embodiment, the standard image is determined, wherein the content displayed in the standard image is the text to be displayed, and the line width of the text strokes in the standard image is the line width determined in the above embodiment. Based on the inverse matrix A -1 , the standard image is transformed to obtain an inverse perspective transformation image, and the inverse perspective transformation image is printed to generate the test picture, and the test picture is a kind of inverse perspective distortion image with near small and far large corresponding to the standard picture.
[0080] In S104, the imaging quality of the camera is evaluated according to the target image of the test picture.
[0081] The target image is obtained by the camera based on the pose parameters and the object distance and a test image located on the object plane.
[0082] For example, as shown in FIG. 1, a test image is set on the object plane P, the intersection of the test image and the optical axis O is O', the pose parameters and the object distance of the camera 10 are set as the same pose parameters and the object distance as when the test image is determined, and the test image is captured based on the set pose parameters and the object distance. Figure 1 As shown in FIG. 1, the test image is set on the object plane P, the intersection of the test image and the optical axis O is O', the pose parameters and the object distance of the camera 10 are set as the same pose parameters and the object distance as when the test image is determined, and the test image is captured based on the set pose parameters and the object distance. Since the camera 10 will be perspective deformed when imaging the test image, it is equivalent to processing the test image based on the perspective transformation matrix A to obtain the target image, and the test image is processed based on the inverse matrix A -1 of the perspective transformation matrix A, so the standard image is inversely perspective deformed and then perspective deformed to obtain the target image. Obviously, the target image is a standard non-distorted image.
[0083] The standard non-distorted image will not be affected by perspective distortion, so that the influence of the perspective angle on the imaging quality of the camera at the perspective angle can be eliminated, and therefore the imaging quality of the camera at the perspective angle can be evaluated based on the target image. In addition, after the camera obtains the target image, it is not necessary to correct the perspective deformation of the target image, and the calculation amount of the camera can be reduced
[0084] Figure 5 FIG. 2 is a flowchart of another method for evaluating the imaging quality of a camera according to the present disclosure, Figure 5 For example, as shown in FIG. 1, a test image is set on the object plane P, the intersection of the test image and the optical axis O is O', the pose parameters and the object distance of the camera 10 are set as the same pose parameters and the object distance as when the test image is determined, and the test image is captured based on the set pose parameters and the object distance. Figure 4 For example, as shown in FIG. 1, a test image is set on the object plane P, the intersection of the test image and the optical axis O is O', the pose parameters and the object distance of the camera 10 are set as the same pose parameters and the object distance as when the test image is determined, and the test image is captured based on the set pose parameters and the object distance.
[0085] S1011, determining first coordinates of a plurality of first target points in a field of view in a first coordinate system according to the pose parameters and the field of view angle.
[0086] For example, as shown in FIG. 1, a test image is set on the object plane P, the intersection of the test image and the optical axis O is O', the pose parameters and the object distance of the camera 10 are set as the same pose parameters and the object distance as when the test image is determined, and the test image is captured based on the set pose parameters and the object distance. Figure 6 For example, as shown in FIG. 1, a test image is set on the object plane P, the intersection of the test image and the optical axis O is O', the pose parameters and the object distance of the camera 10 are set as the same pose parameters and the object distance as when the test image is determined, and the test image is captured based on the set pose parameters and the object distance. Figure 6 As shown in FIG. 1, the four vertices of the camera field of view range are the four vertices P1, P2, P3 and P4, the camera field of view range is a trapezoid, the four vertices of the trapezoid are P1, P2, P3 and P4, wherein P1P4 is the short side of the trapezoid, P2P3 is the long side of the trapezoid, the midpoint of P1P4 is E, and the midpoint of P2P3 is F, that is, EF is perpendicular to P1P4. In order to facilitate representation, the optical center C of the camera is used to represent the camera, as shown in FIG. 1. Figure 6 As shown in FIG. 1, the distance between the camera and the object plane P is H, the intersection of the optical axis O and the object plane P is O', and the angle between CO' and the object plane P is θ.
[0087] A straight line passing through intersection O' and perpendicular to object plane P is taken as the Z axis of the first coordinate system XYZ, the origin O1 of the first coordinate system XYZ is located between O' and the camera along the Z axis, and the direction of O' is taken as the positive direction of the Z axis; a straight line passing through O1 and parallel to P1P4 is taken as the X axis of the first coordinate system XYZ, and the direction of P4 to P1 is taken as the positive direction of the X axis; and a straight line passing through O1 and perpendicular to the XZ plane is taken as the Y axis of the first coordinate system XYZ, and the direction of E to F is taken as the positive direction of the Y axis, so that the first coordinate system XYZ can be established. In the first coordinate system XYZ, according to the distance between the optical center C of the camera and the object plane P being H, the angle between CO' and the object plane P being θ, the longitudinal field of view angle β and the transverse field of view angle γ, the first coordinates (x1, y1, z1) of P1, the first coordinates (x2, y2, z2) of P2, the first coordinates (x3, y3, z3) of P3 and the first coordinates (x4, y4, z4) of P4 can be determined.
[0088] For example, the distance between the origin O1 and O' is 1 cm, as shown in Figure 6 According to the geometric relationship, it can be determined that:
[0089]
[0090]
[0091]
[0092]
[0093] z1=z2=z3=z4=1
[0094] Accordingly, the first coordinates (x1, y1, z1) of P1, the first coordinates (x2, y2, z2) of P2, the first coordinates (x3, y3, z3) of P3 and the first coordinates (x4, y4, z4) of P4 can be determined.
[0095] It should be noted that, in order to facilitate calculation, the Z axis coordinate of the first target point is taken as 1 in the subsequent embodiments of the disclosure.
[0096] S1012, determining the second coordinates of the plurality of second target points in the second coordinate system.
[0097] The optical center of the camera and the second target point and the corresponding first target point thereof are located on the same straight line, and the second target point is located in a plane perpendicular to the optical axis of the camera and passing through the intersection of the object plane and the optical axis.
[0098] For example, Figure 7 Another schematic diagram of the field of view of the camera provided by the disclosure is as shown in Figure 7As shown, the field of view of the camera is a trapezoid, the four vertices of the trapezoid are P1, P2, P3 and P4, P1, P2, P3 and P4 are a plurality of first target points, P1P4 is the short side of the trapezoid, P2P3 is the long side of the trapezoid, the midpoint of P1P4 is E, the midpoint of P2P3 is F, EF is perpendicular to P1P4, the distance between the optical center C and the object plane P is H, the intersection of the optical axis O and the object plane P is O', and the angle between CO' and the object plane P is θ. The plane ω passes through O' and is perpendicular to the optical axis O, as shown in Figure 7 As shown, the distance between the optical center C of the camera and the plane ω is d, the intersection of the straight line CP1 determined by P1 and the plane ω is R1, the intersection of the straight line CP2 determined by P2 and the plane ω is R2, the intersection of the straight line CP3 determined by P3 and the plane ω is R3, and the intersection of the straight line CP4 determined by P4 and the plane ω is R4. Then R1, R2, R3 and R4 are the second target points.
[0099] The optical center C of the camera is taken as the origin of the second coordinate system X'Y'Z', a straight line passing through the C point and parallel to P1P4 is taken as the X' axis of the second coordinate system X'Y'Z', and the direction of P4 pointing to P1 is taken as the positive direction of the X' axis. The optical axis O is taken as the Z' axis of the second coordinate system X'Y'Z', and the direction of the optical center C pointing to O' is taken as the positive direction of the Z' axis. A straight line passing through the optical center C and perpendicular to the plane ω is taken as the Y' axis of the second coordinate system X'Y'Z', and the direction pointing to the upper side of the Y' axis is taken as the positive direction of the Y' axis. In this way, the second coordinate system X'Y'Z' can be established. In the second coordinate system X'Y'Z', according to the distance d between the optical center C and the plane ω, the angle θ between CO' and the object plane P, the longitudinal field of view angle β and the transverse field of view angle γ, the second coordinates (x1', y1', d) of R1, the second coordinates (x2', y2', d) of R2, the second coordinates (x3', y3', d) of R3 and the second coordinates (x4', y4', d) of R4 can be determined.
[0100] In S1013, the inverse matrix is determined according to the target correspondence relationship, the first coordinates and the second coordinates.
[0101] The target correspondence relationship is used to represent the correspondence relationship between the first coordinates and the second coordinates, and the perspective transformation matrix is included in the target correspondence relationship. The perspective transformation matrix can be obtained by substituting the first coordinates and the second coordinates into the target correspondence relationship.
[0102] For example, the perspective transformation matrix A can be represented as:
[0103] a 33 = 1
[0104] The target correspondence relationship can be represented as:
[0105]
[0106]
[0107] zn' = d, n = 1, 2, 3, 4
[0108] wherein xn' represents the X' axis coordinate of the second coordinate, yn' represents the Y' axis coordinate of the second coordinate, zn' represents the Z' axis coordinate of the second coordinate, xn represents the X axis coordinate of the first coordinate, yn represents the Y axis coordinate of the first coordinate, and zn represents the Z axis coordinate of the first coordinate.
[0109] The first coordinate (x1, y1, 1) of P1, the first coordinate (x2, y2, 1) of P2, the first coordinate (x3, y3, 1) of P3, and the first coordinate (x4, y4, 1) of P4, and the second coordinate (x1', y1', d) of R1, the second coordinate (x2', y2', d) of R2, the second coordinate (x3', y3', d) of R3, and the second coordinate (x4', y4', d) of R4 are substituted into the above target correspondence relationship, and the perspective transformation matrix A can be determined. The inverse matrix of the perspective transformation matrix A can be obtained by inverting the perspective transformation matrix A. -1 .
[0110] Figure 8 A flowchart of another imaging quality evaluation method of a camera provided by the present disclosure is shown in FIG. 11, Figure 8 A flowchart of another imaging quality evaluation method of a camera provided by the present disclosure is shown in FIG. 11, Figure 5 On the basis of the embodiment shown in FIG. 10, before S1013 is performed, the method further includes:
[0111] S201, determining a first correspondence relationship between the first coordinate and the third coordinate of the plurality of first target points in the second coordinate system.
[0112] Perspective transformation refers to using the condition that the three points of the perspective midpoint, the image point, and the target point are collinear, rotating the perspective surface by a certain angle around the perspective axis according to the law of perspective rotation, destroying the original projection light beam, and still maintaining the projection geometry on the projection surface unchanged. Based on the perspective transformation formula, the following first correspondence relationship is determined:
[0113] [xn", yn", zn"] = A[xn, yn, 1], n = 1, 2, 3, 4
[0114] wherein xn" represents the X' axis coordinate of the third coordinate, yn" represents the Y' axis coordinate of the third coordinate, and zn" represents the Z' axis coordinate of the third coordinate.
[0115] Obviously, the first correspondence gives the correspondence between the first coordinate of the first target point and the corresponding third coordinate, that is, the third coordinate can be expressed as the product of the corresponding first coordinate and the perspective transformation matrix A.
[0116] S202, determine the second correspondence between the third coordinate and the second coordinate.
[0117] As shown in the example, Figure 7 Based on the above embodiment, the third coordinate of the first target point and the second coordinate of the corresponding second target point can be determined according to the similar triangle in the second coordinate system X'Y'Z' as follows:
[0118]
[0119]
[0120] zn′=d,n=1,2,3,4
[0121] Obviously, through the second correspondence, the second coordinate of the second target point can be expressed as the product of the ratio of the corresponding X' axis coordinate and Z' axis coordinate of the first target point and the distance d from the optical center C to the plane ω.
[0122] S203, determine the target correspondence according to the first correspondence and the second correspondence.
[0123] Substitute the first correspondence determined in the above embodiment into the second correspondence, and then substitute the expression of the perspective transformation matrix A, the target correspondence can be determined as follows:
[0124]
[0125]
[0126] zn′=d,n=1,2,3,4
[0127] In this way, through the target correspondence, the correspondence between the first coordinate of the first target point in the first coordinate system and the second coordinate of the corresponding second target point in the second coordinate system is established.
[0128] Figure 9 The flowchart of another camera imaging quality evaluation method provided by the present disclosure is shown in Figure 9 Based on the embodiment shown in Figure 4 The specific description of one possible implementation of S102 is as follows:
[0129] S1021, determine the spatial frequency of the camera according to the pixel size.
[0130] As a specific description of one possible implementation manner when S1021 is performed, as shown in the following: Figure 10
[0131] S301, determining the Nyquist frequency of the camera according to the pixel size.
[0132] For example, the pixel size of the camera is M microns, and the Nyquist frequency N of the camera can be determined according to the pixel size M of the camera as follows:
[0133] N = 1000 / 2M
[0134] S302, determining the spatial frequency according to one half of the Nyquist frequency and / or one fourth of the Nyquist frequency.
[0135] For example, based on the above embodiment, one half of the Nyquist frequency N can be taken as the spatial frequency, that is, the spatial frequency is N / 2, one fourth of the Nyquist frequency N can be taken as the spatial frequency, that is, the spatial frequency is N / 4, or one half of the Nyquist frequency N and one fourth of the Nyquist frequency N can be taken as different spatial frequencies, that is, the first spatial frequency is N / 2 and the second spatial frequency is N / 4.
[0136] S1022, determining the line width on the image plane according to the spatial frequency.
[0137] Based on the above embodiment, the spatial frequency N / 2 corresponds to the text stroke line width w on the image plane = [1000 / (N / 2)] / 2, and the spatial frequency N / 4 corresponds to the text stroke line width w on the image plane = [1000 / (N / 4)] / 2.
[0138] S1023, determining the line width on the object plane according to the line width on the image plane, the object distance and the conjugate distance.
[0139] The paraxial imaging formula is as follows:
[0140]
[0141] Wherein, f is the focal length of the camera lens, L is the object distance of the camera lens, and L' is the conjugate distance of the camera lens.
[0142] According to the similarity relationship, the following relationship is obtained:
[0143]
[0144] Wherein, w represents the text stroke line width on the image plane, and W represents the text stroke line width on the object plane.
[0145] In summary, different spatial frequencies correspond to different line widths w of text strokes on the image plane, that is, different line widths W of text strokes on the object plane.
[0146] Figure 11 This is a flowchart illustrating yet another method for evaluating the image quality of a camera provided in this disclosure. Figure 11 for Figure 4 Based on the illustrated embodiment, a specific description of a possible implementation of S103 is as follows:
[0147] S1031, Determine the font size of the text based on the line width.
[0148] Different characters of the same font size have different line widths for their strokes. For example, the line widths of horizontal and vertical strokes are smaller than those of diagonal strokes. The average line width of the maximum and minimum line widths among the strokes of the same font size can be used as the line width corresponding to that font size. Based on this, and using the line widths corresponding to different font sizes, as well as the line width W of the character strokes on the object surface determined in the above embodiments, the font size of the text to be displayed is determined.
[0149] S1032, Determine the standard image based on the font size and the text to be displayed.
[0150] Based on the determined font size of the text to be displayed and the text to be displayed, a standard image is generated. The text to be displayed is displayed in the standard image, and the font size of the displayed text is the same as the font size of the text to be displayed determined in the above embodiment. The text to be displayed in the standard image is free from distortion.
[0151] S1033, transform the standard image according to the inverse matrix to generate the test image.
[0152] For example, multiple key points on the standard image can be selected. Based on the coordinates of these key points in the second coordinate system and the second correspondence, the coordinates of the projection points of these key points on the object projection plane can be determined. Based on the coordinates of these projection points, the projection image of the standard image on the object projection plane can be obtained. Then, the projection image is compared with the inverse matrix A of the perspective transformation matrix A. -1 Multiplying these results in an inverse perspective transformed image. Printing this image generates a test image. The text displayed in the test image exhibits a perspective distortion where near text appears smaller and far text appears larger, such as... Figure 12 As shown.
[0153] Figure 13 This is a flowchart illustrating yet another method for evaluating the image quality of a camera provided in this disclosure. Figure 13 for Figure 4 Based on the illustrated embodiment, a specific description of a possible implementation of S104 is as follows:
[0154] S1041, Based on the target image of the test image at different spatial frequencies, determine the recognition rate of the camera for the target image at different spatial frequencies.
[0155] Based on the above embodiments, different spatial frequencies can be determined according to the Nyquist frequency of the camera. For example, the spatial frequency can be half or a quarter of the Nyquist frequency. The line width of the text strokes in the test images corresponding to different spatial frequencies is different, and the camera's recognition rate for the text in the test images corresponding to different spatial frequencies is different. Based on the target images of the test images captured at different spatial frequencies, different recognition rates can be determined according to the recognition algorithm.
[0156] For example, the first test image corresponding to the first spatial frequency N / 2 is as follows: Figure 12 As shown, the line width of the text strokes in the first test image is W1, and the second test image corresponding to the second spatial frequency N / 4 is as follows. Figure 14 As shown, the line width of the text strokes in the second test image is W2, and the target image of the first test image is as follows. Figure 15 As shown, the target image of the second test image is as follows: Figure 16 As shown. Since the first spatial frequency N / 2 is greater than the second spatial frequency N / 4, the line width W1 is less than the line width W2. That is, the text line width in the target image of the first test image is less than the text line width in the target image of the second test image, as shown. Figure 15 and Figure 16 As shown, the corresponding camera may have a lower recognition rate for text in the first test image than for text in the second test image.
[0157] S1042, Evaluate the imaging quality of the camera based on the camera's recognition rate of the target image at different spatial frequencies.
[0158] Based on the above embodiments, a curve showing the change of target image recognition rate with spatial frequency can be obtained according to different spatial frequencies and their corresponding target image recognition rates. This curve shows that as the spatial frequency increases, the target image recognition rate decreases, and the camera's imaging quality decreases, thereby enabling the evaluation of the camera's imaging quality.
[0159] Figure 17 This is a flowchart illustrating yet another method for evaluating the image quality of a camera provided in this disclosure. Figure 17 for Figure 4 Based on the illustrated embodiment, another possible implementation of S104 is described in detail below:
[0160] S1041', Based on the target image of the test image at different spatial frequencies, determine the modulation transfer function of the camera at different spatial frequencies.
[0161] Modulation Transfer Function (MTF), i.e. the ratio of the contrast of the output image and the input image, MTF = contrast of the output image / contrast of the input image, because the contrast of the output image is always less than the contrast of the input image, so the MTF value is between 0-1.
[0162] The MTF of the camera is related to the spatial frequency, different spatial frequencies correspond to different MTFs, for example, the first spatial frequency N / 2 corresponds to the first MTF, and the second spatial frequency N / 4 corresponds to the second MTF, because the first spatial frequency N / 2 is greater than the second control frequency N / 4, therefore, the first MTF can be less than the second MTF.
[0163] S1042', according to the modulation transfer function of the camera at different spatial frequencies, evaluating the imaging quality of the camera.
[0164] Based on the above embodiments, according to different spatial frequencies and their corresponding modulation transfer functions, a modulation transfer function curve with spatial frequency can be obtained, through which it can be known that as the spatial frequency increases, the modulation transfer function decreases, and the imaging quality of the camera decreases, so as to evaluate the imaging quality of the camera.
[0165] The present disclosure also provides a camera imaging quality evaluation device, Figure 18 A structural schematic diagram of a camera imaging quality evaluation device provided by the present disclosure is shown in Figure 18 As shown, the camera imaging quality evaluation device comprises:
[0166] The determination module 110 is configured to determine the inverse matrix of the perspective transformation matrix according to the pose parameters of the camera and the field of view angle, the pose parameters comprising the included angle between the optical axis of the camera and the object plane, the included angle being greater than 0 degrees and less than 90 degrees; and determine the line width on the object plane according to the object distance, the pixel size and the distance of the camera.
[0167] The picture generation module 120 is configured to generate a test picture according to the inverse matrix and the line width.
[0168] The evaluation module 130 is configured to evaluate the imaging quality of the camera according to the target image of the test picture, the target image being obtained by the camera based on the pose parameters and the object distance to shoot the test picture located on the object plane.
[0169] Optionally, the determining module 110 is further configured to determine first coordinates of the plurality of first target points in the field of view in the first coordinate system according to the pose parameter and the field of view angle; determine second coordinates of a plurality of second target points in the second coordinate system, wherein the second target points and corresponding first target points and the optical center of the camera are located on the same straight line, and the second target points are located in a plane perpendicular to the optical axis of the camera and passing through the intersection of the object plane and the optical axis; and determine the inverse matrix according to the target correspondence relationship, the first coordinates and the second coordinates.
[0170] Optionally, the determining module 110 is further configured to determine a first correspondence relationship between the first coordinates and third coordinates of the plurality of first target points in the second coordinate system; determine a second correspondence relationship between the third coordinates and the second coordinates; and determine the target correspondence relationship according to the first correspondence relationship and the second correspondence relationship.
[0171] Optionally, the determining module 110 is further configured to determine a spatial frequency of the camera according to the pixel size; determine a line width on the image plane according to the spatial frequency; and determine a line width on the object plane according to the line width on the image plane, the object distance and the camera distance.
[0172] Optionally, the determining module 110 is further configured to determine a Nyquist frequency of the camera according to the pixel size; and determine the spatial frequency according to one half of the Nyquist frequency and / or one fourth of the Nyquist frequency.
[0173] Optionally, the picture generating module 120 is further configured to determine a font size of text according to the line width; determine a standard image according to the font size and the text to be displayed; and generate the test picture by transforming the standard image according to the inverse matrix.
[0174] Optionally, the evaluation module 130 is further configured to determine recognition rates of the camera for the target image at different spatial frequencies according to the target image of the test picture at different spatial frequencies; and evaluate the imaging quality of the camera according to the recognition rates of the camera for the target image at different spatial frequencies.
[0175] Optionally, the evaluation module 130 is further configured to determine modulation transfer functions of the camera at different spatial frequencies according to the target image of the test picture at different spatial frequencies; and evaluate the imaging quality of the camera according to the modulation transfer functions of the camera at different spatial frequencies.
[0176] The apparatus of the embodiment can be used to execute the steps of the method embodiments, and has similar implementation principles and technical effects, which will not be described here.
[0177] The present disclosure also provides an electronic device, comprising: a processor configured to execute a computer program stored in a memory, wherein the computer program, when executed by the processor, implements the steps of the method according to any one of the preceding method embodiments.
[0178] The present disclosure also provides a computer readable storage medium having stored thereon a computer program, wherein the computer program, when executed by a processor, implements the steps of the method according to any one of the preceding method embodiments.
[0179] The present disclosure also provides a computer program product which, when executed on a computer, causes the computer to perform the steps of the method according to any one of the preceding method embodiments.
[0180] It should be noted that, in the present document, relational terms such as "first" and "second", and the like, are used solely to distinguish one entity or action from another entity or action, without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. In addition, terms such as "first" and "second" are used herein only to describe one entity or action from another entity or action, without necessarily requiring or implying any actual such relationship or order between such entities or actions.
[0181] The foregoing is merely illustrative of the principles of the disclosure and various modifications can be made by those skilled in the art without departing from the spirit and scope of the disclosure. The disclosure is not intended to be limited to the embodiments described herein but is to be accorded the full scope that resides in the art that comes within the scope of the appended claims along with the full scope of equivalents to which such claims are entitled. It is therefore desired that what is claimed be supported by the embodiments disclosed herein.
Claims
1. A method of evaluating an imaging quality of a camera, characterized by, The method comprises the following steps: determining an inverse matrix of a perspective transformation matrix according to a pose parameter and a field of view angle of the camera, the pose parameter comprising an included angle between an optical axis of the camera and an object plane, the included angle being greater than 0 degrees and less than 90 degrees; determining a line width on the object plane according to an object distance, a pixel size and a distance from the camera; generating a test picture according to the inverse matrix and the line width; evaluating an imaging quality of the camera according to a target image of the test picture, the target image being obtained by the camera based on the pose parameter and the object distance and the test picture located on the object plane; the step of determining the inverse matrix of the perspective transformation matrix according to the pose parameter and the field of view angle comprises the following steps: determining first coordinates of a plurality of first target points in a field of view in a first coordinate system according to the pose parameter and the field of view angle; determining second coordinates of a plurality of second target points in a second coordinate system, wherein the second target points, the corresponding first target points and an optical center of the camera are located on the same straight line, and the second target points are located in a plane perpendicular to the optical axis of the camera and passing through the intersection of the object plane and the optical axis; determining the inverse matrix according to a target correspondence relationship, the first coordinates and the second coordinates; before the step of determining the inverse matrix according to the target correspondence relationship, the first coordinates and the second coordinates, the method further comprises the following steps: determining a first correspondence relationship between the first coordinates and third coordinates of the plurality of first target points in the second coordinate system; determining a second correspondence relationship between the third coordinates and the second coordinates; determining the target correspondence relationship according to the first correspondence relationship and the second correspondence relationship.
2. The method according to any one of claim 1, characterized in that, the step of determining the line width on the object plane according to the object distance, the pixel size and the distance from the camera comprises the following steps: determining a spatial frequency of the camera according to the pixel size; determining a line width on an image plane according to the spatial frequency; determining the line width on the object plane according to the line width on the image plane, the object distance and the distance from the camera.
3. The method of claim 2, wherein, the step of determining the spatial frequency of the camera according to the pixel size comprises the following steps: determining a Nyquist frequency of the camera according to the pixel size; determining the spatial frequency according to one half of the Nyquist frequency and / or one fourth of the Nyquist frequency.
4. The method of any one of claims 1, wherein, the step of generating the test picture according to the inverse matrix and the line width comprises the following steps: determining a font size of text according to the line width; determining a standard image according to the font size and the text to be displayed; generating the test picture by transforming the standard image according to the inverse matrix.
5. The method of any one of claims 1, wherein, the step of evaluating the imaging quality of the camera according to the target image of the test picture comprises the following steps: determining a recognition rate of the target image at different spatial frequencies by the camera according to the target image of the test picture at different spatial frequencies; evaluating the imaging quality of the camera according to the recognition rate of the target image at different spatial frequencies by the camera.
6. The method of any one of claims 1, wherein, the step of evaluating the imaging quality of the camera according to the target image of the test picture comprises the following steps: determining a modulation transfer function at different spatial frequencies by the camera according to the target image of the test picture at different spatial frequencies; According to a modulation transfer function of the camera at different spatial frequencies, the imaging quality of the camera is evaluated.
7. An imaging quality evaluation apparatus of a camera, characterized by comprising: The method comprises the steps of: determining a first coordinate of a plurality of first target points in a first coordinate system according to a pose parameter of the camera and a field of view angle, the pose parameter comprising an included angle between an optical axis of the camera and an object plane, the included angle being greater than 0 degree and less than 90 degree; and determining a line width on the object plane according to an object distance, a pixel size and a distance between the camera and the object plane; generating a test picture according to the inverse matrix and the line width; evaluating the imaging quality of the camera according to a target image of the test picture, the target image being obtained by the camera based on the pose parameter and the object distance and by shooting the test picture located on the object plane; the determining module is specifically configured to determine the first coordinate of the plurality of first target points in the first coordinate system according to the pose parameter and the field of view angle; determine a second coordinate of a plurality of second target points in a second coordinate system, wherein the second target points, the corresponding first target points and an optical center of the camera are located on the same straight line, and the second target points are located in a plane perpendicular to the optical axis of the camera and passing through an intersection point of the object plane and the optical axis; and determine the inverse matrix according to a target correspondence relationship, the first coordinate and the second coordinate. The determining module is further configured to determine a first correspondence relationship between the first coordinate and a third coordinate of the plurality of first target points in the second coordinate system; determine a second correspondence relationship between the third coordinate and the second coordinate; and determine the target correspondence relationship according to the first correspondence relationship and the second correspondence relationship.
8. An electronic device, comprising: The method comprises the steps of: a processor configured to execute a computer program stored in a memory, the computer program being executed by the processor to implement the steps of the method according to any one of claims 1-6.
9. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method according to any one of claims 1-6.
10. A computer program product, characterised in that, When the computer program product is running on the computer, the computer is caused to perform the steps of the method according to any one of claims 1-6.
Citation Information
Patent Citations
Article recognition management method and device, server and readable storage medium
CN111931674A
Image acquisition method and device based on inverse perspective transformation
CN112017246A