Method and device for determining resolution of camera module, storage medium and electronic equipment
By obtaining the standard image and calculating the edge expansion function curve of the camera module, and determining the SFR value, the problem of the resolution test solution in the prior art cannot be matched with the lens, poor field of view deviation and stability, and efficient analysis is achieved Force test.
Patent Information
- Application Number
- CN202411630364.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2044-11-14
AI Technical Summary
In the prior art, the camera module resolution test solution cannot be effectively benchmarked with lens test, and the algorithm is prone to failure, there is a field of view deviation and poor stability.
By acquiring the label image, extracting the field of view ROI area, determining the sector-shaped effective area and pixel point coordinates of the target circle based on the sagittal direction and/or the tangential direction, the edge expansion function curve of the camera module is calculated to determine the SFR value.
It realizes the effective calculation of SFR values in any direction when the image has or is distorted, improves the test stability, and solves the shortcomings of the resolution test scheme in the prior art.
Smart Images

Figure CN119151921A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of SFR testing, and more specifically, to 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. Background Art
[0002] As the demand for images surges in the AI era, the requirements for testing the resolution of camera modules are also gradually increasing. Figure 1 As shown in the figure, the conventional SFR (spatial frequency response) method based on inclined edges is currently a more common resolution test solution, but this method has the following problems: first, the conventional SFR method cannot be effectively compared with the lens test; second, the conventional SFR method has requirements for the angle of the inclined edge, but because the FOV of the wide-angle module is larger, the algorithm will fail; third, the conventional SFR algorithm has a field of view deviation, and the stability of repeated tests at the same or different workstations is poor. Summary of the invention
[0003] The main purpose of the present application is to 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, so as to at least solve the problems in the prior art that the resolution test scheme of the camera module cannot be effectively matched with the lens test, and the algorithm is prone to failure, there is a field of view deviation and the stability is poor.
[0004] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for determining the resolution of a camera module is provided, including: obtaining a standard plate image, wherein the standard plate image is an image obtained by using a camera module to shoot a standard plate with a circular pattern, wherein the circular pattern covers the entire field of view and includes edge information in all directions; extracting multiple field of view ROI areas from the standard plate image, and determining the circles with the top N distance rankings in each of the field of view ROI areas as target circles, wherein the distance ranking is a ranking 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. distance, N is a positive integer; based on the sagittal direction and / or the tangential direction, determine the fan-shaped effective area corresponding to the target circle and the coordinates of each pixel point in the fan-shaped effective area, the pixel points in the fan-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 fan-shaped effective areas, and one fan-shaped effective area corresponds to one direction; according to the coordinates of each pixel point, determine the edge extension function curve of the camera module, and according to the edge extension function curve, determine the SFR value of the camera module, the SFR value is used to characterize the resolution of the camera module.
[0005] Optionally, the circular part in the circular pattern is black, the non-circular part is white, N=1, multiple field of view ROI areas are extracted from the standard plate image, and the circles ranked in the top N in distance in each field of view ROI area are determined as target circles, including: performing binary segmentation on each field of view ROI area to obtain a binary image corresponding to the field of view ROI area; determining the number of all pixels in each circular part in the binary image, and removing the circular part whose number of pixels is less than or equal to a preset number to obtain the remaining circles; according to the first calculation formula , determine the relative distances of the remaining circles, where is the relative distance of the remaining circles, Area is the area of the remaining circles, and d is the maximum distance from the center of the remaining circles to the edge contour of the field of view ROI area; the remaining circle with the smallest relative distance is determined as the target circle.
[0006] Optionally, based on the sagittal direction and / or the tangential direction, the fan-shaped effective area corresponding to the target circle and the coordinates of each pixel point in the fan-shaped effective area are determined, including: based on the sagittal direction and / or the tangential direction, determining the initial triangular area corresponding to the target circle, one of the vertices of the initial triangular area is the vertex of the fan-shaped effective area; determining the inner diameter and the outer diameter of the fan-shaped effective area, determining the fan-shaped effective area from the initial triangular area, the fan-shaped effective area includes the transition area and the non-transition area; determining the coordinates of the non-pixel points in the non-transition area, and using the radial difference centroid method to calculate the sub-pixel coordinates of the transition pixel points in the transition area.
[0007] Optionally, based on the sagittal direction and / or the tangential direction, determining the initial triangular area corresponding to the target circle 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 central angle of the initial triangle, A is the angle between the two boundaries of the initial triangle, (Px1, Py1) is the coordinate of the first endpoint, and (Px2, Py2) is the coordinate of the second endpoint; according to the coordinate of the first endpoint and the coordinate of the second endpoint, the first endpoint and the second endpoint are determined respectively; the center of the target circle is determined as one of the vertices of the initial triangle, and the first endpoint and the second endpoint are determined as the other two vertices of the initial triangle to obtain the initial triangle.
[0008] Optionally, according to the coordinates of each pixel point, determining the edge extension function curve of the camera module includes: rotating all the sector-shaped effective areas to the same horizontal direction to obtain the rotated sector-shaped area; according to the rotation coordinate formula , determine the rotated coordinates of each pixel point in the sector-shaped effective area, where (Cx, Cy) is the coordinate of the vertex of the sector-shaped effective area, is the center angle of the sector-shaped effective area, (x, y) is the initial coordinates of the pixel points in the sector-shaped effective area, and (Rx, Ry) is the rotated coordinates of the pixel points in the rotated sector-shaped area; calculate the target distance between the non-pixel point and the pixel points along the radial direction of the non-pixel point, and the radial direction is the direction where the non-pixel point and the vertex of the sector-shaped effective area are located; determine the average grayscale value of the non-pixel point and the grayscale value of the pixel point along the radial direction of the non-pixel point as the grayscale mean corresponding to the target distance; determine the edge extension function curve according to the target distance and the corresponding grayscale mean.
[0009] Optionally, the SFR value of the camera module is determined according to the edge spread function curve, including: performing differential processing on the edge spread function curve to calculate a line spread function curve; performing Hamming window processing on the line spread function curve to obtain a windowed curve; performing fast Fourier transform on the windowed curve to convert it into the frequency domain to calculate a modulation transfer function curve; according to the modulation transfer function curve, outputting a value at a specific frequency, and determining the 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 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 expansion function curve, including: determining the SFR value of each sector-shaped effective area in each direction according to the edge expansion function curve; calculating the coefficient of the first plane model according to the 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.
[0011] According to another aspect of the present application, a device for determining the resolution of a camera module is provided, including: an acquisition unit for acquiring a standard plate image, wherein the standard plate image is an image obtained by using a camera module to shoot a standard plate with a circular pattern, wherein the circular pattern covers the entire field of view and includes edge information in all directions; a first determination unit for extracting multiple field of view ROI areas from the standard plate image, and determining the circles with the top N distance rankings in each of the field of view ROI areas as target circles, wherein the distance ranking is a ranking 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, where N is a positive integer; a second determining unit, for determining the fan-shaped effective area corresponding to the target circle and the coordinates of each pixel point in the fan-shaped effective area based on the sagittal direction and / or the tangential direction, the pixel points in the fan-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 fan-shaped effective areas, and one fan-shaped effective area corresponds to one direction; a third determining unit, for determining the edge extension 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 extension function curve, the SFR value being used to characterize the resolution of the camera module.
[0012] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the methods for determining the resolution of the camera module.
[0013] According to another aspect of the present application, an electronic device is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and 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 the camera module to execute any one of the methods.
[0014] Applying the technical solution of the present application, the method for determining the resolution of the above-mentioned camera module first obtains a standard plate image, which is an image obtained by using a camera module to shoot a standard plate with a circular pattern; then, multiple field of view ROI areas are extracted from the standard plate image, and the circles with the top N distance rankings in each field of view ROI area 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 area; then, based on the sagittal direction and / or the tangential direction, the fan-shaped effective area corresponding to the target circle and the coordinates of each pixel point in the fan-shaped effective area are determined, and the pixel points in the fan-shaped effective area include transition pixel points in the transition area and non-pixel points in the non-transition area; finally, according to the coordinates of each pixel point, the edge extension function curve of the camera module is determined, and according to the edge extension 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 in the existing technology that the resolution test scheme of the camera module cannot be effectively matched with the lens test, and the algorithm is prone to failure, there is field of view deviation and poor stability. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The drawings constituting part of the present application are used to provide a further understanding of the present application. The exemplary embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0016] Figure 1 A hardware structure block diagram of a mobile terminal for executing a method for determining the resolution of a camera module provided in an embodiment of the present application is shown;
[0017] Figure 2 A schematic diagram of a flow chart of a method for determining the resolution of a camera module provided in accordance with an embodiment of the present application is shown;
[0018] Figure 3 A schematic diagram of a circular marking plate style provided according to an embodiment of the present application is shown;
[0019] Figure 4 A schematic diagram of multiple field of view ROI regions provided according to an embodiment of the present application is shown;
[0020] Figure 5 An S / T direction definition diagram provided according to an embodiment of the present application is shown;
[0021] Figure 6 A schematic diagram of selecting a circular initial triangle area provided according to an embodiment of the present application is shown;
[0022] Figure 7A schematic diagram showing a minimum rectangular area of a stored initial triangular area provided according to an embodiment of the present application is shown;
[0023] Figure 8 A schematic diagram showing a valid area of a stored initial triangle area provided according to an embodiment of the present application is shown;
[0024] Fig. 9 A schematic diagram of sub-pixel edge point positioning within an effective area provided according to an embodiment of the present application is shown;
[0025] Fig.10 A schematic diagram of fitting edge points in the horizontal direction provided according to an embodiment of the present application is shown;
[0026] Fig.11 A schematic diagram showing the projection of pixel points in the effective area along the radial direction according to an embodiment of the present application is shown;
[0027] Fig.12 A graph showing an ESF (edge spread function) value of an initial triangle effective area provided according to an embodiment of the present application;
[0028] Fig.13 A graph showing the LSF (Line Spread Function) value of the initial triangle effective area provided according to an embodiment of the present application;
[0029] Fig.14 A graph showing the MTF (Modulation Transfer Function) value of the initial triangle effective area provided according to an embodiment of the present application;
[0030] Fig.15 A schematic diagram showing the selection of a circular triangular area according to a specific method for determining the resolution of a camera module provided in an embodiment of the present application;
[0031] Fig.16 A flowchart of a method for determining the resolution of a specific camera module provided in an embodiment of the present application is shown;
[0032] Fig.17 A structural block diagram of a device for determining the resolution of a camera module provided according to an embodiment of the present application is shown.
[0033] The above drawings include the following reference numerals:
[0034] 102, processor; 104, memory; 106, transmission device; 108, input and output devices. DETAILED DESCRIPTION
[0035] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying 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 solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0037] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0038] As introduced in the background technology, the more common resolution test scheme in the prior art is the conventional SFR (spatial frequency response) method based on tilted edges. However, this method has the following problems: first, it can only test the resolution in the horizontal and vertical directions, but the lens design is generally rotationally symmetrical, and the sagittal and tangential directions can better reflect the module characteristics, and the lens test also uses the S / T direction, so 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, but the wide-angle module has a large FOV, and the image will produce a large distortion. In this case, the tilted edge of the field of view outside the image will be distorted into a horizontal or vertical edge, and the tilt angle will be lost, 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, and there is a field of view deviation, and the stability of repeated tests at the same station or different stations is poor.
[0039] In order to solve the problems in the prior art that the resolution test scheme of the camera module cannot be effectively matched 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] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with 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 in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of a method for determining the resolution of a camera module according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a 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, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0042] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for determining the resolution of the camera module in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above method is implemented. 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 memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The transmission device 106 is used to receive or send data via a network. The above-mentioned specific network examples may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[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 a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in an order different from that shown here.
[0044] Figure 2 FIG. 1 is a flow chart of a method for determining the resolution of a camera module according to an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:
[0045] Step S201, obtaining 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;
[0046] Specifically, the SFR test algorithm mainly evaluates the resolution of the camera module by analyzing the frequency response of the edge black-white transition part, while the conventional SFR Chart only contains the edges in the H / V directions. In order to calculate the SFR value in any direction, this embodiment uses dots containing edge information in each direction instead of color blocks, and designs a dot Chart style, such as Figure 3This chart style has the following advantages: first, it can be shared by multiple stations, improving test efficiency and UPH, and it does not need to be aligned, so the cost of use is low; second, the dots cover the entire field of view, and the desired field of view points can be flexibly set according to project requirements; third, the dots are staggered up and down 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 to reduce the overall test time;
[0047] Step S202, extracting multiple field of view ROI areas from the above-mentioned standard plate image, and determining the circles with the top N distance rankings in each of the above-mentioned field of view ROI areas as target circles, wherein the above-mentioned distance ranking is ranked from small to large according to the target distance, and the above-mentioned target distance is the distance between the center of the above-mentioned target circle and the center of the above-mentioned field of view ROI area, and N is a positive integer;
[0048] Specifically, in order to reduce the amount of calculation, improve the calculation efficiency, and facilitate the parallel processing of the algorithm, the algorithm idea of local ROI processing is adopted, and the field of view ROI area with width and height of BlockW and BlockH is extracted with the field of view point (FieldPCx, FieldPCy) as the center. Among them, FieldPCx is the horizontal coordinate of the field of view point FieldP, and FieldPCy is the vertical coordinate of the field of view point FieldP.
[0049] like Figure 4 As shown, Figure 4 In the figure, FieldPROI1, FieldPROI2, FieldPROI3, FieldPROI4 and FieldPROI5 are five field of view ROI areas respectively, 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] The circular part of the circular pattern is black, the non-circular part is white, N=1, and multiple field of view ROI areas are extracted from the standard plate image, and the circles ranked in the top N in distance in each of the field of view ROI areas are determined as target circles, including the following steps:
[0051] Step S2021, performing 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;
[0052] Step S2022, determining the number of all pixels in each of the circular parts in the binary image, and removing the circular parts whose number of pixels is less than or equal to a preset number, to obtain remaining circles;
[0053] Step S2023, according to the first calculation formula , determine the relative distances 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 area;
[0054] Step S2024: determine the remaining circle with the smallest relative distance as the target circle.
[0055] Specifically, this can accurately screen the searched dots, remove dots with incomplete edges, and finally locate the dots closest to the field of view point as the main body of subsequent calculations. Binarization segmentation is performed on each field of view ROI area. The binary grayscale threshold calculation can use the Otsu method of maximum inter-class variance or other algorithms. After binarization, all pixels corresponding to black dots are set to 1, indicating the foreground, and the remaining pixels are set to 0, indicating the background. Then, all connected areas (i.e. dots) in the binary image are searched and marked with different numbers. The searched dots are screened by area (number of pixels in the connected area) and circularity (as shown in the following formula) indicators to remove dots with incomplete edges. Finally, the dots closest to the field of view point are located as the main body of subsequent calculations.
[0056] Step S203, 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;
[0057] Specifically, similar to the concept of the knife edge in the conventional SFR algorithm, the concept of a sector is defined in Circular SFR, which is represented by one vertex and two endpoints. The central angle of the sector is the sagittal and tangential directions, where the direction of the line connecting the circle and the center of the image is the S direction, and the direction perpendicular to the S direction is the T direction, such as Figure 5 As shown, this step locates four sector ROI areas in the S / T direction according to the dot center, image center, dot diameter, and desired sector angle range, as shown in FIG. Figure 6 shown.
[0058] Wherein, based on the sagittal direction and / or the tangential direction, determining the sector-shaped effective area corresponding to the target circle and the coordinates of each pixel point in the sector-shaped effective area comprises the following steps:
[0059] Step S301, determining an initial triangular area corresponding to the target circle based on the sagittal direction and / or the tangential direction, wherein one of the vertices of the initial triangular area is a vertex of the fan-shaped effective area;
[0060] Wherein, based on the sagittal direction and / or the tangential direction, determining the initial triangular area corresponding to the target circle comprises the following steps:
[0061] Step S3011, 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 angle between the two boundaries of the initial triangular area, (Px1, Py1) is the coordinate of the first endpoint, and (Px2, Py2) is the coordinate of the second endpoint;
[0062] Step S3012, determining the first endpoint and the second endpoint respectively according to the first endpoint coordinates and the second endpoint coordinates;
[0063] Step S3013: 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.
[0064] Specifically, in this way, the three vertices of the initial triangular area can be accurately determined, so that the fan-shaped effective area can be determined from the initial triangular area later.
[0065] Because the images in the computer are stored in matrix form, the smallest rectangular area containing the vertex and two endpoints of the fan is used as the fan ROI area, such as Figure 7 Because there is interference from other dots in the sector ROI area, and in order to ensure that there are enough pixels at the same radial distance to ensure the stability of the ESF curve calculated below, it is necessary to determine the inner and outer diameters of the sector according to the number distribution of black pixels in the radial direction, that is, to determine the effective area within the sector ROI and shield the invalid, interfering or unstable areas, such as Figure 8 shown.
[0066] Step S302, determining the inner diameter and the outer diameter of the fan-shaped effective area, and determining 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;
[0067] Step S303, determining the coordinates of the non-pixel points in the non-transition area, and calculating the sub-pixel coordinates of the transition pixel points in the transition area using a radial difference centroid method.
[0068] Specifically, this can shield invalid, interfering or computationally unstable areas, ensuring the stability of the subsequent ESF curve calculation. Fig. 9 As shown, the edge points of the black-white transition position in the sector-shaped effective area are located. The positioning accuracy here must reach the sub-pixel level, otherwise it will affect the accuracy of the ESF curve calculated below, thereby affecting the accuracy of the final SFR. The present invention adopts the radial difference centroid method to calculate the sub-pixel edge points, that is, first obtain the grayscale 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, determining the edge extension function curve of the camera module according to the coordinates of each of the above pixel points, and determining 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.
[0070] Specifically, through the design and implementation of the dot chart, circular SFR algorithm, and plane fitting weighted algorithm, firstly, the test efficiency and UPH can be improved by using multiple stations at the same time; secondly, the resolution of the module in the S / T direction can be accurately tested, which is beneficial to the comparison between the module resolution test and the lens resolution test; thirdly, the algorithm will not fail in the case of wide-angle distortion, and can still accurately reflect the resolution situation; fourthly, the stability of repeated tests at the same station and between different stations can be improved; fifthly, the distortion calibration stations can be combined to reduce the overall test time.
[0071] According to the coordinates of each of the above pixel points, determining the edge spread function curve of the above camera module includes the following steps:
[0072] Step S401, rotating all the above-mentioned sector-shaped effective areas to the same horizontal direction to obtain a rotated sector-shaped area;
[0073] Step S402: According to the rotation coordinate formula , determine the rotated coordinates of each of the above-mentioned pixel points in the above-mentioned fan-shaped effective area, where (Cx, Cy) is the coordinate of the vertex of the above-mentioned fan-shaped effective area, is the central angle of the above-mentioned sector-shaped effective area, (x, y) is the initial coordinate of the pixel point in the above-mentioned sector-shaped effective area, and (Rx, Ry) is the rotated coordinate of the pixel point in the above-mentioned sector-shaped area after rotation;
[0074] Step S403, calculating the target distance between the non-pixel point and the pixel point along the radial direction of the non-pixel point, where the radial direction is the direction where the non-pixel point and the vertex of the fan-shaped effective area are located;
[0075] Step S404, determining 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;
[0076] Step S405: determining the edge spread function curve according to the target distance and the corresponding grayscale mean value.
[0077] Specifically, due to the definition of the S / T direction, the central angle of the fan-shaped ROI area may have various directions, which will inevitably bring difficulties to the edge point fitting. Therefore, in order to facilitate processing, the present invention uniformly rotates the fans in different directions to the horizontal direction for processing, such as Fig.10 As shown, this makes it easy to fit the edge points in a unified manner to obtain the theoretical edge of the black-white transition position. In addition, the rotation operation here is only a processing of the pixel coordinates, and no image gray value interpolation operation will occur to affect the SFR calculation result.
[0078] Wherein, determining the SFR value of the camera module according to the edge spread function curve comprises the following steps:
[0079] Step S501, performing differential processing on the edge spread function curve to calculate and obtain a line spread function curve;
[0080] Step S502, performing Hamming window processing on the line spread function curve to obtain a windowed curve;
[0081] Step S503, performing a fast Fourier transform on the windowed curve to convert it into the frequency domain to obtain a modulation transfer function curve;
[0082] Step S504: output a value at a specific frequency according to the modulation transfer function curve, and determine the value as the SFR value.
[0083] Specifically, the core step of the conventional SFR algorithm calculation is to project and calculate the ESF (edge spread function) curve. This embodiment develops a special projection method for arc edges, such as Figure 11 to Figure 12 As shown, the distance from the edge to each pixel in the sector-shaped effective area is calculated along the radial direction, and the grayscale values of pixels at the same distance are averaged to obtain the grayscale mean corresponding to the distance. During the projection process, the same 4-fold oversampling method as the conventional SFR algorithm is used to ensure the stability of the calculation.
[0084] After obtaining the ESF curve, the remaining steps are consistent with the conventional SFR algorithm, such as Fig.13 and Fig.14As shown in the figure, the ESF curve is differentially processed 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 converted to the frequency domain by fast Fourier transform (FFT) to calculate the modulation transfer function (MTF) curve, and the value at a specific frequency is output as the SFR value.
[0085] Wherein, N=4, the center of the field of view ROI area is the field of view point, one of the target circles corresponds to four of the above-mentioned sector-shaped effective areas, and 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. According to the edge spread function curve, determining the SFR value of the above-mentioned camera module includes the following steps:
[0086] Step S601, determining the SFR value of each of the above-mentioned sector-shaped effective areas in each direction according to the above-mentioned edge spread function curve;
[0087] Step S602: Calculate the coefficients of the first plane model using the formula , determine the first sagittal direction coefficient of the plane model in the above-mentioned first sagittal direction, 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 arc-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 arc-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 arc-sagittal direction, i=1, 2, 3, 4;
[0088] Step S603, 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.
[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 area on the nearest circle, so there is a field of view deviation and it cannot truly reflect the resolution of the field of view point. In order to solve the above problem, this embodiment designs and develops a weighted algorithm based on plane fitting, such as Fig.15As shown, locate the 4 dots closest to the field of view point, calculate the SFR value of the S1 / T1 / S2 / T2 direction sector ROI of each dot respectively. The 4 dots have a total of 4 S1 direction sectors, 4 T1 direction sectors, 4 S2 direction sectors and 4 T2 direction sectors. The SFR value of the S1 direction corresponding to the field of view point is calculated by plane fitting the S1 direction sector SFR values of the 4 dots. The plane model is shown in the following formula, and the plane distribution model of the SFR value of the S1 direction can be obtained, thereby calculating the SFR value of the S1 direction at the field of view point position, and the SFR values of the other directions of the field of view point can be obtained similarly.
[0090] The method for determining the resolution of the above-mentioned camera module of the present application first obtains a standard plate image, which is an image obtained by using a camera module to shoot a standard plate with a circular pattern; then, multiple field of view ROI areas are extracted from the standard plate image, and the circles with the top N distance rankings in each field of view ROI area 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 area; then, based on the sagittal direction and / or the tangential direction, the fan-shaped effective area corresponding to the target circle and the coordinates of each pixel point in the fan-shaped effective area are determined, and the pixel points in the fan-shaped effective area include transition pixel points in the transition area and non-pixel points in the non-transition area; finally, according to the coordinates of each pixel point, the edge extension function curve of the camera module is determined, and according to the edge extension 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 in the existing technology that the resolution test scheme of the camera module cannot be effectively matched with the lens test, and the algorithm is prone to failure, there is field of view deviation and poor stability.
[0091] In addition, the above embodiment requires SFR test equipment, Chart, module and test software integrating Circular SFR algorithm, and the specific implementation method is as follows: design a dot Chart drawing with suitable diameter according to module characteristics such as FOV, test distance, resolution and other indicators, print a film standard plate according to the drawing, and place the standard plate under the light source of the test equipment, fix the module in the fixture of the test equipment, collect images through the test software, and calculate with the above Circular SFR algorithm and weighted algorithm to output the SFR value of a specific frequency at a specific field of view point. Through the design and implementation of the dot Chart, Circular SFR algorithm and plane fitting weighted algorithm, first, the test efficiency and UPH can be improved by using multiple stations; second, the resolution of the module in the S / T direction can be accurately tested, which is conducive to 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 station and different stations can be improved; fifth, the distortion calibration station is merged to reduce the overall test time.
[0092] In order to enable those skilled in the art to more clearly understand the technical solution 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 combination with specific embodiments.
[0093] This embodiment relates to a specific method for determining the resolution of a camera module. Fig.16 As shown, the following steps are included:
[0094] S1: Provide a target plate with a circular pattern.
[0095] S2: Use local ROI processing to extract the field of view ROI area with width and height of BlockW and BlockH centered at the field of view point (FieldPCx, FieldPCy).
[0096] S3: Binarize and segment the field of view ROI area.
[0097] S4: Store the minimum rectangular area including the fan vertex and the two endpoints as the fan ROI area.
[0098] S5: Locate the edge of the black-white transition position in the sector-shaped effective area, obtain the grayscale distribution curve in the radial direction, then perform differential calculation on the curve to calculate the curve change rate, and weight the coordinates with the change rate as the weight to obtain the sub-pixel coordinates of the edge.
[0099] S6: uniformly processing the fan-shaped areas, including uniformly rotating the fans in different directions to a horizontal direction for processing.
[0100] S7: After obtaining the ESF curve based on the acquired coordinates and grayscale binary values, the ESF curve is differentially processed 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 converted to the frequency domain by fast Fourier transform (FFT) to calculate the modulation transfer function (MTF) curve, and the value at a specific frequency is output as 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 a camera module in the embodiment of the present application can be used to execute the method for determining the resolution of a camera module provided in the embodiment of the present application. The device is used to implement the above-mentioned embodiments and preferred implementation modes, and those that have been described will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0102] The following is an introduction to the device for determining the resolution of a camera module provided in an embodiment of the present application.
[0103] Fig.17 is a schematic diagram of a device for determining the resolution of a camera module according to an embodiment of the present application. Fig.17 As 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 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; the first determination unit 20 is used to extract a plurality of field of view ROI areas from the standard plate image, and determine the circles with the top N distance rankings in each of the field of view ROI areas as target circles, wherein the distance ranking is a ranking from small to large according to the target distance, wherein 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; the second determination unit 30 is used to determine the target circle based on the arc The vector direction and / or tangential direction are used to determine the fan-shaped effective area corresponding to the above-mentioned target circle and the coordinates of each pixel point in the above-mentioned fan-shaped effective area. The pixel points in the above-mentioned fan-shaped effective area include transition pixel points in the transition area and non-pixel points in the non-transition area. One above-mentioned target circle corresponds to multiple above-mentioned fan-shaped effective areas, and one above-mentioned fan-shaped effective area corresponds to one direction. The third determination unit 40 is used to determine the edge extension function curve of the above-mentioned camera module according to the coordinates of each of the above-mentioned pixel points, and determine the SFR value of the above-mentioned camera module according to the above-mentioned edge extension function curve. The above-mentioned SFR value is used to characterize the resolution of the above-mentioned camera module.
[0104] The above-mentioned camera module resolution determination device 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 standard plate image, the standard plate image is an image obtained by using a camera module to shoot a standard 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 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, the distance ranking is ranked from small to large according to the target distance, and the target distance is the center of the target circle The distance between the center of the field of view ROI area, N is a positive integer; the 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 pixel point, and determine the SFR value of the camera module according to the edge extension function curve. The SFR value is used to characterize the resolution of the camera module. The device can not only effectively improve the test UPH, but also effectively calculate the SFR value in any direction whether the image is distorted or not, especially the S / T direction, and can improve the test stability, solving the problem that the resolution test scheme of the camera module in the prior art cannot be effectively matched with the lens test, and the algorithm is prone to failure, there is a field of view deviation and poor stability.
[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 areas to obtain a binary image corresponding to the above-mentioned field of view ROI area; the first determination module is used to determine the number of all pixels in each of the above-mentioned circular parts in the above-mentioned binary image, and remove the above-mentioned circular parts whose number of pixels is less than or equal to a preset number to obtain the remaining circles; the second determination module is used to calculate the number of pixels according to the first calculation formula. , determine the relative distances of the remaining circles, where is the relative distance of the remaining circles, Area is the area of the remaining circles, and d is the maximum distance from the center of the remaining circles to the edge contour of the field of view ROI area; the third determination module is used to determine the remaining circle with the smallest relative distance as the target circle. In this way, the searched points can be accurately screened, points with incomplete edges can be removed, and finally the point closest to the field of view point can be located as the subject of subsequent calculations.
[0106] In some examples, the second determination unit includes a fourth determination module, a fifth determination module and a sixth determination module, wherein the fourth determination module is used to determine the initial triangular area corresponding to the target circle based on the sagittal direction and / or the tangential direction, wherein one of the vertices of the initial triangular area is the vertex of the fan-shaped effective area; the fifth determination module is used to determine the inner diameter and 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 sixth determination module is used to 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. In this way, invalid, interfering or calculation unstable areas can be shielded to ensure the stability of the subsequent calculation of the ESF curve.
[0107] In some examples, the fourth determination module further includes a first determination submodule, a second determination submodule and a third determination submodule, wherein the first determination submodule is configured to determine the first endpoint formula 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 angle between the two boundaries of the initial triangular area, (Px1, Py1) is the coordinate of the first endpoint, and (Px2, Py2) is the coordinate of the second endpoint; the second determination submodule is used to determine the first endpoint and the second endpoint respectively according to the coordinate of the first endpoint and the coordinate of the second endpoint; the third determination submodule is used to 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. In this way, the three vertices of the initial triangular area can be accurately determined, so that the fan-shaped effective area can be determined from the initial triangular area later.
[0108] In some examples, the third determining unit includes a second processing module, a seventh determining module, a third processing module, an eighth determining module and a ninth determining module, wherein the second processing module is used to rotate all the above-mentioned sector-shaped effective areas to the same horizontal direction to obtain the rotated sector-shaped areas; the seventh determining module is used to determine the sector-shaped areas according to the rotation coordinate formula , determine the rotated coordinates of each of the above-mentioned pixel points in the above-mentioned fan-shaped effective area, where (Cx, Cy) is the coordinate of the vertex of the above-mentioned fan-shaped effective area, is the central angle of the above-mentioned sector-shaped effective area, (x, y) is the initial coordinate of the pixel point in the above-mentioned sector-shaped effective area, and (Rx, Ry) is the rotated coordinate of the pixel point in the above-mentioned sector-shaped area after rotation; the third processing module is used to calculate the target distance between the above-mentioned non-pixel point and the above-mentioned pixel point along the radial direction of the above-mentioned non-pixel point, and the above-mentioned radial direction is the direction where the above-mentioned non-pixel point and the vertex of the above-mentioned sector-shaped effective area are located; the eighth determination module is used to determine the average value of the grayscale value of the above-mentioned non-pixel point and the grayscale value of the above-mentioned pixel point along the radial direction as the grayscale mean corresponding to the above-mentioned target distance; the ninth determination unit is used to determine the above-mentioned edge extension function curve according to the above-mentioned target distance and the corresponding grayscale mean. In this way, it is convenient to fit the edge points in a unified way to obtain the theoretical edge of the black-white transition position. In addition, the rotation operation here is only the processing of the pixel coordinates, and no image grayscale value interpolation operation will occur 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, wherein the fourth processing module is used to perform differential processing on the edge spread function curve to calculate the line spread function curve; the fifth processing module is used to perform Hamming window processing on the line spread function curve to obtain the windowed curve; the sixth processing module is used to perform fast Fourier transform on the windowed curve to convert it into the frequency domain to calculate the modulation transfer function curve; the tenth determination module is used to output the value at a specific frequency according to the modulation transfer function curve, and determine the value as the 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, wherein the eleventh determination module is used to determine the SFR value of each of the above-mentioned sector-shaped effective areas in each direction according to the above-mentioned edge spread function curve; the twelfth determination module is used to calculate the SFR value of each of the above-mentioned sector-shaped effective areas 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) 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 arc 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 arc 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 arc sagittal direction, i=1, 2, 3, 4; the seventh processing module is used to calculate the SFR value according to the 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, z is the SFR value of the (x, y) position in the first sagittal direction. 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 area on the nearest circle, so there is a field of view deviation and it cannot truly reflect the resolution of the field of view point.
[0111] The above-mentioned device for determining the resolution of the camera module includes a processor and a memory, and the above-mentioned acquisition unit and the like are stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to implement corresponding functions. The above-mentioned modules are all located in the same processor; or, the above-mentioned modules are located in different processors in any combination.
[0112] The processor includes a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the kernel parameters can be adjusted to test the resolution of the camera module in the prior art. The resolution test scheme cannot be effectively compared with the lens test, and the algorithm is prone to failure, there is a field of view deviation and poor stability.
[0113] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0114] An embodiment of the present invention provides a computer-readable storage medium, which includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute the method for determining the resolution of the camera module.
[0115] An embodiment of the present invention provides a processor, which is used to run a program, wherein the method for determining the resolution of the camera module is executed when the program is running.
[0116] An embodiment of the present invention provides a device, the device comprising a processor, a memory, and a program stored in the memory and executable on the processor, and when the processor executes the program, at least the following steps are implemented:
[0117] Step S201, obtaining 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;
[0118] Step S202, extracting multiple field of view ROI areas from the above-mentioned standard plate image, and determining the circles with the top N distance rankings in each of the above-mentioned field of view ROI areas as target circles, wherein the above-mentioned distance ranking is ranked from small to large according to the target distance, and the above-mentioned target distance is the distance between the center of the above-mentioned target circle and the center of the above-mentioned field of view ROI area, and N is a positive integer;
[0119] Step S203, 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;
[0120] Step S204, determining the edge extension function curve of the camera module according to the coordinates of each of the above pixel points, and determining 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.
[0121] The devices in this article can be servers, PCs, PADs, mobile phones, etc.
[0122] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program for initializing at least the following method steps:
[0123] Step S201, obtaining 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;
[0124] Step S202, extracting multiple field of view ROI areas from the above-mentioned standard plate image, and determining the circles with the top N distance rankings in each of the above-mentioned field of view ROI areas as target circles, wherein the above-mentioned distance ranking is ranked from small to large according to the target distance, and the above-mentioned target distance is the distance between the center of the above-mentioned target circle and the center of the above-mentioned field of view ROI area, and N is a positive integer;
[0125] Step S203, 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;
[0126] Step S204, determining the edge extension function curve of the camera module according to the coordinates of each of the above pixel points, and determining 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.
[0127] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0128] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0129] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0130] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0131] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0132] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0133] 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 read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0134] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. 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 technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0135] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0136] From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:
[0137] 1) The method for determining the resolution of the above-mentioned camera module of the present application first obtains a standard plate image, which is an image obtained by using a camera module to shoot a standard plate with a circular pattern; then, multiple field of view ROI areas are extracted from the standard plate image, and the circles with the top N distance rankings in each field of view ROI area 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 area; then, based on the sagittal direction and / or the tangential direction, the fan-shaped effective area corresponding to the target circle and the coordinates of each pixel point in the fan-shaped effective area are determined, and the pixel points in the fan-shaped effective area include transition pixel points in the transition area and non-pixel points in the non-transition area; finally, according to the coordinates of each pixel point, the edge extension function curve of the camera module is determined, and according to the edge extension 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 in the existing technology that the resolution test scheme of the camera module cannot be effectively matched with the lens test, and the algorithm is prone to failure, there is field of view deviation and poor stability.
[0138] 2) The apparatus for determining the resolution of the camera module of the present application comprises: an acquisition unit, a first determination unit, a second determination unit and a third determination unit. The acquisition unit is used to acquire a standard plate image, which is an image obtained by photographing a standard plate with a circular pattern using a camera module. 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 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. The distance ranking is to rank the target distance from small to large, and the target distance is the target circle. The distance between the center and the center of the field of view ROI area, N is a positive integer; the second determination unit is used to determine the sector effective area corresponding to the target circle and the coordinates of each pixel point in the sector effective area based on the sagittal direction and / or the tangential direction. The pixel points in the sector 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 effective areas, and one sector effective area corresponds to one direction; the third determination unit is used to determine the edge expansion 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 expansion function curve. The SFR value is used to characterize the resolution of the camera module. The device can not only effectively improve the test UPH, but also effectively calculate the SFR value in any direction whether the image is distorted or not, especially the S / T direction, and can improve the test stability, solving the problem that the resolution test scheme of the camera module in the prior art cannot be effectively matched with the lens test, and the algorithm is prone to failure, there is a field of view deviation and poor stability.
[0139] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in 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 The circular part of the circular pattern is black, the non-circular part is white, N=1, multiple field of view ROI areas are extracted from the standard plate image, and the circles ranked in the top N distances in each field of view ROI area are determined as target circles, including: Performing binary segmentation on each of the field of view ROI regions to obtain a binary image corresponding to the field of view ROI region; Determine the number of all pixels in each circular part in the binary image, and remove the circular part whose number of pixels is less than or equal to a preset number, to obtain remaining circles; According to the first calculation formula , determine the relative distances 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 area; The remaining circle with the smallest relative distance is determined as the target circle.
3. 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.
4. The method according to claim 3, 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 central angle of the initial triangular area, A is the angle between the two boundaries of the initial triangular area, (Px1, Py1) is the coordinate of the first endpoint, and (Px2, Py2) is the coordinate of the second endpoint; 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.
5. 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.
6. 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.
7. 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.
8. 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.
9. 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 the camera module according to any one of claims 1 to 7.
10. 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 7.
Citation Information
Patent Citations
Measurement method, system and device and terminal equipment
CN111947894A
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
Method for picture mark supported image evaluation
WO2008077538A1
Wide-view-field ultrahigh-resolution optical imaging system and method
WO2014023231A1
