Test calibration method, apparatus, device, and computer-readable storage medium
By automatically calibrating the lens position in the imaging device and using the positioning block to determine the center point coincidence and calculate the calibration parameters, the problem of inaccurate alignment of the lens optical axis center is solved, and efficient and accurate imaging device testing is achieved.
Patent Information
- Application Number
- CN202011375666.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-30
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2040-11-30
AI Technical Summary
In existing technologies, the alignment accuracy between the optical axis center of the imaging device lens and the center of the test chart is insufficient, resulting in poor test results. Furthermore, the manual calibration process is cumbersome and inefficient.
By determining the center point of the first image captured by the lens of the device under test in the imaging device and the center point of the second image where the pre-set positioning block is located on the test pattern, it is determined whether the two coincide. Based on the position difference, calibration parameters are calculated to automatically calibrate the lens position so that the center of the lens optical axis is aligned with the center of the test pattern.
It improves the accuracy and efficiency of imaging equipment testing, ensures the accurate alignment of the lens optical axis center with the test image center, reduces manual intervention, and enhances testing efficiency.
Smart Images

Figure CN114584755B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to imaging device testing technology, and in particular to a test calibration method, device, equipment and storage medium. BACKGROUND
[0002] With the increasing demand for resolution of cameras, video cameras and other imaging devices, ensuring image quality has become a necessary step for every imaging device manufacturer. In order to detect the image clarity and resolution of the imaging device, an optical test chart can be used to detect the image clarity and resolution of the imaging device during testing of the imaging device.
[0003] The test chart is an important image quality factor for detecting image clarity and resolution. For example, in image resolution and focusing tests, the test chart used for testing needs to meet the requirement that the center of the chart and the optical axis center of the lens of the device to be tested are on a straight line.
[0004] To meet the above requirement, a laser calibration scheme is currently mainly used, that is, a laser pen or other laser device is used to manually calibrate the alignment of the optical axis center of the lens of the device to be tested and the center of the chart, and after confirming the alignment, actual testing is started, and the distance and direction are continuously adjusted according to the manual observation effect. The laser calibration scheme cannot guarantee the accuracy of the alignment of the optical axis center of the lens of the device to be tested and the center of the chart because the optical axis center of the lens of the device to be tested and the center of the chart are manually aligned, which will affect the subsequent test effect. SUMMARY
[0005] Therefore, embodiments of the present application provide a test calibration method applied to an electronic device, the electronic device comprising an imaging device, the method comprising:
[0006] In the imaging device, a first position of a first image center point photographed by a lens of a device to be tested is determined;
[0007] According to at least two positioning blocks pre-set on the test chart, a second position of a second image center point displayed on the imaging device is determined;
[0008] According to the first position and the second position, it is judged whether the first image center point and the second image center point coincide;
[0009] When they do not coincide, calibration parameters are determined according to the first position and the second position;
[0010] Wherein, the first image is an image obtained by the lens of the device under test capturing the test image; the second image is an image formed by the entire content of the test image filling the full screen of the imaging device; the calibration parameters are used to calibrate the position of the lens of the device under test so that the center of the test image is on the optical axis of the lens of the device under test.
[0011] This invention also provides a testing and calibration device for use in electronic devices, the electronic devices including imaging devices, characterized in that the device comprises:
[0012] The first determining unit is configured to determine, within the imaging device, the first position where the center point of the first image captured by the lens of the device under test is located;
[0013] The second determining unit is configured to determine the second position of the center point of the second image displayed on the imaging device based on at least two pre-set positioning blocks on the test diagram.
[0014] The judgment unit is configured to determine whether the center point of the first image and the center point of the second image coincide based on the first position and the second position;
[0015] The third determining unit is configured to determine calibration parameters based on the first position and the second position when they do not coincide.
[0016] Wherein, the first image is an image obtained by the lens of the device under test taking the test image; the second image is an image formed by the entire content of the test image filling the full screen of the imaging device; the calibration parameters are used to calibrate the position of the lens of the device under test so that the optical axis center of the lens of the device under test is on a straight line with the center of the test image.
[0017] This invention also provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the above-described test calibration method.
[0018] This invention also provides a computer-readable storage medium storing an information processing program, which, when executed by a processor, implements the above-described test calibration method.
[0019] The technical solution provided by the embodiments of the present invention can ensure the accuracy of the alignment between the optical axis center of the lens of the device under test and the center of the chart, thereby improving the subsequent testing results.
[0020] Other advantages of this application can be realized and obtained through the solutions described in the specification and drawings. Attached Figure Description
[0021] The accompanying drawings are used to provide an understanding of the technical solutions of this application and constitute a part of the specification. They are used together with the embodiments of this application to explain the technical solutions of this application and do not constitute a limitation on the technical solutions of this application.
[0022] Figure 1 This is a calibration diagram for chart testing in related technologies;
[0023] Figure 2 This is a calibration schematic diagram of a laser calibration scheme in related technologies;
[0024] Figure 3 This is a schematic flowchart of a test calibration method provided in an embodiment of the present invention;
[0025] Figure 4 This is a schematic diagram of the center point of a first image provided in an embodiment of the present invention;
[0026] Figure 5 A schematic diagram showing the coordinates of the center point of a first image provided in an embodiment of the present invention;
[0027] Figure 6 This is a schematic diagram illustrating the setting of a positioning block on a chart according to an embodiment of the present invention;
[0028] Figure 7 This is a schematic diagram of the center point of a second image provided in an embodiment of the present invention;
[0029] Figure 8 This is a schematic diagram showing the first image center point and the second image center point according to an embodiment of the present invention;
[0030] Figure 9 This is a schematic diagram illustrating the setting of a positioning block on a chart according to an embodiment of the present invention;
[0031] Figure 10 A schematic flowchart of a test calibration method provided in another embodiment of the present invention;
[0032] Figure 11a This is a schematic diagram of the original chart provided in an embodiment of the present invention;
[0033] Figure 11b This is a schematic diagram of setting the ROI of the original chart image according to an embodiment of the present invention;
[0034] Figure 11c This is a schematic diagram of a binarized image obtained after binarizing a preprocessed image, according to an embodiment of the present invention.
[0035] Figure 11dThis is a schematic diagram illustrating feature filtering and identification of localization blocks in a binarized image according to an embodiment of the present invention;
[0036] Figure 11e This is a schematic diagram of each identified positioning block after correction using the minimum bounding rectangle algorithm, provided in an embodiment of the present invention.
[0037] Figure 11f This is a schematic diagram illustrating the process of performing distance calculations on each corrected positioning block to obtain the image features of each positioning block, according to an embodiment of the present invention.
[0038] Figure 12 This is a schematic diagram of a test system structure provided in an embodiment of the present invention;
[0039] Figure 13 A schematic flowchart of a test calibration method provided in another embodiment of the present invention;
[0040] Figure 14 This is a schematic flowchart of a test and calibration device provided in an embodiment of the present invention;
[0041] Figure 15 This is a flowchart illustrating an electronic device according to an embodiment of the present invention. Detailed Implementation
[0042] This application describes several embodiments, but these descriptions are exemplary and not restrictive, and it will be apparent to those skilled in the art that many more embodiments and implementations are possible within the scope of the embodiments described herein. Although many possible combinations of features are shown in the drawings and discussed in the detailed description, many other combinations of the disclosed features are also possible. Unless specifically limited, any feature or element of any embodiment may be used in combination with, or may replace, any feature or element of any other embodiment.
[0043] This application includes and contemplates combinations of features and elements known to those skilled in the art. The embodiments, features, and elements disclosed in this application may also be combined with any conventional features or elements to form a unique inventive scheme as defined by the claims. Any feature or element of any embodiment may also be combined with features or elements from other inventive schemes to form another unique inventive scheme as defined by the claims. Therefore, it should be understood that any feature shown and / or discussed in this application may be implemented individually or in any suitable combination. Therefore, the embodiments are not limited except by the limitations imposed by the appended claims and their equivalents. Furthermore, various modifications and changes may be made within the scope of the appended claims.
[0044] Furthermore, in describing representative embodiments, the specification may have presented methods and / or processes as a specific sequence of steps. However, the method or process should not be limited to the specific order of steps described herein, to the extent that it does not depend on such a specific order. As will be understood by those skilled in the art, other sequences of steps are also possible. Therefore, the specific order of steps set forth in the specification should not be construed as a limitation of the claims. Moreover, the claims concerning the method and / or process should not be limited to the steps performed in the written order, and those skilled in the art will readily understand that these orders can be varied and still remain within the spirit and scope of the embodiments of this application.
[0045] Figure 1 This is a calibration diagram for chart testing in related technologies, such as... Figure 1 As shown, when using a chart for testing, the center of the chart and the center of the optical axis of the lens of the device under test must be on a straight line. For example... Figure 1 The dashed line in the middle is the connecting line after aligning the center of the chart with the center of the optical axis of the lens of the device under test.
[0046] In addition, in image resolution and focus testing, the chart test must also meet the requirement that the entire content of the chart fills the entire screen of the imaging device. For example Figure 1 As shown on the right, in a monitor (i.e., an imaging device), the entire content of the chart fills the entire screen and cannot exceed or fall below the screen size.
[0047] Figure 2 This is a calibration diagram of a laser calibration scheme in related technologies, such as... Figure 2 As shown, a laser pointer can be used to manually align the optical axis center of the device under test (DUT) lens with the center of the chart. After confirming alignment, the actual test can begin, and the distance and direction can be continuously adjusted based on manual observation. Of course, other laser devices besides a laser pointer can also be used. However, in the laser calibration method, because the alignment of the DUT lens optical axis center with the chart center is done manually, the accuracy of the alignment cannot be guaranteed, which will affect the subsequent test results.
[0048] Furthermore, when it's necessary to change the test equipment or chart, manual recalibration is required, which is time-consuming and cumbersome, resulting in low testing efficiency. Additionally, the entire calibration process and test results lack control, leaving no data for analysis and thus no means to locate, trace, or optimize problems.
[0049] Therefore, one embodiment of the present invention provides a test calibration method applied to electronic devices, the electronic devices including imaging devices, such as... Figure 3 As shown, the method includes:
[0050] Step 301: In the imaging device, determine the first position where the center point of the first image captured by the lens of the device under test is located; the first image is the image obtained by the lens of the device under test capturing the test image;
[0051] In an exemplary embodiment, determining the first position of the center point of the first image captured by the lens of the device under test includes:
[0052] Based on the first point value corresponding to the first resolution value in the length direction of the first image, determine the row coordinates corresponding to half of the first point value;
[0053] Based on the second point value corresponding to the second resolution value in the width direction of the first image, determine the column coordinates corresponding to half of the second point value;
[0054] The position represented by the row coordinates and the column coordinates is taken as the first position.
[0055] In one exemplary embodiment, before determining the first location of the center point of the first image captured by the lens of the device under test, the method further includes:
[0056] An image is obtained by controlling the lens of the device under test to capture the test image;
[0057] The image is binarized to obtain a binarized image;
[0058] The binarized image is used as the first image and displayed on the imaging device.
[0059] For example Figure 4 and Figure 5 As shown, Figure 4 The point on the diagonal of the image is the center point 1 of the first image. This center point 1 is independent of the content and position of the chart. The coordinates of this center point 1 can be obtained based on the image resolution; that is, by reading the image resolution and dividing it by half in each row and column, the coordinates of this point are obtained. For example... Figure 5 As shown, the coordinates of center point 1 are (row / 2, column / 2).
[0060] It should be noted that in this embodiment, other methods can also be used, as long as it is possible to determine the first position of the center point of the first image captured by the lens of the device under test. There are no restrictions on this.
[0061] Step 302: Determine the second position of the center point of the second image displayed on the imaging device based on at least two pre-set positioning blocks on the test image; the second image is an image formed by filling the entire screen of the imaging device with the entire content of the test image.
[0062] The phrase "the entire content of the test image fills the entire screen of the imaging device" means that the test image fills the entire imaging surface of the device under test. In other words, the imaging screen of the device under test must include the entire test image and cannot exceed or be smaller than the imaging screen.
[0063] In an exemplary embodiment, determining the second position of the center point of the second image displayed on the imaging device based on at least two pre-defined positioning blocks on the test map includes:
[0064] Determine the position of the center point of each of the at least two positioning blocks;
[0065] The second position is determined based on the location of the center point of each positioning block.
[0066] In an exemplary embodiment, determining the location of the center point of each of the at least two positioning blocks includes:
[0067] Determine the image features of each localization block;
[0068] Based on the image features of each positioning block, calculate the location of the center point of that positioning block.
[0069] In one exemplary embodiment, the center point of each of the at least two positioning blocks is located on a straight line passing through the center of the test chart at a predetermined angle; the center points of any two of the at least two positioning blocks are respectively located on different straight lines passing through the center of the test chart;
[0070] Determining the second position based on the location of the center point of each positioning block includes:
[0071] For each positioning block, a straight line is formed by passing through the center point of the positioning block at its corresponding preset angle.
[0072] Determine the intersection points of all the resulting straight lines;
[0073] The position of the intersection point is calculated based on the position of the center point of each of the at least two positioning blocks;
[0074] The location of the intersection point is taken as the second location.
[0075] In one exemplary embodiment, determining the image features of each localization block includes:
[0076] A region of interest (ROI) including the localization block is set at the edge position of the second image;
[0077] Perform image preprocessing on the ROI;
[0078] The preprocessed image is binarized to obtain a binary image;
[0079] Each localization block is identified in the binarized image based on a pre-set image feature threshold.
[0080] The minimum bounding rectangle algorithm is used to correct each positioning block, and the moment operation is performed on each corrected positioning block to obtain the image features of each positioning block.
[0081] In one exemplary embodiment, one of the at least two positioning blocks is located at the center of the long border of the test chart, and the other positioning block is located at the center of the short border of the test chart; or, one of the at least two positioning blocks is located at the center of either the long or wide border of the test chart, and the other positioning block is located at any vertex of the test chart; or, one of the at least two positioning blocks is located at the center of the long or wide border of the test chart. Figure 1 One of the long border vertices, and another positioning block is located at another vertex of the long border of the test chart; or one of the at least two positioning blocks is located in the test chart. Figure 1 One short border vertex, and another positioning block located at the other vertex of the wide border of the test chart.
[0082] It should be noted that the positions of the positioning blocks described above are merely illustrative. The positions of the positioning blocks only need to meet the following requirements, and are not limited thereto: the center point of each positioning block is located on a straight line passing through the center of the test chart at a predetermined angle; the center points of any two positioning blocks are located on different straight lines passing through the center of the test chart. For example, when setting positioning blocks on the chart, the image features and predetermined angle of each positioning block are recorded so that the positioning block can be identified based on the image features, and the predetermined angle corresponding to the positioning block can be found, thereby determining the straight line formed by passing through the center point of the positioning block at the predetermined angle.
[0083] In an exemplary embodiment, there are no special requirements for the shape of the positioning blocks. For example, they can be square, rectangular, sector, semicircular, circular, etc., as long as the following requirements are met: the center point of each positioning block is located on a straight line passing through the center of the test chart at a predetermined angle; the center points of any two positioning blocks are located on different straight lines passing through the center of the test chart.
[0084] For example, Figure 6 In any of the four schemes shown, two positioning blocks (i.e., the black rectangular blocks in the figure) are added to the test chart beforehand. The positioning blocks are rectangular in shape, and the center points of the two positioning blocks intersect with a straight line perpendicular to the border of the chart. The intersection point is the center of the chart.
[0085] For example, Figure 7 As shown, the chart has two positioning blocks (the black rectangles in the image), located at the centers of the long and short borders respectively. Draw straight lines perpendicular to the center points of the two positioning blocks from the long and short borders respectively; the intersection of these two lines is the location of the chart's center point 2. This center point 2 remains fixed and does not change with the rest of the image; it is always at the very center of the chart.
[0086] Step 303: Based on the first position and the second position, determine whether the center point of the first image and the center point of the second image coincide;
[0087] In an exemplary embodiment, determining whether the center point of the first image and the center point of the second image coincide based on the first position and the second position includes:
[0088] Determine whether the coordinates of the first position and the coordinates of the second position coincide;
[0089] When they coincide, it is determined that the center point of the first image and the center point of the second image coincide.
[0090] When they do not overlap, it is determined that the center point of the first image and the center point of the second image do not overlap.
[0091] The calibration ends when the center point of the first image and the center point of the second image coincide; when the center point of the first image and the center point of the second image do not coincide, step 304 is executed.
[0092] Step 304: Determine calibration parameters based on the first position and the second position; the calibration parameters are used to calibrate the position of the lens of the device under test so that the center of the test pattern is on the optical axis of the lens of the device under test.
[0093] In an exemplary embodiment, determining calibration parameters based on the first position and the second position includes:
[0094] In the image coordinate system, based on the coordinates of the first position and the coordinates of the second position, the direction and distance parameters required to move the first position to the second position are calculated.
[0095] The direction and distance parameters are used as calibration parameters.
[0096] In one exemplary embodiment, the method further includes:
[0097] The position of the lens of the device under test is calibrated according to the calibration parameters so that the center of the test image is on the optical axis of the lens of the device under test.
[0098] For example, Figure 8 As shown, throughout the entire testing process, the center point of the first image (i.e., center point 1 in the figure) and the center point of the second image (i.e., center point 2 in the figure) are displayed in real time on the imaging device, facilitating the operator's intuitive calibration of the lens position of the device under test. For example, by comparing the positions of the two center points in the image coordinate system, the direction and position are adjusted according to the position information obtained from the comparison, ultimately making the two center points coincide and achieving the purpose of optical axis alignment. The positions of the two center points are displayed in real time throughout the entire testing process, facilitating the operator's intuitive calibration of the position.
[0099] For example, a prompt message can be displayed on the imaging device, which may be calibration parameters, prompting the operator to calibrate the position of the lens of the device under test according to the calibration parameters. Alternatively, electronic equipment can automatically calibrate the position of the lens of the device under test directly based on the calibration parameters, without manual intervention, further improving testing efficiency.
[0100] The calibration ends when the center point of the first image coincides with the center point of the second image.
[0101] It should be noted that there is no fixed order between steps 301 and 302 above. Step 301 can be executed before step 302, or vice versa; there is no restriction on this. Of course, before executing this method, the device under test and the chart must have been placed in the test environment.
[0102] The technical solution provided in this embodiment can automatically determine calibration parameters and facilitate the calibration of the position of the device under test, so that the optical axis center of the lens of the device under test is on a straight line with the center of the test chart, thereby ensuring the accuracy of the alignment between the optical axis center of the lens of the device under test and the center of the test chart, and improving the testing efficiency.
[0103] In another embodiment of the present invention, based on the above embodiment, at least one border of at least one of the at least two positioning blocks coincides with the long border and / or short border of the test pattern.
[0104] In one exemplary embodiment, before determining the first location of the center point of the first image captured by the lens of the device under test, the method further includes:
[0105] Based on the at least one positioning block, determine whether the entire content of the test image fills the entire screen of the imaging device.
[0106] When the entire contents of the test image fill the entire screen of the imaging device, the first position of the center point of the first image captured by the lens of the device under test is determined.
[0107] In an exemplary embodiment, determining whether the entire content of the test image fills the entire screen of the imaging device includes:
[0108] Determine the image features of each positioning block in the at least one positioning block;
[0109] Based on the image features of each positioning block and a pre-set image feature threshold, it is determined whether the positioning block displayed on the imaging device is complete;
[0110] When the positioning block is fully displayed and located at the edge of the second image, it is determined that the entire content of the test image fills the full screen of the imaging device.
[0111] The location of the positioning block at the edge of the second image means that the border of the positioning block that coincides with the border of the test image coincides with a border of the second image.
[0112] The system can pre-set and save image feature thresholds for each positioning block. These image features include the block's contour features and area features, and the image feature thresholds include contour feature thresholds and area feature thresholds. For example, when the contour feature of a positioning block is greater than or equal to the contour feature threshold, it indicates that the block is fully displayed, and / or, when the area feature of a positioning block is greater than or equal to the area feature threshold, it indicates that the block is fully displayed.
[0113] In one exemplary embodiment, determining the image features of each localization block includes:
[0114] A region of interest (ROI) including the localization block is set at the edge position of the second image;
[0115] Perform image preprocessing on the ROI;
[0116] The preprocessed image is binarized to obtain a binary image;
[0117] Each localization block is identified in the binarized image based on a pre-set image feature threshold.
[0118] The minimum bounding rectangle algorithm is used to correct each positioning block, and the moment operation is performed on each corrected positioning block to obtain the image features of each positioning block.
[0119] The ROI needs to be set not only at the edge of the image, but also contain a complete positioning block.
[0120] The technical solution provided in this embodiment can automatically detect whether the entire content of the test chart fills the entire imaging screen of the imaging device by pre-setting positioning blocks on the chart, without the need for manual intervention, thus further improving testing efficiency.
[0121] In another embodiment of the present invention, the test calibration method is described in detail, taking the example of setting two positioning blocks in advance on the test chart.
[0122] In this embodiment, with Figure 9 As shown, a rectangular positioning block is set at the center of the length and width borders of the test chart, and one border of each positioning block coincides with the length border and segment border of the chart, respectively.
[0123] In this embodiment, an image feature threshold and a preset angle are pre-set for each positioning block. The image feature threshold is used to determine whether the positioning block is fully displayed on the imaging device and located at the edge, and to identify the positioning block on the second image. The preset angle is used to form a straight line through the center of the positioning block when determining the second position of the center of the second image. In this embodiment, the preset angle of the positioning block located on the long border is 90 degrees to the long border, i.e., perpendicular to the long border; the preset angle of the positioning block located on the short border is 90 degrees to the short border, i.e., perpendicular to the short border.
[0124] The test and calibration method provided in this embodiment is applied to electronic devices, including imaging devices, such as... Figure 10 As shown, the method includes:
[0125] Step 1001: Based on the positioning blocks on the test image displayed on the imaging device, determine whether the entire content of the test image fills the entire imaging screen of the imaging device;
[0126] In an exemplary embodiment, determining whether the entire content of the test image fills the entire imaging screen of the imaging device includes:
[0127] Determine the image features of each localization block;
[0128] Based on the image features of each positioning block and a pre-set image feature threshold, it is determined whether the positioning block displayed on the imaging device is complete;
[0129] When the positioning block is fully displayed and located at the edge of the second image, it is determined that the entire content of the test image fills the full screen of the imaging device.
[0130] When the entire content of the test image fills the entire screen of the imaging device, the test image displayed on the imaging device will be used as the second image, and step 1002 will be executed. When it is determined that the entire content of the test image does not fill the entire screen of the imaging device, step 1007 will be executed.
[0131] Step 1002: Control the lens of the device under test to capture the test image and obtain an image; perform binarization processing on the image to obtain a binarized image; use the binarized image as the first image and display it on the imaging device;
[0132] Step 1003: Determine the first position of the center point of the first image based on the resolution of the first image;
[0133] In an exemplary embodiment, determining the first position of the center point of the first image based on the resolution of the first image includes:
[0134] Based on the first point value corresponding to the first resolution value in the length direction of the first image, determine the row coordinates corresponding to half of the first point value;
[0135] Based on the second point value corresponding to the second resolution value in the width direction of the first image, determine the column coordinates corresponding to half of the second point value;
[0136] The position represented by the row coordinates and the column coordinates is taken as the first position.
[0137] Step 1004: Determine the second position of the center point of the second image based on the two positioning blocks on the second image displayed on the imaging device;
[0138] In one exemplary embodiment, determining the second position of the center point of the second image based on two positioning blocks on the second image displayed on the imaging device includes:
[0139] Determine the image features of each localization block;
[0140] Calculate the location of the center point of each positioning block based on its image features;
[0141] For each positioning block, a straight line is formed through the center point of the positioning block according to a preset angle;
[0142] Determine the intersection point of the two resulting straight lines;
[0143] The location of the intersection point is calculated based on the location of the center point of each positioning block;
[0144] The location of the intersection point is taken as the second location.
[0145] In one exemplary embodiment, determining the image features of each localization block includes:
[0146] A region of interest (ROI) containing the localized block is set at the edge of the second image;
[0147] Perform image preprocessing on the ROI;
[0148] The preprocessed image is binarized to obtain a binary image;
[0149] Each localization block is identified in the binarized image based on a pre-set image feature threshold.
[0150] The minimum bounding rectangle algorithm is used to correct each positioning block, and the moment operation is performed on each corrected positioning block to obtain the image features of each positioning block.
[0151] Preprocessing includes image filtering, such as filtering out particle image parts that do not need to be analyzed.
[0152] Step 1005: Based on the first position and the second position, determine whether the center point of the first image and the center point of the second image coincide;
[0153] When the center point of the first image and the center point of the second image coincide, the calibration ends; when the center point of the first image and the center point of the second image do not coincide, step 1006 is executed.
[0154] Step 1006: Determine calibration parameters based on the first position and the second position; the calibration parameters are used to calibrate the position of the lens of the device under test so that the center of the test pattern is on the optical axis of the lens of the device under test.
[0155] Step 1007: Adjust the display parameters of the imaging device, re-display the Chart, and return to step 1001.
[0156] The technical solution provided by this invention can automatically determine whether the entire content of the test chart fills the entire imaging screen of the imaging device, and automatically determine calibration parameters to calibrate the position of the lens of the device under test, so that the center of the test chart is on the optical axis of the lens of the device under test. This solution not only ensures the accuracy of alignment between the center of the optical axis of the lens of the device under test and the center of the test chart, but also eliminates the need for manual intervention, greatly improving testing efficiency.
[0157] In another embodiment of the present invention, based on the above embodiments, the specific process of determining the image features of each positioning block includes:
[0158] 1. Set the ROI (Region of Interest) in the area of the test chart that contains each localization block; for example... Figure 11a The first image in the chart is the original test chart displayed on the imaging device. Figure 11b The graph after setting the ROI;
[0159] 2. Perform image preprocessing on each ROI;
[0160] Preprocessing includes image filtering, such as filtering out particle image parts that do not need to be analyzed.
[0161] 3. Perform binarization on the preprocessed image to obtain a binarized image;
[0162] For example Figure 11c This is the binarized image obtained after binarization processing;
[0163] 4. Feature filtering, which involves identifying each localization block in a binary image based on pre-set image feature thresholds; for example... Figure 11d ,
[0164] 5. Use the minimum bounding rectangle algorithm to correct each identified positioning block;
[0165] For example Figure 11e .
[0166] Other graphic correction algorithms in existing technologies can also be used, and are not limited to the minimum bounding rectangle algorithm.
[0167] 6. Perform distance calculations on each corrected positioning block to obtain the image features of each positioning block.
[0168] For example Figure 11f As shown.
[0169] Each positioning block has features such as its outline and area.
[0170] Other feature recognition algorithms in existing technologies can also be used, and are not limited to distance operations.
[0171] In another embodiment of the invention, such as Figure 12 As shown, a schematic diagram of a test system architecture is provided. The test system includes:
[0172] Computer and imaging equipment: set up to control the entire testing system, record test data, process and analyze images, and confirm the real-time position of the test chart.
[0173] Power supply: Set to power the device under test so that it can function properly.
[0174] Test chart: In this embodiment, it is an image quality test standard card. It can also be any other test chart.
[0175] Device under test: The device to be tested for image quality.
[0176] In this embodiment, a rectangular positioning block is pre-set at the center of the length and width borders of the test chart, and one border of each positioning block coincides with the length border and segment border of the chart, respectively.
[0177] In this embodiment, an image feature threshold and a preset angle are pre-set for each positioning block. The image feature threshold is used to determine whether the positioning block is fully displayed on the imaging device (i.e., the display in the figure) and located at the edge, and to identify the positioning block on the second image. The preset angle is used to form a straight line through the center of the positioning block when determining the second position of the center of the second image. In this embodiment, the preset angle of the positioning block located on the long border is 90 degrees to the long border, i.e., perpendicular to the long border; the preset angle of the positioning block located on the short border is 90 degrees to the short border, i.e., perpendicular to the short border.
[0178] The computer (i.e., electronic device) is pre-installed with test client software. After the test begins, the client software establishes a communication connection with the device under test and displays the test image on the imaging device.
[0179] based on Figure 12 The test system shown, and the test calibration method provided in this embodiment, are as follows: Figure 13 As shown, it includes:
[0180] Step 1301: The client software determines the image features of each positioning block on the test image displayed on the imaging device; based on the image features of each positioning block and a preset image feature threshold, it determines whether the positioning block displayed on the imaging device is complete.
[0181] When both positioning blocks are fully displayed, and the test image fills the entire screen of the imaging device, the test image displayed on the imaging device is used as the second image, and step 1302 is executed. When either of the two positioning blocks is incomplete, and the test image does not fill the entire screen of the imaging device, step 1307 is executed.
[0182] Step 1302: The client software controls the lens of the device under test to capture the test image and obtain an image; the image is binarized to obtain a binarized image; the binarized image is used as the first image and displayed on the imaging device.
[0183] Step 1303: The client software determines the first position of the center point of the first image based on the resolution of the first image;
[0184] Step 1304: The client software calculates the position of the center point of each positioning block based on the image features of each positioning block in the second image displayed on the imaging device; for each positioning block, a straight line is formed through the center point of the positioning block according to a preset angle; the intersection point of the two formed straight lines is determined; the position of the intersection point is calculated based on the position of the center point of each positioning block; and the position of the intersection point is taken as the second position.
[0185] In particular, the step of determining the image features of each positioning block in step 1304 can directly utilize the calculation results of determining the image features of each positioning block in step 1301, so as to reduce the amount of calculation and improve efficiency.
[0186] Step 1305: The client software determines whether the center point of the first image and the center point of the second image coincide based on the first position and the second position;
[0187] The calibration ends when the center point of the first image and the center point of the second image coincide; when the center point of the first image and the center point of the second image do not coincide, proceed to step 1306.
[0188] Step 1306: The client software determines calibration parameters based on the first position and the second position; the calibration parameters are used to calibrate the position of the lens of the device under test so that the center of the test pattern is on the optical axis of the lens of the device under test.
[0189] Step 1307: The client software adjusts the display parameters of the imaging device, re-displays the chart, and returns to step 1301.
[0190] In another embodiment of the present invention, based on the previous embodiment, after step 1306, the method may further include:
[0191] Step 1308: The client software calibrates the position of the lens of the device under test according to the calibration parameters, so that the center of the test image is on the optical axis of the lens of the device under test.
[0192] In one exemplary embodiment, the calibration parameters include: the direction parameter and distance parameter required to move the first position to the second position in the image coordinate system.
[0193] The solution in this embodiment automatically calibrates the position of the lens of the device under test without human intervention, further improving testing efficiency.
[0194] In another embodiment of the invention, based on Figure 12 The test system shown uses a computer to record data throughout the entire test calibration process, including process images and text records, to facilitate subsequent backtracking, location, and optimization of the test.
[0195] In one embodiment of the invention, a test calibration apparatus is also provided for use in an electronic device, the electronic device including an imaging device, such as... Figure 14 As shown, the device includes:
[0196] The first determining unit is configured to determine, within the imaging device, the first position where the center point of the first image captured by the lens of the device under test is located;
[0197] The second determining unit is configured to determine the second position of the center point of the second image displayed on the imaging device based on at least two pre-set positioning blocks on the test diagram.
[0198] The judgment unit is configured to determine whether the center point of the first image and the center point of the second image coincide based on the first position and the second position;
[0199] The third determining unit is configured to determine calibration parameters based on the first position and the second position when they do not coincide.
[0200] Wherein, the first image is an image obtained by the lens of the device under test capturing the test image; the second image is an image formed by the entire content of the test image filling the full screen of the imaging device; the calibration parameters are used to calibrate the position of the lens of the device under test so that the center of the test image is on the optical axis of the lens of the device under test.
[0201] In an exemplary embodiment, the second determining unit is specifically configured to determine the position of the center point of each of the at least two positioning blocks;
[0202] The second position is determined based on the location of the center point of each positioning block.
[0203] In an exemplary embodiment, determining the location of the center point of each of the at least two positioning blocks includes:
[0204] Determine the image features of each localization block;
[0205] Based on the image features of each positioning block, calculate the location of the center point of that positioning block.
[0206] In one exemplary embodiment, the center point of each of the at least two positioning blocks is located on a straight line passing through the center of the test chart at a predetermined angle; the center points of any two of the at least two positioning blocks are respectively located on different straight lines passing through the center of the test chart;
[0207] Determining the second position based on the location of the center point of each positioning block includes:
[0208] For each positioning block, a straight line is formed by passing through the center point of the positioning block at its corresponding preset angle.
[0209] Determine the intersection points of all the resulting straight lines;
[0210] The position of the intersection point is calculated based on the position of the center point of each of the at least two positioning blocks;
[0211] The location of the intersection point is taken as the second location.
[0212] In an exemplary embodiment, the first determining unit is specifically configured to determine the row coordinates corresponding to half of the first point value based on the first point value corresponding to the first resolution value of the first image in the length direction;
[0213] Based on the second point value corresponding to the second resolution value in the width direction of the first image, determine the column coordinates corresponding to half of the second point value;
[0214] The position represented by the row coordinates and the column coordinates is taken as the first position.
[0215] In one exemplary embodiment, at least one border of at least one of the at least two positioning blocks coincides with the long border and / or short border of the test pattern; the device further includes:
[0216] The fourth determining unit is configured to determine, before determining the first position of the center point of the first image captured by the lens of the device under test, whether the entire content of the test image fills the entire screen of the imaging device based on the at least one positioning block.
[0217] When the entire content of the test image fills the entire screen of the imaging device, the first position of the center point of the first image captured by the lens of the device under test is determined.
[0218] The step of determining whether the entire content of the test image fills the entire screen of the imaging device includes:
[0219] Determine the image features of each positioning block in the at least one positioning block;
[0220] Based on the image features of each positioning block and a pre-set image feature threshold, it is determined whether the positioning block displayed on the imaging device is complete;
[0221] When the positioning block is fully displayed and located at the edge of the second image, it is determined that the entire content of the test image fills the full screen of the imaging device.
[0222] The determination of image features for each localization block includes:
[0223] A region of interest (ROI) including the localization block is set at the edge position of the second image;
[0224] Perform image preprocessing on the ROI;
[0225] The preprocessed image is binarized to obtain a binary image;
[0226] Each localization block is identified in the binarized image based on a pre-set image feature threshold.
[0227] The minimum bounding rectangle algorithm is used to correct each positioning block, and the moment operation is performed on each corrected positioning block to obtain the image features of each positioning block.
[0228] The technical solution provided in this embodiment can automatically determine calibration parameters and facilitate the calibration of the position of the device under test, so that the optical axis center of the lens of the device under test is on a straight line with the center of the test chart, thereby ensuring the accuracy of the alignment between the optical axis center of the lens of the device under test and the center of the test chart, and improving the testing efficiency.
[0229] An embodiment of the present invention also provides an electronic device, such as... Figure 15 As shown, it includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements any of the aforementioned test calibration methods.
[0230] An embodiment of the present invention also provides a computer-readable storage medium storing an information processing program, which, when executed by a processor, implements any of the above-described test calibration methods.
[0231] It will be understood by those skilled in the art that all or some of the steps, systems, or apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
Claims
1. A test calibration method applied to an electronic device, the electronic device including an imaging device, the method comprising: Based on at least one of the two pre-set positioning blocks on the test image, determine whether the entire content of the test image fills the entire screen of the imaging device. At least one border of at least one of the at least two positioning blocks coincides with the long border and / or short border of the test pattern; When the entire content of the test image fills the full screen of the imaging device, determine the first position where the center point of the first image captured by the lens of the device under test is located. Based on at least two pre-set positioning blocks on the test chart, determine the second position where the center point of the second image displayed on the imaging device is located; Based on the first position and the second position, determine whether the center point of the first image and the center point of the second image coincide; When they do not coincide, the calibration parameters are determined based on the first position and the second position; Wherein, the first image is an image obtained by the lens of the device under test capturing the test image; the second image is an image formed by the entire content of the test image filling the full screen of the imaging device; the calibration parameters are used to calibrate the position of the lens of the device under test so that the center of the test image is on the optical axis of the lens of the device under test; The step of determining whether the entire content of the test image fills the entire screen of the imaging device includes: Determine the image features of each positioning block in the at least one positioning block; Based on the image features of each positioning block and a pre-set image feature threshold, it is determined whether the positioning block displayed on the imaging device is complete; When the positioning block is fully displayed and located at the edge of the second image, it is determined that the entire content of the test image fills the full screen of the imaging device.
2. The method according to claim 1, characterized in that, Determining the second position of the center point of the second image displayed on the imaging device based on at least two pre-set positioning blocks on the test map includes: Determine the position of the center point of each of the at least two positioning blocks; The second position is determined based on the location of the center point of each positioning block.
3. The method according to claim 2, characterized in that, Determining the position of the center point of each of the at least two positioning blocks includes: Determine the image features of each localization block; Based on the image features of each positioning block, calculate the location of the center point of that positioning block.
4. The method according to claim 2, characterized in that, The center point of each of the at least two positioning blocks is located on a straight line passing through the center of the test chart at a predetermined angle; the center points of any two of the at least two positioning blocks are respectively located on different straight lines passing through the center of the test chart. Determining the second position based on the location of the center point of each positioning block includes: For each positioning block, a straight line is formed by passing through the center point of the positioning block at its corresponding preset angle. Determine the intersection points of all the resulting straight lines; The position of the intersection point is calculated based on the position of the center point of each of the at least two positioning blocks; The location of the intersection point is taken as the second location.
5. The method according to claim 2, characterized in that, Determining the first position of the center point of the first image captured by the lens of the device under test includes: Based on the first point value corresponding to the first resolution value in the length direction of the first image, determine the row coordinates corresponding to half of the first point value; Based on the second point value corresponding to the second resolution value in the width direction of the first image, determine the column coordinates corresponding to half of the second point value; The position represented by the row coordinates and the column coordinates is taken as the first position.
6. The method according to claim 3 or 1, characterized in that, The process of determining the image features of each localization block includes: A region of interest (ROI) including the localization block is set at the edge position of the second image; Perform image preprocessing on the ROI; The preprocessed image is binarized to obtain a binary image; Each localization block is identified in the binarized image based on a pre-set image feature threshold. The minimum bounding rectangle algorithm is used to correct each positioning block, and the moment operation is performed on each corrected positioning block to obtain the image features of each positioning block.
7. A test and calibration apparatus for use in electronic devices, said electronic devices including imaging devices, characterized in that, The device includes: The first determining unit is configured to determine the first position where the center point of the first image captured by the lens of the device under test is located. The second determining unit is configured to determine the second position of the center point of the second image displayed on the imaging device based on at least two pre-set positioning blocks on the test diagram. The judgment unit is configured to determine whether the center point of the first image and the center point of the second image coincide based on the first position and the second position; The third determining unit is configured to determine calibration parameters based on the first position and the second position when they do not coincide. Wherein, the first image is an image obtained by the lens of the device under test capturing the test image; the second image is an image formed by the entire content of the test image filling the full screen of the imaging device; the calibration parameters are used to calibrate the position of the lens of the device under test so that the center of the test image is on the optical axis of the lens of the device under test; At least one border of at least one of the at least two positioning blocks coincides with the long border and / or short border of the test pattern; Before determining the first position of the center point of the first image captured by the lens of the device under test, the method further includes: determining whether the entire content of the test image fills the entire screen of the imaging device based on the at least one positioning block. When the entire content of the test image fills the entire screen of the imaging device, the first position of the center point of the first image captured by the lens of the device under test is determined. The step of determining whether the entire content of the test image fills the entire screen of the imaging device includes: Determine the image features of each positioning block in the at least one positioning block; Based on the image features of each positioning block and a pre-set image feature threshold, it is determined whether the positioning block displayed on the imaging device is complete; When the positioning block is fully displayed and located at the edge of the second image, it is determined that the entire content of the test image fills the full screen of the imaging device.
8. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the test calibration method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores an information processing program, which, when executed by a processor, implements the test calibration method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Method and system for capturing content of test chart
CN104168476A
Locating and focusing method of visual inspection system of liquid crystal display panel
CN104931421A