A kind of camera equipment resolution detection method, device, equipment and storage medium
By using the Siemens star map detection method, the center coordinates of the positioning block are identified and the inverse matrix of the transformation matrix is calculated, which solves the problems of long detection time of camera equipment resolution and the impact of ISP sharpening, and realizes accurate multi-directional resolution detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- DUOPAI (ZHEJIANG) INTELLIGENT EQUIP CO LTD
- Filing Date
- 2022-12-16
- Publication Date
- 2026-04-17
AI Technical Summary
Existing methods for detecting camera resolution are time-consuming, prone to errors, and unable to effectively process images sharpened by the ISP, resulting in inaccurate detection results.
The Siemens star map detection method is adopted. By identifying the actual and theoretical coordinates of the center of the positioning block in the image, the transformation matrix and its inverse matrix are calculated. The resolution is calculated by combining the grayscale curve, which can adapt to images with different intensity of distortion and ISP sharpening.
It achieves accurate resolution detection for camera devices with varying degrees of distortion, can detect resolution from multiple angles, and adapts to images sharpened by the ISP.
Smart Images

Figure CN116152351B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to a method, apparatus, device and storage medium for detecting the resolution of a camera device. Background Technology
[0002] In the research, development, and production of video surveillance cameras, resolution testing is essential. Resolution is the numerical value corresponding to the densest pair of lines that can be clearly seen in an image captured by the camera; higher resolution cameras produce denser pairs of lines. Manual resolution measurement is time-consuming, highly repetitive, and prone to errors, requiring significant improvement in both cost and reliability. Utilizing AI machine vision for camera resolution measurement saves manpower and facilitates quality control of camera equipment.
[0003] Patent CN105447878A invented a process for image quality testing and analysis, which calls the ImaTest software to test the area to be tested. However, since the sharpness calculation area covers all directions of the image, the position and size of the obtained image vary due to different angles and distances during shooting, and the position of the sharpness calculation area is not fixed. Therefore, this testing method still requires the tester to manually select the area to be tested on the image to be tested.
[0004] Patent CN114004768A invented a positioning method for the SFRplus sharpness test chart for ImaTest, avoiding the need for manual selection of the test area. The SFRplus sharpness test chart is based on the Modulation Transfer Function (MTF) principle. However, the output images of existing cameras are mostly processed by ISP, including image sharpening, to make the images visually clearer. The MTF curve of the sharpened image is distorted, and the resolution can no longer be calculated from the MTF curve. Therefore, the SFRplus sharpness test chart cannot process images that have undergone ISP processing.
[0005] Patent CN106937109B designs a novel resolution detection chart. The chart is printed with black lines of at least two different spatial frequencies, and the corresponding resolution value is found by measuring the grayscale contrast value. This method requires establishing a comparison table of the grayscale contrast value of the camera device and the corresponding resolution level, and does not take into account the impact of ISP sharpening on the grayscale contrast value.
[0006] Patent CN110049319A designed a resolution test chart, which includes line pairs consisting of 5 black lines and 5 white lines and positioning blocks. The line pairs are positioned by square and circular positioning blocks. However, the line pairs consisting of 5 black lines and 5 white lines are easily affected by moiré patterns, thus failing to provide accurate resolution values.
[0007] In summary, there is an urgent need for those skilled in the art to provide a method, apparatus, device, and storage medium for detecting the resolution of a camera device in order to solve the aforementioned technical problems. Summary of the Invention
[0008] This application provides a method, apparatus, device, and storage medium for detecting camera device resolution, enabling the detection of camera devices with different levels of distortion, and allowing the detection of camera device resolution from multiple angles, as well as the detection of images after ISP sharpening.
[0009] In view of the above, the first aspect of this application provides a method for detecting the resolution of a camera device, the method comprising:
[0010] S1. Obtain the image to be tested captured by the camera device under test using a preset resolution detection chart. The preset resolution detection chart contains at least one Siemens star chart, and the four corners and center of the Siemens star chart each contain a positioning block of a preset color.
[0011] S2. Identify the five positioning blocks in the image to be tested, and determine the actual center coordinates and theoretical center coordinates of the five positioning blocks respectively;
[0012] S3. Calculate the transformation matrix from the theoretical center coordinates to the actual center coordinates of the four corner positioning blocks and the inverse matrix of the transformation matrix through projection transformation;
[0013] S4. Calculate the center transformation coordinates corresponding to the actual center coordinates of the center positioning block using the inverse matrix;
[0014] S5. The circle formed by the central transformation coordinates is transformed onto the star map using a transformation matrix to obtain the gray values corresponding to the point sequence, forming the gray curve of the circle. The contrast of the circle is calculated based on the gray curve to obtain the resolution of the camera device under test in the corresponding position on the Siemens star map.
[0015] Optionally, in step S1, the preset colors corresponding to the positioning blocks contained in the four corners and the center of the Siemens star map are different.
[0016] Optionally, step S2 specifically includes:
[0017] Convert the image to be tested into HSV format;
[0018] The five positioning blocks in the image under test are located according to the color tone, corresponding to the pixels of the preset color.
[0019] Calculate the average value of the pixel coordinates of the five positioning blocks corresponding to the preset colors to obtain the actual center coordinates of the five positioning blocks;
[0020] Obtain the theoretical center coordinates of the positioning block.
[0021] Optionally, step S5 specifically includes:
[0022] Using the central transformation coordinates as the center, select H radii R to form H circles, and arrange them in ascending order of value to form a radius sequence R = [R1, R2, ..., R]. i ,…,R H ], R H The radius of the star map;
[0023] Take N points on each circle, and let the j-th point p circle_j The coordinates are:
[0024] (x 0_appro +cos(θ j )*R i ,y 0_appro +sin(θ j )*R i );
[0025] Where θ j =2π / N*j, (x 0_appro ,y 0_appro Transform coordinates around the center;
[0026] All points on the circumference are represented by P. circle =[P circle_1 ,P circle_2 ,…,P circle_j ,…,P circle_N ];
[0027] The point sequence obtained by transforming the circle centered on the central transformation coordinates onto the star map using the transformation matrix is P = [P1, P2, ..., P]. j ,…,P N ], P j The corresponding grayscale value is I j The grayscale curve of the circle is I = [I1, I2, ..., I... j ,…,I N Based on the grayscale curve, the contrast of the circumference is calculated to obtain the resolution of the camera device under test in the corresponding position on the Siemens star map.
[0028] Optionally, the step of calculating the contrast of the circumference based on the grayscale curve to obtain the resolution of the camera device under test at the corresponding location on the Siemens star map specifically involves:
[0029] Calculate the maxima and minima of the grayscale curve. If the number of line pairs in the Siemens star graph is T, then the grayscale curve has T minima and T maxima, where:
[0030] The minimum value is Minima = [Minima1, Minima2, ..., Minima] j Minima T ];
[0031] The maximum value is Maxima = [Maxima1, Maxima2, ..., Maxima] j Maxima T ];
[0032] Based on the grayscale curve, the radius R is calculated. i Contrast on:
[0033] Contrast i =(Median Maxima -Median Minima ) / (Median Maxima +Median Minima );
[0034] Among them, Median Minima Median is the median of Minima. Maxima This is the median of Maxima;
[0035] H radii are obtained to form a contrast curve:
[0036] Contrast=[Contrast1,Contrast2,…,Contrast j Contrast H ];
[0037] Based on the set contrast limit ContrastLimit, find a radius sequence R with a contrast greater than or equal to ContrastLimit. Limit minimum radius R Limit R Limit The corresponding resolution value is the resolution of the camera device under test in the corresponding position on the Siemens star map.
[0038] Optionally, after step S4, the method further includes:
[0039] Connect the actual center coordinates of the four corner positioning blocks of the four sub-star diagram. If the line forms a non-square, it is determined that the camera device under test has distortion; otherwise, the camera device under test does not have distortion.
[0040] A second aspect of this application provides a camera device resolution detection apparatus, the apparatus comprising:
[0041] The acquisition unit is used to acquire the image to be tested captured by the camera device under test from a preset sharpness detection chart. The preset sharpness detection chart contains at least one Siemens star chart, and the four corners and the center of the Siemens star chart each contain a positioning block of a preset color.
[0042] The identification unit is used to identify the five positioning blocks in the image to be tested, and to determine the actual center coordinates and theoretical center coordinates of the five positioning blocks respectively.
[0043] The first processing unit is used to calculate the transformation matrix from the theoretical center coordinates to the actual center coordinates of the four corner positioning blocks and the inverse matrix of the transformation matrix through projection transformation.
[0044] The second processing unit is used to calculate the center transformation coordinates corresponding to the actual center coordinates of the center positioning block through the inverse matrix;
[0045] The third processing unit is used to transform the circle formed by the central transformation coordinates onto the star map through a transformation matrix, obtain the gray values corresponding to the point sequence to form the gray curve of the circle, and calculate the contrast of the circle based on the gray curve to obtain the resolution of the camera device under test in the corresponding position on the Siemens star map.
[0046] Optionally, the third processing unit is specifically used for:
[0047] Using the central transformation coordinates as the center, select H radii R to form H circles, and arrange them in ascending order of value to form a radius sequence R = [R1, R2, ..., R]. i ,…,R H ], R H The radius of the star map;
[0048] Take N points on each circle, and let the j-th point p circle_j The coordinates are:
[0049] (x 0_appro +cos(θ j )*R i ,y 0_appro +sin(θ j )*R i );
[0050] Where θ j =2π / N*j, (x 0_appro ,y 0_appro Transform coordinates around the center;
[0051] All points on the circumference are represented by P. circle =[P circle_1 ,P circle_2 ,…,P circle_j ,…,Pcircle_N ];
[0052] The point sequence obtained by transforming the circle centered on the central transformation coordinates onto the star map using the transformation matrix is P = [P1, P2, ..., P]. j ,…,P N ], P j The corresponding grayscale value is I j The grayscale curve of the circle is I = [I1, I2, ..., I... j ,…,I N Based on the grayscale curve, the contrast of the circumference is calculated to obtain the resolution of the camera device under test in the corresponding position on the Siemens star map.
[0053] A third aspect of this application provides a camera resolution detection device, the device comprising a processor and a memory:
[0054] The memory is used to store program code and transmit the program code to the processor;
[0055] The processor is configured to execute the steps of the camera device resolution detection method as described in the first aspect above, according to the instructions in the program code.
[0056] A fourth aspect of this application provides a computer-readable storage medium for storing program code for performing the method described in the first aspect above.
[0057] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:
[0058] This application provides a method, apparatus, device, and storage medium for detecting the resolution of a camera device. It determines the actual center coordinates of five positioning blocks in the image under test by identifying their preset colors. Based on the transformation matrix from the theoretical center coordinates to the actual center coordinates of the four corner positioning blocks and its inverse matrix, it calculates the contrast of different radii of the star map. The resolution corresponding to the contrast limit position is the resolution of the camera device under test in the corresponding position on the star map. This enables the detection of camera devices with different levels of distortion, and can detect the resolution of camera devices in multiple positions, as well as images after ISP sharpening. Attached Figure Description
[0059] Figure 1 This is a flowchart of the camera device resolution detection method in the embodiments of this application;
[0060] Figure 2 This is a schematic diagram of the camera resolution detection device in the embodiments of this application;
[0061] Figure 3This is a schematic diagram of the structure of the camera resolution detection device in the embodiments of this application;
[0062] Figure 4 A Siemens star chart with 5 positioning color blocks;
[0063] Figure 5 A 9-star Siemens star chart;
[0064] Figure 6 This is a schematic diagram illustrating the positioning of the Siemens star map using the four corner positioning color blocks;
[0065] Figure 7 An image to be tested, taken by a camera with distortion.
[0066] Figure 8 for Figure 7 A magnified view of a portion of the Siemens star chart in the upper right corner;
[0067] Figure 9 For Stars Figure 4 Diagram showing equal division. Detailed Implementation
[0068] To enable those skilled in the art to better understand 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. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0069] This application designs a method, apparatus, device, and storage medium for detecting the resolution of a camera device, enabling the detection of camera devices with different levels of distortion, and the detection of the resolution of camera devices from multiple angles, as well as the detection of images after ISP sharpening.
[0070] For easier understanding, please refer to Figure 1 , Figure 1 This is a flowchart of the camera device resolution detection method in the embodiments of this application, such as... Figure 1 As shown, specifically:
[0071] S1. Obtain the image to be tested captured by the camera device under test using a preset sharpness detection chart. The preset sharpness detection chart contains at least one Siemens star chart, and the four corners and the center of the Siemens star chart each contain a positioning block of a preset color.
[0072] The four corners and the center of the Siemens star map contain different preset colors for the positioning blocks.
[0073] It should be noted that, as Figure 4 and Figure 5 As shown, Figure 4 This is a Siemens star chart with 5 positioning color blocks. A black line and a white line form a line pair. The number of line pairs in the Siemens star chart needs to be designed according to the resolution of the camera equipment. Figure 4 It has 144 line pairs and is suitable for camera devices with a resolution of >= 2M; for camera devices with a resolution of < 2M, you can choose a Siemens star chart with fewer than 144 line pairs, such as 72 line pairs.
[0074] Figure 4 and Figure 5 The central circle is used to locate the center of the star chart, and the square color blocks at the four corners are used to locate the outer edges of the star chart.
[0075] In the BGR color representation, the center color block is BGR(0,0,255), which is red; the top-left corner is BGR(255,0,255), which is purple; the top-right corner is BGR(255,0,0), which is blue; the bottom-left corner is BGR(0,255,0), which is green; and the bottom-left corner is BGR(0,255,255), which is yellow. The number, color, and shape of the positioning color blocks are not limited. Figure 4 and Figure 5 As shown in the image.
[0076] Figure 5 This is a 9-star Siemens star chart used to test the resolution of images from multiple directions. The number and layout of the star chart are not limited. Figure 5 .
[0077] S2. Identify the five positioning blocks in the image to be tested, and determine the actual center coordinates and theoretical center coordinates of the five positioning blocks respectively;
[0078] Specifically:
[0079] Convert the image to be tested to HSV format;
[0080] Based on the color tone, locate the pixels of the five positioning blocks in the image to be tested that correspond to the preset colors;
[0081] Calculate the average value of the pixel coordinates of the five positioning blocks corresponding to the preset colors to obtain the actual center coordinates of the five positioning blocks;
[0082] Obtain the theoretical coordinates of the center of the positioning block.
[0083] It should be noted that, as Figure 6 As shown, Figure 6This diagram illustrates the positioning of the Siemens star map using four corner positioning color blocks. Taking the blue color block BGR(255,0,0) in the upper right corner as an example, the image is converted to HSV (Hue, Saturation, Value) format. The blue hue is between 106 and 135. Blue pixels are selected based on the blue hue, and the average coordinates of all blue pixels is taken as the center of the blue color block. For example... Figure 6 If a distortion-free camera is used to take the picture, and the center of the four color blocks is connected by a line, a square is formed, which can be used to determine the center and radius of the star map.
[0084] When testing with a camera device that has distortion, the Siemens star map captured is no longer circular, and the line connecting the four color blocks is no longer forming a square. Furthermore, the distortion parameters of different camera devices are different, and the degree of distortion of the star map at the center of the image is also different from that at the corners.
[0085] Figure 7 It is an image taken by a camera with distortion, with the distortion being most severe at the four corners.
[0086] S3. Calculate the transformation matrix from the theoretical center coordinates to the actual center coordinates of the four corner positioning blocks and the inverse matrix of the transformation matrix through projection transformation;
[0087] It should be noted that, Figure 7 The distortion shown can be approximated as a projection transformation, such as... Figure 6 The coordinates of the four vertices of the original square are: P1(x1,y1), P2(x2,y2), P3(x3,y3), P4(x4,y4); For example... Figure 8 The coordinates of the four vertices of the distorted square are: P1`(x1`,y1`), P2`(x2`,y2`), P3`(x3`,y3`), P4`(x4`,y4`);
[0088] The transformation matrix M from (P1, P2, P3, P4) to (P1', P2', P3', P4') can be calculated through projection transformation.
[0089] The inverse matrix M' of the transformation matrix M is the transformation matrix from (P1', P2', P3', P4') to (P1, P2, P3, P4).
[0090] S4. Calculate the center transformation coordinates corresponding to the actual center coordinates of the center positioning block using the inverse matrix;
[0091] Furthermore, step S4 is followed by:
[0092] Connect the actual center coordinates of the four corner positioning blocks of the four-gate sub-star diagram. If the line forms a non-square, it is determined that the camera device under test has distortion; otherwise, the camera device under test does not have distortion.
[0093] It should be noted that, as Figure 6 As shown, the line connecting the theoretical coordinates of the centers of the four corner positioning blocks forms a square. If the camera device has no distortion, the line connecting the actual coordinates of the centers of the four corner positioning blocks in the captured image will also form a square. If the camera device has distortion, the line connecting the actual coordinates of the centers of the four corner positioning blocks will no longer form a square. This can be used to determine whether the camera device has distortion.
[0094] When distortion exists, the center-transformed coordinates of the center positioning block will deviate slightly from the center-theoretical coordinates. In this case, using the center-transformed coordinates as the center to select the circumference (compared to using the center-theoretical coordinates as the center to select the circumference) will result in a more accurate resolution.
[0095] If the distortion of the camera device is a perfect projection transformation, then the original star map center P0(x0,y0) will be obtained after the inverse matrix M' transformation from the distorted star map center P0`(x0,y0).
[0096] However, the distortion of the camera equipment is an approximate projection transformation. P is obtained from the distorted star map center P0`(x0`,y0`) through the inverse matrix M`. 0_appro (x 0_appro ,y 0_appro ), P 0_appro The coordinates are slightly different from those of P0.
[0097] S5. Transform the circle formed by the central transformation coordinates onto the star map using the transformation matrix to obtain the gray values corresponding to the point sequence to form the gray curve of the circle, and calculate the contrast of the circle based on the gray curve to obtain the resolution of the camera device under test in the corresponding position of the Siemens star map.
[0098] Specifically:
[0099] Using the coordinates of the center transformation as the center, select H radii R to form H circles, and arrange them in ascending order of value to form a radius sequence R = [R1, R2, ..., R]. i ,…,R H ], R H The radius of the star map;
[0100] Take N points on each circle, and let the j-th point p circle_j The coordinates are:
[0101] (x 0_appro +cos(θ j )*R i ,y0_appro +sin(θ j )*R i );
[0102] Where θ j =2π / N*j, (x 0_appro ,y 0_appro Transform coordinates around the center;
[0103] All points on the circumference are represented by P. circle =[P circle_1 ,P circle_2 ,…,P circle_j ,…,P circle_N ];
[0104] The point sequence obtained by transforming the circle centered on the central transformation coordinates onto the star map using the transformation matrix is P = [P1, P2, ..., P]. j ,…,P N ], P j The corresponding grayscale value is I j The grayscale curve of the circle is I = [I1, I2, ..., I... j ,…,I N The contrast of the circumference is calculated based on the grayscale curve to obtain the resolution of the camera device under test in the corresponding position on the Siemens star map.
[0105] Based on the contrast of the circumference calculated using the grayscale curve, the resolution of the camera under test in the corresponding position on the Siemens star map is obtained as follows:
[0106] Calculate the maxima and minima of the grayscale curve. If the number of line pairs in the Siemens star chart is T, then the grayscale curve has T minima and T maxima, where:
[0107] The minimum value is Minima = [Minima1, Minima2, ..., Minima] j Minima T ];
[0108] The maximum value is Maxima = [Maxima1, Maxima2, ..., Maxima] j Maxima T ];
[0109] Based on the grayscale curve, the radius R is calculated. i Contrast on:
[0110] Contrast i =(Median Maxima -Median Minima ) / (Median Maxima+Median Minima );
[0111] Among them, Median Minima Median is the median of Minima. Maxima This is the median of Maxima;
[0112] H radii are obtained to form a contrast curve:
[0113] Contrast=[Contrast1,Contrast2,…,Contrast j Contrast H ];
[0114] Based on the set contrast limit ContrastLimit, find a radius sequence R with a contrast greater than or equal to ContrastLimit. Limit minimum radius R Limit R Limit The corresponding resolution value is the resolution of the camera device under test in the corresponding position on the Siemens star map.
[0115] It is understandable that the resolution of a camera varies in different directions, and existing methods cannot measure the resolution in different directions. Based on the technical solution of this application, the circumference can be divided into L parts, and the resolution of each part can be calculated separately. For example, the circumference can be divided into 4 equal parts (e.g., Figure 9 (As shown). Figure 8 Showing for Figure 7 The calculation results of the four equal divisions of the star chart in the upper right corner show that the horizontal resolutions of divisions 1 and 3 are 1538 and 1458 respectively, and the vertical resolutions of divisions 2 and 4 are 1342 and 1244 respectively. This indicates that the vertical resolution is lower than that of the horizontal resolution.
[0116] Please see Figure 2 , Figure 2 This is a schematic diagram of the structure of the camera resolution detection device in the embodiments of this application, as shown below. Figure 2 As shown, specifically:
[0117] The acquisition unit 201 is used to acquire the image to be tested captured by the camera device under test on a preset sharpness detection chart. The preset sharpness detection chart contains at least one Siemens star chart, and the four corners and the center of the Siemens star chart each contain a positioning block of a preset color.
[0118] The recognition unit 202 is used to recognize the five positioning blocks in the image to be tested, and to determine the actual center coordinates and theoretical center coordinates of the five positioning blocks respectively.
[0119] The first processing unit 203 is used to calculate the transformation matrix from the theoretical center coordinates to the actual center coordinates of the four corner positioning blocks and the inverse matrix of the transformation matrix through projection transformation.
[0120] The second processing unit 204 is used to calculate the center transformation coordinates corresponding to the actual center coordinates of the center positioning block through the inverse matrix.
[0121] The third processing unit 205 is used to transform the circle formed by the central transformation coordinates onto the star map through a transformation matrix, obtain the gray value corresponding to the point sequence to form the gray curve of the circle, and calculate the contrast of the circle based on the gray curve to obtain the resolution of the camera device under test in the corresponding position of the Siemens star map.
[0122] Furthermore, the third processing unit 205 is specifically used for:
[0123] Using the coordinates of the center transformation as the center, select H radii R to form H circles, and arrange them in ascending order of value to form a radius sequence R = [R1, R2, ..., R]. i ,…,R H ], R H The radius of the star map;
[0124] Take N points on each circle, and let the j-th point p circle_j The coordinates are:
[0125] (x 0_appro +cos(θ j )*R i ,y 0_appro +sin(θ j )*R i );
[0126] Where θ j =2π / N*j, (x 0_appro ,y 0_appro Transform coordinates around the center;
[0127] All points on the circumference are represented by P. circle =[P circle_1 ,P circle_2 ,…,P circle_j ,…,P circle_N ];
[0128] The point sequence obtained by transforming the circle centered on the central transformation coordinates onto the star map using the transformation matrix is P = [P1, P2, ..., P]. j ,…,P N ], P j The corresponding grayscale value is I j The grayscale curve of the circle is I = [I1, I2, ..., I... j ,…,IN The contrast of the circumference is calculated based on the grayscale curve to obtain the resolution of the camera device under test in the corresponding position on the Siemens star map.
[0129] This application also provides another camera resolution detection device, such as... Figure 3 As shown, for ease of explanation, only the parts related to the embodiments of this application are shown. For specific technical details not disclosed, please refer to the method section of the embodiments of this application. The terminal can be any terminal device including mobile phones, tablets, personal digital assistants (PDAs), point-of-sale (POS) terminals, in-vehicle computers, etc. Taking a mobile phone as an example:
[0130] Figure 3 This is a block diagram illustrating a portion of the structure of a mobile phone related to the terminal provided in the embodiments of this application. (Reference) Figure 3 The mobile phone includes: a radio frequency (RF) circuit 1010, a memory 1020, an input unit 1030, a display unit 1040, a sensor 1050, an audio circuit 1060, a wireless fidelity (WiFi) module 1070, a processor 1080, and a power supply 1090, etc. Those skilled in the art will understand that... Figure 3 The mobile phone structure shown does not constitute a limitation on the mobile phone and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0131] The following is combined Figure 3 A detailed introduction to each component of a mobile phone:
[0132] The RF circuit 1010 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink information from the base station and processes it with the processor 1080; additionally, it transmits uplink data to the base station. Typically, the RF circuit 1010 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier (LNA), a duplexer, etc. Furthermore, the RF circuit 1010 can also communicate wirelessly with networks and other devices. The aforementioned wireless communications may use any communication standard or protocol, including but not limited to Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, and Short Messaging Service (SMS).
[0133] The memory 1020 can be used to store software programs and modules. The processor 1080 executes various mobile phone functions and data processing by running the software programs and modules stored in the memory 1020. The memory 1020 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory 1020 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0134] The input unit 1030 can be used to receive input numerical or character information, and to generate key signal inputs related to user settings and function control of the mobile phone. Specifically, the input unit 1030 may include a touch panel 1031 and other input devices 1032. The touch panel 1031, also known as a touch screen, can collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel 1031), and drive the corresponding connection devices according to a pre-set program. Optionally, the touch panel 1031 may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch position and the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 1080, and can also receive and execute commands sent by the processor 1080. In addition, the touch panel 1031 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 1031, the input unit 1030 may also include other input devices 1032. Specifically, other input devices 1032 may include, but are not limited to, one or more of the following: physical keyboard, function keys (such as volume control buttons, power buttons, etc.), trackball, mouse, joystick, etc.
[0135] The display unit 1040 can be used to display information input by the user or information provided to the user, as well as various menus of the mobile phone. The display unit 1040 may include a display panel 1041, which may optionally be configured as a Liquid Crystal Display (LCD), Organic Light-Emitting Diode (OLED), or similar display panel 1041. Further, a touch panel 1031 may cover the display panel 1041. When the touch panel 1031 detects a touch operation on or near it, it transmits the information to the processor 1080 to determine the type of touch event. Subsequently, the processor 1080 provides corresponding visual output on the display panel 1041 according to the type of touch event. Although in Figure 3 In this embodiment, the touch panel 1031 and the display panel 1041 are two separate components to realize the input and output functions of the mobile phone. However, in some embodiments, the touch panel 1031 and the display panel 1041 can be integrated to realize the input and output functions of the mobile phone.
[0136] The mobile phone may also include at least one sensor 1050, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 1041 according to the ambient light level, and the proximity sensor can turn off the display panel 1041 and / or the backlight when the phone is moved to the ear. As a type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity and can be used for applications that recognize the phone's posture (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition-related functions (such as pedometer, taps), etc. Other sensors that may be configured in the mobile phone, such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, will not be described in detail here.
[0137] The audio circuit 1060, speaker 1061, and microphone 1062 provide an audio interface between the user and the mobile phone. The audio circuit 1060 converts the received audio data into electrical signals and transmits them to the speaker 1061, where the speaker 1061 converts them into sound signals for output. On the other hand, the microphone 1062 converts the collected sound signals into electrical signals, which are then received by the audio circuit 1060, converted into audio data, and then processed by the processor 1080 before being transmitted via the RF circuit 1010 to, for example, another mobile phone, or the audio data can be output to the memory 1020 for further processing.
[0138] WiFi is a short-range wireless transmission technology. Through the WiFi module 1070, mobile phones can help users send and receive emails, browse web pages, and access streaming media, providing users with wireless broadband internet access. Although Figure 3 The WiFi module 1070 is shown, but it is understood that it is not an essential component of a mobile phone and can be omitted as needed without changing the essence of the invention.
[0139] The processor 1080 is the control center of the mobile phone, connecting various parts of the phone through various interfaces and lines. It executes software programs and / or modules stored in the memory 1020 and calls data stored in the memory 1020 to perform various functions and process data, thereby providing overall monitoring of the phone. Optionally, the processor 1080 may include one or more processing units; preferably, the processor 1080 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 1080.
[0140] The mobile phone also includes a power supply 1090 (such as a battery) that supplies power to various components. Preferably, the power supply can be logically connected to the processor 1080 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system.
[0141] Although not shown, mobile phones may also include camera devices, Bluetooth modules, etc., which will not be elaborated here.
[0142] In this embodiment of the application, the processor 1080 included in the terminal also has the following functions:
[0143] S1. Obtain the image to be tested captured by the camera device under test using a preset sharpness detection chart. The preset sharpness detection chart contains at least one Siemens star chart, and the four corners and the center of the Siemens star chart each contain a positioning block of a preset color.
[0144] S2. Identify the five positioning blocks in the image to be tested, and determine the actual center coordinates and theoretical center coordinates of the five positioning blocks respectively;
[0145] S3. Calculate the transformation matrix from the theoretical center coordinates to the actual center coordinates of the four corner positioning blocks and the inverse matrix of the transformation matrix through projection transformation;
[0146] S4. Calculate the center transformation coordinates corresponding to the actual center coordinates of the center positioning block using the inverse matrix;
[0147] S5. Transform the circle formed by the central transformation coordinates onto the star map using a transformation matrix to obtain the gray values corresponding to the point sequence, forming the gray curve of the circle. Calculate the contrast of the circle based on the gray curve to obtain the resolution of the camera device under test in the corresponding position on the Siemens star map.
[0148] This application also provides a computer-readable storage medium for storing program code that executes any one of the implementation methods for camera device resolution detection described in the foregoing embodiments.
[0149] This application provides a method, apparatus, device, and storage medium for detecting the resolution of a camera device. It determines the actual center coordinates of five positioning blocks in the image under test by identifying their preset colors. Based on the transformation matrix from the theoretical center coordinates to the actual center coordinates of the four corner positioning blocks and its inverse matrix, it calculates the contrast of different radii of the star map. The resolution corresponding to the contrast limit position is the resolution of the camera device under test in the corresponding position on the star map. This enables the detection of camera devices with different levels of distortion, and can detect the resolution of camera devices in multiple positions, as well as images after ISP sharpening.
[0150] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0151] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0152] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0153] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.
[0154] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0155] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0156] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes: USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, optical disks, and other media capable of storing program code.
[0157] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for detecting the resolution of a camera device, characterized in that, Including the following steps: S1. Obtain the image to be tested captured by the camera device under test using a preset resolution detection chart. The preset resolution detection chart contains at least one Siemens star chart, and the four corners and center of the Siemens star chart each contain a positioning block of a preset color. S2. Identify the five positioning blocks in the image to be tested, and determine the actual center coordinates and theoretical center coordinates of the five positioning blocks respectively; S3. Calculate the transformation matrix from the theoretical center coordinates to the actual center coordinates of the four corner positioning blocks and the inverse matrix of the transformation matrix through projection transformation; S4. Calculate the center transformation coordinates corresponding to the actual center coordinates of the center positioning block using the inverse matrix; S5. The circle formed by the central transformation coordinates is transformed onto the star map using a transformation matrix to obtain the gray values corresponding to the point sequence, forming the gray curve of the circle. The contrast of the circle is calculated based on the gray curve to obtain the resolution of the camera device under test in the corresponding position on the Siemens star map.
2. The method for detecting the resolution of a camera device according to claim 1, characterized in that, In step S1, the preset colors corresponding to the positioning blocks contained in the four corners and the center of the Siemens star map are different.
3. The method for detecting the resolution of a camera device according to claim 1, characterized in that, Step S2 specifically includes: Convert the image to be tested into HSV format; The five positioning blocks in the image under test are located according to the color tone, corresponding to the pixels of the preset color. Calculate the average value of the pixel coordinates of the five positioning blocks corresponding to the preset colors to obtain the actual center coordinates of the five positioning blocks; Obtain the theoretical center coordinates of the positioning block.
4. The method for detecting the resolution of a camera device according to claim 1, characterized in that, Step S5 specifically includes: Using the central transformation coordinates as the center, select H radii R to form H circles, and arrange them in ascending order of value to form a radius sequence. , The radius of the star map; Take N points on each circle, and the j-th point... The coordinates are: ; in , Transform the coordinates around the center; All points on the circumference are represented as ; The point sequence obtained by transforming the circle centered on the central transformation coordinates onto the star map using a transformation matrix is as follows: , The corresponding grayscale value is The grayscale curve of the circumference is The contrast of the circumference is calculated based on the grayscale curve to obtain the resolution of the camera device under test in the corresponding position on the Siemens star map.
5. The method for detecting the resolution of a camera device according to claim 1 or 4, characterized in that, The specific steps for calculating the contrast of the circumference based on the grayscale curve to obtain the resolution of the camera device under test in the corresponding position on the Siemens star map are as follows: Calculate the maxima and minima of the grayscale curve. If the number of line pairs in the Siemens star graph is T, then the grayscale curve has T minima and T maxima, where: Minimum value ; The maximum value is ; Based on the grayscale curve, the radius is calculated. Contrast on: ; in, for the median of for the median; H radii are obtained to form a contrast curve: ; Based on the set contrast limit Find the radius sequence R with a contrast greater than or equal to minimum radius , The corresponding resolution value is the resolution of the camera device under test in the corresponding position on the Siemens star map.
6. The method for detecting the resolution of a camera device according to claim 1, characterized in that, The process following step S4 also includes: Connect the actual center coordinates of the four corner positioning blocks of the Siemens star map. If the line forms a non-square, it is determined that the camera device under test has distortion; otherwise, the camera device under test does not have distortion.
7. A resolution detection device for a camera, characterized in that, include: The acquisition unit is used to acquire the image to be tested captured by the camera device under test from a preset sharpness detection chart. The preset sharpness detection chart contains at least one Siemens star chart, and the four corners and the center of the Siemens star chart each contain a positioning block of a preset color. The identification unit is used to identify the five positioning blocks in the image to be tested, and to determine the actual center coordinates and theoretical center coordinates of the five positioning blocks respectively. The first processing unit is used to calculate the transformation matrix from the theoretical center coordinates to the actual center coordinates of the four corner positioning blocks and the inverse matrix of the transformation matrix through projection transformation. The second processing unit is used to calculate the center transformation coordinates corresponding to the actual center coordinates of the center positioning block through the inverse matrix; The third processing unit is used to transform the circle formed by the central transformation coordinates onto the star map through a transformation matrix, obtain the gray values corresponding to the point sequence to form the gray curve of the circle, and calculate the contrast of the circle based on the gray curve to obtain the resolution of the camera device under test in the corresponding position on the Siemens star map.
8. The camera resolution detection device according to claim 7, characterized in that, The third processing unit is specifically used for: Using the central transformation coordinates as the center, select H radii R to form H circles, and arrange them in ascending order of value to form a radius sequence. , The radius of the star map; Take N points on each circle, and the j-th point... The coordinates are: ; in , Transform the coordinates around the center; All points on the circumference are represented as ; The point sequence obtained by transforming the circle centered on the central transformation coordinates onto the star map using a transformation matrix is as follows: , The corresponding grayscale value is The grayscale curve of the circumference is The contrast of the circumference is calculated based on the grayscale curve to obtain the resolution of the camera device under test in the corresponding position on the Siemens star map.
9. A camera resolution detection device, characterized in that, The device includes a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the camera device resolution detection method according to any one of claims 1-6 according to the instructions in the program code.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store program code, which, when executed by a processor, implements the camera device resolution detection method according to any one of claims 1-6.
Citation Information
Patent Citations
Image quality test analysis method and system
CN105447878A
A low-cost method for judging the resolution level of a camera
CN106937109B
Camera definition detection method and definition detection image card
CN110049319A
Digital camera dynamic resolution measurement technology and device
CN109587475A
Vehicle parking distance measurement method and device based on deep learning, and electronic equipment
CN113034583A