CN119211516A - Color reproduction test method and device for wide-angle lens, electronic equipment, and medium - Google Patents
Color reproduction test method and device for wide-angle lens, electronic equipment, and medium Download PDFInfo
- Publication number
- CN119211516A CN119211516A CN202411163323.2A CN202411163323A CN119211516A CN 119211516 A CN119211516 A CN 119211516A CN 202411163323 A CN202411163323 A CN 202411163323A CN 119211516 A CN119211516 A CN 119211516A
- Authority
- CN
- China
- Prior art keywords
- color
- pixel
- image
- card
- block
- 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.)
- Pending
Links
- 238000010998 test method Methods 0.000 title claims abstract description 22
- 238000012360 testing method Methods 0.000 claims abstract description 32
- 238000000034 method Methods 0.000 claims abstract description 27
- 238000004364 calculation method Methods 0.000 claims abstract description 19
- 238000000605 extraction Methods 0.000 claims abstract description 19
- 238000003708 edge detection Methods 0.000 claims abstract description 13
- 238000001514 detection method Methods 0.000 claims description 13
- 238000004590 computer program Methods 0.000 claims description 11
- 230000011218 segmentation Effects 0.000 claims description 10
- 239000003086 colorant Substances 0.000 claims description 5
- 238000011156 evaluation Methods 0.000 claims description 5
- 238000012216 screening Methods 0.000 claims description 3
- 238000012545 processing Methods 0.000 abstract description 7
- 230000009467 reduction Effects 0.000 abstract description 7
- 238000004891 communication Methods 0.000 description 8
- 238000012937 correction Methods 0.000 description 7
- 230000008569 process Effects 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 230000005484 gravity Effects 0.000 description 3
- 238000004458 analytical method Methods 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 230000007935 neutral effect Effects 0.000 description 2
- 238000003672 processing method Methods 0.000 description 2
- PXFBZOLANLWPMH-UHFFFAOYSA-N 16-Epiaffinine Natural products C1C(C2=CC=CC=C2N2)=C2C(=O)CC2C(=CC)CN(C)C1C2CO PXFBZOLANLWPMH-UHFFFAOYSA-N 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 238000009966 trimming Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N17/00—Diagnosis, testing or measuring for television systems or their details
- H04N17/002—Diagnosis, testing or measuring for television systems or their details for television cameras
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/80—Camera processing pipelines; Components thereof
- H04N23/84—Camera processing pipelines; Components thereof for processing colour signals
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- General Health & Medical Sciences (AREA)
- Image Analysis (AREA)
- Image Processing (AREA)
Abstract
The embodiment of the application provides a color reproduction test method and device of a wide-angle lens, electronic equipment and medium, and belongs to the field of digital image processing. The method comprises the steps of obtaining an initial image acquired by a wide-angle lens on a preset color chart, extracting a color chart region from the initial image, then carrying out color block edge detection on the color chart region to obtain color block contour coordinate data, carrying out color extraction on the color chart region according to the color block contour coordinate data to obtain color block color data, carrying out color filling according to the color block color data and a preset color chart template to obtain a reconstructed color chart image, and finally carrying out index calculation based on the reconstructed color chart image and the color data of the preset color chart to obtain color index parameters. Compared with the existing testing method, the embodiment of the application does not need to correct distortion of the image acquired by the wide-angle lens, directly generates a reconstructed color chart, and evaluates the color reduction capability based on the color chart, thereby improving the efficiency of the color reduction test.
Description
Technical Field
The present application relates to the field of digital image processing, and in particular, to a color reproduction test method and apparatus for a wide-angle lens, an electronic device, and a storage medium.
Background
In the related art, before performing a color reproduction test of the wide-angle lens, the wide-angle lens is allowed to collect an image including a standard color chart, then distortion correction is performed on the image, and then a related index parameter is calculated on the corrected image according to the standard color chart, where the index parameter is used to indicate the capability of the wide-angle lens to reproduce colors. However, the current processing method cannot complete the distortion correction of a single image, or can realize the distortion correction by splicing images with a plurality of acquisition angles, so that the efficiency of the color reproduction test is low. Therefore, how to improve the efficiency of the wide-angle lens color reproduction test is a urgent problem to be solved.
Disclosure of Invention
The embodiment of the application mainly aims to provide a color reproduction test method and device of a wide-angle lens, electronic equipment and storage medium, and aims to improve the efficiency of the color reproduction test of the wide-angle lens.
In order to achieve the above object, a first aspect of an embodiment of the present application provides a color reproduction test method for a wide-angle lens, the method including:
Acquiring an initial image acquired by a wide-angle lens to a preset color card;
Extracting a color card area from the initial image;
Performing color block edge detection on the color card area to obtain color block contour coordinate data;
performing color extraction on the color card area according to the color block contour coordinate data to obtain color block color data;
performing color filling according to the color data of the color blocks and a preset color card template to obtain a reconstructed color card image;
and performing index calculation based on the reconstructed color card image and the color data of the preset color card to obtain color index parameters, so as to evaluate the color reproduction capability of the wide-angle lens according to the color index parameters.
In some embodiments, the extracting the color chip area from the initial image includes:
Acquiring an initial pixel color value of the initial image;
Determining a segmentation threshold according to the initial pixel color value to obtain a first color threshold;
converting the initial image into a first intermediate image in a luminance-chrominance color space, and converting the first color threshold into a luminance threshold on a luminance channel, wherein the luminance-chrominance color space comprises the luminance channel;
binarizing the first intermediate image according to the brightness threshold value to obtain a brightness binarized image;
performing contour detection on the brightness binarization image to obtain target contour coordinate data;
and cutting the initial image based on the target contour coordinate data to obtain the color card area.
In some embodiments, the determining the segmentation threshold according to the initial pixel color value, to obtain a first color threshold, includes:
Performing pixel color clustering on the initial pixel color values to obtain first color clustering data, wherein the first color clustering data comprise color values of each pixel corresponding to each type;
screening a target class from the first color cluster data based on the number of pixels corresponding to each class, and a color value of each pixel corresponding to the target class;
And carrying out numerical calculation according to the color value of the pixel corresponding to the target class to obtain the first color threshold.
In some embodiments, performing color patch edge detection on the color patch area to obtain color patch contour coordinate data includes:
Acquiring color card pixel color values of the color card area;
Determining a segmentation threshold according to the color value of the color card pixel to obtain a second color threshold;
Converting the color card region into a second intermediate image in a hue saturation brightness color space, and converting the second color threshold into a brightness threshold on a brightness channel, wherein the hue saturation brightness color space comprises the brightness channel;
Binarizing the second intermediate image according to the brightness threshold value to obtain a brightness binarization image;
and carrying out contour detection on the brightness binarized image to obtain the color block contour coordinate data.
In some embodiments, the performing color filling according to the color data of the color patch and a preset color card template to obtain a reconstructed color card image includes:
performing color filling on the frame area of the color card template according to the second color threshold value to obtain an intermediate color card image;
and filling the color block area of the intermediate color card image with the color according to the color block color data to obtain the reconstructed color card image.
In some embodiments, the performing color extraction on the color card area according to the color patch profile coordinate data to obtain color patch color data includes:
Extracting pixel colors of the color card area according to the color block outline coordinate data to obtain color block pixel color values of each pixel of the color block;
calculating an average value according to color block pixel color values of all pixels of the color block to obtain a color average value;
Performing gap evaluation on each pixel according to the color average value and the color value of each color block pixel to obtain an outlier pixel;
If the number of the outlier pixels is larger than a preset outlier number threshold, deleting the outlier pixels in a preset proportion, and returning to the color values of all the pixels according to the color block for average value calculation to obtain a color average value;
and if the number of the outlier pixels is smaller than or equal to a preset pixel number threshold, determining the color average value as the color data of the color block.
In some embodiments, the performing a gap evaluation on each pixel according to the color average value and the color value of each color block pixel to obtain an outlier pixel includes:
performing difference calculation according to the color average value and the color value of each pixel to obtain a color difference value of each pixel;
And if the color difference value is greater than or equal to a preset difference value threshold, determining the pixel as the outlier pixel.
To achieve the above object, a second aspect of the embodiments of the present application provides a color reproduction test apparatus for a wide-angle lens, the apparatus including:
The acquisition module is used for acquiring an initial image acquired by the wide-angle lens to a preset color card;
The color card extraction module is used for extracting a color card area from the initial image;
the color block contour detection module is used for carrying out color block edge detection on the color card area to obtain color block contour coordinate data;
The color extraction module is used for carrying out color extraction on the color card area according to the color block outline coordinate data to obtain color block color data;
The color card reconstruction module is used for performing color filling according to the color data of the color blocks and a preset color card template to obtain a reconstructed color card image;
the parameter determining module is used for performing index calculation based on the reconstructed color card image and the color data of the preset color card to obtain color index parameters so as to evaluate the color restoration capability of the wide-angle lens according to the color index parameters
To achieve the above object, a third aspect of the embodiments of the present application proposes an electronic device, including a memory storing a computer program and a processor implementing the method according to the first aspect when the processor executes the computer program.
To achieve the above object, a fourth aspect of the embodiments of the present application proposes a computer-readable storage medium storing a computer program which, when executed by a processor, implements the method of the first aspect.
The application provides a color reproduction test method and device of a wide-angle lens, electronic equipment and a storage medium. Then, the outline of the color patch is identified by edge detection, and color extraction is performed based on these outline data, resulting in color information of the color patch. And then, performing color filling by using the extracted color data and a preset color card template, and reconstructing the color card image. And finally, calculating color index parameters by matching the color data of the specific gravity color card image and the preset color card, thereby evaluating the color reproduction capability of the wide-angle lens. Compared with the existing test method, the method does not need to correct distortion of the image acquired by the wide-angle lens, directly generates a reconstructed color chart according to the acquired image, and evaluates the color reproduction capability based on the color chart, so that the efficiency of color reproduction test is improved.
Drawings
Fig. 1 is a flowchart of a color reproduction test method of a wide-angle lens according to an embodiment of the present application;
fig. 2 is a flowchart of step S102 in fig. 1;
fig. 3 is a flowchart of step S202 in fig. 2;
Fig. 4 is a flowchart of step S103 in fig. 1;
fig. 5 is a flowchart of step S104 in fig. 1;
Fig. 6 is a flowchart of step S503 in fig. 5;
fig. 7 is a flowchart of step S105 in fig. 1;
Fig. 8 is a schematic structural diagram of a color reproduction testing device of a wide-angle lens according to an embodiment of the present application;
Fig. 9 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application;
FIG. 10 is an initial image provided by an embodiment of the present application;
FIG. 11 is an intermediate image provided by an embodiment of the present application;
FIG. 12 is a binarized image provided by an embodiment of the present application;
FIG. 13 is a chart area image provided by an embodiment of the present application;
FIG. 14 is another intermediate image provided by an embodiment of the present application;
FIG. 15 is another binarized image provided by an embodiment of the present application;
fig. 16 is a reconstructed color card image provided by an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
It should be noted that although functional block division is performed in a device diagram and a logic sequence is shown in a flowchart, in some cases, the steps shown or described may be performed in a different order than the block division in the device, or in the flowchart. The terms first, second and the like in the description and in the claims and in the above-described figures, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the application only and is not intended to be limiting of the application.
First, several nouns involved in the present application are parsed:
Three primary colors (Red-Green-B ue, RGB) color space, a color representation based on three basic color components of Red (Red), green (Green), and blue (B ue).
Lab color space refers to a color representation model, which comprises three components, namely L (luminance), a (chromaticity axis a) and b (chromaticity axis b), wherein L represents the brightness of the color, the value range is usually 0 to 100, the larger the L value is, the closer the color is to white, the smaller the L value is, and the color is closer to black. a represents a change in color from green to red, a positive value represents a reddish color, and a negative value represents a greenish color. b (chromaticity axis b) indicates a change in color from blue to yellow, positive values indicate a yellow shift in color, and negative values indicate a blue shift in color.
HSV (Hue, saturat ion, val ue) color space HSV is a color space created by A.R. Smith in 1978 based on intuitive properties of color, also known as the hexagonal pyramid model (Hexcone Mode l). The color space includes three components, hue (Hue, H), saturation (Saturat i on, S) and brightness (Va l ue, V), respectively. Wherein hue denotes the basic type of color, i.e. the kind of color, such as red, green, blue, etc. Saturation means the purity or intensity of a color, i.e., the vividness of the color. Brightness means the brightness or darkness of a color.
In the related art, since the angle of view and the distortion of the image of the wide-angle lens are large, the color reduction test performed on the wide-angle lens can first collect an image including a standard color chart, then correct the distortion of the image, and then calculate relevant index parameters (such as parameters of color difference, saturation level, white balance error, etc.) for the corrected image according to the standard color chart, where the index parameters are used to indicate the capability of the wide-angle lens to reduce the color. However, the current processing method cannot complete the distortion correction of a single image, or can realize the distortion correction by splicing images with a plurality of acquisition angles, so that the efficiency of the color reproduction test is low. Therefore, how to improve the efficiency of the wide-angle lens color reproduction test is a urgent problem to be solved.
Based on the above, the embodiment of the application provides a color reproduction test method and device of a wide-angle lens, electronic equipment and a storage medium, aiming at improving the efficiency of the color reproduction test of the wide-angle lens.
The color reproduction test method and device, the electronic device and the storage medium provided by the embodiment of the application are specifically described by the following embodiments, and the color reproduction test method in the embodiment of the application is described first.
Fig. 1 is an optional flowchart of a color reproduction test method for a wide-angle lens according to an embodiment of the present application, where the method in fig. 1 may include, but is not limited to, steps S101 to S106.
Step S101, acquiring an initial image acquired by the wide-angle lens on a preset color chart.
Step S102, extracting a color card area from the initial image.
And step S103, performing color block edge detection on the color card area to obtain color block contour coordinate data.
And step S104, carrying out color extraction on the color card area according to the color block contour coordinate data to obtain color block color data.
And step S105, performing color filling according to the color data of the color block and a preset color card template to obtain a reconstructed color card image.
And S106, performing index calculation based on the reconstructed color chart image and the color data of the preset color chart to obtain color index parameters so as to evaluate the color restoration capability of the wide-angle lens according to the color index parameters.
In steps S101 to S106 shown in the embodiment of the present application, first, an initial color chart image taken by a wide-angle lens is acquired, and a color chart region is extracted. Then, the outline of the color patch is identified by edge detection, and color extraction is performed based on these outline data, resulting in color information of the color patch. And then, performing color filling by using the extracted color data and a preset color card template, and reconstructing the color card image. And finally, calculating color index parameters by matching the color data of the specific gravity color card image and the preset color card, thereby evaluating the color reproduction capability of the wide-angle lens. Compared with the existing test method, the method does not need to correct distortion of the image acquired by the wide-angle lens, directly generates a reconstructed color chart according to the acquired image, and evaluates the color reproduction capability based on the color chart, so that the efficiency of color reproduction test is improved.
In step S101 of some embodiments, the preset color card may be a 24-color card or a 12-color card, and the tester may adjust according to the actual test requirement. The initial image is an image of a preset color chart acquired by the wide-angle lens. It should be noted that, in the application scenario of the color reproduction test of some embodiments, the test requires that the preset color chart account for 50% to 70% of the initial image frame. That is, the initial image will collect the background except the preset color chart, and in order to eliminate the interference of the background on the subsequent image processing, the color chart image in the initial image needs to be extracted.
Referring to fig. 2, in some embodiments, step S102 may include, but is not limited to, steps S201 to S206:
Step S201, an initial pixel color value of an initial image is acquired.
Step S202, determining a segmentation threshold according to the initial pixel color value to obtain a first color threshold.
Step S203 converts the initial image into a first intermediate image in the luminance-chrominance color space and converts the first color threshold into a luminance threshold on the luminance channel. Wherein the luminance-chrominance color space comprises a luminance channel.
Step S204, binarizing the first intermediate image according to the brightness threshold value to obtain a brightness binarized image.
Step S205, performing contour detection on the brightness binarized image to obtain target contour coordinate data.
And S206, clipping the initial image based on the target contour coordinate data to obtain a color card area.
In step S201 of some embodiments, the initial pixel color value is the RGB value of each pixel in the initial image.
In step S202 of some embodiments, the first color threshold is the RGB average of the background. It should be noted that, in the application scenario of the color reproduction test of some embodiments, the test requires that the background of the preset color chart is neutral gray of 18 °, as shown in fig. 10.
In step S203 of some embodiments, the luminance and chrominance color space may be a Lab color space, and the first intermediate image may be an L-channel image in which the initial image is converted from the RGB color space to the Lab color space, as shown in fig. 11. It can be understood that, in the embodiment of the present application, the Lab color space and the image on the L component channel are selected because, for the initial image in the color reproduction test scene, the color space and the component channel have a better segmentation effect on the background area and the color card area, and the color space and the component channel can be adaptively modified according to the actually processed image. The luminance threshold, i.e. the first color threshold, is converted into a luminance value of the luminance L channel in the Lab color space.
In step S204 of some embodiments, pixels in the first intermediate image having a luminance value greater than or equal to the luminance threshold value are set to have a luminance value of 100, and pixels having a luminance value less than the luminance threshold value are set to have a luminance value of 0, to obtain a binarization result. In some embodiments, the binarization result is further subjected to inverse binarization, and the final image is a brightness binarization image, as shown in fig. 12.
In step S205 of some embodiments, the target contour coordinate data may be a set of pixel coordinate data for the color chart edge. The contour detection can be performed on the brightness binarized image through a machine vision algorithm, and in this embodiment, contour level information in the brightness binarized image is obtained by using a contour detection function (fi nd contents) of an OpenCV library, where the contour level information includes Contours of a plurality of small color blocks and Contours of color card edges. And at the moment, selecting the largest outline, namely the outline of the color card edge, and performing outline fitting on the outline, so as to obtain the target outline coordinate data.
In step S206 of some embodiments, four vertices in the target contour coordinate data are selected to locate to the preset color chart, and affine correction is performed on the target contour coordinate data based on the four vertices, where it should be noted that, the operation is not to correct distortion of the image, but to correct the extracted contour data, and finally, the minimum bounding rectangle of the color chart is extracted, and the color chart area is cut according to the minimum bounding rectangle, as shown in fig. 13.
In the steps S201 to S206 shown in the embodiment of the present application, through a series of image processing steps, the color card area is accurately extracted from the initial image, so as to provide a reliable data base for the subsequent color reproduction test.
Referring to fig. 3, in some embodiments, step S202 performs segmentation threshold determination according to the initial pixel color value to obtain a first color threshold, which may include, but is not limited to, steps S301 to S303:
Step S301, performing pixel color clustering on the initial pixel color values to obtain first color clustering data.
Step S302, a target class is screened out from the first color cluster data based on the number of pixels corresponding to each class, and the color value of each pixel corresponding to the target class.
Step S303, performing numerical calculation according to the color value of the pixel corresponding to the target class to obtain a first color threshold.
In step S301 of some embodiments, the first color cluster data is a result of clustering the initial speed limit color values, including a color value of each pixel corresponding to each class, and may be obtained by a K-clustering algorithm. For an application scenario in which the preset color chart is a 24-color chart, the initial image in the RGB color space is randomly distributed with 25 centroids (24 colors plus background gray class), and the pixel RGB values of all the initial images are clustered according to the spatial distance between the pixel RGB values and the 25 centroids, so that 25 classes are finally obtained, and each class corresponds to a pixel.
In step S302 of some embodiments, the target class is classified into a class of background color, and in the color reduction test scene of the present application, the target class is an 18 ° neutral gray class of the background, and the color has the largest ratio in the initial image, so that the class with the largest number of pixels is selected to extract the background area.
In step S303 of some embodiments, the numerical calculation is to perform an average calculation on the RGB values of the pixels classified as the target class.
The steps S301 to S303 shown in the embodiment of the application ensure that the background color can be accurately extracted and used in the color reproduction test through pixel color clustering and screening, and provide a reliable basis for subsequent image processing and color correction.
Referring to fig. 4, in step S103 of some embodiments, the color chart region is subjected to color patch edge detection to obtain color patch contour coordinate data, and step S103 may include, but is not limited to, steps S401 to S405:
step S401, color card pixel color values of the color card area are obtained.
Step S402, determining a segmentation threshold according to the color value of the color card pixel to obtain a second color threshold.
Step S403 converts the color card region into a second intermediate image in the hue saturation brightness color space and converts the second color threshold into a brightness threshold on the brightness channel. Wherein the hue saturation lightness color space comprises a lightness channel.
Step S404, binarizing the second intermediate image according to the brightness threshold value to obtain a brightness binarized image.
Step S405, performing contour detection on the brightness binarized image to obtain color block contour coordinate data.
In step S401 of some embodiments, the color chart pixel color value is the RGB value of each pixel of the color chart region extracted in the above step.
In step S402 of some embodiments, the second color threshold is a black-like RGB value in the color chart. In the color reproduction test scene, the frame of the template of the color card and one color block are black, so that the pixel RGB values of the color card are clustered, the class with the largest pixel number is black, and the average value of all RGB values corresponding to the black is calculated, and the obtained RGB average value is the second color threshold.
In step S403 of some embodiments, the hue saturation brightness color space may be an HSV color space. The second intermediate image, the color card area, is converted from the RGB color space to a V-channel image of the HSV color space, as shown in fig. 14. The brightness threshold, the second color threshold, is converted to a brightness value for the V-channel in the HSV color space.
In step S404 of some embodiments, pixels in the second intermediate image whose brightness value is greater than or equal to the brightness threshold value are set to have a brightness value of 1, and appear white, and pixels whose brightness value is less than the brightness threshold value are set to have a brightness value of 0, and appear black. The resulting image brightness binarized image as shown in fig. 15.
In step S405 of some embodiments, the patch profile coordinate data may be a set of pixel coordinate data of all patch edges in the patch area image. And obtaining a closed graph contour in the brightness binarization image by using a contour detection function (fi nd contents), carrying out statistical calculation on the area of the closed graph contour, and obtaining a final color block contour coordinate by trimming the average value. In the color reproduction test scene of the embodiment of the application, the outlines of the color blocks are quadrangles, and when black is confirmed, the black color blocks and edges are black in the brightness binarized image, so that when the outlines of the color blocks are detected, no method is adopted to distinguish the outlines of the color blocks from other color blocks, the outlines of the black color blocks are not found, and finally 23 color block outlines are found.
In the steps S401 to S405 shown in the embodiment of the present application, the outline of the color patch is accurately identified and extracted by performing secondary processing on the extracted color card area.
Referring to fig. 5, in some embodiments, step S104 may further include, but is not limited to, steps S501 to S505:
in step S501, pixel color extraction is performed on the color card area according to the color patch contour coordinate data, so as to obtain a color patch pixel color value of each pixel of the color patch.
Step S502, calculating an average value according to the color values of the color block pixels of all pixels of the color block to obtain a color average value.
Step S503, performing difference evaluation on each pixel according to the color average value and the color value of each color block pixel to obtain an outlier pixel.
Step S504, if the number of the outlier pixels is greater than the preset outlier number threshold, deleting the outlier pixels with a predetermined proportion, and returning to perform average calculation according to the color values of all the pixels of the color block to obtain a color average.
In step S505, if the number of outliers is less than or equal to the preset pixel number threshold, the color average is determined as the color data of the color block.
In step S501 of some embodiments, the color block pixel color values are RGB values for each pixel for the same color block. The color block contour coordinate data includes a contour coordinate set of each color block, and pixels surrounded by contour coordinates of the same color block can be determined as objects to be extracted with RGB values.
In step S502 of some embodiments, the RGB values of all pixels of the same color block are averaged to obtain an RGB average value, i.e., a color average value.
In step S503 of some embodiments, referring to fig. 6, in some embodiments, step S503 includes, but is not limited to, steps S601 to S602:
step S601, performing difference calculation according to the color average value and the color value of each pixel to obtain a color difference value of each pixel.
In step S602, if the color difference value is greater than or equal to the preset difference threshold, the pixel is determined to be an outlier pixel.
In step S601 of some embodiments, the color difference value is the absolute value of the difference between the color average value and one pixel RGB value in the corresponding color block.
In step S602 of some embodiments, the preset difference threshold may be 100, and the tester may modify the preset difference threshold according to the test requirement. The outlier pixels are pixels with too large difference between the RGB values and the RGB average value.
In steps S601 to S602 shown in the embodiment of the present application, outlier pixels in a color patch are identified by calculating a difference between the pixel and a color patch color average. The accuracy of the color mean value of the color block is improved, and a more reliable data base is provided for subsequent color reduction tests and color difference analysis.
In step S504 of some embodiments, the preset outlier number threshold may be 5% of the number of pixels of the current color block, or the predetermined ratio may be 5%, which is not strictly limited in the embodiments of the present application. If the number of outliers is greater than the preset outlier threshold, the process returns to step S502 to recalculate the average RGB value of the current color block.
In step S505 of some embodiments, if the number of outlier pixels is less than or equal to the preset outlier number threshold, the average RGB value in S502 is directly taken as the RGB value of the current color block.
The steps S501 to S505 shown in the embodiment of the application provide more reliable data base for subsequent color reproduction test and color difference analysis by improving the accuracy of color block color mean value.
Referring to fig. 7, in some embodiments, step S105, that is, performing color filling according to the color data of the color patch and the preset color chart template, obtains a reconstructed color chart image, which may include, but is not limited to, steps S701 to S702:
and step S701, performing color filling on the frame area of the color card template according to the second color threshold value to obtain an intermediate color card image.
And step S702, performing color filling on the color block area of the intermediate color card image according to the color block color data to obtain a reconstructed color card image.
In step S701 of some embodiments, the color card template may be an image of size 1920px x 1280px, and 24 color blocks of size 240px x 240px are arranged in an array, where the starting pixel coordinate of the first color block is (50, 50), and the adjacent color blocks are separated by 50px. The frame area is filled with the black RGB value, that is, the second color threshold, and in this embodiment, color filling is further required for the black blocks according to the black RGB value to obtain an intermediate color card image, where the color of the intermediate color card image is not filled in the other color blocks except for the black blocks.
In step S702 of some embodiments, the 23 color block color data acquired in the above steps sequentially fill the intermediate color card image, and finally a reconstructed color card image is obtained, as shown in fig. 16.
In the steps S701 to S702 shown in the embodiment of the present application, the color card can be quickly and efficiently generated by extracting the color in the color card image and directly filling the color into the preset color card template.
In step S106 of some embodiments, the color data of the preset color chart may be color data widely used in the industry, such as X-rite 24 color chart standard values. The color index parameters may be color difference, saturation level, white balance error data, etc. The reconstructed color chart can be input into a professional image processing software program (such as Imatest, which is widely applied to the fields of scientific research, industrial detection, medical images and the like, and the iQ-Ana lyzer) to calculate and output color difference values of different color spaces, saturation, color difference including brightness, color difference after saturation calibration, and color difference after saturation calibration.
Referring to fig. 8, an embodiment of the present application further provides a color reproduction test apparatus for a wide-angle lens, which can implement the color reproduction test method for a wide-angle lens, where the apparatus includes:
the acquisition module is used for acquiring an initial image acquired by the wide-angle lens to a preset color chart.
And the color card extraction module is used for extracting the color card area from the initial image.
And the color block contour detection module is used for carrying out color block edge detection on the color card area to obtain color block contour coordinate data.
And the color extraction module is used for carrying out color extraction on the color card area according to the color block contour coordinate data to obtain color block color data.
And the color card reconstruction module is used for carrying out color filling according to the color data of the color block and a preset color card template to obtain a reconstructed color card image.
The parameter determining module is used for performing index calculation based on the reconstructed color card image and the color data of the preset color card to obtain color index parameters so as to evaluate the color restoration capability of the wide-angle lens according to the color index parameters.
The specific implementation of the color reproduction test device of the wide-angle lens is basically the same as the specific example of the color reproduction test method of the wide-angle lens, and will not be repeated here.
The embodiment of the application also provides electronic equipment, which comprises a memory and a processor, wherein the memory stores a computer program, and the processor realizes the color reproduction test method of the wide-angle lens when executing the computer program. The electronic equipment can be any intelligent terminal including a tablet personal computer, a vehicle-mounted computer and the like.
Referring to fig. 9, fig. 9 illustrates a hardware structure of an electronic device according to another embodiment, the electronic device includes:
The processor 901 may be implemented by a general purpose CPU (Centra l Process I ng Un it ), a microprocessor, an application specific integrated circuit (APP L I CAT I on SPEC I F I C I NTEGRATED CI rcu it, AS ic), or one or more integrated circuits, etc. for executing related programs, so AS to implement the technical solution provided by the embodiments of the present application;
The memory 902 may be implemented in the form of read-only memory (Read On l y Memory, ROM), static storage, dynamic storage, or random access memory (Random Access Memory, RAM), among others. The memory 902 may store an operating system and other application programs, and when the technical solution provided in the embodiments of the present disclosure is implemented by software or firmware, relevant program codes are stored in the memory 902, and the processor 901 invokes a color reproduction test method for executing the wide-angle lens of the embodiments of the present disclosure;
An input/output interface 903 for inputting and outputting information;
the communication interface 904 is configured to implement communication interaction between the present device and other devices, and may implement communication in a wired manner (such as USB, network cable, etc.), or may implement communication in a wireless manner (such as mobile network, WI F I, bluetooth, etc.);
A bus 905 that transfers information between the various components of the device (e.g., the processor 901, the memory 902, the input/output interface 903, and the communication interface 904);
Wherein the processor 901, the memory 902, the input/output interface 903 and the communication interface 904 are communicatively coupled to each other within the device via a bus 905.
The embodiment of the application also provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program realizes the color reproduction test method of the wide-angle lens when being executed by a processor.
The memory, as a non-transitory computer readable storage medium, may be used to store non-transitory software programs as well as non-transitory computer executable programs. In addition, the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory optionally includes memory remotely located relative to the processor, the remote memory being connectable to the processor through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The embodiment of the application provides a color reproduction test method and device of a wide-angle lens, electronic equipment and a storage medium, which are used for acquiring an initial color card image shot by the wide-angle lens and extracting a color card area. Then, the outline of the color patch is identified by edge detection, and color extraction is performed based on these outline data, resulting in color information of the color patch. And then, performing color filling by using the extracted color data and a preset color card template, and reconstructing the color card image. And finally, calculating color index parameters by matching the color data of the specific gravity color card image and the preset color card, thereby evaluating the color reproduction capability of the wide-angle lens. Compared with the existing test method, the method does not need to correct distortion of the image acquired by the wide-angle lens, and directly generates the reconstructed color chart according to the acquired image, so that the efficiency of color reduction test is improved.
The embodiments described in the embodiments of the present application are for more clearly describing the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application, and those skilled in the art can know that, with the evolution of technology and the appearance of new application scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.
It will be appreciated by persons skilled in the art that the embodiments of the application are not limited by the illustrations, and that more or fewer steps than those shown may be included, or certain steps may be combined, or different steps may be included.
The above described apparatus embodiments are merely illustrative, wherein the units illustrated as separate components may or may not be physically separate, i.e. may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
Those of ordinary skill in the art will appreciate that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof.
The terms "first," "second," "third," "fourth," and the like in the description of the application and in the above figures, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that in the present application, "at least one (item)" means one or more, and "a plurality" means two or more. "and/or" is used to describe an association relationship of an associated object, and indicates that three relationships may exist, for example, "a and/or B" may indicate that only a exists, only B exists, and three cases of a and B exist simultaneously, where a and B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one of a, b or c may represent a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the above-described division of units is merely a logical function division, and there may be another division manner in actual implementation, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including multiple instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method of the various embodiments of the present application. The storage medium includes various media capable of storing programs, such as a usb disk, a removable hard disk, a read-only memory (ReadOn ly Memory, ROM for short), a random access memory (Random Access Memory, RAM for short), a magnetic disk, or an optical disk.
The preferred embodiments of the present application have been described above with reference to the accompanying drawings, and are not thereby limiting the scope of the claims of the embodiments of the present application. Any modifications, equivalent substitutions and improvements made by those skilled in the art without departing from the scope and spirit of the embodiments of the present application shall fall within the scope of the claims of the embodiments of the present application.
Claims (10)
1. A color reproduction test method for a wide-angle lens, the method comprising:
Acquiring an initial image acquired by a wide-angle lens to a preset color card;
Extracting a color card area from the initial image;
Performing color block edge detection on the color card area to obtain color block contour coordinate data;
performing color extraction on the color card area according to the color block contour coordinate data to obtain color block color data;
performing color filling according to the color data of the color blocks and a preset color card template to obtain a reconstructed color card image;
and performing index calculation based on the reconstructed color card image and the color data of the preset color card to obtain color index parameters, so as to evaluate the color reproduction capability of the wide-angle lens according to the color index parameters.
2. The method of claim 1, wherein the extracting the color chip area from the initial image comprises:
Acquiring an initial pixel color value of the initial image;
Determining a segmentation threshold according to the initial pixel color value to obtain a first color threshold;
converting the initial image into a first intermediate image in a luminance-chrominance color space, and converting the first color threshold into a luminance threshold on a luminance channel, wherein the luminance-chrominance color space comprises the luminance channel;
binarizing the first intermediate image according to the brightness threshold value to obtain a brightness binarized image;
performing contour detection on the brightness binarization image to obtain target contour coordinate data;
and cutting the initial image based on the target contour coordinate data to obtain the color card area.
3. The method of claim 2, wherein said determining a segmentation threshold from said initial pixel color value results in a first color threshold, comprising:
Performing pixel color clustering on the initial pixel color values to obtain first color clustering data, wherein the first color clustering data comprise color values of each pixel corresponding to each type;
screening a target class from the first color cluster data based on the number of pixels corresponding to each class, and a color value of each pixel corresponding to the target class;
And carrying out numerical calculation according to the color value of the pixel corresponding to the target class to obtain the first color threshold.
4. The method of claim 1, wherein performing patch edge detection on the color card region to obtain patch profile coordinate data comprises:
Acquiring color card pixel color values of the color card area;
Determining a segmentation threshold according to the color value of the color card pixel to obtain a second color threshold;
Converting the color card region into a second intermediate image in a hue saturation brightness color space, and converting the second color threshold into a brightness threshold on a brightness channel, wherein the hue saturation brightness color space comprises the brightness channel;
Binarizing the second intermediate image according to the brightness threshold value to obtain a brightness binarization image;
and carrying out contour detection on the brightness binarized image to obtain the color block contour coordinate data.
5. The method of claim 4, wherein the performing color filling according to the color data of the color patch and a preset color card template to obtain a reconstructed color card image comprises:
performing color filling on the frame area of the color card template according to the second color threshold value to obtain an intermediate color card image;
and filling the color block area of the intermediate color card image with the color according to the color block color data to obtain the reconstructed color card image.
6. The method of claim 4, wherein performing color extraction on the color chip area according to the color patch profile coordinate data to obtain color patch color data comprises:
Extracting pixel colors of the color card area according to the color block outline coordinate data to obtain color block pixel color values of each pixel of the color block;
calculating an average value according to color block pixel color values of all pixels of the color block to obtain a color average value;
Performing gap evaluation on each pixel according to the color average value and the color value of each color block pixel to obtain an outlier pixel;
If the number of the outlier pixels is larger than a preset outlier number threshold, deleting the outlier pixels in a preset proportion, and returning to the color values of all the pixels according to the color block for average value calculation to obtain a color average value;
and if the number of the outlier pixels is smaller than or equal to a preset pixel number threshold, determining the color average value as the color data of the color block.
7. The method of claim 6, wherein performing a gap evaluation on each pixel according to the color average and the color value of each color block pixel to obtain an outlier pixel comprises:
performing difference calculation according to the color average value and the color value of each pixel to obtain a color difference value of each pixel;
And if the color difference value is greater than or equal to a preset difference value threshold, determining the pixel as the outlier pixel.
8. A color reproduction testing apparatus for a wide angle lens, the apparatus comprising:
The acquisition module is used for acquiring an initial image acquired by the wide-angle lens to a preset color card;
The color card extraction module is used for extracting a color card area from the initial image;
the color block contour detection module is used for carrying out color block edge detection on the color card area to obtain color block contour coordinate data;
The color extraction module is used for carrying out color extraction on the color card area according to the color block outline coordinate data to obtain color block color data;
The color card reconstruction module is used for performing color filling according to the color data of the color blocks and a preset color card template to obtain a reconstructed color card image;
And the parameter determining module is used for carrying out index calculation based on the reconstructed color card image and the color data of the preset color card to obtain color index parameters so as to evaluate the color reproduction capability of the wide-angle lens according to the color index parameters.
9. An electronic device comprising a memory storing a computer program and a processor implementing the method of any of claims 1 to 7 when the computer program is executed by the processor.
10. A computer readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, implements the method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202411163323.2A CN119211516A (en) | 2024-08-23 | 2024-08-23 | Color reproduction test method and device for wide-angle lens, electronic equipment, and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202411163323.2A CN119211516A (en) | 2024-08-23 | 2024-08-23 | Color reproduction test method and device for wide-angle lens, electronic equipment, and medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN119211516A true CN119211516A (en) | 2024-12-27 |
Family
ID=94073105
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202411163323.2A Pending CN119211516A (en) | 2024-08-23 | 2024-08-23 | Color reproduction test method and device for wide-angle lens, electronic equipment, and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN119211516A (en) |
-
2024
- 2024-08-23 CN CN202411163323.2A patent/CN119211516A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110544258B (en) | Image segmentation method and device, electronic equipment and storage medium | |
CN109978890B (en) | Target extraction method and device based on image processing and terminal equipment | |
Podpora et al. | YUV vs RGB-Choosing a Color Space for Human-Machine Interaction. | |
CN108206917B (en) | Image processing method and device, storage medium and electronic device | |
CN107204034B (en) | A kind of image processing method and terminal | |
US10922801B2 (en) | Channel-based binarization of color | |
CN110691226B (en) | Image processing method, device, terminal and computer readable storage medium | |
CN102867295B (en) | A kind of color correction method for color image | |
WO2015070723A1 (en) | Eye image processing method and apparatus | |
CN108734684B (en) | Image background subtraction for dynamic illumination scene | |
CN115082400B (en) | Image processing method, device, computer equipment and readable storage medium | |
CN111523551A (en) | Binarization method, device and equipment for blue object | |
CN111311500B (en) | A method and device for color restoration of an image | |
CN112699760A (en) | Face target area detection method, device and equipment | |
CN108877030B (en) | Image processing method, device, terminal and computer readable storage medium | |
WO2020107196A1 (en) | Photographing quality evaluation method and apparatus for photographing apparatus, and terminal device | |
KR100488014B1 (en) | YCrCb color based human face location detection method | |
CN119211516A (en) | Color reproduction test method and device for wide-angle lens, electronic equipment, and medium | |
CN112801112B (en) | Image binarization processing method, device, medium and equipment | |
US10083516B2 (en) | Method for segmenting a color image and digital microscope | |
US9367923B2 (en) | Image processing apparatus with improved compression of image data of character images and background images using respective different compressing methods | |
Shen et al. | A holistic image segmentation framework for cloud detection and extraction | |
CN109766831A (en) | A kind of road colour band recognition methods, device, computer equipment and storage medium | |
CN116074640B (en) | Image processing method and related device | |
CN110751053B (en) | Vehicle color identification method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |