Camera clarity detection method and device
By processing the camera test card image through the element positioning model, the number of scan lines is automatically identified and analyzed, which solves the problem of relying on manual judgment and realizes the standardization and speed improvement of camera clarity detection.
Patent Information
- Application Number
- CN202210673497.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-13
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2042-06-13
AI Technical Summary
Existing methods for detecting the clarity of cameras rely on manual judgment, which is highly subjective, slow, and prone to errors.
The element positioning model is used to process the test card image captured by the camera, identify the scan line element group, obtain the sub-image corresponding to each scan line element group through attribute information processing, and analyze the number of scan lines to automatically determine the camera's clarity.
It achieves standardization and speed-up of camera clarity detection, eliminates the need for manual judgment, improves the objectivity and efficiency of detection, and adapts to the personalized needs of different test charts.
Smart Images

Figure CN115086648B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of machine vision, and in particular to a camera clarity detection method and device. Background Art
[0002] During the production process of cameras, other products, the clarity of the products needs to be tested during the production line testing phase.
[0003] In traditional testing solutions, the TVline (scan line) test method can be used to test the resolution of cameras and other products. The TVline test method mainly obtains the number of scan lines through observation, and then makes a subjective evaluation of the clarity of cameras and other products based on the number of scan lines. It requires manual judgment.
[0004] In the actual production process of cameras, etc., the following problems will be encountered when using the TVline test method to test the clarity of products: manual judgment is greatly affected by subjective factors, and different people have different standards, making standardization impossible; manual judgment is slow and prone to errors due to eye fatigue. Summary of the Invention
[0005] In view of this, an embodiment of the present invention provides a camera clarity detection method and device to solve the problem that product clarity testing cannot be standardized and is slow.
[0006] According to one aspect of the present disclosure, a camera clarity detection method is provided, the method comprising:
[0007] Acquire an image to be tested obtained by photographing a test chart with a camera, wherein the test chart includes a plurality of scan lines;
[0008] Processing the image to be tested using the trained element positioning model to identify and obtain multiple scan line element groups;
[0009] Processing, according to the image to be tested and the attribute information of each scan line element group, to obtain a sub-image corresponding to each scan line element group;
[0010] Analyzing the sub-images corresponding to each scan line element group to obtain the number of scan lines contained in each scan line element group;
[0011] The definition information of the camera is determined based on the attribute information of each scan line element group, the number of scan lines contained in each scan line element group, and the number of scan lines in the test chart.
[0012] Optionally, the attribute information includes coordinate frame information;
[0013] The step of obtaining a sub-image corresponding to each scan line element group based on the image to be tested and the attribute information of each scan line element group includes:
[0014] For each scan line element group, the coordinate frame information of the scan line element group is expanded by a preset size to obtain updated coordinate frame information;
[0015] According to the image to be tested and the updated attribute information of each scan line element group, a sub-image corresponding to each scan line element group is obtained by processing.
[0016] Optionally, the attribute information includes region category information, and the region category information is used to indicate whether the scan line element group belongs to a central region or a non-central region;
[0017] The step of obtaining a sub-image corresponding to each scan line element group based on the image to be tested and the attribute information of each scan line element group includes:
[0018] For the scan line element group in the central area, according to the attribute information of the image to be tested and the scan line element group in the central area, a first sub-image corresponding to the scan line element group in the central area is obtained by processing;
[0019] For the scan line element group in the non-central area, a second sub-image corresponding to the scan line element group in the non-central area is obtained by processing according to the image to be tested and the attribute information of the scan line element group in the non-central area.
[0020] Optionally, the processing of the scan line element group in the central area to obtain a first sub-image corresponding to the scan line element group in the central area according to the image to be tested and the attribute information of the scan line element group in the central area includes:
[0021] determining a first number of scan line element groups in the central region;
[0022] Performing a first legitimacy check based on the first number;
[0023] When the preset first legitimacy is not satisfied, the scan line element group in the central area is corrected until the first legitimacy is satisfied;
[0024] Obtaining current attribute information of the scan line element group in the central area;
[0025] According to the current attribute information of the image to be tested and the scan line element group in the central area, a first sub-image corresponding to the scan line element group in the central area is obtained by processing.
[0026] Optionally, performing a first legitimacy check based on the first number includes:
[0027] checking whether the first number is equal to a first preset number;
[0028] When the preset first legitimacy is not satisfied, the scan line element group in the central area is corrected until the first legitimacy is satisfied, including:
[0029] When the first number is not equal to the first preset number, the scan line element group in the central area is modified until the first number is equal to the first preset number.
[0030] Optionally, the non-central area includes multiple categories, and the multiple categories include an upper left corner area, an upper right corner area, a lower right corner area, and a lower left corner area;
[0031] The step of processing the scan line element group in the non-central area to obtain a second sub-image corresponding to the scan line element group in the non-central area according to the image to be tested and the attribute information of the scan line element group in the non-central area includes:
[0032] determining a second number of scan line element groups corresponding to each classification;
[0033] Performing a second legitimacy check based on the second number;
[0034] When the preset second legality is not satisfied, the scan line element group corresponding to the illegal classification that does not satisfy the second legality is corrected until the illegal classification satisfies the second legality;
[0035] Obtaining current attribute information of the scan line element group corresponding to each classification;
[0036] According to the image to be tested and the current attribute information of the scan line element group corresponding to each classification, a second sub-image corresponding to the scan line element group in the non-central area is obtained by processing.
[0037] Optionally, performing a second legitimacy check based on the second number includes:
[0038] checking whether the second number is equal to a second preset number;
[0039] When the preset second legality is not satisfied, the scan line element group corresponding to the illegal classification that does not satisfy the second legality is corrected until the illegal classification satisfies the second legality, including:
[0040] When the second number is not equal to the second preset number, the scan line element groups corresponding to the illegal classifications that do not meet the second legality are corrected until the second number of scan line element groups corresponding to the illegal classifications is equal to the second preset number.
[0041] Optionally, the scan line element group includes a scan line element group in a central area;
[0042] The sub-images corresponding to each scan line element group are analyzed respectively to obtain the number of scan lines contained in each scan line element group, including:
[0043] For the sub-image corresponding to the scan line element group in the central area, duplicate it to obtain a plurality of first initial sub-images;
[0044] Processing each first initial partial image separately to obtain a processed first partial image;
[0045] Each processed first partial image is analyzed to obtain the number of scan lines included in the scan line element group in the central area.
[0046] Optionally, the scan lines include horizontal scan lines and vertical scan lines, the first initial partial images include a first vertical initial partial image and a first horizontal initial partial image, and the first partial images include a first vertical partial image and a first horizontal partial image;
[0047] The step of processing each first initial partial image to obtain a processed first partial image includes:
[0048] performing a horizontal scan line removal operation on the first vertical initial partial image to obtain a first vertical partial image;
[0049] A vertical scan line removal operation is performed on the first horizontal initial partial image to obtain a first horizontal partial image.
[0050] Optionally, the scan line element group includes a scan line element group in a non-central area;
[0051] The sub-images corresponding to each scan line element group are analyzed respectively to obtain the number of scan lines contained in each scan line element group, including:
[0052] Segmenting the sub-image corresponding to the non-central area to obtain a plurality of second initial sub-images;
[0053] processing each second initial partial image respectively to obtain a processed second partial image;
[0054] Each processed second partial image is analyzed to obtain the number of scan lines included in the scan line element group of the non-central area.
[0055] Optionally, the scan lines include horizontal scan lines and vertical scan lines, the second initial partial images include second vertical initial partial images and second horizontal initial partial images, and the second partial images include second vertical partial images and second horizontal partial images;
[0056] The processing of each second initial partial image to obtain a processed second partial image includes:
[0057] removing first impurity lines from the second vertical initial partial image to obtain a second vertical partial image, wherein the first impurity lines are other lines in the second vertical initial partial image except the target vertical scan line;
[0058] The second impurity lines in the second horizontal initial partial image are removed to obtain a second horizontal partial image, wherein the second impurity lines are other lines in the second horizontal initial partial image except the target horizontal scan line.
[0059] According to another aspect of the present disclosure, a camera clarity detection device is provided, the device comprising:
[0060] an acquisition module, configured to acquire an image to be tested obtained by photographing a test chart with a camera, wherein the test chart includes a plurality of scan lines;
[0061] A positioning module, configured to process the image to be tested using a trained element positioning model to identify and obtain a plurality of scan line element groups;
[0062] a processing module, configured to obtain a sub-image corresponding to each scan line element group based on the image to be tested and the attribute information of each scan line element group;
[0063] a parsing module, configured to parse the sub-images corresponding to each scan line element group to obtain the number of scan lines contained in each scan line element group;
[0064] A determination module is used to determine the definition information of the camera based on the attribute information of each scan line element group, the number of scan lines contained in each scan line element group, and the number of scan lines in the test chart.
[0065] According to another aspect of the present disclosure, there is provided an electronic device, comprising:
[0066] processor; and
[0067] Memory for storing programs,
[0068] The program includes instructions, which, when executed by the processor, cause the processor to execute the camera clarity detection method.
[0069] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the camera clarity detection method.
[0070] In the present disclosure, by processing the test image through the element positioning model, the clarity information of the test image card taken by the camera can be directly obtained, and the clarity information of the corresponding camera can be automatically obtained. The speed is fast, and there is no need for manual judgment of the number of scanning lines. It is more objective and standardized. In addition, this method can adapt to different test images and can meet the personalized needs of different products. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] Further details, features and advantages of the present disclosure are disclosed in the following description of exemplary embodiments in conjunction with the accompanying drawings, in which:
[0072] Figure 1 A flow chart of a camera definition detection method according to an exemplary embodiment of the present disclosure is shown;
[0073] Figure 2 shows a schematic diagram of an image to be tested according to an exemplary embodiment of the present disclosure;
[0074] Figure 3 A flow chart of obtaining a first sub-image according to an exemplary embodiment of the present disclosure is shown;
[0075] Figure 4 A flow chart of obtaining a second sub-image according to an exemplary embodiment of the present disclosure is shown;
[0076] Figure 5 A flowchart illustrating attribute information processing according to an exemplary embodiment of the present disclosure is shown;
[0077] Figure 6 A schematic diagram showing the positional symmetry relationship of the central area according to an exemplary embodiment of the present disclosure is shown;
[0078] Figure 7 A schematic diagram showing the positional symmetry relationship of non-central areas according to an exemplary embodiment of the present disclosure is shown;
[0079] Figure 8 A flowchart of central area parsing according to an exemplary embodiment of the present disclosure is shown;
[0080] Figure 9 A flow chart of a method for obtaining a first vertical component image according to an exemplary embodiment of the present disclosure is shown;
[0081] Figure 10 A flow chart of a method for obtaining a first horizontal sub-image according to an exemplary embodiment of the present disclosure is shown;
[0082] Figure 11 A flowchart of non-central area parsing according to an exemplary embodiment of the present disclosure is shown;
[0083] Figure 12 A flow chart of obtaining a second vertical sub-image according to an exemplary embodiment of the present disclosure is shown;
[0084] Figure 13 FIG2 shows a schematic diagram of second vertical initial image processing according to an exemplary embodiment of the present disclosure;
[0085] Figure 14 A flow chart of obtaining a second vertical sub-image according to an exemplary embodiment of the present disclosure is shown;
[0086] Figure 15 FIG2 shows a schematic diagram of the second level initial segmented image processing according to an exemplary embodiment of the present disclosure;
[0087] Figure 16 A schematic diagram of an image to be tested showing definition information according to an exemplary embodiment of the present disclosure is shown;
[0088] Figure 17 A flowchart of an element positioning model training method according to an exemplary embodiment of the present disclosure is shown;
[0089] Figure 18 A schematic block diagram of a camera clarity detection device according to an exemplary embodiment of the present disclosure is shown;
[0090] Figure 19 A structural block diagram of an exemplary electronic device that can be used to implement the embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0091] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.
[0092] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0093] The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the description below. It should be noted that the concepts of "first", "second", etc. mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0094] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".
[0095] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0096] The present disclosure provides a method for detecting camera clarity, which can be performed by a terminal, a server, and / or other devices with processing capabilities. The method provided in the present disclosure can be performed by any of the above devices, or by multiple devices together, and this disclosure does not limit this.
[0097] The following will refer to Figure 1 The camera clarity detection method flow chart shown introduces the camera clarity detection method.
[0098] Step 101: Acquire an image to be tested obtained by photographing a test image card with a camera.
[0099] The test chart includes multiple scan lines, which can be divided into horizontal scan lines and vertical scan lines. In this embodiment, the camera definition is detected by comparing the image to be tested with the scan lines in the test chart.
[0100] In one possible implementation, a detection signal may be triggered when a camera needs to perform a clarity test. For example, a test chart may be photographed using the camera, and a detection signal may be triggered after the photographing is complete. This embodiment does not limit the specific scenario in which the detection signal is triggered.
[0101] When the detection signal is received, the image captured by the camera can be obtained. Before the detection is performed, the captured image can be preprocessed. The preprocessing may include converting the image format, performing noise reduction processing on the image, or scaling the image to a preset size. The preprocessed image can be used as the image to be tested. For example, Figure 2 The schematic diagram of the image to be tested is shown. Specifically, the method of preprocessing the image to be identified to obtain the image to be tested may include: converting the image in YUV format into JPG format, performing noise reduction processing on the image, and scaling the image proportionally to a preset size. The embodiment of the present disclosure does not limit the specific preprocessing method.
[0102] Step 102: Process the image to be tested using the trained element positioning model to identify and obtain multiple scan line element groups.
[0103] The scan line element group refers to an element group obtained by predicting the image of the input model, and each scan line element group may include at least one scan line element, that is, display at least one scan line.
[0104] In one possible implementation, after obtaining a test image, the trained element localization model can be used to perform recognition processing on the test image to obtain multiple scan line element groups. Each scan line element group has corresponding attribute information, which may include coordinate frame information, region category information, and confidence level. The confidence level may refer to the element localization model's prediction accuracy for the scan line element group.
[0105] Step 103 : According to the image to be tested and the attribute information of each scan line element group, a sub-image corresponding to each scan line element group is obtained by processing.
[0106] The attribute information may include coordinate frame information, and the coordinate frame information may be used to indicate the position and range information of the corresponding scan line element group in the image to be tested.
[0107] In a possible implementation, a sub-image corresponding to each scan line element group may be intercepted from the image to be tested according to the coordinate frame information of each scan line element group.
[0108] Optionally, before capturing the sub-image, the coordinate frame information may be expanded. The specific processing of step 103 may be as follows:
[0109] For each scan line element group, the coordinate frame information of the scan line element group is expanded by a preset size to obtain updated coordinate frame information;
[0110] According to the image to be tested and the updated attribute information of each scan line element group, a sub-image corresponding to each scan line element group is obtained through processing.
[0111] In one possible implementation, the coordinate frame information may include coordinates and dimensions, etc. For example, if the scan line element group corresponding to any set of attribute information is located in the proposed coordinate frame, the coordinate frame information in the set of attribute information may include the coordinates of the upper left corner of the coordinate frame and the width and height of the coordinate frame. The embodiment of the present application does not limit the specific content of the coordinate frame information.
[0112] The coordinates and dimensions of the coordinate frame information within the attribute information of each scan line element group can be adjusted. Specifically, each proposed coordinate frame is expanded outward by a predetermined number of pixels. This results in multiple updated coordinate frame information. The image to be tested can then be captured based on these updated coordinate frame information to produce multiple sub-images. Expanding the proposed coordinate frame reduces the likelihood of the proposed coordinate frame being too compact, allowing for greater flexibility in subsequent processing of the sub-images.
[0113] Optionally, the attribute information may further include region category information, which may be used to indicate whether the scan line element group belongs to the central region or the non-central region, and sub-images may be captured for the scan line element groups in the central region and the non-central region, respectively. Based on this, the specific processing of the above step 103 may also be as follows:
[0114] For the scan line element group in the central area, according to the attribute information of the image to be tested and the scan line element group in the central area, a first sub-image corresponding to the scan line element group in the central area is obtained;
[0115] For the scan line element group in the non-central area, a second sub-image corresponding to the scan line element group in the non-central area is obtained based on the attribute information of the image to be tested and the scan line element group in the non-central area.
[0116] Optionally, for the central area, such as Figure 3 The flowchart of obtaining the first sub-image is shown in FIG. 4 . The specific process of obtaining the first sub-image can be as follows:
[0117] Step 301, determining a first number of scan line element groups in a central area;
[0118] Step 302: Perform a first validity check based on the first number;
[0119] Step 303: When the preset first legitimacy is not satisfied, the scan line element group in the central area is corrected until the first legitimacy is satisfied.
[0120] Step 304: obtaining current attribute information of the scan line element group in the central area;
[0121] Step 305 : Based on the image to be tested and the current attribute information of the scan line element group in the central area, obtain a first sub-image corresponding to the scan line element group in the central area.
[0122] In one possible implementation, the number of scan line element groups corresponding to the central region can be used as a first number, and a first validity check can be performed on the central region based on the first number. If the central region does not meet the preset first validity, the scan line element groups in the central region can be corrected until they meet the first validity. When the central region meets the first validity, a screenshot of the test image can be taken based on the coordinate frame information of the scan line element groups in the central region to obtain a first sub-image.
[0123] Optionally, the specific processing of the above step 302 may be as follows: checking whether the first number is equal to a first preset number.
[0124] Accordingly, the specific processing of the above step 303 may be as follows: when the first number is not equal to the first preset number, the scan line element group in the central area is corrected until the first number is equal to the first preset number.
[0125] In one possible implementation:
[0126] The first preset number may refer to the number of scan line element groups corresponding to the central area in the test chart.
[0127] Based on this, after obtaining the scan line element groups in the central area, the number of groups of corresponding attribute information can be used as the first number, and a first legality check can be performed, that is, checking whether the first number is equal to the first preset number.
[0128] After the first legality check, if the first number is equal to the first preset number, it indicates that the captured image to be tested matches the central area scan line element group of the test chart, and subsequent processing can be performed.
[0129] If the first number is less than the first preset number, the scan line element group in the central area of the test chart can be compared with the scan line element group in the central area of the image to be tested to obtain the missing scan line element group, and based on the attribute information corresponding to the scan line element group that is symmetrical to the missing scan line element group, the attribute information of the missing scan line element group can be supplemented until the missing scan line element group is supplemented and the first number is equal to the first preset number.
[0130] If the first number is greater than the first preset number, the central area scan line element groups of the image to be tested may be sorted in descending order of confidence, and the first first preset number of central area scan line element groups are retained.
[0131] After the first number of the central area scan line element groups is equal to the first preset number, the image to be tested may be screenshoted according to the current coordinate frame information to obtain a first sub-image.
[0132] Optionally, the non-central area includes multiple categories, including the upper left corner area, the upper right corner area, the lower right corner area and the lower left corner area. Based on this, Figure 4 The flowchart of obtaining the second sub-image is shown in FIG. 4 . The specific process of obtaining the second sub-image can be as follows:
[0133] Step 401, determining a second number of scan line element groups corresponding to each category;
[0134] Step 402: Perform a second validity check based on the second number.
[0135] Step 403: When the preset second legitimacy is not satisfied, the scan line element group corresponding to the illegal classification that does not satisfy the second legitimacy is corrected until the illegal classification satisfies the second legitimacy.
[0136] Step 404: obtaining current attribute information of the scan line element group corresponding to each category;
[0137] Step 405 : Based on the image to be tested and the current attribute information of the scan line element group corresponding to each classification, a second sub-image corresponding to the scan line element group in the non-central area is obtained by processing.
[0138] In one possible implementation, for any classification, the number of corresponding scan line element groups can be used as the second number, and a second validity check can be performed on the classification based on the second number. If the classification does not meet the preset second validity check, the scan line element groups corresponding to the classification can be modified until the classification meets the second validity check. Once the classification meets the second validity check, the current coordinate frame information for the classification can be obtained, and a screenshot of the test image can be taken to obtain a second sub-image.
[0139] Optionally, the specific processing of the above step 402 may be as follows: checking whether the second number is equal to the second preset number.
[0140] Accordingly, the specific processing of the above step 403 can be as follows: when the second number is not equal to the second preset number, the scan line element group corresponding to the illegal classification that does not meet the second legality is corrected until the second number of scan line element groups corresponding to the illegal classification is equal to the second preset number.
[0141] In one possible implementation:
[0142] For any category in the non-central area, the second preset number refers to the number of scan line element groups corresponding to the category in the test chart.
[0143] Based on this, for each category, after obtaining the scan line element groups of the category, the number of groups of corresponding attribute information can be used as the second number, and a second legality check can be performed, that is, checking whether the second number is equal to the second preset number.
[0144] After the second legality check, if the second number is equal to the second preset number, it indicates that the captured image to be tested matches the scan line element group of the classification of the test chart, and subsequent processing can be performed.
[0145] If the second number is less than the second preset number, the scan line element group of this category of the test chart can be compared with the scan line element group of this category of the image to be tested to obtain the missing scan line element group corresponding to the category, and based on the attribute information corresponding to the scan line element group that is symmetrical in position to the missing scan line element group, the attribute information of the missing scan line element group can be supplemented until the missing scan line element group is supplemented and the second number is equal to the second preset number.
[0146] If the second number is greater than the second preset number, the scan line element groups corresponding to the classification may be sorted in descending order of confidence, and the first second preset number of scan line element groups are retained.
[0147] After the second number of scan line element groups corresponding to the classification is equal to the second preset number, the image to be tested may be screenshoted according to the current coordinate frame information to obtain a second sub-image.
[0148] Therefore, before processing the image to be tested based on the attribute information to obtain a sub-image, a legality check may be performed to adjust the scan line element group obtained by the element positioning model recognition, thereby improving the detection accuracy.
[0149] The above step 103 will be described below in conjunction with specific areas.
[0150] like Figure 5 The flowchart of attribute information processing shown in FIG. 1 is a flowchart of attribute information processing shown in FIG. 1 , and the specific processing of step 103 can be as follows:
[0151] Step 501: Acquire attribute information of multiple scan line element groups output by the trained element positioning model.
[0152] Step 502 : performing coordinate frame information update processing according to the attribute information of the plurality of scan line element groups output by the element positioning model to obtain a plurality of updated coordinate frame information and updated attribute information of the plurality of scan line element groups.
[0153] Step 503: Determine multiple scan line element groups corresponding to the central area.
[0154] Step 504 : Perform a first validity check on the multiple scan line element groups corresponding to the central area to determine the central area scan line element group that meets the first validity.
[0155] Step 505 includes the following steps 5051-5054:
[0156] Step 5051, determining multiple scan line element groups corresponding to the upper left corner area;
[0157] Step 5052, determining multiple scan line element groups corresponding to the upper right corner area;
[0158] Step 5053, determining multiple scan line element groups corresponding to the lower right corner area;
[0159] Step 5054: determine multiple scan line element groups corresponding to the lower left corner area.
[0160] Step 506, perform a second legitimacy check on the multiple scan line element groups corresponding to the upper left corner area, the upper right corner area, the lower right corner area and the lower left corner area, and determine the scan line element group of the upper left corner area, the scan line element group of the upper right corner area, the scan line element group of the lower right corner area and the scan line element group of the lower left corner area that meet the second legitimacy.
[0161] Step 507 : Process the image to be tested according to the attribute information of the current plurality of scan line element groups to obtain a plurality of sub-images.
[0162] For example, the center area can be represented by "identifier + serial number of the corresponding scan line element group", which can be center7, center8, center9, center10, center11, center12, center13 and center14 respectively, and the embodiment of the present disclosure does not limit this. Figure 6A schematic diagram of the positional symmetry relationship of the central area is shown, wherein the black lines within the frame are the scan line element groups corresponding to center7, center8, center9, center10, center11, center12, center13 and center14. Based on this, the scan line element groups that have a positional symmetry relationship with the scan line element group corresponding to center7 are: the scan line element group corresponding to center8 and the scan line element group corresponding to center10. Similarly, the scan line element groups corresponding to center8, center9, center10, center11, center12, center13 and center14 all have a positional symmetry relationship. The embodiments of the present disclosure will not be repeated here.
[0163] The non-central area can be represented by "the identifier of the corresponding scan line element group + the field of view angle", that is, the upper left corner area is leftup0.3, leftup0.5 and leftup0.7 respectively, the upper right corner area is rightup0.3, rightup0.5 and rightup0.7 respectively, the lower right corner area is rightdown0.3, rightdown0.5 and rightdown0.7 respectively, and the lower left corner area is leftdown0.3, leftdown0.5 and leftdown0.7 respectively. The embodiment of the present disclosure does not limit the specific content of the non-central area classification. Figure 7 The schematic diagram of the positional symmetry relationship of the non-central area is shown, wherein the black line within the frame line on the upper left side is the scan line element group corresponding to leftup0.3, and the black line within the frame line on the lower right side is the scan line element group corresponding to rightdown0.3. Based on this, the scan line element group that has a positional symmetry relationship with the scan line element group corresponding to leftup0.3 is: the scan line element group corresponding to rightdown0.3. Similarly, the scan line element groups corresponding to leftup0.5, leftup0.7, rightup0.3, rightup0.5, rightup0.7, rightdown0.3, rightdown0.5, rightdown0.7, leftdown0.3, leftdown0.5 and leftdown0.7 all have a positional symmetry relationship. The embodiments of the present disclosure will not be repeated here.
[0164] Step 104 : Analyze the sub-images corresponding to each scan line element group to obtain the number of scan lines included in each scan line element group.
[0165] In a possible implementation, after obtaining multiple sub-images, each sub-image may be analyzed to obtain the number of scan lines displayed by each sub-image, that is, the number of scan lines included in each scan line element group.
[0166] For the scan line element group in the central area, the processing of step 104 can be as follows:
[0167] For the sub-image corresponding to the scan line element group in the central area, duplicate it to obtain a plurality of first initial sub-images;
[0168] Processing each first initial partial image separately to obtain a processed first partial image;
[0169] Each processed first partial image is analyzed to obtain the number of scan lines contained in the scan line element group in the central area.
[0170] In a possible implementation, the copying may refer to copying the sub-image in the central area into two copies to obtain two first initial partial images, namely, a first vertical initial partial image and a first horizontal initial partial image.
[0171] Furthermore, the processing of each first initial partial image can be as follows: for the first vertical initial partial image, perform a horizontal scan line removal operation to obtain a first vertical partial image; for the first horizontal initial partial image, perform a vertical scan line removal operation to obtain a first horizontal partial image.
[0172] Through the above processing, the first vertical sub-image may include only vertical scan lines, and the first horizontal sub-image may include only horizontal scan lines, thereby reducing interference of non-detection objects on the object to be detected, thereby improving detection accuracy.
[0173] Optionally, the background of the first initial partial image can be set to white, and the scan lines in the first initial partial image can be set to black, such as Figure 8 As shown in the central region analysis flowchart, for any sub-image, the specific processing of step 104 can be as follows:
[0174] Step 801 : performing contrast enhancement, brightness enhancement and binarization processing on any sub-image in the central area to obtain a pre-processed sub-image.
[0175] Step 802: Copy the pre-processed sub-image as a first vertical initial sub-image and a first horizontal initial sub-image respectively.
[0176] Step 803 includes the following steps 8031-8032:
[0177] Step 8031: performing a horizontal scan line removal operation on the first vertical initial partial image to obtain a first vertical partial image;
[0178] Step 8032: Perform a vertical scan line removal operation on the first horizontal initial partial image to obtain a first horizontal partial image.
[0179] Step 804 : Analyze the first vertical sub-image and the first horizontal sub-image respectively to obtain the number of vertical scan lines and the number of horizontal scan lines, which are used as the number of scan lines included in the scan line element group of the central area.
[0180] In one possible implementation:
[0181] like Figure 9 In the flowchart of obtaining the first vertical sub-image shown in FIG, the specific processing of the above step 8031 can be as follows:
[0182] Step 901: For the first vertical initial partial image, fill the line pair gaps between the vertical scan lines with black, and erase the horizontal scan lines.
[0183] Step 902, detecting a first outline of the largest black block in the first vertical initial partial image;
[0184] Step 903 : performing cutout on the pre-processed sub-image of the central area based on the first contour to obtain a first vertical sub-image.
[0185] like Figure 10 In the flowchart of obtaining the first horizontal sub-image shown in FIG, the specific processing of the above step 8032 can be as follows:
[0186] Step 1001: for a first horizontal initial partial image, fill the line pair gaps between horizontal scan lines with black, and erase the vertical scan lines;
[0187] Step 1002: Detect the second outline of the largest black block in the first horizontal initial partial image;
[0188] Step 1003 : performing cutout on the pre-processed sub-image of the central area based on the second contour to obtain a first horizontal sub-image.
[0189] For the scan line element group in the central area, the processing of step 104 can be as follows:
[0190] Segmenting the sub-image corresponding to the non-central area to obtain a plurality of second initial sub-images;
[0191] processing each second initial partial image respectively to obtain a processed second partial image;
[0192] Each processed second partial image is analyzed to obtain the number of scan lines included in the scan line element group in the non-central area.
[0193] In one possible embodiment, the above-mentioned segmentation may refer to segmenting the sub-image into two second initial segmented images, namely, a second vertical initial segmented image and a second horizontal initial segmented image, according to a pre-set segmentation direction. The second vertical initial segmented image may include a plurality of vertical scan lines and first impurity lines, and the second horizontal initial segmented image may include a plurality of horizontal scan lines and second impurity lines. In this embodiment, the first impurity lines are lines in the second vertical initial segmented image other than the target vertical scan line, and the second impurity lines are lines in the second horizontal initial segmented image other than the target horizontal scan line.
[0194] If the scan line element group of the non-central area is the scan line element group of the upper left corner area, the segmentation direction is "upper left to lower right"; if the scan line element group of the non-central area is the scan line element group of the upper right corner area, the segmentation direction is "upper right to lower left"; if the scan line element group of the non-central area corresponds to the scan line element group of the lower right corner area, the segmentation direction is "upper left to lower right"; if the scan line element group of the non-central area is the scan line element group of the lower left corner area, the segmentation direction is "upper right to lower left".
[0195] Furthermore, each second initial partial image may be processed as follows: first impurity lines in the second vertical initial partial image are removed to obtain a second vertical partial image; second impurity lines in the second horizontal initial partial image are removed to obtain a second horizontal partial image.
[0196] Through the above processing, the second vertical sub-image may include only vertical scan lines, and the second horizontal sub-image may include only horizontal scan lines, thereby reducing interference of non-detection objects on the object to be detected, thereby improving detection accuracy.
[0197] Optionally, the background of the second initial partial image can be set to white, the scan lines in the second initial partial image can be set to black, the first impurity lines can be the residual black lines left during the segmentation process and the relatively scattered vertical scan lines, and the second impurity lines can be the residual black lines left during the segmentation process and the relatively scattered horizontal scan lines, such as Figure 11 As shown in the flowchart of non-central region analysis, for any sub-image, the specific processing of step 104 can be as follows:
[0198] Step 1101 : performing contrast enhancement, brightness enhancement, and binarization processing on any sub-image corresponding to the non-central area to obtain a pre-processed sub-image.
[0199] Step 1102 : Segment the pre-processed sub-image to obtain a second vertical initial sub-image and a second horizontal initial sub-image.
[0200] Step 1103 includes the following steps 11031-11032:
[0201] Step 11031, removing the first impurity line in the second vertical initial partial image to obtain a second vertical partial image including the target vertical scan line;
[0202] Step 11032: remove the second impurity line in the second horizontal initial partial image to obtain a second horizontal partial image including the target vertical scan line.
[0203] Step 1104 : Analyze the second vertical sub-image and the second horizontal sub-image respectively to obtain the number of vertical scan lines and the number of horizontal scan lines, which are used as the number of scan lines included in the scan line element group of the non-central area.
[0204] In one possible implementation:
[0205] like Figure 12 As shown in the flowchart of obtaining the second vertical sub-image, the specific processing of the above step 11031 can be as follows:
[0206] Step 1201: for the second vertical initial sub-image, Figure 13 The second vertical initial sub-image processing schematic diagram shown is to fill the line pair gaps between the vertical scan lines with black and erase the remaining residual black lines;
[0207] Step 1202: Detect multiple third contours corresponding to all black blocks in the second vertical initial partial image, sort the multiple third contours in descending order of area, and use a preset number of third contours as the processed multiple third contours.
[0208] Step 1203 : performing cutout on the pre-processed sub-image of the non-central area based on the processed multiple third contours to obtain a second vertical sub-image.
[0209] like Figure 14 As shown in the flowchart of obtaining the second horizontal sub-image, the specific processing of the above step 11031 can be as follows:
[0210] Step 1401: for the second level initial sub-image, Figure 15 The schematic diagram of the second horizontal initial sub-image processing shown is to fill the line pair gaps between the horizontal scan lines with black and erase the remaining residual black lines;
[0211] Step 1402: Detect a plurality of fourth contours corresponding to all black blocks in the second horizontal initial partial image, sort the plurality of fourth contours in descending order of area, and use a preset number of fourth contours as the processed plurality of fourth contours.
[0212] Step 1403 : Cut out the pre-processed sub-image corresponding to the non-central area based on the processed multiple fourth contours to obtain a second horizontal sub-image.
[0213] Step 105 : Determine the definition information of the camera based on the attribute information of each scan line element group and the number of scan lines included in each scan line element group.
[0214] In one possible implementation, the number of scan lines in the central area can be obtained based on the area category information, and the number of scan lines can be compared with the number of scan lines in the central area of the test chart to determine whether the identified number of scan lines in the central area is within a confidence range. If so, it indicates that the lines in the central area are clearly distinguishable and can participate in subsequent clarity calculations; if not, it indicates that the lines in the central area are blurred and do not participate in subsequent clarity calculations, or the corresponding clarity information is set to 0.
[0215] When calculating the definition, the TVline target value corresponding to each scan line element group can be obtained, and the corresponding definition information can be determined according to the corresponding TVline target value. Figure 16 The following diagram shows a test image displaying sharpness information. The values marked next to the scan line element groups are the target TVline values for that scan line element group. Multiplying the TVline target value by the magnification factor yields the sharpness information for that scan line element group. For example, if the TVline target value for one of the scan line element groups in the center area is "14" and the magnification factor is 100, the resulting sharpness information is 14*100 = 1400 LW / PH (Line Widths per Picture Height).
[0216] Based on the area category information, the number of scan lines for each category in the non-central area can be obtained. Similar to the above, the number of scan lines is compared with the number of scan lines for the corresponding category in the non-central area of the test chart to determine whether the number of identified scan lines is within the confidence range. If so, it indicates that the lines in this area are clearly distinguishable and can participate in subsequent clarity calculations; if not, it indicates that the lines in this area are blurred and do not participate in subsequent clarity calculations, or the corresponding clarity information is set to 0.
[0217] When calculating sharpness, we can obtain the TVline target value corresponding to each scan line. Based on the corresponding TVline target value, we can determine the corresponding sharpness information. For example, if the TVline target value of one group of scan lines in the upper left corner is "7" and the magnification is 100, the sharpness information we can obtain is 7*100=700LW / PH (Line Widths per Picture Height).
[0218] By summarizing the number of scan lines and sharpness information for each area, we can evaluate the camera's sharpness. In other words, the closer the number of scan lines in each area detected matches the actual number of scan lines on the test chart, and the higher the sharpness information value, the higher the camera's sharpness.
[0219] Afterwards, each scan line element group can be marked in the captured image, such as Figure 16 As shown in the target box, the target box can be drawn based on the coordinate frame information of the scan line element group, wherein the position of the corresponding element, the field of view angle, and the clarity information in the horizontal and vertical directions can be displayed in text on the top of the target box.
[0220] Therefore, the clarity information of the test image captured by the camera can be directly obtained based on the annotated image showing the clarity information, and the clarity information of the corresponding camera can be automatically obtained. This is fast, does not require manual judgment of the number of scanning lines, and is relatively standardized.
[0221] The embodiments of the present disclosure can achieve the following technical effects:
[0222] (1) By processing the test image through the element positioning model, the clarity information of the test image card taken by the camera can be directly obtained, and the clarity information of the corresponding camera can be automatically obtained. The speed is fast and there is no need to manually judge the number of scanning lines. It is more objective and standardized. In addition, this method can adapt to different test images and can meet the personalized needs of different products.
[0223] (2) By expanding the proposed coordinate frame corresponding to the attribute information of multiple scan line element groups output by the element positioning model, the possibility of the proposed coordinate frame being too tight can be reduced, so that there is more room for operation when performing cutout processing on the subsequent sub-image analysis.
[0224] (3) By performing image clipping during image analysis, the interference of non-detection objects on the detection objects can be reduced during the detection of scan lines, thereby improving the detection accuracy.
[0225] The element positioning model used in the above disclosed embodiments may be a machine learning model, and the element positioning model may be trained before being used to perform the above processing.
[0226] The training method of the element positioning model may be as follows: the element positioning model is trained based on a plurality of image samples and attribute information corresponding to each image sample.
[0227] In one possible implementation, Figure 17The flowchart of the element positioning model training method is shown in FIG. The element positioning model training method can be specifically as follows:
[0228] Step 1701: Collect multiple image samples.
[0229] Step 1702 : labeling attribute information of the scan line element group included in each image sample.
[0230] Step 1703: Create multiple training data sets, each of which includes a scan line element group and a corresponding set of attribute information.
[0231] Step 1704: Build an initial element positioning model.
[0232] Step 1705: Verify, evaluate, adjust parameters, and optimize the element positioning model based on multiple training data sets. When the training end conditions are met, the trained element positioning model is obtained.
[0233] Exemplarily, in step 1701, the image samples in YUV format obtained by taking pictures with different cameras can be converted into image samples in JPG format for storage; in step 1705, the attribute information output by the initial element positioning model and the attribute information in the corresponding training data set can be input into the loss function to calculate the loss, and the parameters of the initial element positioning model can be adjusted based on the loss calculation; when the training end condition is reached, the current element positioning model is obtained as the trained element positioning model. Among them, the training end condition can be that the number of training times reaches a first threshold, and / or the model accuracy reaches a second threshold, and / or the loss function is lower than a third threshold. The above-mentioned first threshold, second threshold and third threshold can be set based on experience. This embodiment does not limit the specific training end condition.
[0234] In the disclosed embodiment, after the element positioning model is trained, it can be used to implement the above-mentioned camera clarity detection method, so that the test image can be processed by the element positioning model, and the clarity information of the test image card taken by the camera can be directly obtained, and the clarity information of the corresponding camera can be automatically obtained. The speed is fast, and there is no need for manual judgment of the number of scanning lines. It is more objective and standardized. In addition, this method can adapt to different test images and can meet the personalized needs of different products.
[0235] The embodiment of the present disclosure provides a camera clarity detection device, which is used to implement the above-mentioned camera clarity detection method. Figure 18 The schematic block diagram of the camera clarity detection device shown in FIG. 1800 includes: an acquisition module 1801 , a positioning module 1802 , a processing module 1803 , an analysis module 1804 , and a determination module 1805 .
[0236] An acquisition module 1801 is configured to acquire an image to be tested obtained by photographing a test chart with a camera, wherein the test chart includes a plurality of scan lines;
[0237] A positioning module 1802 is configured to process the image to be tested using a trained element positioning model to identify and obtain a plurality of scan line element groups;
[0238] The processing module 1803 is configured to obtain a sub-image corresponding to each scan line element group based on the image to be tested and the attribute information of each scan line element group;
[0239] The parsing module 1804 is configured to parse the sub-images corresponding to each scan line element group to obtain the number of scan lines contained in each scan line element group.
[0240] The determination module 1805 is configured to determine the definition information of the camera based on the attribute information of each scan line element group and the number of scan lines included in each scan line element group.
[0241] Optionally, the attribute information includes coordinate frame information;
[0242] The processing module 1803 is configured to:
[0243] For each scan line element group, the coordinate frame information of the scan line element group is expanded by a preset size to obtain updated coordinate frame information;
[0244] According to the image to be tested and the updated attribute information of each scan line element group, a sub-image corresponding to each scan line element group is obtained by processing.
[0245] Optionally, the attribute information includes region category information, and the region category information is used to indicate whether the scan line element group belongs to a central region or a non-central region;
[0246] The processing module 1803 is configured to:
[0247] For the scan line element group in the central area, according to the attribute information of the image to be tested and the scan line element group in the central area, a first sub-image corresponding to the scan line element group in the central area is obtained by processing;
[0248] For the scan line element group in the non-central area, a second sub-image corresponding to the scan line element group in the non-central area is obtained by processing according to the image to be tested and the attribute information of the scan line element group in the non-central area.
[0249] Optionally, the processing module 1803 is configured to:
[0250] determining a first number of scan line element groups in the central region;
[0251] Performing a first legitimacy check based on the first number;
[0252] When the preset first legitimacy is not satisfied, the scan line element group in the central area is corrected until the first legitimacy is satisfied;
[0253] Obtaining current attribute information of the scan line element group in the central area;
[0254] According to the current attribute information of the image to be tested and the scan line element group in the central area, a first sub-image corresponding to the scan line element group in the central area is obtained by processing.
[0255] Optionally, the processing module 1803 is configured to:
[0256] checking whether the first number is equal to a first preset number;
[0257] When the preset first legitimacy is not satisfied, the scan line element group in the central area is corrected until the first legitimacy is satisfied, including:
[0258] When the first number is not equal to the first preset number, the scan line element group in the central area is modified until the first number is equal to the first preset number.
[0259] Optionally, the non-central area includes multiple categories, and the multiple categories include an upper left corner area, an upper right corner area, a lower right corner area, and a lower left corner area;
[0260] The processing module 1803 is configured to:
[0261] determining a second number of scan line element groups corresponding to each classification;
[0262] Performing a second legitimacy check based on the second number;
[0263] When the preset second legality is not satisfied, the scan line element group corresponding to the illegal classification that does not satisfy the second legality is corrected until the illegal classification satisfies the second legality;
[0264] Obtaining current attribute information of the scan line element group corresponding to each classification;
[0265] According to the image to be tested and the current attribute information of the scan line element group corresponding to each classification, a second sub-image corresponding to the scan line element group in the non-central area is obtained by processing.
[0266] Optionally, the processing module 1803 is configured to:
[0267] checking whether the second number is equal to a second preset number;
[0268] When the preset second legality is not satisfied, the scan line element group corresponding to the illegal classification that does not satisfy the second legality is corrected until the illegal classification satisfies the second legality, including:
[0269] When the second number is not equal to the second preset number, the scan line element groups corresponding to the illegal classifications that do not meet the second legality are corrected until the second number of scan line element groups corresponding to the illegal classifications is equal to the second preset number.
[0270] Optionally, the scan line element group includes a scan line element group in a central area;
[0271] The parsing module 1804 is used to:
[0272] For the sub-image corresponding to the scan line element group in the central area, duplicate it to obtain a plurality of first initial sub-images;
[0273] Processing each first initial partial image separately to obtain a processed first partial image;
[0274] Each processed first partial image is analyzed to obtain the number of scan lines included in the scan line element group in the central area.
[0275] Optionally, the scan lines include horizontal scan lines and vertical scan lines, the first initial partial images include a first vertical initial partial image and a first horizontal initial partial image, and the first partial images include a first vertical partial image and a first horizontal partial image;
[0276] The parsing module 1804 is used to:
[0277] performing a horizontal scan line removal operation on the first vertical initial partial image to obtain a first vertical partial image;
[0278] A vertical scan line removal operation is performed on the first horizontal initial partial image to obtain a first horizontal partial image.
[0279] Optionally, the scan line element group includes a scan line element group in a non-central area;
[0280] The parsing module 1804 is used to:
[0281] Segmenting the sub-image corresponding to the non-central area to obtain a plurality of second initial sub-images;
[0282] processing each second initial partial image respectively to obtain a processed second partial image;
[0283] Each processed second partial image is analyzed to obtain the number of scan lines included in the scan line element group of the non-central area.
[0284] Optionally, the scan lines include horizontal scan lines and vertical scan lines, the second initial partial images include second vertical initial partial images and second horizontal initial partial images, and the second partial images include second vertical partial images and second horizontal partial images;
[0285] The parsing module 1804 is used to:
[0286] removing first impurity lines from the second vertical initial partial image to obtain a second vertical partial image, wherein the first impurity lines are other lines in the second vertical initial partial image except the target vertical scan line;
[0287] The second impurity lines in the second horizontal initial partial image are removed to obtain a second horizontal partial image, wherein the second impurity lines are other lines in the second horizontal initial partial image except the target horizontal scan line.
[0288] In the disclosed embodiment, the test image is processed by the element positioning model, and the clarity information of the test image card taken by the camera can be directly obtained, and the clarity information of the corresponding camera can be automatically obtained. The speed is fast, and there is no need for manual judgment of the number of scanning lines. It is more objective and standardized. In addition, this method can adapt to different test images and can meet the personalized needs of different products.
[0289] The exemplary embodiments of the present disclosure further provide an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor. The memory stores a computer program executable by the at least one processor, the computer program being configured to cause the electronic device to perform a method according to an exemplary embodiment of the present disclosure when executed by the at least one processor.
[0290] Exemplary embodiments of the present disclosure further provide a non-transitory computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor of a computer, is used to cause the computer to perform a method according to an embodiment of the present disclosure.
[0291] Exemplary embodiments of the present disclosure further provide a computer program product, including a computer program, wherein when the computer program is executed by a processor of a computer, it is used to cause the computer to perform the method according to the embodiment of the present disclosure.
[0292] refer to Figure 19, a block diagram of an electronic device 1900 that can serve as a server or client of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0293] like Figure 19 As shown, electronic device 1900 includes a computing unit 1901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1902 or a computer program loaded from a storage unit 1908 into a random access memory (RAM) 1903. Various programs and data required for the operation of device 1900 can also be stored in RAM 1903. Computing unit 1901, ROM 1902, and RAM 1903 are connected to each other via a bus 1904. An input / output (I / O) interface 1905 is also connected to bus 1904.
[0294] Multiple components within electronic device 1900 are connected to I / O interface 1905, including an input unit 1906, an output unit 1907, a storage unit 1908, and a communication unit 1909. Input unit 1906 can be any type of device capable of inputting information into electronic device 1900. Input unit 1906 can receive input numeric or character information and generate key input signals related to user settings and / or function control of the electronic device. Output unit 1907 can be any type of device capable of presenting information and may include, but is not limited to, a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. Storage unit 1908 may include, but is not limited to, a magnetic disk or an optical disk. Communication unit 1909 allows electronic device 1900 to exchange information / data with other devices via computer networks such as the Internet and / or various telecommunication networks, and may include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication transceiver and / or chipset, such as a Bluetooth device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.
[0295] The computing unit 1901 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the computing unit 1901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 1901 performs the various methods and processes described above. For example, in some embodiments, the camera clarity detection method can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 1908. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 1900 via the ROM 1902 and / or the communication unit 1909. In some embodiments, the computing unit 1901 can be configured to perform the camera clarity detection method by any other appropriate means (e.g., via firmware).
[0296] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0297] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0298] As used in this disclosure, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and / or device (e.g., a magnetic disk, an optical disk, a memory, a programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including machine-readable media that receive machine instructions as machine-readable signals. The term "machine-readable signal" refers to any signal used to provide machine instructions and / or data to a programmable processor.
[0299] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0300] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0301] Computer systems may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The client and server relationship arises through computer programs running on the respective computers and having a client-server relationship to each other.
Claims
1. A camera clarity detection method, characterized in that: The method comprises: Acquire an image to be tested obtained by photographing a test chart with a camera, wherein the test chart includes a plurality of scan lines; Processing the image to be tested using the trained element positioning model to identify and obtain multiple scan line element groups; Processing, according to the image to be tested and the attribute information of each scan line element group, to obtain a sub-image corresponding to each scan line element group; Analyzing the sub-images corresponding to each scan line element group to obtain the number of scan lines contained in each scan line element group; The definition information of the camera is determined based on the attribute information of each scan line element group and the number of scan lines included in each scan line element group.
2. The method according to claim 1, characterized in that The attribute information includes coordinate frame information; The step of obtaining a sub-image corresponding to each scan line element group based on the image to be tested and the attribute information of each scan line element group includes: For each scan line element group, the coordinate frame information of the scan line element group is expanded by a preset size to obtain updated coordinate frame information; According to the image to be tested and the updated attribute information of each scan line element group, a sub-image corresponding to each scan line element group is obtained by processing.
3. The method according to claim 1, characterized in that The attribute information includes region category information, and the region category information is used to indicate whether the scan line element group belongs to the central region or the non-central region; The step of obtaining a sub-image corresponding to each scan line element group based on the image to be tested and the attribute information of each scan line element group includes: For the scan line element group in the central area, processing is performed based on the attribute information of the image to be tested and the scan line element group in the central area to obtain a first sub-image corresponding to the scan line element group in the central area; For the scan line element group in the non-central area, a second sub-image corresponding to the scan line element group in the non-central area is obtained by processing according to the image to be tested and the attribute information of the scan line element group in the non-central area.
4. The method according to claim 3, characterized in that The step of processing the scan line element group in the central area to obtain a first sub-image corresponding to the scan line element group in the central area according to the image to be tested and the attribute information of the scan line element group in the central area includes: determining a first number of scan line element groups in the central region; Performing a first legitimacy check based on the first number; When the preset first legitimacy is not satisfied, the scan line element group in the central area is corrected until the first legitimacy is satisfied; Obtaining current attribute information of the scan line element group in the central area; According to the current attribute information of the image to be tested and the scan line element group in the central area, a first sub-image corresponding to the scan line element group in the central area is obtained by processing.
5. The method according to claim 4, characterized in that The performing a first legitimacy check based on the first number includes: checking whether the first number is equal to a first preset number; When the preset first legitimacy is not satisfied, the scan line element group in the central area is corrected until the first legitimacy is satisfied, including: When the first number is not equal to the first preset number, the scan line element group in the central area is modified until the first number is equal to the first preset number.
6. The method according to claim 3, characterized in that The non-central area includes a plurality of categories, and the plurality of categories include an upper left corner area, an upper right corner area, a lower right corner area, and a lower left corner area; The step of processing the scan line element group in the non-central area to obtain a second sub-image corresponding to the scan line element group in the non-central area according to the image to be tested and the attribute information of the scan line element group in the non-central area includes: determining a second number of scan line element groups corresponding to each classification; Performing a second legitimacy check based on the second number; When the preset second legality is not satisfied, the scan line element group corresponding to the illegal classification that does not satisfy the second legality is corrected until the illegal classification satisfies the second legality; Obtaining current attribute information of the scan line element group corresponding to each classification; According to the image to be tested and the current attribute information of the scan line element group corresponding to each classification, a second sub-image corresponding to the scan line element group in the non-central area is obtained by processing.
7. The method according to claim 6, characterized in that The performing a second legitimacy check based on the second number includes: checking whether the second number is equal to a second preset number; When the preset second legality is not satisfied, the scan line element group corresponding to the illegal classification that does not satisfy the second legality is corrected until the illegal classification satisfies the second legality, including: When the second number is not equal to the second preset number, the scan line element groups corresponding to the illegal classifications that do not meet the second legality are corrected until the second number of scan line element groups corresponding to the illegal classifications is equal to the second preset number.
8. The method according to claim 1, characterized in that The scan line element group includes a scan line element group in a central area; The sub-images corresponding to each scan line element group are analyzed respectively to obtain the number of scan lines contained in each scan line element group, including: For the sub-image corresponding to the scan line element group in the central area, duplicate it to obtain a plurality of first initial sub-images; Processing each first initial partial image separately to obtain a processed first partial image; Each processed first partial image is analyzed to obtain the number of scan lines included in the scan line element group in the central area.
9. The method according to claim 8, characterized in that The scan lines include horizontal scan lines and vertical scan lines, the first initial partial images include first vertical initial partial images and first horizontal initial partial images, and the first partial images include first vertical partial images and first horizontal partial images; The step of processing each first initial partial image to obtain a processed first partial image includes: performing a horizontal scan line removal operation on the first vertical initial partial image to obtain a first vertical partial image; A vertical scan line removal operation is performed on the first horizontal initial partial image to obtain a first horizontal partial image.
10. The method according to claim 1, characterized in that The scan line element group includes a scan line element group in a non-central area; The sub-images corresponding to each scan line element group are analyzed respectively to obtain the number of scan lines contained in each scan line element group, including: Segmenting the sub-image corresponding to the non-central area to obtain a plurality of second initial sub-images; processing each second initial partial image respectively to obtain a processed second partial image; Each processed second partial image is analyzed to obtain the number of scan lines included in the scan line element group of the non-central area.
11. The method according to claim 10, characterized in that The scan lines include horizontal scan lines and vertical scan lines, the second initial partial images include second vertical initial partial images and second horizontal initial partial images, and the second partial images include second vertical partial images and second horizontal partial images; The processing of each second initial partial image to obtain a processed second partial image includes: removing first impurity lines from the second vertical initial partial image to obtain a second vertical partial image, wherein the first impurity lines are other lines in the second vertical initial partial image except the target vertical scan line; The second impurity lines in the second horizontal initial partial image are removed to obtain a second horizontal partial image, wherein the second impurity lines are other lines in the second horizontal initial partial image except the target horizontal scan line.
12. A camera clarity detection device, characterized in that: The device comprises: an acquisition module, configured to acquire an image to be tested obtained by photographing a test chart with a camera, wherein the test chart includes a plurality of scan lines; A positioning module, configured to process the image to be tested using a trained element positioning model to identify and obtain a plurality of scan line element groups; a processing module, configured to obtain a sub-image corresponding to each scan line element group based on the image to be tested and the attribute information of each scan line element group; a parsing module, configured to parse the sub-images corresponding to each scan line element group to obtain the number of scan lines contained in each scan line element group; A determination module is used to determine the definition information of the camera based on the attribute information of each scan line element group, the number of scan lines contained in each scan line element group, and the number of scan lines in the test chart.
13. An electronic device comprising: processor; as well as Memory for storing programs, The program includes instructions, which, when executed by the processor, cause the processor to perform the method according to any one of claims 1 to 11.
14. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to enable a computer to execute the method according to any one of claims 1-11.
Citation Information
Patent Citations
Three-dimensional image analysis system, process device, and method thereof
US20110123096A1
Method and apparatus for training a probe model based machine vision system
US8457390B1