Method, apparatus, storage medium, and electronic device for determining resolution of camera module
By obtaining the standard image and calculating the edge expansion function curve of the camera module, and determining the SFR value, the problem that the camera module resolution test solution in the prior art cannot match the lens test, achieving more efficient and stable testing.
Patent Information
- Application Number
- CN202411630364.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2044-11-14
AI Technical Summary
In the prior art, the resolution test scheme of the camera module cannot be effectively benchmarked with lens tests, and the algorithm is prone to failure, has field of view deviation and has poor stability.
By acquiring the standard image, extracting the field of view ROI area, determining the target circle, determining the sector-shaped effective area and pixel point coordinates based on the sagittal direction and/or the tangential direction, calculating the edge expansion function curve of the camera module and determining the SFR value.
It realizes effective improvement of test UPH, and can calculate SFR values in any direction when there is or not, especially the S/T direction, improving test stability.
Smart Images

Figure CN119151921B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of SFR testing. Specifically, it relates to a method for determining the resolution of a camera module, an apparatus for determining the resolution of a camera module, a computer-readable storage medium, and an electronic device. Background Art
[0002] With the surge in demand for images in the AI era, the requirements for testing the resolution of camera modules have gradually increased. As Figure 1 shown, the conventional SFR (Spatial Frequency Response) method based on inclined edges is a relatively common resolution testing scheme at present. However, this method has the following problems: First, the conventional SFR method cannot be effectively benchmarked with lens testing; second, the conventional SFR method has requirements for the angle of the inclined edge, but due to the large FOV of the wide-angle module, the algorithm will fail; third, the conventional SFR algorithm has a field-of-view deviation, and the stability of repeated testing at the same station or different stations is poor. Summary of the Invention
[0003] The main object of the present application is to provide a method for determining the resolution of a camera module, an apparatus for determining the resolution of a camera module, a computer-readable storage medium, and an electronic device, so as to at least solve the problems in the prior art that the resolution testing scheme of the camera module cannot be effectively benchmarked with lens testing, and the algorithm is prone to failure, has a field-of-view deviation, and poor stability.
[0004] To achieve the above object, according to one aspect of the present application, a method for determining the resolution of a camera module is provided, including: obtaining a calibration plate image, where the calibration plate image is an image obtained by using a camera module to photograph a calibration plate with a circular pattern, and the circular pattern covers the entire field of view and includes edge information in all directions; extracting a plurality of field-of-view ROI regions from the calibration plate image, and determining the top N circles in terms of distance ranking in each of the field-of-view ROI regions as target circles, where the distance ranking is in ascending order of the target distance, the target distance is the distance between the center of the target circle and the center of the field-of-view ROI region, and N is a positive integer; determining a fan-shaped effective region corresponding to the target circle and the coordinates of each pixel point in the fan-shaped effective region based on the sagittal direction and / or the tangential direction, where the pixel points in the fan-shaped effective region include transition pixel points in the transition region and non-transition pixel points in the non-transition region, one target circle corresponds to a plurality of the fan-shaped effective regions, and one fan-shaped effective region corresponds to one direction; determining an edge spread function curve of the camera module according to the coordinates of each pixel point, and determining an SFR value of the camera module according to the edge spread function curve, where the SFR value is used to characterize the resolution of the camera module.
[0005] Optionally, the circular part in the circular style is black and the non-circular part is white, N = 1. Extract multiple field-of-view ROI regions from the reticle image, and determine the target circles as the top N ranked circles in terms of distance in each field-of-view ROI region, including: performing binary segmentation on each field-of-view ROI region to obtain the binary image corresponding to the field-of-view ROI region; determining the number of all pixel points in each circular part in the binary image, and removing the circular parts with the number of pixel points less than or equal to a preset number to obtain the remaining circles; according to the first calculation formula , determine the relative distance of each of the remaining circles, where is the relative distance of the remaining circle, Area is the area of the remaining circle, and d is the maximum distance from the center of the remaining circle to the edge contour of the field-of-view ROI region; determine the remaining circle with the smallest relative distance as the target circle.
[0006] Optionally, based on the sagittal direction and / or the tangential direction, determine the sector effective area corresponding to the target circle and the coordinates of each pixel point in the sector effective area, including: based on the sagittal direction and / or the tangential direction, determine the initial triangular area corresponding to the target circle, with one of the vertices of the initial triangular area being the vertex of the sector effective area; determine the inner diameter and outer diameter of the sector effective area, and determine the sector effective area from the initial triangular area, where the sector effective area includes the transition area and the non-transition area; determine the coordinates of the non-pixel points in the non-transition area, and calculate the sub-pixel coordinates of the transition pixel points in the transition area using the radial difference centroid method.
[0007] Optionally, based on the sagittal direction and / or the tangential direction, determine the initial triangular area corresponding to the target circle, including: according to the first endpoint formula and the second endpoint formula , determine the first endpoint coordinates and the second endpoint coordinates of the initial triangular area, where D is the diameter of the target circle, (Cx, Cy) is the center coordinates of the target circle, is the central angle of the initial triangular area, A is the included angle between the two boundaries of the initial triangular area, (Px1, Py1) are the first endpoint coordinates, and (Px2, Py2) are the second endpoint coordinates; according to the first endpoint coordinates and the second endpoint coordinates, determine the first endpoint and the second endpoint respectively; determine the center of the target circle as one of the vertices of the initial triangular area, and determine the first endpoint and the second endpoint as the other two vertices of the initial triangular area to obtain the initial triangular area.
[0008] Optionally, determining the edge extension function curve of the camera module according to the coordinates of each pixel point includes: rotating all the fan-shaped effective areas to the same horizontal direction to obtain the rotated fan-shaped area; according to the rotation coordinate formula , determining the rotated coordinates of each pixel point in the fan-shaped effective area, where (Cx, Cy) are the coordinates of the vertex of the fan-shaped effective area, is the central angle of the fan-shaped effective area, (x, y) are the initial coordinates of the pixel points in the fan-shaped effective area, and (Rx, Ry) are the rotated coordinates of the pixel points in the rotated fan-shaped area; calculating the target distance between the non-pixel point and the pixel points along the radial direction, where the radial direction is the direction where the non-pixel point and the vertex of the fan-shaped effective area are located; determining the average gray value corresponding to the target distance as the average of the gray value of the non-pixel point and the gray values of the pixel points along the radial direction; determining the edge extension function curve according to the target distance and the corresponding average gray value.
[0009] Optionally, determining the SFR value of the camera module according to the edge extension function curve includes: performing a difference processing on the edge extension function curve to calculate and obtain a line spread function curve; performing a Hamming window processing on the line spread function curve to obtain a windowed curve; performing a fast Fourier transform on the windowed curve to convert it to the frequency domain to calculate and obtain a modulation transfer function curve; outputting the value at a specific frequency according to the modulation transfer function curve and determining this value as the SFR value.
[0010] Optionally, N = 4, the center of the field of view ROI area is the field of view point, one target circle corresponds to four fan-shaped effective areas, and the four fan-shaped effective areas respectively correspond to the first sagittal direction, the second sagittal direction, the first tangential direction, and the second tangential direction. Determining the SFR value of the camera module according to the edge extension function curve includes: determining the SFR values of each fan-shaped effective area in each direction according to the edge extension function curve; determining the first sagittal direction coefficient of the plane model in the first sagittal direction according to the first plane model coefficient calculation formula , where (a, b, c) are the plane model coefficients in the first sagittal direction, , SFR_S1_i is the SFR value of the i-th fan-shaped effective area in the first sagittal direction, S1_i_x is the x coordinate of the vertex of the i-th fan-shaped effective area in the first sagittal direction, S1_i_y is the y coordinate of the vertex of the i-th fan-shaped effective area in the first sagittal direction, and i = 1, 2, 3, 4; according to the SFR value calculation formula , plane fitting is performed on the SFR values of the four target circles in the first sagittal direction to obtain the target SFR value of the field point in the first sagittal direction. (x, y) are plane coordinates, and z is the SFR value at the position of (x, y) in the first sagittal direction.
[0011] According to another aspect of the present application, there is provided a device for determining the resolution of a camera module, including: an acquisition unit for acquiring a calibration plate image, where the calibration plate image is an image obtained by photographing a calibration plate with a circular pattern using the camera module, and the circular pattern covers the entire field of view and includes edge information in each direction; a first determination unit for extracting a plurality of field-of-view ROI regions from the calibration plate image and determining the circles ranked in the top N in terms of distance in each field-of-view ROI region as target circles, where the distance ranking is in ascending order of the target distance, and the target distance is the distance between the center of the target circle and the center of the field-of-view ROI region, and N is a positive integer; a second determination unit for determining, based on the sagittal direction and / or the tangential direction, the fan-shaped effective region corresponding to the target circle and the coordinates of each pixel point in the fan-shaped effective region, where the pixel points in the fan-shaped effective region include transition pixel points in the transition region and non-transition pixel points in the non-transition region, one target circle corresponds to a plurality of fan-shaped effective regions, and one fan-shaped effective region corresponds to one direction; a third determination unit for determining the edge spread function curve of the camera module according to the coordinates of each pixel point, and determining the SFR value of the camera module according to the edge spread function curve, where the SFR value is used to characterize the resolution of the camera module.
[0012] According to another aspect of the present application, there is provided a computer-readable storage medium, where the computer-readable storage medium includes a stored program, and when the program runs, it controls the device where the computer-readable storage medium is located to execute any one of the methods for determining the resolution of the camera module.
[0013] According to another aspect of the present application, there is provided an electronic device, including: one or more processors, a memory, and one or more programs, where the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include those for executing any one of the methods for determining the resolution of the camera module.
[0014] Applying the technical solution of the present application, for the method for determining the resolution of the above camera module, first, a calibration plate image is obtained, where the calibration plate image is an image obtained by using the camera module to photograph a calibration plate with a circular pattern; then, multiple field-of-view ROI regions are extracted from the calibration plate image, and the top N circles in terms of distance in each field-of-view ROI region are determined as target circles, and the target distance is the distance between the center of the target circle and the center of the field-of-view ROI region; then, based on the sagittal direction and / or the tangential direction, the fan-shaped effective region corresponding to the target circle and the coordinates of each pixel point in the fan-shaped effective region are determined, and the pixel points in the fan-shaped effective region include the transition pixel points in the transition region and the non-pixel points in the non-transition region; finally, according to the coordinates of each pixel point, the edge spread function curve of the camera module is determined, and based on the edge spread function curve, the SFR value of the camera module is determined. This method can not only effectively improve the test UPH, but also effectively calculate the SFR value in any direction under the condition of whether the image is distorted or not, especially in the S / T direction, and can improve the test stability, solving the problems in the prior art that the resolution test scheme of the camera module cannot be effectively benchmarked with the lens test, and the algorithm is prone to failure, there are field-of-view deviations and the stability is poor. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The accompanying drawings forming a part of this application are used to provide a further understanding of the application. The schematic embodiments and descriptions thereof of the application are used to explain the application and do not constitute an improper limitation of the application. In the drawings:
[0016] Figure 1 The hardware structure block diagram of a mobile terminal for implementing the method for determining the resolution of a camera module provided in an embodiment of the present application is shown;
[0017] Figure 2 The flowchart of a method for determining the resolution of a camera module provided in an embodiment of the present application is shown;
[0018] Figure 3 The schematic diagram of a circular calibration plate pattern provided in an embodiment of the present application is shown;
[0019] Figure 4 The schematic diagram of multiple field-of-view ROI regions provided in an embodiment of the present application is shown;
[0020] Figure 5 The S / T direction definition diagram provided in an embodiment of the present application is shown;
[0021] Figure 6 The schematic diagram of the selection of the initial triangular region of a circle provided in an embodiment of the present application is shown;
[0022] Figure 7Shows a schematic diagram of the minimum rectangular area of an initial triangular area of a memory provided according to an embodiment of the present application;
[0023] Figure 8 Shows a schematic diagram of the effective area of an initial triangular area of a memory provided according to an embodiment of the present application;
[0024] Figure 9 Shows a schematic diagram of sub-pixel edge point positioning within an effective area provided according to an embodiment of the present application;
[0025] Figure 10 Shows a schematic diagram of fitting edge points in the horizontal direction provided according to an embodiment of the present application;
[0026] Figure 11 Shows a schematic diagram of the projection of pixel points within an effective area along the radial direction provided according to an embodiment of the present application;
[0027] Figure 12 Shows a curve graph of the ESF (Edge Spread Function) value of the effective area of the initial triangular area provided according to an embodiment of the present application;
[0028] Figure 13 Shows a curve graph of the LSF (Line Spread Function) value of the effective area of the initial triangular area provided according to an embodiment of the present application;
[0029] Figure 14 Shows a curve graph of the MTF (Modulation Transfer Function) value of the effective area of the initial triangular area provided according to an embodiment of the present application;
[0030] Figure 15 Shows a selection schematic diagram of a circular triangular area for a specific method of determining the resolution of a camera module provided according to an embodiment of the present application;
[0031] Figure 16 Shows a flowchart of a specific method of determining the resolution of a camera module provided according to an embodiment of the present application;
[0032] Figure 17 Shows a structural block diagram of a device for determining the resolution of a camera module provided according to an embodiment of the present application.
[0033] Among them, the above-mentioned drawings include the following reference numerals:
[0034] 102. Processor; 104. Memory; 106. Transmission device; 108. Input / output device. Detailed implementation manners
[0035] It should be noted that, without conflict, the embodiments in the present application and the features in the embodiments may be combined with each other. The following will describe the present application in detail with reference to the drawings and in combination with the embodiments.
[0036] In order to enable those skilled in the art to better understand the solution of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0037] It should be noted that the terms "first", "second", etc. in the description and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not have to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances for the embodiments of the present application described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0038] As introduced in the background art, the relatively common resolution test scheme in the prior art is the conventional SFR (Spatial Frequency Response) method based on the tilted edge. However, this method has the following problems. First, it can only test the resolution in the horizontal and vertical directions. However, the lens design is generally rotationally symmetric, and the sagittal and tangential directions can better reflect the characteristics of the module. Moreover, the lens test also uses the S / T direction. Therefore, the conventional SFR method cannot be effectively compared with the lens test. Second, the conventional SFR method has requirements for the angle of the tilted edge. However, due to the large FOV of the wide-angle module, the image will have a large distortion. In this case, the tilted edge in the outer field of view of the image will be distorted into a horizontal or vertical edge, losing the tilt angle, resulting in the failure of the algorithm. Third, the conventional SFR algorithm calculates the resolution of a specific field of view point through the tilted edge closest to the field of view point, resulting in a field of view deviation, and the repeatability of the test at the same station or different stations is poor.
[0039] To solve the problems that the resolution test scheme of the camera module in the prior art cannot be effectively benchmarked with the lens test, and the algorithm is prone to failure, there is a field of view deviation and poor stability, the embodiments of the present application provide a method for determining the resolution of a camera module, a device for determining the resolution of a camera module, a computer-readable storage medium, and an electronic device.
[0040] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present invention.
[0041] The method embodiments provided in the embodiments of the present application can be executed on a mobile terminal, a computer terminal, or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 is a hardware structure block diagram of a mobile terminal for a method for determining the resolution of a camera module according to an embodiment of the present invention. As Figure 1 shown, the mobile terminal may include one or more ( Figure 1 only one is shown in Figure 1 the processor 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Among them, the above mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those of ordinary skill in the art can understand that Figure 1 the structure shown is only schematic, and it does not limit the structure of the above mobile terminal. For example, the mobile terminal may further include more or fewer components than Figure 1 shown, or have a different configuration from
[0042] The memory 104 can be used to store computer programs, such as software programs and modules of application software, like the computer program corresponding to the method for determining the resolution of the camera module in the embodiments of the present invention. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, that is, implements the above-mentioned method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely disposed relative to the processor 102, and these remote memories can be connected to the mobile terminal through a network. Examples of the above-mentioned network include but are not limited to the Internet, intranet, local area network, mobile communication network, and combinations thereof. The transmission device 106 is used to receive or send data via a network. Specific examples of the above-mentioned network may include the wireless network provided by the communication provider of the mobile terminal. In one instance, the transmission device 106 includes a network adapter (Network Interface Controller, abbreviated as NIC), which can be connected to other network devices through a base station and thus communicate with the Internet. In one instance, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0043] In this embodiment, a method for determining the resolution of a camera module running on a mobile terminal, a computer terminal, or a similar computing device is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.
[0044] Figure 2 It is a flowchart of the method for determining the resolution of the camera module according to the embodiments of the present application. As Figure 2 shown, the method includes the following steps:
[0045] Step S201, obtain a calibration target image. The above calibration target image is an image obtained by using the camera module to photograph a calibration target with a circular pattern, and the above circular pattern covers the entire field of view and includes edge information in all directions;
[0046] Specifically, the SFR test algorithm mainly evaluates the resolution of the camera module by analyzing the frequency response of the black-and-white transition part of the edge. The conventional SFR Chart only includes edges in the H / V two directions. In order to calculate the SFR value in any direction in this embodiment, dots containing edge information in all directions are used to replace color blocks, and a dot Chart pattern is designed, as Figure 3As shown. This Chart style has the following advantages: First, it can be shared by multiple workstations, improving the test efficiency and UPH, and there is no need for centering, with low usage cost; second, the dots cover the entire field of view, and the expected field of view points can be flexibly set according to project requirements; third, the dots are staggered between adjacent dots above and below or left and right, increasing the dot density, which can effectively reduce the test field of view deviation; fourth, the distortion calibration station can be combined with the SFR test, reducing the overall test time;
[0047] Step S202: Extract multiple field of view ROI regions from the above-mentioned calibration plate images, and determine the top N circles in terms of distance in each of the above-mentioned field of view ROI regions as target circles. The above distance ranking is in ascending order of the target distance, and the target distance is the distance between the center of the target circle and the center of the field of view ROI region. N is a positive integer;
[0048] Specifically, to reduce the amount of calculation, improve the calculation efficiency, and facilitate parallel processing of the algorithm, the algorithm idea of local ROI processing is adopted, and a field of view ROI region with a width of BlockW and a height of BlockH is cropped with the field of view point (FieldPCx, FieldPCy) as the center. Among them, FieldPCx is the abscissa of the field of view point FieldP, and FieldPCy is the ordinate of the field of view point FieldP.
[0049] As Figure 4 shown, Figure 4 In it, FieldPROI1, FieldPROI2, FieldPROI3, FieldPROI4, and FieldPROI5 are five field of view ROI regions respectively, and A, B, C, D, and E are the centers of FieldPROI1, FieldPROI2, FieldPROI3, FieldPROI4, and FieldPROI5 respectively, that is, the field of view points.
[0050] Among them, the circular part in the above circular style is black, and the non-circular part is white. N = 1. Extracting multiple field of view ROI regions from the above-mentioned calibration plate images and determining the top N circles in terms of distance in each of the above-mentioned field of view ROI regions as target circles includes the following steps:
[0051] Step S2021: Perform binary segmentation on each of the above-mentioned field of view ROI regions to obtain the binary image corresponding to the field of view ROI region;
[0052] Step S2022: Determine the number of all pixel points in each of the above-mentioned circular parts in the binary image, and remove the above-mentioned circular parts whose number of pixel points is less than or equal to the preset number to obtain the remaining circles;
[0053] Step S2023: According to the first calculation formula , determine the relative distances of each of the remaining circles above, where is the relative distance of the remaining circles above, Area is the area of the remaining circles above, and d is the maximum distance from the center of the remaining circles above to the edge contour of the above field of view ROI area;
[0054] Step S2024, determine the circle with the minimum relative distance among the remaining circles above as the target circle above.
[0055] Specifically, this can accurately screen the detected dot points, remove the dot points with incomplete edges, and finally locate the dot point closest to the field of view point as the main body for subsequent calculations. Perform binary segmentation on each field of view ROI area. The binary gray threshold calculation can use the Otsu method of maximum inter-class variance or other algorithms. After binaryization, all pixels corresponding to the black dot points are set to 1, representing the foreground, and the remaining pixels are set to 0, representing the background. Then search for all connected regions (i.e., dot points) in the binary image and label them with different numbers. Screen the detected dot points through area (the number of pixels in the connected region) and roundness (as shown in the following formula) indicators, remove the dot points with incomplete edges, and finally locate the dot point closest to the field of view point as the main body for subsequent calculations.
[0056] Step S203, based on the sagittal direction and / or tangential direction, determine the corresponding fan-shaped effective area of the target circle above and the coordinates of each pixel point in the fan-shaped effective area. The pixel points in the fan-shaped effective area include the transition pixel points in the transition area and the non-pixel points in the non-transition area. One target circle above corresponds to multiple fan-shaped effective areas, and one fan-shaped effective area corresponds to one direction;
[0057] Specifically, similar to the concept of the knife edge in the conventional SFR algorithm, the concept of a fan shape is defined in Circular SFR, which is represented by 1 vertex and 2 endpoints. The central angle of the fan shape is in the sagittal and tangential directions, where the direction of the line connecting the dot point and the image center is the S direction, and the direction perpendicular to the S direction is the T direction, as Figure 5 shown. In this step, 4 fan-shaped ROI areas in the S / T direction are located according to the dot point center, image center, dot point diameter, and the desired fan angle range, as Figure 6 shown.
[0058] Among them, based on the sagittal direction and / or tangential direction, determining the corresponding fan-shaped effective area of the target circle above and the coordinates of each pixel point in the fan-shaped effective area includes the following steps:
[0059] Step S301, based on the sagittal direction and / or tangential direction, determine the corresponding initial triangular area of the target circle above. One of the vertices of the initial triangular area is the vertex of the fan-shaped effective area;
[0060] Among them, based on the sagittal direction and / or the tangential direction, determining the initial triangular region corresponding to the above target circle includes the following steps:
[0061] Step S3011, according to the first endpoint formula and the second endpoint formula , determine the coordinates of the first endpoint and the second endpoint of the above initial triangular region, where D is the diameter of the above target circle, (Cx, Cy) is the center coordinate of the above target circle, is the central angle of the above initial triangular region, A is the included angle between the two boundaries of the above initial triangular region, (Px1, Py1) is the coordinate of the above first endpoint, and (Px2, Py2) is the coordinate of the above second endpoint;
[0062] Step S3012, determine the first endpoint and the second endpoint respectively according to the above first endpoint coordinate and the above second endpoint coordinate;
[0063] Step S3013, determine the center of the above target circle as one of the vertices of the above initial triangular region, and determine the above first endpoint and the above second endpoint as the other two vertices of the above initial triangular region to obtain the above initial triangular region.
[0064] Specifically, in this way, the three vertices of the initial triangular region can be accurately determined, so as to subsequently determine the fan-shaped effective region from the initial triangular region.
[0065] Since images in a computer are stored in a matrix manner, the smallest rectangular region containing the fan-shaped vertex and two endpoints is used as the fan-shaped ROI region, as Figure 7 shown. Since there are interferences from other dot parts in the fan-shaped ROI region, and at the same time, in order to ensure that there are enough pixels at the same radial distance to ensure the stability of the following ESF curve calculation, it is necessary to determine the inner diameter and outer diameter of the fan according to the number distribution of black pixels in the radial direction, that is, to determine the effective region within the fan-shaped ROI and shield the invalid, interfering or computationally unstable regions, as Figure 8 shown.
[0066] Step S302, determine the inner diameter and outer diameter of the above fan-shaped effective region, and determine the above fan-shaped effective region from the above initial triangular region. The above fan-shaped effective region includes the above transition region and the above non-transition region;
[0067] Step S303, determine the coordinates of the above non-pixel points in the above non-transition region, and calculate the sub-pixel coordinates of the above transition pixel points in the above transition region by using the radial difference centroid method.
[0068] Specifically, this can mask invalid, interfering, or computationally unstable regions to ensure the stability of subsequent calculations of the ESF curve. As Figure 9 shown, edge points at the black-and-white transition positions within the effective sector region are located. The positioning accuracy here must reach the sub-pixel level; otherwise, it will affect the accuracy of the subsequent calculation of the ESF curve, thereby affecting the accuracy of the final SFR. The present invention uses the radial difference centroid method to calculate sub-pixel edge points, that is, first obtain the gray distribution curve in the radial direction, then perform differential calculation on the curve to calculate the curve change rate, and finally weight the coordinates with the change rate as the weight to obtain the sub-pixel coordinates of the edge.
[0069] Step S204: Determine the edge spread function curve of the camera module according to the coordinates of each of the above pixel points, and determine the SFR value of the camera module according to the edge spread function curve. The SFR value is used to characterize the resolution of the camera module.
[0070] Specifically, through the design and implementation of the dot Chart, Circular SFR algorithm, and plane fitting weighting algorithm, first, the test efficiency and UPH can be improved by using multiple workstations simultaneously; second, the resolution in the S / T direction of the module can be accurately tested, which is beneficial for the comparison between the module resolution test and the lens resolution test; third, the algorithm will not fail in the case of wide-angle distortion and can still accurately reflect the resolution situation; fourth, the stability of repeated tests between the same workstation and different workstations can be improved; fifth, the distortion calibration stations are merged to reduce the overall test time.
[0071] Among them, determining the edge spread function curve of the camera module according to the coordinates of each of the above pixel points includes the following steps:
[0072] Step S401: Rotate all the above-mentioned effective sector regions to the same horizontal direction to obtain the rotated sector regions;
[0073] Step S402: Determine the rotated coordinates of each of the above pixel points in the above-mentioned effective sector region according to the rotation coordinate formula , where (Cx, Cy) are the coordinates of the vertex of the above-mentioned effective sector region, is the central angle of the above-mentioned effective sector region, (x, y) are the initial coordinates of the pixel points in the above-mentioned effective sector region, and (Rx, Ry) are the rotated coordinates of the pixel points in the above-mentioned rotated sector region;
[0074] Step S403: Calculate the target distance between the above-mentioned non-pixel points and the above-mentioned pixel points along the radial direction. The radial direction is the direction where the non-pixel point and the vertex of the above-mentioned effective sector region are located;
[0075] Step S404: Determine the gray - level mean value corresponding to the target distance by using the gray - level values of the non - pixel points and the average value of the gray - level values of the pixel points along the radial direction of the non - pixel points.
[0076] Step S405: Determine the edge expansion function curve according to the target distance and the corresponding gray - level mean value.
[0077] Specifically, due to the previous definition of the S / T direction, the central angle of the fan - shaped ROI region will have various directions, which will inevitably bring difficulties to the fitting of edge points. Therefore, for the convenience of processing, the present invention rotates the fans in different directions to the horizontal direction for processing. As Figure 10 shown, this can facilitate the fitting of edge points in a unified manner to obtain the theoretical edge at the black - and - white transition position. In addition, the rotation operation here is only for the processing of pixel coordinates and will not perform any image gray - level value interpolation operation that affects the SFR calculation result.
[0078] Among them, determining the SFR value of the camera module according to the edge expansion function curve includes the following steps:
[0079] Step S501: Perform a difference operation on the edge expansion function curve to calculate and obtain a line spread function curve.
[0080] Step S502: Perform a Hamming window addition operation on the line spread function curve to obtain a window - added curve.
[0081] Step S503: Perform a fast Fourier transform on the window - added curve to transform it to the frequency domain and calculate and obtain a modulation transfer function curve.
[0082] Step S504: Output the value at a specific frequency according to the modulation transfer function curve and determine this value as the SFR value.
[0083] Specifically, the core step of the conventional SFR algorithm for calculation is to project and calculate the ESF (edge spread function) curve. In this embodiment, a special projection method is developed for the arc edge. As Figures 11 to 12 shown, that is, for each pixel within the effective fan - shaped region, the distance from the edge is calculated along the radial direction, and the average value of the gray - level values of the pixels with the same distance is taken to obtain the gray - level mean value corresponding to this distance. During the projection process, the same 4 - fold oversampling method as the conventional SFR algorithm is also used to ensure the stability of the calculation.
[0084] After obtaining the ESF curve, the remaining steps are the same as those of the conventional SFR algorithm. As Figure 13 and Figure 14As shown, the ESF curve is differentiated to calculate the line spread function (LSF), and then a Hamming window is added to prevent frequency leakage during frequency domain transformation. The windowed curve is then subjected to a fast Fourier transform (FFT) to be transformed into the frequency domain to calculate the modulation transfer function (MTF) curve, and the value at a specific frequency is output as the SFR value.
[0085] Where N = 4, the center of the above-mentioned field of view ROI region is the field of view point, one of the above-mentioned target circles corresponds to four of the above-mentioned fan-shaped effective regions, and the four above-mentioned fan-shaped effective regions respectively correspond to the first sagittal direction, the second sagittal direction, the first tangential direction, and the second tangential direction. According to the above-mentioned edge spread function curve, determining the SFR value of the above-mentioned camera module includes the following steps:
[0086] Step S601, according to the above-mentioned edge spread function curve, determine the SFR value of each of the above-mentioned fan-shaped effective regions in each direction;
[0087] Step S602, according to the first plane model coefficient calculation formula , determine the first sagittal direction coefficient of the plane model in the above-mentioned first sagittal direction, where (a, b, c) is the plane model coefficient in the above-mentioned first sagittal direction, , SFR_S1_i is the SFR value of the i-th of the above-mentioned fan-shaped effective regions in the above-mentioned first sagittal direction, S1_i_x is the x coordinate of the vertex of the i-th of the above-mentioned fan-shaped effective regions in the above-mentioned first sagittal direction, S1_i_y is the y coordinate of the vertex of the i-th of the above-mentioned fan-shaped effective regions in the above-mentioned first sagittal direction, and i = 1, 2, 3, 4;
[0088] Step S603, according to the SFR value calculation formula , perform plane fitting on the above-mentioned SFR values of the four above-mentioned target circles in the above-mentioned first sagittal direction to obtain the target SFR value of the above-mentioned field of view point in the above-mentioned first sagittal direction, (x, y) is the plane coordinate, and z is the SFR value at the position (x, y) in the above-mentioned first sagittal direction.
[0089] Specifically, this can solve the problem that the Circular SFR algorithm calculates the SFR value of the field of view point by calculating the fan-shaped ROI region on the nearest circular point. Therefore, there is a field of view deviation and it cannot truly reflect the resolving power of the field of view point. To solve the above problem, this embodiment designs and develops a weighted algorithm based on plane fitting, such as Figure 15As shown in the figure, locate the 4 dots closest to the field of view point, and calculate the SFR values of the sector ROIs in the S1 / T1 / S2 / T2 directions for each dot. There are a total of 4 sector ROIs in the S1 direction, 4 sector ROIs in the T1 direction, 4 sector ROIs in the S2 direction, and 4 sector ROIs in the T2 direction for the 4 dots. Then the calculation method for the SFR value in the S1 direction corresponding to the field of view point is to perform a plane fitting on the SFR values of the sector ROIs in the S1 direction of the 4 dots. The plane model is shown in the following formula, and the plane distribution model of the SFR value in the S1 direction can be obtained, so as to calculate the SFR value in the S1 direction at the field of view point position. The SFR values in the other directions of the field of view point can be obtained in the same way.
[0090] For the method for determining the resolution of the camera module of the present application, first obtain a calibration plate image, which is an image obtained by using the camera module to photograph a calibration plate with a circular pattern; then extract multiple field of view ROI regions from the calibration plate image, and determine the top N circles in terms of distance ranking in each field of view ROI region as the target circles, where the target distance is the distance between the center of the target circle and the center of the field of view ROI region; then based on the sagittal direction and / or tangential direction, determine the sector effective region corresponding to the target circle and the coordinates of each pixel point in the sector effective region. The pixel points in the sector effective region include the transition pixel points in the transition region and the non-pixel points in the non-transition region; finally, according to the coordinates of each pixel point, determine the edge spread function curve of the camera module, and according to the edge spread function curve, determine the SFR value of the camera module. This method can not only effectively improve the test UPH, but also effectively calculate the SFR values in any direction, especially in the S / T direction, whether the image is distorted or not, and can improve the test stability, solving the problems that the resolution test scheme of the camera module in the prior art cannot be effectively compared with the lens test, and the algorithm is easy to fail, there are field of view deviations and the stability is poor.
[0091] Moreover, the above embodiments require an SFR test device, a Chart diagram, a module, and test software integrated with the Circular SFR algorithm. The specific implementation is as follows: Design a dot Chart drawing with an appropriate diameter according to module characteristics such as FOV, test distance, resolution, etc. Print a film reticle according to the drawing, place the reticle under the light source of the test device, fix the module in the fixture of the test device, collect images through the test software, and calculate using the above Circular SFR algorithm and weighted algorithm to output the SFR value of a specific frequency at a specific field point. Through the design and implementation of the dot Chart, Circular SFR algorithm, and planar fitting weighted algorithm, first, the test efficiency and UPH can be improved by using multiple workstations simultaneously; second, the resolution in the S / T direction of the module can be accurately tested, which is beneficial for the comparison between the module resolution test and the lens resolution test; third, the algorithm will not fail in the case of wide-angle distortion and can still accurately reflect the resolution; fourth, the stability of repeated tests between the same workstation and different workstations can be improved; fifth, the distortion calibration stations can be merged to reduce the overall test time.
[0092] In order to enable those skilled in the art to more clearly understand the technical solutions of the present application, the implementation process of the method for determining the resolution of the camera module of the present application will be described in detail below in conjunction with specific embodiments.
[0093] This embodiment relates to a specific method for determining the resolution of a camera module, as Figure 16 shown, including the following steps:
[0094] S1: Provide a reticle with a circular pattern.
[0095] S2: Adopt local ROI processing to extract a field ROI region with a width and height of BlockW and BlockH centered on the field point (FieldPCx, FieldPCy).
[0096] S3: Perform binary segmentation on the field ROI region.
[0097] S4: Store the smallest rectangular region containing the sector vertex and two endpoints as the sector ROI region.
[0098] S5: Locate the edge at the black-and-white transition position within the effective region of the sector, obtain the gray-scale distribution curve in the radial direction, then perform differential calculation on the curve to calculate the curve change rate, and use the change rate as the weight to weight the coordinates to obtain the sub-pixel coordinates of the edge.
[0099] S6: Uniformly process the sector regions, including uniformly rotating sectors in different directions to the horizontal direction for processing.
[0100] S7: After obtaining the coordinates and getting the ESF curve through grayscale binarization, perform differential processing on the ESF curve to calculate the line spread function (LSF). Then add a Hamming window to prevent frequency leakage during frequency domain transformation, and perform a fast Fourier transform (FFT) on the windowed curve to transform it to the frequency domain to calculate the modulation transfer function (MTF) curve. The value at a specific frequency output is the SFR value.
[0101] The embodiment of the present application also provides a device for determining the resolution of a camera module. It should be noted that the device for determining the resolution of the camera module in the embodiment of the present application can be used to execute the method for determining the resolution of the camera module provided in the embodiment of the present application. This device is used to implement the above-mentioned embodiments and preferred implementation manners, and those that have been described will not be repeated. As used hereinafter, the term "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0102] The following introduces the device for determining the resolution of the camera module provided in the embodiment of the present application.
[0103] Figure 17 is a schematic diagram of the device for determining the resolution of the camera module according to the embodiment of the present application. As Figure 17 shown, the device includes: an acquisition unit 10, a first determination unit 20, a second determination unit 30, and a third determination unit 40. The acquisition unit 10 is used to acquire a calibration plate image, where the calibration plate image is an image obtained by using the camera module to photograph a calibration plate with a circular pattern, and the circular pattern covers the entire field of view and includes edge information in all directions; the first determination unit 20 is used to extract multiple field of view ROI regions from the calibration plate image, and determine the circles ranked in the top N in terms of distance in each of the field of view ROI regions as target circles, where the distance ranking is in ascending order of the target distance, and the target distance is the distance between the center of the target circle and the center of the field of view ROI region, and N is a positive integer; the second determination unit 30 is used to determine the sector effective region corresponding to the target circle and the coordinates of each pixel point in the sector effective region based on the sagittal direction and / or the tangential direction. The pixel points in the sector effective region include transition pixel points in the transition region and non-pixel points in the non-transition region. One target circle corresponds to multiple sector effective regions, and one sector effective region corresponds to one direction; the third determination unit 40 is used to determine the edge spread function curve of the camera module according to the coordinates of each pixel point, and determine the SFR value of the camera module according to the edge spread function curve, where the SFR value is used to characterize the resolution of the camera module.
[0104] The device for determining the resolution of the camera module of the present application includes: an acquisition unit, a first determination unit, a second determination unit, and a third determination unit. The acquisition unit is used to acquire a calibration plate image, which is an image obtained by using the camera module to photograph a calibration plate with a circular pattern. The circular pattern covers the entire field of view and includes edge information in all directions. The first determination unit is used to extract multiple field-of-view ROI regions from the calibration plate image, and determine the circles ranked in the top N in terms of distance in each field-of-view ROI region as target circles. The distance ranking is in ascending order of the target distance, and the target distance is the distance between the center of the target circle and the center of the field-of-view ROI region. N is a positive integer. The second determination unit is used to determine the sector effective region corresponding to the target circle and the coordinates of each pixel point in the sector effective region based on the sagittal direction and / or the tangential direction. The pixel points in the sector effective region include the transition pixel points in the transition region and the non-pixel points in the non-transition region. One target circle corresponds to multiple sector effective regions, and one sector effective region corresponds to one direction. The third determination unit is used to determine the edge spread function curve of the camera module according to the coordinates of each pixel point, and determine the SFR value of the camera module according to the edge spread function curve. The SFR value is used to characterize the resolution of the camera module. This device can not only effectively improve the test UPH, but also effectively calculate the SFR value in any direction, especially in the S / T direction, whether the image is distorted or not, and can improve the test stability, solving the problems that the resolution test scheme of the camera module in the prior art cannot be effectively compared with the lens test, and the algorithm is prone to failure, there is a field-of-view deviation, and the stability is poor.
[0105] In some examples, the first determination unit includes a first processing module, a first determination module, a second determination module, and a third determination module. The first processing module is used to perform binary segmentation on each of the above-mentioned field-of-view ROI regions to obtain a binary image corresponding to the above-mentioned field-of-view ROI region. The first determination module is used to determine the number of all pixel points in each of the above-mentioned circular parts in the above-mentioned binary image, and remove the above-mentioned circular parts with the number of pixel points less than or equal to a preset number to obtain the remaining circles. The second determination module is used to determine the relative distance of each of the above-mentioned remaining circles according to the first calculation formula , where is the relative distance of the above-mentioned remaining circle, Area is the area of the above-mentioned remaining circle, and d is the maximum distance from the center of the above-mentioned remaining circle to the edge contour of the above-mentioned field-of-view ROI region. The third determination module is used to determine the above-mentioned remaining circle with the smallest relative distance as the above-mentioned target circle. In this way, the searched circular dots can be accurately screened, the circular dots with incomplete edges can be removed, and finally the circular dot closest to the field-of-view point is located as the main body for subsequent calculations.
[0106] In some examples, the second determination unit includes a fourth determination module, a fifth determination module, and a sixth determination module. The fourth determination module is configured to determine an initial triangular region corresponding to the target circle based on the sagittal direction and / or the tangential direction, and one of the vertices of the initial triangular region is the vertex of the effective sector region. The fifth determination module is configured to determine the inner diameter and the outer diameter of the effective sector region, and determine the effective sector region from the initial triangular region, where the effective sector region includes the transition region and the non-transition region. The sixth determination module is configured to determine the coordinates of the non-pixel points in the non-transition region, and calculate the sub-pixel coordinates of the transition pixel points in the transition region by using the radial differential centroid method. This can mask invalid, interfering, or computationally unstable regions and ensure the stability of subsequent ESF curve calculations.
[0107] In some examples, the fourth determination module further includes a first determination sub-module, a second determination sub-module, and a third determination sub-module. The first determination sub-module is configured to determine the first endpoint coordinate and the second endpoint coordinate of the initial triangular region according to the first endpoint formula and the second endpoint formula , where D is the diameter of the target circle, (Cx, Cy) is the center coordinate of the target circle, is the central angle of the initial triangular region, A is the included angle between the two boundaries of the initial triangular region, (Px1, Py1) is the first endpoint coordinate, and (Px2, Py2) is the second endpoint coordinate. The second determination sub-module is configured to determine the first endpoint and the second endpoint respectively according to the first endpoint coordinate and the second endpoint coordinate. The third determination sub-module is configured to determine the center of the target circle as one of the vertices of the initial triangular region, and determine the first endpoint and the second endpoint as the other two vertices of the initial triangular region, so as to obtain the initial triangular region. This can accurately determine the three vertices of the initial triangular region, and thus subsequently determine the effective sector region from the initial triangular region.
[0108] In some examples, the third determination unit includes a second processing module, a seventh determination module, a third processing module, an eighth determination module, and a ninth determination module. The second processing module is configured to rotate all the effective sector regions to the same horizontal direction to obtain the rotated sector regions. The seventh determination module is configured to determine the rotated coordinates of the pixel points in the effective sector region according to the rotation coordinate formula , where (Cx, Cy) is the coordinate of the vertex of the effective sector region, is the central angle of the above-mentioned fan-shaped effective area, (x, y) is the initial coordinates of the pixel points in the above-mentioned fan-shaped effective area, and (Rx, Ry) is the rotated coordinates of the pixel points in the above-mentioned rotated fan-shaped area; the third processing module is used to calculate the target distance between the above-mentioned non-pixel points and the above-mentioned pixel points along the radial direction, and the above-mentioned radial direction is the direction where the above-mentioned non-pixel point and the vertex of the above-mentioned fan-shaped effective area are located; the eighth determination module is used to determine the average value of the gray value of the above-mentioned non-pixel point and the gray value of the above-mentioned pixel points along the radial direction as the gray mean value corresponding to the above-mentioned target distance; the ninth determination unit is used to determine the above-mentioned edge expansion function curve according to the above-mentioned target distance and the corresponding above-mentioned gray mean value. This can facilitate fitting the edge points in a unified manner to obtain the theoretical edge at the black-and-white transition position. In addition, the rotation operation here is only for processing the pixel point coordinates and will not perform any image gray value interpolation operation to affect the SFR calculation result.
[0109] In some examples, the third determination unit further includes a fourth processing module, a fifth processing module, a sixth processing module, and a tenth determination module. The fourth processing module is used to perform a difference processing on the above-mentioned edge expansion function curve to calculate and obtain a line spread function curve; the fifth processing module is used to perform a Hamming window processing on the above-mentioned line spread function curve to obtain a windowed curve; the sixth processing module is used to perform a fast Fourier transform on the above-mentioned windowed curve to transform it into the frequency domain to calculate and obtain a modulation transfer function curve; the tenth determination module is used to output the value at a specific frequency according to the above-mentioned modulation transfer function curve and determine this value as the above-mentioned SFR value. Developing a special projection method can ensure the stability of the calculation.
[0110] In some examples, the third determination unit further includes an eleventh determination module, a twelfth determination module, and a seventh processing module. The eleventh determination module is used to determine the SFR value of each of the above-mentioned fan-shaped effective areas in each direction according to the above-mentioned edge expansion function curve; the twelfth determination module is used to determine the first sagittal direction coefficient of the plane model in the above-mentioned first sagittal direction according to the first plane model coefficient calculation formula , where (a, b, c) are the plane model coefficients in the above-mentioned first sagittal direction, , SFR_S1_i is the SFR value of the i-th above-mentioned fan-shaped effective area in the above-mentioned first sagittal direction, S1_i_x is the x coordinate of the vertex of the i-th above-mentioned fan-shaped effective area in the above-mentioned first sagittal direction, S1_i_y is the y coordinate of the vertex of the i-th above-mentioned fan-shaped effective area in the above-mentioned first sagittal direction, and i = 1, 2, 3, 4; the seventh processing module is used to determine according to the SFR value calculation formula , the SFR values of the four above-mentioned target circles in the above-mentioned first sagittal direction are plane-fitted to obtain the target SFR value of the above-mentioned field point in the above-mentioned first sagittal direction. (x, y) are plane coordinates, and z is the SFR value of the (x, y) position in the above-mentioned first sagittal direction. This can solve the problem that the Circular SFR algorithm calculates the SFR value of the field point by calculating the fan-shaped ROI area on the nearest circular point, so there is a field deviation and it cannot truly reflect the resolution of the field point.
[0111] The device for determining the resolution of the above-mentioned camera module includes a processor and a memory. The above-mentioned acquisition unit and the like are all stored in the memory as program units, and the corresponding functions are implemented by the processor executing the above-mentioned program units stored in the memory. The above-mentioned modules are all located in the same processor; alternatively, the above-mentioned modules are respectively located in different processors in any combination form.
[0112] The processor contains a kernel, and the kernel retrieves the corresponding program unit from the memory. One or more kernels can be set, and by adjusting the kernel parameters, the resolution test scheme of the camera module in the prior art cannot be effectively benchmarked with the lens test, and the algorithm is prone to failure, there is a field deviation, and the stability is poor.
[0113] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of, for example, read-only memory (ROM) or flash memory (flash RAM). The memory includes at least one memory chip.
[0114] An embodiment of the present invention provides a computer-readable storage medium. The above-mentioned computer-readable storage medium includes a stored program. Among them, when the above-mentioned program runs, it controls the device where the above-mentioned computer-readable storage medium is located to execute the method for determining the resolution of the above-mentioned camera module.
[0115] An embodiment of the present invention provides a processor. The above-mentioned processor is used to run a program. Among them, when the above-mentioned program runs, it executes the method for determining the resolution of the above-mentioned camera module.
[0116] An embodiment of the present invention provides a device. The device includes a processor, a memory, and a program stored on the memory and executable on the processor. When the processor executes the program, it implements at least the following steps:
[0117] Step S201, obtain a calibration plate image. The above-mentioned calibration plate image is an image obtained by using a camera module to photograph a calibration plate with a circular pattern. The above-mentioned circular pattern covers the entire field of view and includes edge information in all directions;
[0118] Step S202: Extract multiple field-of-view ROI regions from the above-mentioned calibration plate image, and determine the target circles as the top N circles ranked by distance in each of the above-mentioned field-of-view ROI regions. The above distance ranking is in ascending order of the target distance, where the target distance is the distance between the center of the target circle and the center of the field-of-view ROI region, and N is a positive integer;
[0119] Step S203: Based on the sagittal direction and / or the tangential direction, determine the corresponding sector effective regions of the above-mentioned target circles and the coordinates of each pixel point in the above-mentioned sector effective regions. The pixel points in the above-mentioned sector effective regions include the transitional pixel points in the transitional region and the non-pixel points in the non-transitional region. One above-mentioned target circle corresponds to multiple above-mentioned sector effective regions, and one above-mentioned sector effective region corresponds to one direction;
[0120] Step S204: According to the coordinates of each of the above-mentioned pixel points, determine the edge spread function curve of the above-mentioned camera module, and according to the above-mentioned edge spread function curve, determine the SFR value of the above-mentioned camera module. The SFR value is used to characterize the resolution of the above-mentioned camera module.
[0121] The devices in this article can be servers, PCs, PADs, mobile phones, etc.
[0122] This application also provides a computer program product, which, when executed on a data processing device, is adapted to execute a program initialized with at least the following method steps:
[0123] Step S201: Obtain a calibration plate image, where the calibration plate image is an image obtained by using a camera module to photograph a calibration plate with a circular pattern. The circular pattern covers the entire field of view and includes edge information in each direction;
[0124] Step S202: Extract multiple field-of-view ROI regions from the above-mentioned calibration plate image, and determine the target circles as the top N circles ranked by distance in each of the above-mentioned field-of-view ROI regions. The above distance ranking is in ascending order of the target distance, where the target distance is the distance between the center of the target circle and the center of the field-of-view ROI region, and N is a positive integer;
[0125] Step S203: Based on the sagittal direction and / or the tangential direction, determine the corresponding sector effective regions of the above-mentioned target circles and the coordinates of each pixel point in the above-mentioned sector effective regions. The pixel points in the above-mentioned sector effective regions include the transitional pixel points in the transitional region and the non-pixel points in the non-transitional region. One above-mentioned target circle corresponds to multiple above-mentioned sector effective regions, and one above-mentioned sector effective region corresponds to one direction;
[0126] Step S204: Determine the edge extension function curve of the camera module according to the coordinates of each of the above pixel points, and determine the SFR value of the camera module according to the edge extension function curve, where the SFR value is used to characterize the resolution of the camera module.
[0127] Obviously, those skilled in the art should understand that the various modules or steps of the present invention described above can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed over a network composed of multiple computing devices. They can be implemented by program codes executable by the computing device. Thus, they can be stored in a storage device and executed by the computing device. And in some cases, the steps shown or described herein can be executed in a different order, or they can be separately fabricated into individual integrated circuit modules, or multiple modules or steps among them can be fabricated into a single integrated circuit module for implementation. In this way, the present invention is not limited to any specific combination of hardware and software.
[0128] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program codes.
[0129] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, as well as the combination of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0130] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device that implements the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0131] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide for implementing the process Figure 1 a process or multiple processes and / or blocks Figure 1 steps of the functions specified in a block or multiple blocks.
[0132] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.
[0133] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM), and / or non-volatile memory such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of computer-readable media.
[0134] Computer-readable media includes permanent and non-permanent, removable and non-removable media and can store information by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.
[0135] It should also be noted that the term "comprising", "including" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, commodity or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, commodity or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of another identical element in the process, method, commodity or device comprising the element.
[0136] From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:
[0137] 1)、For the method of determining the resolution of the above camera module of the present application, first, a calibration plate image is obtained. The calibration plate image is an image obtained by using the camera module to photograph a calibration plate with a circular pattern. Then, multiple field-of-view ROI regions are extracted from the calibration plate image, and the top N circles in terms of distance in each field-of-view ROI region are determined as target circles. The target distance is the distance between the center of the target circle and the center of the field-of-view ROI region. Then, based on the sagittal direction and / or the tangential direction, the sector effective region corresponding to the target circle and the coordinates of each pixel point in the sector effective region are determined. The pixel points in the sector effective region include the transition pixel points in the transition region and the non-pixel points in the non-transition region. Finally, according to the coordinates of each pixel point, the edge spread function curve of the camera module is determined, and based on the edge spread function curve, the SFR value of the camera module is determined. This method can not only effectively improve the test UPH, but also effectively calculate the SFR value in any direction, especially the S / T direction, whether the image is distorted or not, and can improve the test stability, solving the problems that the resolution test scheme of the camera module in the prior art cannot be effectively compared with the lens test, and the algorithm is prone to failure, there is a field-of-view deviation and the stability is poor.
[0138] 2)、The device for determining the resolution of the above camera module of the present application includes: an acquisition unit, a first determination unit, a second determination unit, and a third determination unit. The acquisition unit is used to acquire a calibration plate image, which is an image obtained by using the camera module to photograph a calibration plate with a circular pattern, and the circular pattern covers the entire field of view and includes edge information in each direction. The first determination unit is used to extract multiple field-of-view ROI regions from the calibration plate image, and determine the top N circles in terms of distance in each field-of-view ROI region as target circles. The distance ranking is in ascending order of the target distance, and the target distance is the distance between the center of the target circle and the center of the field-of-view ROI region, and N is a positive integer. The second determination unit is used to determine the sector effective region corresponding to the target circle and the coordinates of each pixel point in the sector effective region based on the sagittal direction and / or the tangential direction. The pixel points in the sector effective region include the transition pixel points in the transition region and the non-pixel points in the non-transition region. One target circle corresponds to multiple sector effective regions, and one sector effective region corresponds to one direction. The third determination unit is used to determine the edge spread function curve of the camera module according to the coordinates of each pixel point, and determine the SFR value of the camera module based on the edge spread function curve. The SFR value is used to characterize the resolution of the camera module. This device can not only effectively improve the test UPH, but also effectively calculate the SFR value in any direction, especially the S / T direction, whether the image is distorted or not, and can improve the test stability, solving the problems that the resolution test scheme of the camera module in the prior art cannot be effectively compared with the lens test, and the algorithm is prone to failure, there is a field-of-view deviation and the stability is poor.
[0139] The above are only the preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the protection scope of the present application.
Claims
1. A method for determining the resolution of a camera module, characterized in that: include: Acquire a standard plate image, wherein the standard plate image is an image obtained by photographing a standard plate with a circular pattern using a camera module, wherein the circular pattern covers the entire field of view and includes edge information in all directions; Extract multiple field of view ROI areas from the standard plate image, and determine the circles with the top N distance rankings in each field of view ROI area as target circles, wherein the distance ranking is ranked from small to large according to the target distance, and the target distance is the distance between the center of the target circle and the center of the field of view ROI area, and N is a positive integer; Based on the sagittal direction and / or the tangential direction, determine the sector-shaped effective area corresponding to the target circle and the coordinates of each pixel point in the sector-shaped effective area, the pixel points in the sector-shaped effective area include transition pixel points in the transition area and non-pixel points in the non-transition area, one target circle corresponds to multiple sector-shaped effective areas, and one sector-shaped effective area corresponds to one direction; According to the coordinates of each of the pixel points, an edge extension function curve of the camera module is determined, and according to the edge extension function curve, an SFR value of the camera module is determined, and the SFR value is used to characterize the resolution of the camera module.
2. The method according to claim 1, characterized in that Determining the sector-shaped effective area corresponding to the target circle and the coordinates of each pixel point in the sector-shaped effective area based on the sagittal direction and / or the tangential direction includes: Based on the sagittal direction and / or the tangential direction, determining an initial triangular area corresponding to the target circle, wherein one of the vertices of the initial triangular area is a vertex of the fan-shaped effective area; Determine the inner diameter and the outer diameter of the fan-shaped effective area, and determine the fan-shaped effective area from the initial triangular area, wherein the fan-shaped effective area includes the transition area and the non-transition area; The coordinates of the non-pixel points in the non-transition area are determined, and the sub-pixel coordinates of the transition pixel points in the transition area are calculated using a radial difference centroid method.
3. The method according to claim 2, characterized in that Determining an initial triangular area corresponding to the target circle based on the sagittal direction and / or the tangential direction includes: According to the first endpoint formula and the second endpoint formula , determine the first endpoint coordinates and the second endpoint coordinates of the initial triangular area, where D is the diameter of the target circle, (Cx, Cy) is the center coordinates of the target circle, is the center angle of the initial triangle area, A is the desired fan angle range, (Px1, Py1) is the first endpoint coordinate, (Px2, Py2) is the second endpoint coordinate; Determine the first endpoint and the second endpoint respectively according to the first endpoint coordinates and the second endpoint coordinates; The center of the target circle is determined as one of the vertices of the initial triangular area, and the first endpoint and the second endpoint are determined as the other two vertices of the initial triangular area, so as to obtain the initial triangular area.
4. The method according to claim 1, characterized in that: Determining an edge spread function curve of the camera module according to the coordinates of each of the pixel points includes: Rotating all the sector-shaped effective areas to the same horizontal direction to obtain a rotated sector-shaped area; According to the rotation coordinate formula , determine the rotated coordinates of each pixel point in the sector effective area, where (Cx, Cy) is the coordinate of the vertex of the sector effective area, is the central angle of the sector effective area, (x, y) is the initial coordinates of the pixel points in the sector effective area, and (Rx, Ry) is the rotated coordinates of the pixel points in the sector area after rotation; Calculating a target distance between the non-pixel point and the pixel point along a radial direction of the non-pixel point, wherein the radial direction is a direction where the non-pixel point and the vertex of the fan-shaped effective area are located; Determine the average of the grayscale values of the non-pixel points and the grayscale values of the pixel points along the radial direction of the non-pixel points as the grayscale mean corresponding to the target distance; The edge spread function curve is determined according to the target distance and the corresponding grayscale mean.
5. The method according to claim 1, characterized in that Determining the SFR value of the camera module according to the edge spread function curve includes: Performing differential processing on the edge spread function curve to calculate and obtain a line spread function curve; Performing Hamming window processing on the line spread function curve to obtain a windowed curve; Performing a fast Fourier transform on the windowed curve to convert it into a frequency domain to calculate and obtain a modulation transfer function curve; According to the modulation transfer function curve, a value at a specific frequency is output, and the value is determined as the SFR value.
6. The method according to claim 1, characterized in that N=4, the center of the field of view ROI area is the field of view point, one target circle corresponds to four sector-shaped effective areas, the four sector-shaped effective areas correspond to the first sagittal direction, the second sagittal direction, the first tangential direction and the second tangential direction respectively, and the SFR value of the camera module is determined according to the edge spread function curve, including: Determining the SFR value of each of the sector-shaped effective areas in each direction according to the edge spread function curve; According to the first plane model coefficient calculation formula , determine the first sagittal direction coefficient of the plane model in the first sagittal direction, where (a, b, c) are the plane model coefficients in the first sagittal direction, , SFR_S1_i is the SFR value of the i-th sector effective area in the first sagittal direction, S1_i_x is the x-coordinate of the vertex of the i-th sector effective area in the first sagittal direction, S1_i_y is the y-coordinate of the vertex of the i-th sector effective area in the first sagittal direction, i=1, 2, 3, 4; According to the SFR value calculation formula , perform plane fitting on the SFR values of the four target circles in the first sagittal direction to obtain the target SFR value of the field of view point in the first sagittal direction, (x, y) is the plane coordinate, and z is the SFR value of the (x, y) position in the first sagittal direction.
7. A device for determining the resolution of a camera module, characterized in that: include: An acquisition unit, used for acquiring a standard plate image, wherein the standard plate image is an image obtained by photographing a standard plate with a circular pattern using a camera module, wherein the circular pattern covers the entire field of view and includes edge information in all directions; A first determination unit is used to extract multiple field of view ROI areas from the standard plate image, and determine the circles with the top N distance rankings in each field of view ROI area as target circles, wherein the distance ranking is ranked from small to large according to the target distance, and the target distance is the distance between the center of the target circle and the center of the field of view ROI area, and N is a positive integer; A second determination unit is used to determine the sector-shaped effective area corresponding to the target circle and the coordinates of each pixel point in the sector-shaped effective area based on the sagittal direction and / or the tangential direction, the pixel points in the sector-shaped effective area include transition pixel points in the transition area and non-pixel points in the non-transition area, one target circle corresponds to multiple sector-shaped effective areas, and one sector-shaped effective area corresponds to one direction; The third determination unit is used to determine the edge extension function curve of the camera module according to the coordinates of each of the pixel points, and determine the SFR value of the camera module according to the edge extension function curve, wherein the SFR value is used to characterize the resolution of the camera module.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method for determining the resolution of a camera module as described in any one of claims 1 to 6.
9. An electronic device, characterized in that: include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include a method for determining the resolution of a camera module as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Camera module resolution detection method and device, electronic equipment and storage medium
CN116456074A
Camera SFR image analysis capability calculation method and device, and computer storage medium
CN118334499A