Color rendition test method and device of wide-angle lens, electronic equipment and medium

By extracting the color card area and color data collected by the wide-angle lens, the reconstruction color card image is directly generated, which solves the problem of low color restoration testing efficiency in the existing technology, and realizes a method to quickly evaluate the color restoration capabilities of wide-angle lenses.

CN119211516AActive Publication Date: 2024-12-27SHENZHEN ZHONGXIN CHUANGZHAN TECH CO LTD

Patent Information

Application Number
CN202411163323.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2024-12-27
Estimated Expiration
2044-08-23

AI Technical Summary

Technical Problem

The existing wide-angle lens color restoration test methods are inefficient and cannot complete distortion correction for a single image. Multiple angle images need to be spliced, resulting in low testing efficiency.

Method used

By obtaining the initial color card image collected by the wide-angle lens, extracting the color card area, performing color block edge detection and color extraction, using the extracted color data and preset color card templates for color filling, directly generate the reconstructed color card image, and evaluate color restoration ability.

Benefits of technology

The efficiency of color restoration test is improved, the distortion correction step of the image is avoided, and the reconstruction color card is directly generated based on the acquired image, thereby quickly evaluating the color restoration capability of the wide-angle lens.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119211516A_ABST
    Figure CN119211516A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a color rendition test method and device for a wide-angle lens, electronic equipment and a medium, and belongs to the field of digital image processing. The method comprises the following steps: acquiring an initial image acquired by a wide-angle lens for a preset color card, extracting a color card area from the initial image, then 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, and displaying the color block color data on the wide-angle lens. Performing color filling according to the color block color data and a preset color card template to obtain a reconstructed color card image, and finally performing index calculation based on the reconstructed color card image and color data of a preset color card to obtain color index parameters. Compared with the existing test method, the embodiment of the invention does not need to perform distortion correction on the image acquired by the wide-angle lens, but directly generates the reconstructed color card graph, and performs color rendition ability evaluation based on the color card, thereby improving the efficiency of color rendition test.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of digital image processing, and in particular to a color reproduction test method and device for a wide-angle lens, an electronic device, and a storage medium. Background Art

[0002] In the related art, before the color reproduction test of the wide-angle lens is performed, the wide-angle lens is allowed to capture an image containing a standard color card, and then the image is distorted and corrected. Then, the relevant index parameters are calculated for the corrected image according to the standard color card. The index parameters are used to indicate the ability of the wide-angle lens to restore colors. However, the current processing methods cannot complete the distortion correction of a single image, or need to splice images of multiple acquisition angles to achieve distortion correction, resulting in low efficiency of color reproduction testing. Therefore, how to improve the efficiency of wide-angle lens color reproduction testing has become an urgent problem to be solved. Summary of the invention

[0003] The main purpose of the embodiments of the present application is to provide a color reproduction test method and device for a wide-angle lens, an electronic device, and a storage medium, aiming to improve the efficiency of the color reproduction test of a wide-angle lens.

[0004] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application provides a color reproduction test method for a wide-angle lens, the method comprising:

[0005] Acquire an initial image of a preset color card captured by a wide-angle lens;

[0006] Extracting a color card area from the initial image;

[0007] Performing color block edge detection on the color card area to obtain color block outline coordinate data;

[0008] Performing color extraction on the color card area according to the color block outline coordinate data to obtain color block color data;

[0009] Performing color filling according to the color block color data and a preset color card template to obtain a reconstructed color card image;

[0010] Index calculation is performed 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.

[0011] In some embodiments, extracting a color card area from the initial image includes:

[0012] Obtaining an initial pixel color value of the initial image;

[0013] Determine a segmentation threshold according to the initial pixel color value to obtain a first color threshold;

[0014] 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 includes the luminance channel;

[0015] Binarize the first intermediate image according to the brightness threshold to obtain a brightness binarized image;

[0016] Performing contour detection on the brightness binary image to obtain target contour coordinate data;

[0017] The initial image is cropped based on the target contour coordinate data to obtain the color card area.

[0018] In some embodiments, determining the segmentation threshold according to the initial pixel color value to obtain the first color threshold includes:

[0019] Performing pixel color clustering on the initial pixel color value to obtain first color clustering data, wherein the first color clustering data includes a color value of each pixel corresponding to each class;

[0020] Filtering out a target class and a color value of each pixel corresponding to the target class from the first color clustering data based on the number of pixels corresponding to each class;

[0021] The first color threshold is obtained by performing numerical calculation according to the color value of the pixel corresponding to the target class.

[0022] In some embodiments, performing color block edge detection on the color card area to obtain color block outline coordinate data includes:

[0023] Obtain the color value of the color card pixel in the color card area;

[0024] Determine the segmentation threshold according to the color value of the color card pixel to obtain a second color threshold;

[0025] Converting the color card area into a second intermediate image in a hue-saturation-lightness color space, and converting the second color threshold into a lightness threshold on a lightness channel; wherein the hue-saturation-lightness color space includes the lightness channel;

[0026] Binarize the second intermediate image according to the brightness threshold to obtain a brightness binary image;

[0027] Contour detection is performed on the brightness binary image to obtain the colour block contour coordinate data.

[0028] In some embodiments, the color filling according to the color block color data and a preset color card template to obtain a reconstructed color card image includes:

[0029] Filling the border area of ​​the color card template with color according to the second color threshold to obtain an intermediate color card image;

[0030] The color block area of ​​the intermediate color card image is filled with color according to the color block color data to obtain the reconstructed color card image.

[0031] In some embodiments, the step of performing color extraction on the color card area according to the color block outline coordinate data to obtain the color block color data includes:

[0032] Perform pixel color extraction on the color card area according to the color block outline coordinate data to obtain a color block pixel color value of each pixel of the color block;

[0033] Calculate the average value of the color block pixel color values ​​of all pixels of the color block to obtain a color average value;

[0034] 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;

[0035] If the number of the outlier pixels is greater than a preset outlier number threshold, a predetermined proportion of the outlier pixels are deleted, and the color values ​​of all pixels of the color block are returned to perform average calculation to obtain a color average value;

[0036] If the number of the outlier pixels is less than or equal to a preset pixel number threshold, the color average value is determined as the color block color data.

[0037] In some embodiments, 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:

[0038] Performing a difference calculation based on the color average value and the color value of each pixel to obtain a color difference value of each pixel;

[0039] If the color difference value is greater than or equal to a preset difference threshold, the pixel is determined to be the outlier pixel.

[0040] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides a color reproduction test device for a wide-angle lens, the device comprising:

[0041] A collection module, the collection module is used to obtain an initial image of a preset color card collected by a wide-angle lens;

[0042] A color card extraction module, the color card extraction module is used to extract a color card area from the initial image;

[0043] A color block contour detection module, which is used to perform color block edge detection on the color card area to obtain color block contour coordinate data;

[0044] A color extraction module, the color extraction module is used to extract the color of the color card area according to the color block outline coordinate data to obtain color block color data;

[0045] A color card reconstruction module, the color card reconstruction module is used to perform color filling according to the color block color data and a preset color card template to obtain a reconstructed color card image;

[0046] A parameter determination module, the parameter determination module is used to perform 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 ability of the wide-angle lens according to the color index parameters

[0047] To achieve the above objectives, a third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in the first aspect is implemented.

[0048] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.

[0049] The color reproduction test method and device, electronic device, and storage medium of a wide-angle lens proposed in the present application obtain an initial color card image taken by a wide-angle lens and extract the color card area. Then, the outline of the color block is identified by edge detection, and color extraction is performed based on these outline data to obtain the color information of the color block. Next, the extracted color data and the preset color card template are used to perform color filling to reconstruct the color card image. Finally, by comparing the reconstructed color card image with the color data of the preset color card, the color index parameters are calculated to evaluate the color reproduction ability of the wide-angle lens. Compared with the existing test method, the present method does not need to perform distortion correction on the image captured by the wide-angle lens, but directly generates a reconstructed color card image based on the captured image, and performs color reproduction ability evaluation based on the color card, thereby improving the efficiency of the color reproduction test. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 is a flow chart of a color reproduction test method for a wide-angle lens provided in an embodiment of the present application;

[0051] Figure 2 yes Figure 1 Flow chart of step S102 in FIG.

[0052] Figure 3 yes Figure 2 Flow chart of step S202 in FIG.

[0053] Figure 4 yes Figure 1 Flow chart of step S103 in FIG.

[0054] Figure 5 yes Figure 1 Flow chart of step S104 in FIG.

[0055] Figure 6 yes Figure 5 Flow chart of step S503 in FIG.

[0056] Figure 7 yes Figure 1 Flow chart of step S105 in FIG.

[0057] Figure 8 is a structural schematic diagram of a color reproduction test device for a wide-angle lens provided in an embodiment of the present application;

[0058] Fig. 9 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;

[0059] Fig.10 is an initial image provided by an embodiment of the present application;

[0060] Fig.11 is an intermediate image provided by an embodiment of the present application;

[0061] Fig.12 is a binary image provided by an embodiment of the present application;

[0062] Fig.13 is a color card area image provided in an embodiment of the present application;

[0063] Fig.14 is another intermediate image provided in an embodiment of the present application;

[0064] Fig.15 is another binary image provided by an embodiment of the present application;

[0065] Fig.16 This is a reconstructed color card image provided in an embodiment of the present application. DETAILED DESCRIPTION

[0066] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0067] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0068] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0069] First, some nouns involved in this application are analyzed:

[0070] Red-Green-Blue (RGB) color space: a color representation method based on the three basic color components of red (Red), green (Green) and blue (Blue).

[0071] Lab color space: refers to a color representation model. This color space includes three components, namely L (lightness), a (chromaticity axis a) and b (chromaticity axis b). L represents the brightness of the color. The value range is usually 0 to 100. The larger the L value, the closer the color is to white, and the smaller the L value, the closer the color is to black. a represents the change of color from green to red. A positive value indicates that the color is reddish, and a negative value indicates that the color is greenish. b (chromaticity axis b) represents the change of color from blue to yellow. A positive value indicates that the color is yellowish, and a negative value indicates that the color is bluish.

[0072] HSV (Hue, Saturation, Value) color space: HSV is a color space created by AR Smith in 1978 based on the intuitive characteristics of color, also known as the Hexcone Model. This color space includes three components, namely hue (Hue, H), saturation (Saturation, S) and value (V). Hue represents the basic type of color, that is, the type of color, such as red, green, blue, etc. Saturation represents the purity or intensity of the color, that is, the vividness of the color. Value represents the brightness or lightness of the color.

[0073] In the related art, since the field of view and image distortion of wide-angle lenses are large, the color restoration test for such lenses will first let the wide-angle lens capture an image containing a standard color card, then perform distortion correction on the image, and then calculate relevant index parameters (such as color difference, saturation level, white balance error and other parameters) for the corrected image based on the standard color card. The index parameters are used to indicate the ability of the wide-angle lens to restore color. However, today's processing methods cannot complete complete distortion correction for a single image, or require splicing of images from multiple acquisition angles to achieve distortion correction, resulting in low efficiency of color restoration testing. Therefore, how to improve the efficiency of wide-angle lens color restoration testing has become an urgent problem to be solved.

[0074] Based on this, the embodiments of the present application provide a method and device for color reproduction testing of a wide-angle lens, an electronic device, and a storage medium, aiming to improve the efficiency of color reproduction testing of a wide-angle lens.

[0075] The color reproduction test method and device, electronic device and storage medium provided in the embodiments of the present application are specifically described through the following embodiments. First, the color reproduction test method in the embodiments of the present application is described.

[0076] Figure 1 is an optional flow chart of a color reproduction test method for a wide-angle lens provided in an embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S106.

[0077] Step S101, obtaining an initial image of a preset color card captured by a wide-angle lens.

[0078] Step S102: extracting a color card area from the initial image.

[0079] Step S103, performing color block edge detection on the color card area to obtain color block outline coordinate data.

[0080] Step S104, performing color extraction on the color card area according to the color block outline coordinate data to obtain color block color data.

[0081] Step S105 , color filling is performed according to the color block color data and a preset color card template to obtain a reconstructed color card image.

[0082] Step S106 , 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.

[0083] In steps S101 to S106 shown in the embodiment of the present application, first, an initial color card image taken by a wide-angle lens is obtained, and the color card area is extracted. Then, the outline of the color block is identified by edge detection, and color extraction is performed based on these outline data to obtain the color information of the color block. Next, the extracted color data and the preset color card template are used to perform color filling to reconstruct the color card image. Finally, by comparing the reconstructed color card image with the color data of the preset color card, the color index parameters are calculated to evaluate the color reproduction ability of the wide-angle lens. Compared with the existing testing methods, the present method does not need to perform distortion correction on the image captured by the wide-angle lens, but directly generates a reconstructed color card image based on the captured image, and performs color reproduction ability evaluation based on the color card, thereby improving the efficiency of the color reproduction test.

[0084] In step S101 of some embodiments, the preset color card can be a 24-color card or a 12-color card, and the tester can adjust it according to the actual test requirements. The initial image is an image of the preset color card captured by a wide-angle lens. It should be noted that in the application scenario of the color restoration test in some embodiments, the test requires that the preset color card occupies 50% to 70% of the initial image. That is, the initial image will capture the background other than the preset color card. In order to eliminate the interference of the background on subsequent image processing, the color card image in the initial image needs to be extracted.

[0085] See also Figure 2 In some embodiments, step S102 may include but is not limited to steps S201 to S206:

[0086] Step S201, obtaining the initial pixel color value of the initial image.

[0087] Step S202, determining a segmentation threshold according to the initial pixel color value to obtain a first color threshold.

[0088] Step S203: convert the initial image into a first intermediate image in a luminance-chrominance color space, and convert the first color threshold into a luminance threshold in a luminance channel, wherein the luminance-chrominance color space includes a luminance channel.

[0089] Step S204: binarize the first intermediate image according to the brightness threshold to obtain a brightness binarized image.

[0090] Step S205, performing contour detection on the brightness binary image to obtain target contour coordinate data.

[0091] Step S206, cropping the initial image based on the target contour coordinate data to obtain a color card area.

[0092] In step S201 of some embodiments, the initial pixel color value is the RGB value of each pixel in the initial image.

[0093] In step S202 of some embodiments, the first color threshold is the RGB average value of the background. It should be noted that in the application scenario of the color reproduction test in some embodiments, the test requires that the background of the preset color card is a neutral gray of 18°, such as Fig.10 shown.

[0094] In step S203 of some embodiments, the luminance and chromaticity color space may be a Lab color space, and the first intermediate image may be an L channel image of the initial image converted from the RGB color space to the Lab color space, such as Fig.11 As shown. It can be understood that the embodiment of the present application selects the image on the Lab color space and the L component channel because for the initial image in the color restoration test scene, the color space and component channel have a better segmentation effect on the background area and the color card area, and the selection of the color space and component channel can be adaptively modified according to the actual processed image. The brightness threshold is the brightness value of the brightness L channel in the Lab color space converted from the first color threshold.

[0095] In step S204 of some embodiments, the pixels in the first intermediate image whose brightness values ​​are greater than or equal to the brightness threshold are set to have a brightness value of 100, and the pixels whose brightness values ​​are less than the brightness threshold are set to have a brightness value of 0, to obtain a binarization result. In some embodiments, the binarization result is further debinarized, and the final image obtained is a brightness binarization image, such as Fig.12 shown.

[0096] In step S205 of some embodiments, the target contour coordinate data may be a pixel coordinate data set of the edge of the color card. The brightness binary image may be subjected to contour detection by a machine vision algorithm. In this embodiment, the contour detection function (find Contours) of the OpenCV library is used to obtain contour level information in the brightness binary image. At this time, the contour level information includes the contours of multiple small color blocks and the contours of the edge of the color card. At this time, the largest contour, i.e., the contour of the edge of the color card, is selected and contour fitting is performed on it to obtain the target contour coordinate data.

[0097] In step S206 of some embodiments, four vertices in the target contour coordinate data are selected to locate the preset color card, and the target contour coordinate data is corrected based on the four vertices. It should be noted that the operation here is not to correct the distortion of the image, but to straighten the extracted contour data, and finally extract the minimum bounding rectangle of the color card, and cut out the color card area according to the minimum bounding rectangle, such as Fig.13 shown.

[0098] Steps S201 to S206 shown in the embodiment of the present application accurately extract the color card area from the initial image through a series of image processing steps, thereby providing a reliable data basis for subsequent color reproduction tests.

[0099] See also Figure 3 In some embodiments, step S202 determines the segmentation threshold according to the initial pixel color value to obtain the first color threshold, which may include but is not limited to steps S301 to S303:

[0100] Step S301, performing pixel color clustering on the initial pixel color value to obtain first color clustering data.

[0101] Step S302 : Filter out a target class and a color value of each pixel corresponding to the target class from the first color clustering data based on the number of pixels corresponding to each class.

[0102] Step S303, performing numerical calculation according to the color value of the pixel corresponding to the target class to obtain a first color threshold.

[0103] In step S301 of some embodiments, the first color clustering data is the result of clustering the initial speed limit color value, including the color value of each pixel corresponding to each class, which can be obtained by the K clustering algorithm. Exemplarily, for an application scenario where the preset color card is a 24-color card, 25 centroids (24 colors plus background gray class) are randomly distributed in the initial image in the RGB color space, and the pixel RGB values ​​of all the initial images are clustered according to the spatial distance between the pixel RGB value and the 25 centroids, and finally 25 classes are obtained, and the pixels corresponding to each class.

[0104] In step S302 of some embodiments, the target class is classified as a background color. In the color restoration test scene of the present application, the target class is the 18° neutral gray class of the background, and this color accounts for the largest proportion in the initial image, so the background area can be extracted by selecting the class with the largest number of pixels.

[0105] In step S303 of some embodiments, the numerical calculation is to calculate the average value of the RGB values ​​of the pixels classified as the target class.

[0106] Steps S301 to S303 shown in the embodiment of the present application ensure that the background color can be accurately extracted and used in the color restoration test through pixel color clustering and screening, thereby providing a reliable basis for subsequent image processing and color correction.

[0107] See also Figure 4In some embodiments, step S103, i.e., performing color block edge detection on the color card area to obtain color block outline coordinate data, step S103 may include but is not limited to steps S401 to S405:

[0108] Step S401, obtaining the color value of the color card pixel in the color card area.

[0109] Step S402, determining a segmentation threshold according to the color value of the color card pixel to obtain a second color threshold.

[0110] Step S403, converting the color card area into a second intermediate image in a hue-saturation-lightness color space, and converting the second color threshold into a lightness threshold on a lightness channel, wherein the hue-saturation-lightness color space includes a lightness channel.

[0111] Step S404: binarize the second intermediate image according to the brightness threshold to obtain a brightness binarized image.

[0112] Step S405, performing contour detection on the brightness binary image to obtain color block contour coordinate data.

[0113] In step S401 of some embodiments, the color card pixel color value is the RGB value of each pixel of the color card area extracted in the above step.

[0114] In step S402 of some embodiments, the second color threshold is the black class RGB value in the color card. The calculation principle of this step is consistent with the calculation principle of the first color threshold. In the color restoration test scene of the present application, since the border and a color block of the template of the color card are both black, the pixel RGB values ​​of the color card are clustered first, and the class with the largest number of pixels is the black class. The average value of all RGB values ​​corresponding to the black class is calculated, and the obtained RGB average value is the second color threshold.

[0115] In step S403 of some embodiments, the hue, saturation, and brightness color space may be an HSV color space. The second intermediate image, i.e., the V channel image of the color card area converted from the RGB color space to the HSV color space, is as follows: Fig.14 The brightness threshold is the brightness value of the V channel in the HSV color space converted from the second color threshold.

[0116] In step S404 of some embodiments, the pixels in the second intermediate image whose brightness values ​​are greater than or equal to the brightness threshold are set to have a brightness value of 1, which is expressed as white, and the pixels whose brightness values ​​are less than the brightness threshold are set to have a brightness value of 0, which is expressed as black. The resulting image brightness binary image is as follows: Fig.15 shown.

[0117] In step S405 of some embodiments, the color block outline coordinate data may be a pixel coordinate data set of all color block edges in the color card area image. The contour detection function (find Contours) is used to obtain the closed figure outline in the brightness binary image, and the area of ​​the closed figure outline is statistically calculated, and the final color block outline coordinates are obtained by trimming the average value. Exemplarily, in the color restoration test scene of the embodiment of the present application, the color block outline is a quadrilateral, and when confirming the black class, since the black color block and the edge are both displayed as black in the brightness binary image, when detecting the color block outline, there is no way to distinguish it from other color blocks, so the outline of the black color block will not be found, and finally 23 color block outlines are found.

[0118] In steps S401 to S405 shown in the embodiment of the present application, the contour of the color block is accurately identified and extracted by performing secondary processing on the extracted color card area.

[0119] See also Figure 5 In some embodiments, step S104 may also include but is not limited to steps S501 to S505:

[0120] Step S501 , extracting pixel colors of a color card area according to the color block outline coordinate data, and obtaining a color block pixel color value of each pixel of the color block.

[0121] Step S502, calculating an average value of the color block pixel color values ​​of all pixels of the color block to obtain a color average value.

[0122] Step S503 , 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.

[0123] Step S504: if the number of outlier pixels is greater than a preset outlier number threshold, a predetermined proportion of outlier pixels are deleted, and the color values ​​of all pixels in the color block are returned to perform average calculation to obtain a color average value.

[0124] Step S505 : if the number of outlier pixels is less than or equal to a preset pixel number threshold, the color average value is determined as the color block color data.

[0125] In step S501 of some embodiments, the color block pixel color value is the RGB value of each pixel for the same color block. The color block outline coordinate data includes a set of outline coordinates of each color block, and the pixels surrounded by the same color block outline coordinates can be determined as objects for extracting RGB values.

[0126] In step S502 of some embodiments, the RGB values ​​of all pixels in the same color block are averaged to obtain an RGB average value, which is the color average value.

[0127] In step S503 of some embodiments, see Figure 6 In some embodiments, step S503 includes but is not limited to steps S601 to S602:

[0128] Step S601 , performing a difference calculation based on the color average value and the color value of each pixel to obtain a color difference value of each pixel.

[0129] Step S602: If the color difference value is greater than or equal to a preset difference threshold, the pixel is determined to be an outlier pixel.

[0130] In step S601 of some embodiments, the color difference value is the absolute value of the difference between the color average value and the RGB value of a pixel in the corresponding color block.

[0131] In step S602 of some embodiments, the preset difference threshold may be 100, and the tester may modify it according to the test needs. The embodiment of the present application does not strictly limit the specific value of the preset difference threshold. Outlier pixels are pixels whose RGB values ​​differ too much from the RGB average value.

[0132] In the step S601 to step S602 shown in the embodiment of the present application, outlier pixels in the color block are identified by calculating the difference between the pixel and the color average value of the color block, thereby improving the accuracy of the color average value of the color block and providing a more reliable data basis for subsequent color reproduction testing and color difference analysis.

[0133] In step S504 of some embodiments, the preset outlier number threshold may be 5% of the number of pixels of the current color block, and the predetermined ratio may also be 5%, which is not strictly limited in the embodiments of the present application. If the number of outlier pixels is greater than the preset outlier number threshold, the process returns to step S502 to recalculate the average RGB value of the current color block.

[0134] In step S505 of some embodiments, if the number of outlier pixels is less than or equal to a preset outlier number threshold, the average RGB value in S502 is directly used as the RGB value of the current color block.

[0135] Steps S501 to S505 shown in the embodiment of the present application provide a more reliable data basis for subsequent color reproduction testing and color difference analysis by improving the accuracy of the color mean of the color blocks.

[0136] See also Figure 7 In some embodiments, step S105, i.e., color filling is performed according to the color block color data and the preset color card template to obtain a reconstructed color card image, may include but is not limited to steps S701 to S702:

[0137] Step S701, filling the border area of ​​the color card template with color according to the second color threshold to obtain an intermediate color card image.

[0138] Step S702, color filling is performed 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.

[0139] In step S701 of some embodiments, for example, the color card template may be an image with a size of 1920px*1280px and an array of 24 color blocks with a size of 240px*240px, wherein the starting pixel coordinates of the first color block are (50,50), and the interval between adjacent color blocks is 50px. The border area is filled with the black RGB value, i.e., the second color threshold. In this embodiment, the black color block also needs to be filled with color according to the black RGB value to obtain an intermediate color card image. At this time, the other color blocks of the intermediate color card image except the black color block have not been filled with color.

[0140] In step S702 of some embodiments, the 23 color block color data obtained in the above steps are sequentially filled into the intermediate color card image to finally obtain a reconstructed color card image, such as Fig.16 shown.

[0141] In steps S701 to S702 shown in the embodiment of the present application, a color card can be generated quickly and efficiently by extracting colors from a color card image and then directly filling the colors into a preset color card template.

[0142] In step S106 of some embodiments, the color data of the preset color card may be color data widely used in the industry, such as the standard value of the Xrite 24 color card. The color index parameters may be color difference, saturation level, and white balance error data, etc. The reconstructed color card image may be input into a professional image processing software program (such as Imatest, which is widely used in scientific research, industrial inspection, medical imaging, and other fields, and iQ-Ana lyzer) to calculate and output the color difference values, saturation, color difference including brightness, color difference after calibrating saturation, and color difference after not calibrating saturation.

[0143] See also Figure 8 The embodiment of the present application further provides a color reproduction test device for a wide-angle lens, which can implement the color reproduction test method for a wide-angle lens, and the device includes:

[0144] The acquisition module is used to obtain an initial image of a preset color card acquired by a wide-angle lens.

[0145] The color card extraction module is used to extract the color card area from the initial image.

[0146] The color block contour detection module is used to perform color block edge detection on the color card area to obtain color block contour coordinate data.

[0147] The color extraction module is used to extract the color of the color card area according to the color block outline coordinate data to obtain the color data of the color block.

[0148] The color card reconstruction module is used to perform color filling according to the color data of the color block and the preset color card template to obtain a reconstructed color card image.

[0149] The parameter determination module is used to perform 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 ability of the wide-angle lens according to the color index parameters.

[0150] The specific implementation of the color reproduction testing device for a wide-angle lens is substantially the same as the specific implementation of the color reproduction testing method for a wide-angle lens described above, and will not be described in detail herein.

[0151] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the color reproduction test method of the wide-angle lens when executing the computer program. The electronic device can be any smart terminal including a tablet computer, a car computer, etc.

[0152] See also Fig. 9 , Fig. 9 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:

[0153] The processor 901 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.

[0154] The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 902, and the processor 901 calls and executes the color reproduction test method of the wide-angle lens in the embodiment of this application;

[0155] Input / output interface 903, used to implement information input and output;

[0156] Communication interface 904, used to realize communication interaction between the device and other devices, which can be realized through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WI FI, Bluetooth, etc.);

[0157] A bus 905 that transmits information between various components of the device (e.g., the processor 901, the memory 902, the input / output interface 903, and the communication interface 904);

[0158] The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .

[0159] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the color reproduction test method of the wide-angle lens is implemented.

[0160] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0161] The color reproduction test method and device, electronic device and storage medium of a wide-angle lens provided in the embodiments of the present application obtain an initial color card image taken by a wide-angle lens and extract the color card area. Then, the outline of the color block is identified by edge detection, and color extraction is performed based on these outline data to obtain the color information of the color block. Next, the color is filled using the extracted color data and a preset color card template to reconstruct the color card image. Finally, by comparing the reconstructed color card image with the color data of the preset color card, the color index parameters are calculated to evaluate the color reproduction ability of the wide-angle lens. Compared with the existing test methods, this method does not need to perform distortion correction on the image captured by the wide-angle lens, but directly generates a reconstructed color card image based on the captured image, thereby improving the efficiency of the color reproduction test.

[0162] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0163] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0164] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0165] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0166] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0167] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0168] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0169] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple 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.

[0170] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0171] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ReadOnly Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.

[0172] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.

Claims

1. A color reproduction test method for a wide-angle lens, characterized in that: The method comprises: Acquire an initial image of a preset color card captured by a wide-angle lens; Extracting a color card area from the initial image; Performing color block edge detection on the color card area to obtain color block outline coordinate data; Performing color extraction on the color card area according to the color block outline coordinate data to obtain color block color data; Performing color filling according to the color block color data and a preset color card template to obtain a reconstructed color card image; Index calculation is performed 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.

2. The method according to claim 1, characterized in that The step of extracting a color card area from the initial image comprises: Obtaining an initial pixel color value of the initial image; Determine 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 includes the luminance channel; Binarize the first intermediate image according to the brightness threshold to obtain a brightness binarized image; Performing contour detection on the brightness binary image to obtain target contour coordinate data; The initial image is cropped based on the target contour coordinate data to obtain the color card area.

3. The method according to claim 2, characterized in that The step of determining the segmentation threshold according to the initial pixel color value to obtain a first color threshold comprises: Performing pixel color clustering on the initial pixel color value to obtain first color clustering data, wherein the first color clustering data includes a color value of each pixel corresponding to each class; Filtering out a target class and a color value of each pixel corresponding to the target class from the first color clustering data based on the number of pixels corresponding to each class; The first color threshold is obtained by performing numerical calculation according to the color value of the pixel corresponding to the target class.

4. The method according to claim 1, characterized in that The color block edge detection is performed on the color card area to obtain the color block outline coordinate data, including: Obtain the color value of the color card pixel in the color card area; Determine the segmentation threshold according to the color value of the color card pixel to obtain a second color threshold; Converting the color card area into a second intermediate image in a hue-saturation-lightness color space, and converting the second color threshold into a lightness threshold on a lightness channel; wherein the hue-saturation-lightness color space includes the lightness channel; Binarize the second intermediate image according to the brightness threshold to obtain a brightness binary image; Contour detection is performed on the brightness binary image to obtain the colour block contour coordinate data.

5. The method according to claim 4, characterized in that The color filling is performed according to the color block color data and a preset color card template to obtain a reconstructed color card image, including: Filling the border area of ​​the color card template with color according to the second color threshold to obtain an intermediate color card image; The color block area of ​​the intermediate color card image is filled with color according to the color block color data to obtain the reconstructed color card image.

6. The method according to claim 4, characterized in that The step of performing color extraction on the color card area according to the color block outline coordinate data to obtain color block color data includes: Perform pixel color extraction on the color card area according to the color block outline coordinate data to obtain a color block pixel color value of each pixel of the color block; Calculate the average value of the color block pixel color values ​​of all pixels of the color block to obtain a color average value; 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; If the number of the outlier pixels is greater than a preset outlier number threshold, a predetermined proportion of the outlier pixels are deleted, and the color values ​​of all pixels of the color block are returned to perform average calculation to obtain a color average value; If the number of the outlier pixels is less than or equal to a preset pixel number threshold, the color average value is determined as the color block color data.

7. The method according to claim 6, characterized in that The step of 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 comprises: Performing a difference calculation based on the color average value and the color value of each pixel to obtain a color difference value of each pixel; If the color difference value is greater than or equal to a preset difference threshold, the pixel is determined to be the outlier pixel.

8. A color reproduction test device for a wide-angle lens, characterized in that: The device comprises: A collection module, the collection module is used to obtain an initial image of a preset color card collected by a wide-angle lens; A color card extraction module, the color card extraction module is used to extract a color card area from the initial image; A color block contour detection module, which is used to perform color block edge detection on the color card area to obtain color block contour coordinate data; A color extraction module, the color extraction module is used to extract the color of the color card area according to the color block outline coordinate data to obtain color block color data; A color card reconstruction module, the color card reconstruction module is used to perform color filling according to the color block color data and a preset color card template to obtain a reconstructed color card image; A parameter determination module is used to perform 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 ability of the wide-angle lens according to the color index parameters.

9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Method and device for detecting color card based on block matching

    CN102081802A

  • Color cast detection method and device, equipment and storage medium

    CN113840135A

  • Color card detection method and device, electronic equipment and storage medium

    CN115761270A

  • AWB and SNR image objective index automatic analysis method and device

    CN116708754A

  • Color rendition testing method and system and storage medium

    CN118175282A

Cited By

  • High-power LED color output control system and method

    CN120472828A