CN116612331B - Image quality automatic detection method, device and storage medium based on image processing - Google Patents
Image quality automatic detection method, device and storage medium based on image processing Download PDFInfo
- Publication number
- CN116612331B CN116612331B CN202310699575.6A CN202310699575A CN116612331B CN 116612331 B CN116612331 B CN 116612331B CN 202310699575 A CN202310699575 A CN 202310699575A CN 116612331 B CN116612331 B CN 116612331B
- Authority
- CN
- China
- Prior art keywords
- digital image
- card
- image sample
- current digital
- test
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Abstract
The invention relates to the technical field of image processing and discloses an automatic picture quality detection method, device and storage medium based on image processing; the automatic picture quality detection method comprises the steps of obtaining a plurality of digital image samples obtained by shooting different test image cards through a shooting device, automatically identifying the type of the test image card shot by each digital image sample, automatically classifying the plurality of digital image samples according to the type of the test image card to obtain at least two groups of image sample sets, and analyzing and testing each group of image sample sets according to respective corresponding image quality test methods to obtain an image quality test result. In the embodiment of the invention, the type of the test chart photographed by the digital image sample can be automatically identified by adopting an image feeding algorithm, so that the digital image sample is automatically classified according to the type of the test chart, the high-efficiency and high-quality classification can be realized without manual intervention in the whole classification process, the labor cost is greatly saved, and the working efficiency is improved.
Description
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a method and apparatus for automatically detecting quality of a picture based on image processing, and a storage medium.
Background
Image quality is one of important indicators for evaluating the optical performance of a photographing device. In the evaluation of the photographing quality of a photographing device, besides subjective feeling of human eyes, objective evaluation indexes such as color accuracy, color saturation, definition, signal to noise ratio and the like are often used for quantitatively analyzing the quality of a picture photographed by the photographing device. For this purpose, the evaluation of the evaluation index of the camera requires the use of a test chart.
In general, the method for quantitatively analyzing the shooting quality of the shooting device through the test chart comprises the following steps:
firstly, shooting a plurality of different types of test image cards (such as a gray-scale card, a 24-color card and the like) one by using a shooting device, wherein each type of test image card always shoots a plurality of digital image samples;
Manually classifying all the photographed digital image samples according to the photographed test chart types;
And then, respectively sending each group of classified digital image samples to a corresponding test module of the test tool to complete each test analysis.
In the analysis process, the pictures are classified manually, and the pictures which need to be classified frequently reach hundreds of pictures, so that the classification work is time-consuming and labor-consuming.
Disclosure of Invention
The invention aims to provide an image quality automatic detection method, device and storage medium based on image processing, so as to overcome the defects of time and labor consumption in the prior art by adopting a manual classification mode.
To achieve the purpose, the invention adopts the following technical scheme:
An automatic picture quality detection method based on image processing comprises the following steps:
acquiring a plurality of digital image samples obtained by shooting different test image cards by a shooting device;
Automatically identifying the type of a test chart shot by each digital image sample, and automatically classifying a plurality of digital image samples according to the type of the test chart to obtain at least two image sample sets;
and analyzing and testing each group of image sample sets according to the corresponding image quality testing method to obtain an image quality testing result.
Optionally, the test chart card is specifically a gray-scale card, a 24-color card, an analytical force card, a star chart card or a black dot chart card.
Optionally, in the step of automatically identifying the type of the test chart photographed by each digital image sample, the method for determining whether the type of the test chart photographed by the current digital image sample is a gray-scale card includes:
Extracting each image contour from the current digital image sample through image morphology operation;
selecting small rectangular patterns positioned in a central area from each image contour, and respectively and continuously horizontally shifting the small rectangular patterns from the current position to the left and right sides of the small rectangular patterns for a plurality of times so as to draw a plurality of small rectangular patterns which are adjacent in sequence in a current digital image sample, wherein the number of the small rectangular patterns is larger than the gray scale number M of a gray scale card;
selecting a small rectangular pattern with the minimum gray level value and a total area covered by the continuous M-1 small rectangular patterns positioned on the left side of the small rectangular pattern as a gray level area to be detected;
And judging whether the type of the test chart card shot by the current digital image sample is a gray-scale card or not according to the actual gray-scale information of the gray-scale area to be detected of the current digital image sample and the reference gray-scale information of the standard gray-scale card.
Optionally, after determining the gray-scale area to be tested and before determining whether the type of the test chart card photographed by the current digital image sample is a gray-scale card, the method further includes:
after gathering adjacent areas according to the gray scale value approximation degree, the gray scale areas to be detected are preliminarily cut to form a plurality of horizontally arranged rectangular blocks;
if the number of the rectangular blocks contained in the gray scale region to be detected is smaller than the gray scale number M of the gray scale card, dividing the rectangular blocks with the width larger than the preset width threshold value until the number of the rectangular blocks in the gray scale region to be detected is equal to the gray scale number M of the gray scale card.
Optionally, the determining whether the type of the test chart card shot by the current digital image sample is a gray-scale card according to the actual gray-scale information of the gray-scale area to be tested of the current digital image sample and the reference gray-scale information of the standard gray-scale card specifically includes:
acquiring gray scale values of a left-end rectangular block and a right-end rectangular block of the gray scale region to be detected;
and judging whether the gray scale value of the rectangular block at the left end is larger than that of the rectangular block at the right end and whether the difference value meets a preset gray scale difference threshold value, and if so, judging that the type of the test chart card shot by the current digital image sample is a gray scale card.
Optionally, in the step of automatically identifying the type of the test chart photographed by each digital image sample, the method for determining whether the type of the test chart photographed by the current digital image sample is a 24-color card includes:
After converting the current digital image sample into an HSV color gamut, extracting a target color block from the current digital image sample through morphological operation, wherein the color gamut of the target color block is the same as the color gamut of a color block specified in a standard 24 color card;
according to the arrangement mode of the target color block and other 23 color blocks in the standard 24 color card and the area and coordinate position of the target color block in the current digital image sample, calculating the coordinate positions of the other 23 color blocks in the current digital image sample;
Extracting color gamuts of 24 color blocks at each coordinate position in a current digital image sample, and judging the type of a test chart shot by the current digital image sample to be a 24-color chart if 18 color gamuts and 6 gray scales are met.
Optionally, the target color block is specifically a green color block.
Optionally, the calculating the coordinate positions of the other 23 color blocks in the current digital image sample includes:
Firstly, calculating the coordinate position of a white color block in a current digital image sample according to the relative position of the green color block in a standard 24 color card and the white color block positioned at the corner position and the area and the coordinate position of the green color block in the current digital image sample;
And then the white color block in the current digital image sample is displaced by the current coordinate position of the white color block so as to obtain the coordinate positions of other color blocks in the current digital image sample.
Optionally, in the step of automatically identifying the type of the test chart photographed by each digital image sample, the method for determining whether the type of the test chart photographed by the current digital image sample is an analytical force card includes:
Extracting each image contour from the current digital image sample through image morphology operation;
Selecting a reference image from each image contour, determining a shooting angle of a current digital image sample by taking the reference image as a base point according to the design position of the reference image in a standard analysis force card, and dividing a left side area, a middle area and a right side area of the current digital image sample according to the shooting angle;
and respectively extracting at least one test pattern from the left side area, the middle area and the right side area of the current digital image sample through image morphology operation, and judging whether the type of the test pattern card shot by the current digital image sample is an analysis force card according to the number of the test patterns extracted from each area.
Optionally, the test pattern includes an analytical force test pattern and a spatial response frequency test pattern;
Judging whether the type of the test image card shot by the current digital image sample is an analytical card according to the number of the test patterns extracted by each region comprises the following steps:
Judging whether the number of the analysis force test patterns extracted in the left side area and the right side area is 2, and whether the number of the analysis force test patterns extracted in the middle area and the number of the space response frequency test patterns are 2, if yes, judging that the type of the test chart card shot by the current digital image sample is an analysis force card.
Optionally, in the step of automatically identifying the type of the test chart photographed by each digital image sample, the method for determining whether the type of the test chart photographed by the current digital image sample is a star chart includes:
judging whether the current digital image sample comprises a circular pattern or not through image morphology operation, and if so, cutting the circular pattern from the current digital image sample;
performing binarization processing on the circular pattern to obtain a binarized picture;
And judging whether the type of the test card shot by the current digital image sample is a star-shaped card or not according to the black-white duty ratio in the binarized picture.
Optionally, the determining whether the type of the test card photographed by the current digital image sample is a star-shaped card according to the black-and-white ratio in the binarized picture includes:
dividing the binarized picture into 4x4 areas, and respectively solving the black-and-white ratio of each area;
Judging whether the black-and-white duty ratios of other areas except the central area meet the preset duty ratio range, if yes, judging that the type of the test chart card shot by the current digital image sample is a star chart card.
Optionally, in the step of automatically identifying the type of the test chart photographed by each digital image sample, the method for determining whether the type of the test chart photographed by the current digital image sample is a black dot chart includes:
processing the current digital image sample through threshold and morphological operations;
counting the number of white outlines in the current digital image sample;
and judging whether the number of the white outlines meets a preset number threshold, if so, judging that the type of the test chart card shot by the current digital image sample is a black point chart card.
An automatic image quality detection device based on image processing is used for realizing the automatic image quality detection method based on image processing, and comprises the following steps:
The image sample acquisition module is used for acquiring a plurality of digital image samples obtained by shooting different test image cards by the shooting device;
the sample automatic classification module is used for automatically identifying the type of a test chart shot by each digital image sample, and automatically classifying a plurality of digital image samples according to the type of the test chart to obtain at least two image sample sets;
The quality analysis module is used for analyzing and testing each group of image sample sets according to the corresponding image quality testing method to obtain an image quality testing result.
A storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the steps in the image processing-based picture quality automatic detection method as described in any one of the above.
Compared with the prior art, the invention has the beneficial effects that:
in the embodiment of the invention, the type of the test chart photographed by the digital image sample can be automatically identified by adopting an image feeding algorithm, so that the digital image sample is automatically classified according to the type of the test chart, the high-efficiency and high-quality classification can be realized without manual intervention in the whole classification process, the labor cost is greatly saved, and the working efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a method for automatically detecting picture quality based on image processing according to an embodiment of the present invention.
Fig. 2 is a flowchart of a method for determining whether a type of a test chart photographed by a current digital image sample is a gray-scale card according to an embodiment of the present invention.
Fig. 3 is an exemplary diagram of a method for determining a 20-level gray-scale card according to an embodiment of the present invention.
Fig. 4 is a flowchart of a method for determining whether a type of a test chart photographed by a current digital image sample is a 24-color chart according to an embodiment of the present invention.
Fig. 5 is an exemplary diagram of a method for determining a 24 color chart according to an embodiment of the present invention.
Fig. 6 is a flowchart of a method for determining whether a type of a test card photographed by a current digital image sample is an analytical card according to an embodiment of the present invention.
Fig. 7 is an exemplary diagram of a determination method of an analytical force card according to an embodiment of the present invention.
Fig. 8 is a flowchart of a method for determining whether a type of a test card photographed by a current digital image sample is a star card according to an embodiment of the present invention.
Fig. 9 is an exemplary diagram of a method for determining a star card according to an embodiment of the present invention.
Fig. 10 is a flowchart of a method for determining whether a type of a test card photographed by a current digital image sample is a star card according to an embodiment of the present invention.
Fig. 11 is an exemplary diagram of a method for determining a star card according to an embodiment of the present invention.
Detailed Description
In order to make the objects, features and advantages of the present invention more comprehensible, the technical solutions in the embodiments of the present invention are described in detail below with reference to the accompanying drawings, and it is apparent that the embodiments described below are only some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In order to overcome the defect of time and effort consumption in the manual classification mode in the existing image quality detection process, referring to fig. 1, an embodiment of the present invention provides an automatic image quality detection method based on image processing, including:
step S1, a plurality of digital image samples obtained by shooting different test image cards by a shooting device are obtained.
And S2, automatically identifying the type of a test chart shot by each digital image sample, and automatically classifying a plurality of digital image samples according to the type of the test chart to obtain at least two image sample sets.
And S3, analyzing and testing each group of image sample sets according to the corresponding image quality testing method to obtain an image quality testing result.
In the embodiment of the invention, the type of the test chart photographed by the digital image sample can be automatically identified by adopting an image feeding algorithm, so that the digital image sample is automatically classified according to the type of the test chart, the high-efficiency and high-quality classification can be realized without manual intervention in the whole classification process, the labor cost is greatly saved, and the working efficiency is improved.
It should be noted that, in order to ensure the comprehensiveness of the image quality test, the test items in the image quality standard often include resolution, color reproduction, white balance, gray scale, signal to noise ratio, brightness uniformity, distortion, frame rate, image plane color uniformity, field angle, and/or texture.
The test chart card is used as a test tool for the specific index of the shooting device, and is a necessary tool for daily use and regular maintenance of the shooting device. To normalize the specific parameter indicators of the camera, a test may be performed using a test chart. The test cards selected for different test items are different, so as to realize different test functions. Optionally, in the embodiment of the present invention, the test chart card is specifically a gray-scale card, a 24-color card, an analytical force card, a star chart card or a black dot chart card.
The gray scale card is mainly used for testing parameters such as noise, dynamic range, contrast, exposure accuracy, lens glare and the like. There are typically 5-tone gray-scale cards, 7-tone gray-scale cards, 9-tone gray-scale cards, 11-tone gray-scale cards, 13-tone gray-scale cards, 20-tone gray-scale cards, etc., which are a series of gray-scale combinations arranged in sequence. Illustratively, a 20-tone gray scale card consists of 20 gray scales of different tone from white to black.
The 24-color chart can be used for testing indexes such as color reproduction errors, color saturation, signal to noise ratio, automatic white balance, exposure errors and the like. The standard 24 color card is formed by arranging 6×4 color blocks with different colors, and the size of each color block is 40mm×40mm. The colors of the 24 color blocks in the color chart are carefully selected, and the color chart is quite wide in relation to the field, and each color block can represent a certain special color in nature, such as skin color, leaf color and sky blue, and the color blocks have the same color as the same color analogues thereof and have the same reflected light mode in the visible spectrum range. Because of these unique properties, it can make color matching excellent in any color reproduction process under any light source.
The analysis force card has the main functions of detecting the visual resolution (visual resolution), the limiting resolution (limiting resolution), the spatial response frequency (spatial frequency), the image folding distortion (aliasing ratio determination) and the like of the camera. In this embodiment, the standard resolution card conforms to the ISO 12233 standard (electronic still picture digital camera resolution measurement), and SFR measurement and calculation are required for accurately evaluating the standard camera.
The star-shaped image card is mainly used for testing or adjusting the focal length of the lens, focusing, checking the focal point of the lens and the like.
The following describes the method for determining the types of the test chart in step S2, respectively, it will be understood that whether the digital image sample is a gray-scale card, a 24-color card, an analytical force card, a star-shaped chart card or a black dot chart card may be sequentially determined according to any preset determination sequence, until the determination procedure is ended after the types of the test chart captured by the digital image sample are determined, which is not particularly limited in the embodiment of the present invention.
Referring to fig. 2, in the above step S2, the method for determining whether the type of the test chart photographed by the current digital image sample is a gray-scale card includes:
Step S101, extracting each image contour from the current digital image sample through image morphology operation.
Step S102, selecting a small rectangular pattern positioned in the central area from each image contour.
Step S103, the small rectangular patterns are respectively and horizontally displaced for a plurality of times from the current position to the left and right sides, the displacement of each displacement is the horizontal width of the small rectangular patterns, so that a plurality of small rectangular patterns which are adjacent in sequence are drawn in the current digital image sample, and the number of the small rectangular patterns is larger than the gray scale number M of the gray scale card.
Taking a standard gray scale card as an example of a 20-scale gray scale card, the total number of small rectangular patterns drawn may be 22.
Step S104, selecting the small rectangular pattern with the minimum gray level value and the total area covered by the continuous M-1 small rectangular patterns positioned at the left side of the small rectangular pattern as the gray level area to be measured.
Step 105, judging whether the type of the test chart card shot by the current digital image sample is a gray-scale card according to the actual gray-scale information of the gray-scale area to be tested of the current digital image sample and the reference gray-scale information of the standard gray-scale card.
The embodiment of the invention firstly selects the small rectangular pattern positioned in the central area from the first digital image sample, then obtains a plurality of small rectangular patterns by continuously and repeatedly shifting the small rectangular patterns to the left side and the right side of the small rectangular pattern, and the number of the small rectangular patterns exceeds the gray scale number of the gray scale card, so that the area covered by the small rectangular patterns is slightly larger than the actual gray scale area, and then selects the small rectangular pattern with the minimum gray scale value and the area covered by the continuous M-1 small rectangular patterns positioned at the left side of the small rectangular pattern in the larger area covered by the small rectangular patterns as the gray scale area to be tested, thereby realizing the automatic selection and identification of the gray scale area to be tested, being capable of replacing the traditional manual classification mode and effectively improving the classification efficiency.
In order to ensure that each gray scale block with uneven area can be accurately selected for a digital image sample obtained by photographing a gray scale card at an oblique photographing angle in a non-standard test environment, in the embodiment of the invention, after determining a gray scale area to be tested and before judging whether the type of the test image card photographed by the current digital image sample is a gray scale card, the method further comprises:
The gray scale area to be detected is subjected to aggregation of adjacent areas according to the gray scale value approximation degree, and then a plurality of rectangular blocks which are horizontally arranged are formed by preliminary cutting;
if the number of the rectangular blocks contained in the gray scale area to be detected is smaller than the gray scale number M of the gray scale card, dividing the rectangular blocks with the width larger than the preset width threshold value until the number of the rectangular blocks in the gray scale area to be detected is equal to the gray scale number M of the gray scale card.
The method comprises the steps of firstly gathering the gray scale areas to be detected according to the gray scale value approximation degree, then cutting the gray scale areas according to the gathering result, and then dividing the cut large rectangular blocks according to the width, so that the gray scale areas to be detected can be accurately divided to be more similar to the standard gray scale card division mode, a foundation is laid for the following gray scale value comparison step, and the accuracy of the judgment result is improved.
Exemplary, as shown in fig. 3, fig. 3 (1) and fig. 3 (2) are respectively taken under a laboratory test environment with good environmental configuration and an office test environment with poor environmental configuration, two digital image samples obtained by taking a 20-level gray scale card under the laboratory test environment have better image effects than those taken under the office test environment, the subsequent accurate classification and analysis are more facilitated, fig. 3 (3) is a view of a digital image sample taken under the laboratory test environment and shown in fig. 3 (1) after contour extraction, fig. 3 (4) is a view of a digital image sample taken under the office test environment and shown in fig. 3 (2) after contour extraction, therefore, it is seen that the contour of a part of gray scale blocks possibly cannot be accurately extracted due to the severe limitation of a threshold value and the like in basic morphological operation, fig. 3 (5) and fig. 3 (6) are respectively selected from a small rectangular pattern which can be accurately identified and is positioned in a central area in the first, then the left rectangular pattern is selected from fig. 3 (3)/3 (4), the gray scale image to be measured is divided into a plurality of gray scale areas (3) and a more than the actual gray scale areas (3) which are respectively obtained by the gray scale areas (7) and the gray scale areas (3, the gray scale areas to be measured in the gray scale areas are respectively measured) and the gray scale areas are respectively measured by the gray scale areas (3 and the gray scale areas are respectively measured 1 and the gray scale areas are measured respectively (3 and the gray scale areas respectively) and the gray scale areas are measured respectively measured, the method can be used as a judging basis for judging whether the type of the test chart photographed by the current digital image sample is a gray-scale card.
In step S101, due to severe restrictions such as a threshold value in the basic morphological operation, the contours of all the images may not be accurately extracted, and the contours of part of the images (such as part of the gray-scale blocks that may be present) may be missing. Therefore, in step S102, only a small rectangular pattern (the contour of which approaches to the contour of the gray scale block, so that it can be primarily assumed to be the gray scale block, and then the gray scale block is used as the reference to distinguish the whole gray scale region) in the center region, then the gray scale region to be detected can be selected based on the missing image by moving the small rectangular pattern left and right, and then the actual gray scale information of the gray scale region to be detected and the reference gray scale information of the standard gray scale card can be compared to accurately determine whether the type of the test image card photographed by the current digital image sample is the gray scale card. As can be seen from fig. 3 (7) and fig. 3 (8), whether the laboratory test environment meets the higher requirements or the office test environment is an office test environment in which the photographed image is prone to inclination, overexposure or blurring due to poor environment, the method can accurately identify whether the type of the test chart card photographed by the current digital image sample is a gray-scale card.
Further, according to the actual gray-scale information of the gray-scale area to be tested of the current digital image sample and the reference gray-scale information of the standard gray-scale card, judging whether the type of the test chart card shot by the current digital image sample is a gray-scale card or not, specifically comprising:
acquiring gray scale values of a left-end rectangular block and a right-end rectangular block of a gray scale region to be detected;
and judging whether the gray scale value of the rectangular block at the left end is larger than that of the rectangular block at the right end and whether the difference value meets a preset gray scale difference threshold value, and if so, judging that the type of the test chart card shot by the current digital image sample is a gray scale card.
Referring to fig. 4, in the above step S2, the method for determining whether the type of the test chart photographed by the current digital image sample is a 24 color chart includes:
Step S201, after converting the current digital image sample into HSV color gamut, extracting a target color block from the current digital image sample through morphological operation, where the color gamut of the target color block is the same as the color gamut of the color block specified in the standard 24 color card.
The designated color block can be any color block in the standard 24 color card, but in order to reduce the recognition difficulty and improve the recognition accuracy, the designated color block is preferably a green color block which is convenient to recognize.
Step S202, calculating the coordinate positions of the other 23 color blocks in the current digital image sample according to the arrangement mode of the target color blocks and the other 23 color blocks in the standard 24 color card and the area and the coordinate positions of the target color blocks in the current digital image sample.
In the step, the theoretical coordinate positions of other color patches in the current digital image sample can be accurately calculated by taking the color patch arrangement mode in the standard 24 color card as a reference.
Step 203, extracting color gamuts of color blocks at 24 coordinate positions in the current digital image sample, and if 18 color gamuts and 6 gray levels are satisfied, determining that the type of the test chart photographed by the current digital image sample is 24 color chart.
As shown in fig. 5, fig. 5 (1) and fig. 5 (2) are respectively taken for two digital image samples obtained by photographing a 24-color card under a laboratory test environment with good environmental configuration and an office test environment with poor environmental configuration, fig. 5 (3) is a view of the digital image samples taken under the laboratory test environment shown in fig. 5 (1) after contour extraction, and fig. 5 (4) is a view of the digital image samples taken under the office test environment shown in fig. 5 (2) after contour extraction, so that only the contour of a part of the color blocks, such as green blocks, may be extracted due to severe restrictions such as threshold values in basic morphological operations, and fig. 5 (5) and fig. 5 (6) are respectively taken for drawing images of corresponding contours after calculating the coordinate positions of other color blocks based on the green blocks selected in fig. 5 (3)/5 (4). Therefore, by adopting the calculation method, the coordinate positions of the color blocks can be effectively extracted no matter the test environment is good or bad, and a foundation is laid for accurate judgment in the step S203.
In the method for judging the 24 color card, the relatively obvious identified target color block is taken as a base point, the corresponding area in the current digital image sample is divided into 24 color blocks by referring to the color block arrangement mode in the standard 24 color card, and whether the type of the test chart shot by the current digital image sample is the 24 color card can be rapidly and accurately identified by analyzing the color gamut/gray scale of each divided color block.
Further, in step S202, the coordinate positions of the other 23 color blocks in the current digital image sample are calculated, which may specifically include calculating the coordinate positions of the white color blocks in the current digital image sample according to the relative positions of the green color blocks in the standard 24 color card and the white color blocks located at the corner positions, and the areas and the coordinate positions of the green color blocks in the current digital image sample, and then displacing the white color blocks in the current digital image sample from the current coordinate positions thereof to obtain the coordinate positions of the other color blocks in the current digital image sample. The method of determining the coordinate positions of the white color blocks positioned at the corner positions according to the green color blocks and then calculating the coordinate positions of other color blocks according to the areas and the coordinate positions of the white color blocks can reduce the calculation complexity and the calculation amount.
Referring to fig. 6, in the above step S2, the method for determining whether the type of the test card photographed by the current digital image sample is an analytical card includes:
step S301, extracting each image contour from the current digital image sample through image morphology operation.
Step S302, selecting a reference image from each image contour, determining a shooting angle of a current digital image sample by taking the reference image as a base point according to the design position of the reference image in the standard analysis force card, and dividing a left side area, a middle area and a right side area of the current digital image sample according to the shooting angle.
It should be noted that, the current digital image sample may be an image obtained by photographing the resolution card from three photographing angles, namely, left, middle and right, and the actual distribution positions of each test pattern in the current digital image sample will be different under different photographing angles, so in order to ensure that the subsequent test patterns can be accurately extracted, it is necessary to analyze the photographing angles of the current digital image sample based on the reference patterns in advance. The reference pattern is preferably a pattern that is easily recognized and located in a relatively middle area.
Step S303, respectively extracting at least one test pattern from the left side area, the middle area and the right side area of the current digital image sample through image morphology operation, and judging whether the type of the test pattern card shot by the current digital image sample is an analysis force card according to the number of the extracted test patterns in each area.
The test patterns may include, in particular, analytical force test patterns and spatial response frequency test patterns. Based on this, in step S303, whether the type of the test card photographed by the current digital image sample is an analytical card is determined according to the number of the test patterns extracted from each region, which may specifically include:
Judging whether the number of the analysis force test patterns extracted in the left area and the right area is 2, and judging whether the number of the analysis force test patterns extracted in the middle area and the number of the space response frequency test patterns are 2, if yes, judging that the type of the test chart card shot by the current digital image sample is an analysis force card, otherwise, judging that the type of the test chart card shot by the current digital image sample is a non-analysis force card or the shot angle does not meet the requirements.
Exemplary are two digital image samples obtained by photographing a resolution card in a laboratory test environment with a good environmental configuration and an office test environment with a poor environmental configuration, as shown in fig. 7, fig. 7 (1) and 7 (2), respectively, fig. 7 (3) and 7 (4) are images of the digital image samples photographed in the two test environments after contour extraction, fig. 7 (5) and 7 (6), respectively, two resolution test patterns extracted from the middle area of the digital image samples photographed in the laboratory test environment and the office test environment, respectively, fig. 7 (7) and 7 (8), respectively, two spatial response frequency test patterns extracted from the middle area of the digital image samples photographed in the laboratory test environment and the office test environment, respectively, and fig. 7 (9) and 7 (10), respectively, and left and right side resolution test patterns extracted from the middle area of the digital image samples.
Referring to fig. 8, in the above step S2, the method for determining whether the type of the test card photographed by the current digital image sample is a star card includes:
Step S401, judging whether the current digital image sample comprises a circular pattern or not through image morphology operation, and if so, cutting the circular pattern from the current digital image sample.
And step S402, performing binarization processing on the circular pattern to obtain a binarized picture.
Step S403, judging whether the type of the test card shot by the current digital image sample is a star-shaped card according to the black-and-white duty ratio in the binarized picture.
As shown in fig. 9, fig. 9 (1) and 9 (2) are digital image samples obtained by photographing a star-shaped image card at photographing distances of 200cm and 60cm, respectively, and fig. 9 (3) and 9 (4) are images obtained by cutting and binarizing the digital image samples shown in fig. 9 (1) and 9 (2), respectively.
In step S403, whether the type of the test card photographed by the current digital image sample is a star card is determined according to the black-and-white ratio in the binarized image, and further includes dividing the binarized image into 4x4 regions, respectively obtaining the black-and-white ratio of each region, determining whether the black-and-white ratios of the regions other than the center region satisfy the preset ratio range (for example, the ratio is close to 50%), if so, determining that the type of the test card photographed by the current digital image sample is a star card.
In this way, the accuracy of the judgment result can be effectively ensured by dividing the circular binarized picture into a plurality of small areas and analyzing the black-and-white ratio of each small area one by one.
Referring to fig. 10, in the above step S2, the method for determining whether the type of the test card photographed by the current digital image sample is a black dot card includes:
step S501, processing the current digital image sample through threshold and morphology operations.
Step S502, counting the number of white outlines in the current digital image sample.
Step S503, judging whether the number of white outlines meets a preset number threshold, if yes, judging that the type of the test chart card shot by the current digital image sample is a black point chart card.
As shown in fig. 11, fig. 11 (1) is a digital image sample obtained by photographing a black dot pattern card, and fig. 11 (2) is an image of the processed digital image sample shown in fig. 11 (1), and whether the type of the test pattern card photographed by the current digital image sample is the black dot pattern card can be simply and accurately identified according to the number of white outlines therein.
In summary, the embodiment of the invention can realize automatic classification of the digital image samples according to the types of the photographed test cards, replaces a manual classification mode, greatly improves the working efficiency and reduces the labor cost.
Based on the same inventive concept, the embodiment of the invention also provides an image quality automatic detection device based on image processing, which is used for realizing the image quality automatic detection method based on image processing, and comprises the following steps:
The image sample acquisition module is used for acquiring a plurality of digital image samples obtained by shooting different test image cards by the shooting device;
The sample automatic classification module is used for automatically identifying the type of a test chart shot by each digital image sample, and automatically classifying a plurality of digital image samples according to the type of the test chart to obtain at least two image sample sets;
The quality analysis module is used for analyzing and testing each group of image sample sets according to the corresponding image quality testing method to obtain an image quality testing result.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor.
To this end, an embodiment of the present invention further provides a storage medium storing a plurality of instructions that can be loaded by a processor to perform any of the steps in the image quality automatic detection method based on image processing provided in the embodiment of the present invention.
The storage medium may include a Read Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, an optical disk, or the like.
While the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those skilled in the art that the foregoing embodiments may be modified or equivalents may be substituted for some of the features thereof, and that the modifications or substitutions do not depart from the spirit and scope of the embodiments of the invention.
Claims (13)
1. An automatic picture quality detection method based on image processing is characterized by comprising the following steps:
acquiring a plurality of digital image samples obtained by shooting different test image cards by a shooting device;
Automatically identifying the type of a test chart shot by each digital image sample, and automatically classifying a plurality of digital image samples according to the type of the test chart to obtain at least two image sample sets;
analyzing and testing each group of image sample sets according to the corresponding image quality testing method to obtain an image quality testing result;
the test chart card is specifically a gray-scale card, a 24-color card, an analytical force card, a star chart card or a black dot chart card;
in the step of automatically identifying the type of the test chart photographed by each digital image sample, the method for judging whether the type of the test chart photographed by the current digital image sample is an analytical force card comprises the following steps:
Extracting each image contour from the current digital image sample through image morphology operation;
selecting a reference image from each image contour, determining a shooting angle of a current digital image sample by taking the reference image as a base point according to the design position of the reference image in a standard analysis force card, and dividing a left side area, a middle area and a right side area of the current digital image sample according to the shooting angle;
and respectively extracting at least one test pattern from the left side area, the middle area and the right side area of the current digital image sample through image morphology operation, and judging whether the type of the test pattern card shot by the current digital image sample is an analysis force card according to the number of the test patterns extracted from each area.
2. The image processing-based automatic picture quality detection method according to claim 1, wherein in the step of automatically recognizing the type of the test chart photographed by each digital image sample, the method of judging whether the type of the test chart photographed by the current digital image sample is a gray-scale card comprises:
Extracting each image contour from the current digital image sample through image morphology operation;
selecting small rectangular patterns positioned in a central area from each image contour, and respectively and continuously horizontally shifting the small rectangular patterns from the current position to the left and right sides of the small rectangular patterns for a plurality of times so as to draw a plurality of small rectangular patterns which are adjacent in sequence in a current digital image sample, wherein the number of the small rectangular patterns is larger than the gray scale number M of a gray scale card;
selecting a small rectangular pattern with the minimum gray level value and a total area covered by the continuous M-1 small rectangular patterns positioned on the left side of the small rectangular pattern as a gray level area to be detected;
And judging whether the type of the test chart card shot by the current digital image sample is a gray-scale card or not according to the actual gray-scale information of the gray-scale area to be detected of the current digital image sample and the reference gray-scale information of the standard gray-scale card.
3. The image processing-based automatic picture quality detection method according to claim 2, further comprising, after determining the gray-scale area to be detected and before determining whether the type of the test chart photographed by the current digital image sample is a gray-scale card:
after gathering adjacent areas according to the gray scale value approximation degree, the gray scale areas to be detected are preliminarily cut to form a plurality of horizontally arranged rectangular blocks;
If the number of the rectangular blocks contained in the gray scale area to be detected is smaller than the gray scale number M of the gray scale card, dividing the rectangular blocks with the width larger than the preset width threshold value until the number of the rectangular blocks in the gray scale area to be detected is equal to the gray scale number M of the gray scale card.
4. The automatic image quality detection method according to claim 3, wherein the determining whether the type of the test image card photographed by the current digital image sample is a gray-scale card according to actual gray-scale information of the gray-scale area to be detected of the current digital image sample and reference gray-scale information of the standard gray-scale card specifically includes:
acquiring gray scale values of a left-end rectangular block and a right-end rectangular block of the gray scale region to be detected;
and judging whether the gray scale value of the rectangular block at the left end is larger than that of the rectangular block at the right end and whether the difference value meets a preset gray scale difference threshold value, and if so, judging that the type of the test chart card shot by the current digital image sample is a gray scale card.
5. The image processing-based picture quality automatic detection method according to claim 1, wherein in the step of automatically recognizing the type of the test chart photographed by each digital image sample, the method of judging whether the type of the test chart photographed by the current digital image sample is a 24-color card comprises:
After converting the current digital image sample into an HSV color gamut, extracting a target color block from the current digital image sample through morphological operation, wherein the color gamut of the target color block is the same as the color gamut of a color block specified in a standard 24 color card;
according to the arrangement mode of the target color block and other 23 color blocks in the standard 24 color card and the area and coordinate position of the target color block in the current digital image sample, calculating the coordinate positions of the other 23 color blocks in the current digital image sample;
Extracting color gamuts of 24 color blocks at each coordinate position in a current digital image sample, and judging the type of a test chart shot by the current digital image sample to be a 24-color chart if 18 color gamuts and 6 gray scales are met.
6. The image processing-based picture quality automatic detection method according to claim 5, wherein the target color patch is a green color patch.
7. The method for automatically detecting picture quality based on image processing according to claim 6, wherein the calculating the coordinate positions of the other 23 color blocks in the current digital image sample includes:
Firstly, calculating the coordinate position of a white color block in a current digital image sample according to the relative position of the green color block in a standard 24 color card and the white color block positioned at the corner position and the area and the coordinate position of the green color block in the current digital image sample;
And then the white color block in the current digital image sample is displaced by the current coordinate position of the white color block so as to obtain the coordinate positions of other color blocks in the current digital image sample.
8. The image processing-based picture quality automatic detection method according to claim 1, wherein the test pattern includes an analytical force test pattern and a spatial response frequency test pattern;
Judging whether the type of the test image card shot by the current digital image sample is an analytical card according to the number of the test patterns extracted by each region comprises the following steps:
Judging whether the number of the analysis force test patterns extracted in the left side area and the right side area is 2, and whether the number of the analysis force test patterns extracted in the middle area and the number of the space response frequency test patterns are 2, if yes, judging that the type of the test chart card shot by the current digital image sample is an analysis force card.
9. The image processing-based picture quality automatic detection method according to claim 1, wherein in the step of automatically recognizing the type of the test chart photographed by each digital image sample, the method of judging whether the type of the test chart photographed by the current digital image sample is a star-shaped chart comprises:
judging whether the current digital image sample comprises a circular pattern or not through image morphology operation, and if so, cutting the circular pattern from the current digital image sample;
performing binarization processing on the circular pattern to obtain a binarized picture;
And judging whether the type of the test card shot by the current digital image sample is a star-shaped card or not according to the black-white duty ratio in the binarized picture.
10. The method for automatically detecting picture quality based on image processing according to claim 9, wherein the determining whether the type of the test card photographed by the current digital image sample is a star card according to the black-and-white duty ratio in the binarized picture comprises:
dividing the binarized picture into 4x4 areas, and respectively solving the black-and-white ratio of each area;
Judging whether the black-and-white duty ratios of other areas except the central area meet the preset duty ratio range, if yes, judging that the type of the test chart card shot by the current digital image sample is a star chart card.
11. The image processing-based picture quality automatic detection method according to claim 1, wherein in the step of automatically recognizing the type of the test chart photographed by each digital image sample, the method of judging whether the type of the test chart photographed by the current digital image sample is a black dot chart comprises:
processing the current digital image sample through threshold and morphological operations;
counting the number of white outlines in the current digital image sample;
and judging whether the number of the white outlines meets a preset number threshold, if so, judging that the type of the test chart card shot by the current digital image sample is a black point chart card.
12. An image processing-based picture quality automatic detection apparatus for implementing the image processing-based picture quality automatic detection method according to any one of claims 1 to 11, characterized by comprising:
The image sample acquisition module is used for acquiring a plurality of digital image samples obtained by shooting different test image cards by the shooting device;
the sample automatic classification module is used for automatically identifying the type of a test chart shot by each digital image sample, and automatically classifying a plurality of digital image samples according to the type of the test chart to obtain at least two image sample sets;
the quality analysis module is used for analyzing and testing each group of image sample sets according to the corresponding image quality testing method to obtain an image quality testing result;
the test chart card is specifically a gray-scale card, a 24-color card, an analytical force card, a star chart card or a black dot chart card;
in the step of automatically identifying the type of the test chart photographed by each digital image sample, the method for judging whether the type of the test chart photographed by the current digital image sample is an analytical force card comprises the following steps:
Extracting each image contour from the current digital image sample through image morphology operation;
selecting a reference image from each image contour, determining a shooting angle of a current digital image sample by taking the reference image as a base point according to the design position of the reference image in a standard analysis force card, and dividing a left side area, a middle area and a right side area of the current digital image sample according to the shooting angle;
and respectively extracting at least one test pattern from the left side area, the middle area and the right side area of the current digital image sample through image morphology operation, and judging whether the type of the test pattern card shot by the current digital image sample is an analysis force card according to the number of the test patterns extracted from each area.
13. A storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the steps in the image processing based picture quality automatic detection method of any one of claims 1 to 11.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310699575.6A CN116612331B (en) | 2023-06-13 | Image quality automatic detection method, device and storage medium based on image processing |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310699575.6A CN116612331B (en) | 2023-06-13 | Image quality automatic detection method, device and storage medium based on image processing |
Publications (2)
Publication Number | Publication Date |
---|---|
CN116612331A CN116612331A (en) | 2023-08-18 |
CN116612331B true CN116612331B (en) | 2025-03-28 |
Family
ID=
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111226437A (en) * | 2018-11-27 | 2020-06-02 | 深圳市大疆创新科技有限公司 | Method and device for evaluating shooting quality of shooting device and terminal equipment |
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111226437A (en) * | 2018-11-27 | 2020-06-02 | 深圳市大疆创新科技有限公司 | Method and device for evaluating shooting quality of shooting device and terminal equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108764257B (en) | Multi-view pointer instrument identification method | |
US7936377B2 (en) | Method and system for optimizing an image for improved analysis of material and illumination image features | |
CN110930353A (en) | Method and device for detecting state of hole site protection door, computer equipment and storage medium | |
WO2017020829A1 (en) | Resolution testing method and resolution testing device | |
CN113379680B (en) | Defect detection method, defect detection device, electronic device and computer readable storage medium | |
CN115082451B (en) | Stainless steel soup ladle defect detection method based on image processing | |
CN111583258B (en) | Defect detection method, device, system and storage medium | |
CN110909640A (en) | Method and device for determining water level line, storage medium and electronic device | |
JP7062722B2 (en) | Specifying the module size of the optical cord | |
CN111179362B (en) | Test paper color uniformity detection method based on dynamic illumination correction algorithm | |
CN117459700B (en) | Color luminosity three-dimensional imaging method, system, electronic equipment and medium | |
CN106558044B (en) | Method for measuring resolution of image module | |
CN114581415A (en) | Method and device for detecting defects of PCB, computer equipment and storage medium | |
WO2020107196A1 (en) | Photographing quality evaluation method and apparatus for photographing apparatus, and terminal device | |
CN113469171A (en) | Method, device and medium for identifying interest area in SFR test card image | |
CN116612331B (en) | Image quality automatic detection method, device and storage medium based on image processing | |
CN118097305B (en) | Method and system for detecting quality of semiconductor light-emitting element | |
CN118096697A (en) | Cigar tobacco chromaticity measuring method, system, medium and equipment based on information entropy | |
CN113132693B (en) | Color correction method | |
CN117952906A (en) | PIN skew detection method, device, equipment and storage medium | |
CN116612331A (en) | Method, device and storage medium for automatic detection of picture quality based on image processing | |
KR20030091471A (en) | YCrCb color based human face location detection method | |
CN113689378A (en) | Method and device for judging accurate positioning of test strip, storage medium and terminal | |
CN116630298B (en) | ISP objective index automatic analysis method and device based on image processing | |
CN115546208B (en) | Method, device and application for measuring plant height of field crops |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant |