Image color edge quantization method, device, storage medium and program product

By determining the width and color difference of color edges in the image, quantifying the intensity of color edges in the image, the problem that color edge detection relies on subjective judgment in the prior art is solved, and a more accurate and objective evaluation of image quality is achieved.

CN117710489BActive Publication Date: 2024-12-31HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310567260.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-18
Publication Date
2024-12-31
Estimated Expiration
2043-05-18

AI Technical Summary

Technical Problem

The prior art cannot objectively quantify the intensity of color edges in images, resulting in a decline in image quality and visual experience impact, mainly because the detection method relies on subjective judgment and cannot be counted and quantified.

Method used

By obtaining the first and second chromatic aberrations of the target pixel points in the image to be quantized, the width and chromatic aberration of the color edges are determined, and weighted averages are used to quantify the intensity of the color edges according to these parameters, providing a more objective evaluation method.

Benefits of technology

The accurate quantification of the intensity of color edges in the image is achieved, the objectivity and accuracy of image quality evaluation is improved, and the weight value can be set according to different standards to meet the needs of different reviewers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117710489B_ABST
    Figure CN117710489B_ABST
Patent Text Reader

Abstract

The present application provides an image color edge quantization method, device, storage medium and program product. In the image color edge quantization method, an image to be quantized is obtained, and the image to be quantized includes a color edge. The target pixel in the image to be quantized corresponds to a first color component, a second color component and a third color component. The first color difference is the color difference of the first color component of the target pixel relative to the third color component of the target pixel, and the second color difference is the color difference of the second color component of the target pixel relative to the third color component of the target pixel. First, according to the first color difference and the second color difference of the target pixel in the image to be quantized, the width of the color edge and / or the color difference of the color edge are determined, and then according to the width of the color edge and / or the color difference of the color edge, the intensity of the color edge in the image to be quantized can be quantified more accurately, solving the problem that the intensity of the color edge in the image cannot be counted and quantified due to subjective judgment, thereby more objectively evaluating the impact of the color edge.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image color edge quantization method, device, storage medium and program product. Background Art

[0002] When an image acquisition device is shooting, the image sensor generally obtains the original image data. The original image data is processed by image signal processing algorithms to obtain the image we are familiar with.

[0003] However, when an image acquisition device is shooting, due to hardware reasons such as image sensors or algorithm reasons such as image signal processing algorithms, color fringing may appear at the junction of high-brightness areas and low-brightness areas in the image, for example, at the boundary of objects in the image. Color fringing is a kind of pseudo-color phenomenon. Once color fringing appears in an image, the image quality will be degraded, seriously affecting the visual experience.

[0004] Therefore, detecting the intensity of color fringing in an image is of great significance to the research of image acquisition equipment and image signal processing algorithms. However, related color fringing detection methods are often based on subjective judgment and cannot perform statistics and quantification on the intensity of color fringing in an image. Summary of the invention

[0005] The present application provides an image color fringing quantization method, device, storage medium and program product, which determine the intensity of the color fringing in the image to be quantized by determining the width of the color fringing and / or the color difference of the color fringing in the image to be quantized, so as to quantize the intensity of the color fringing in the image to be quantized, solve the problem that subjective judgment leads to the inability to count and quantify the intensity of the color fringing in the image, and thus more objectively evaluate the impact of the color fringing.

[0006] In order to achieve the above objectives, this application adopts the following technical solutions:

[0007] In a first aspect, a method for quantizing color fringes of an image is provided. First, an image to be quantized is obtained, wherein the image to be quantized includes color fringes. Secondly, the width of the color fringes and / or the color difference of the color fringes are determined according to the first color difference and the second color difference of the target pixel in the image to be quantized, wherein the target pixel corresponds to the first color component, the second color component and the third color component, the first color difference is the color difference of the first color component of the target pixel relative to the third color component of the target pixel, and the second color difference is the color difference of the second color component of the target pixel relative to the third color component of the target pixel. Finally, according to the width of the color fringes and / or the color difference of the color fringes, the intensity of the color fringes in the image to be quantized is determined.

[0008] Based on the above technical solution, an image to be quantized is obtained, and the image to be quantized includes color fringes. The target pixel in the image to be quantized corresponds to three color components, namely the first color component, the second color component and the third color component. The first color difference is the color difference of the first color component of the target pixel relative to the third color component of the target pixel, and the second color difference is the color difference of the second color component of the target pixel relative to the third color component of the target pixel. In this embodiment, the width of the color fringes and / or the color difference of the color fringes are first determined according to the first color difference and the second color difference of the target pixel in the image to be quantized; then, the intensity of the color fringes in the image to be quantified is quantified according to the width of the color fringes and / or the color difference of the color fringes, so as to solve the problem that the intensity of the color fringes in the image cannot be counted and quantified due to subjective judgment, thereby more objectively evaluating the impact of the color fringes.

[0009] In a possible implementation of the first aspect, determining the intensity of the color edge in the image to be quantized based on the width of the color edge and the color difference of the color edge includes: performing weighted averaging based on the width of the color edge, the color difference of the color edge, a first weight value preset corresponding to the width of the color edge, and a second weight value preset corresponding to the color difference of the color edge to obtain a target value, wherein the target value represents the intensity of the color edge in the image to be quantized.

[0010] Based on the above technical solution, the first weight value and the second weight value can be set by the evaluator. For example, the first weight value can be set equal to the second weight value; if the evaluator is more concerned about the width of the color edge, the first weight value can be set to be greater than the second weight value; if the evaluator is more concerned about the color difference of the color edge, the second weight value can be set to be greater than the first weight value. Different evaluators can set the first weight value and the second weight value according to different standards, which is conducive to different evaluators quantifying the intensity of the color edge according to different standards.

[0011] In a possible implementation of the first aspect, the determining the width of the color edge according to the first color difference and the second color difference of the target pixel in the image to be quantized includes: determining the number of target pixels whose first color difference is greater than a first preset color difference threshold and whose second color difference is greater than a second preset color difference threshold according to the first color difference and the second color difference of the target pixel in the image to be quantized; determining the width of the color edge according to the number of target pixels whose first color difference is greater than the first preset color difference threshold and whose second color difference is greater than the second preset color difference threshold. Based on the above technical solution, the width of the color edge can be accurately calculated.

[0012] In a possible implementation of the first aspect, determining the color difference of the color edge according to the first color difference and the second color difference of the target pixel in the image to be quantized includes: determining the maximum value of the first color difference and the maximum value of the second color difference of multiple target pixels in the image to be quantized; and determining the color difference of the color edge according to the maximum value of the first color difference and the maximum value of the second color difference. Based on the above technical solution, the color difference of the color edge can be accurately calculated.

[0013] In a possible implementation of the first aspect, determining the color difference of the color fringing according to the maximum value of the first color difference and the maximum value of the second color difference includes: calculating an average value of the maximum value of the first color difference and the maximum value of the second color difference; and determining the color difference of the color fringing according to the average value. Based on the above technical solution, the color difference of the color fringing can be accurately calculated.

[0014] In a possible implementation of the first aspect, the image to be quantized includes N rows and M columns of target pixels, where N and M are both integers greater than or equal to 2; before determining the width of the color edge and / or the color difference of the color edge according to the first color difference and the second color difference of the target pixel in the image to be quantized, it also includes: weighted averaging the first color component, the second color component and the third color component of each row or column of the target pixel in the image to be quantized with a preset weight coefficient, respectively, to obtain the weighted average first color component, the weighted average second color component and the weighted average third color component corresponding to each row or column of the target pixel; determining the first color difference and the second color difference of each row or column of the target pixel according to the weighted average first color component, the weighted average second color component and the weighted average third color component corresponding to each row or column of the target pixel.

[0015] Based on the above technical solution, in this embodiment, weighted averaging is performed on the three color components of each row or column of target pixels according to preset weight coefficients to eliminate random errors, such as noise images during electronic component measurement.

[0016] In a possible implementation of the first aspect, the first color difference and the second color difference of each row or column of target pixels are determined based on the weighted average of the first color component, the weighted average of the second color component, and the weighted average of the third color component corresponding to each row or column of target pixels, including: normalizing the difference between the weighted average of the first color component and the weighted average of the third color component corresponding to each row or column of target pixels to obtain the first color difference of each row or column of target pixels; normalizing the difference between the weighted average of the second color component and the weighted average of the third color component corresponding to each row or column of target pixels to obtain the second color difference of each row or column of target pixels.

[0017] Since the image to be quantized in the present application can be a RAW format image directly captured by an image sensor (the file extension of the RAW format image is such as: .raw, .DNG, .arw, etc.), it can also be a JPG or JPEG format image obtained after being processed by an image signal processing algorithm (the file extension of the JPG or JPEG format image is such as: .jpg, .jpeg, etc.), the number of bits of data in the RAW format image is generally 10 bits, 12 bits or 14 bits, etc., while the number of bits of data in the JPG or JPEG format image is generally 8 bits. In this embodiment, after the difference is normalized, the first color difference and the second color difference finally calculated for the image in any format are within the same value range, which facilitates the comparison between images in different formats.

[0018] In a possible implementation manner of the first aspect, the color of the color edge is purple; the first color component is a red component, the second color component is a blue component, and the third color component is a green component.

[0019] Based on the above technical solution, the color of the color edge is generally purple. The color edge is purple because the red and blue components deviate more significantly than the green component. When the color of the color edge is purple, the green component is selected as the third color component, that is, the third color component is determined in combination with the generation principle of the color edge. The width and / or color difference obtained subsequently based on the first color difference and the second color difference can accurately characterize the width and / or color difference of the color edge.

[0020] In a possible implementation manner of the first aspect, the image to be quantized further includes a highlight area and a low-brightness area, and a brightness difference between a target pixel in the highlight area and a target pixel in the low-brightness area is greater than a preset brightness difference.

[0021] Based on the above technical solution, since the color edge is generally located at the junction of the highlight area and the low-brightness area in the image, the image to be quantized also includes the highlight area and the low-brightness area to ensure that the width of the color edge in the image to be quantized is complete, thereby improving the accuracy of the calculation result of the width of the color edge.

[0022] In a possible implementation manner of the first aspect, the image to be quantized is a partial image in a target image.

[0023] Based on the above technical solution, the entire image can be used as the target image, and the partial area including the color edge in the target image can be used as the image to be quantized, thereby improving the processing speed of the color edge in the quantized image.

[0024] In a second aspect, an image color fringing quantization device is provided, comprising: an acquisition module, used to acquire an image to be quantized, wherein the image to be quantized includes a color fringing; a processing module, used to determine the width of the color fringing and / or the color difference of the color fringing according to a first color difference and a second color difference of a target pixel in the image to be quantized, wherein the target pixel corresponds to a first color component, a second color component and a third color component, the first color difference is the color difference of the first color component of the target pixel relative to the third color component of the target pixel, and the second color difference is the color difference of the second color component of the target pixel relative to the third color component of the target pixel; the processing module is also used to determine the intensity of the color fringing in the image to be quantized according to the width of the color fringing and / or the color difference of the color fringing.

[0025] Based on the above technical solution, an acquisition module is used to acquire an image to be quantified, which includes a color edge. The target pixel in the image to be quantified corresponds to three color components, namely the first color component, the second color component and the third color component. The first color difference is the color difference of the first color component of the target pixel relative to the third color component of the target pixel, and the second color difference is the color difference of the second color component of the target pixel relative to the third color component of the target pixel. In this embodiment, the processing module is used to determine the width of the color edge and / or the color difference of the color edge according to the first color difference and the second color difference of the target pixel in the image to be quantified; the processing module is also used to quantify the intensity of the color edge in the image to be quantified according to the width of the color edge and / or the color difference of the color edge, so as to solve the problem that the intensity of the color edge in the image cannot be counted and quantified due to subjective judgment, so as to more objectively evaluate the impact of the color edge.

[0026] In a possible implementation of the second aspect, the processing module is specifically used to obtain a target value by performing weighted averaging based on the width of the color edge, the color difference of the color edge, a pre-set first weight value corresponding to the width of the color edge, and a pre-set second weight value corresponding to the color difference of the color edge, wherein the target value represents the intensity of the color edge in the image to be quantized.

[0027] Based on the above technical solution, the first weight value and the second weight value can be set by the evaluator. For example, the first weight value can be set equal to the second weight value; if the evaluator is more concerned about the width of the color edge, the first weight value can be set to be greater than the second weight value; if the evaluator is more concerned about the color difference of the color edge, the second weight value can be set to be greater than the first weight value. Different evaluators set the first weight value and the second weight value according to different standards, which is conducive to different evaluators quantifying the intensity of the color edge according to different standards.

[0028] In a possible implementation of the second aspect, the processing module is specifically used to determine the number of target pixel points whose first color difference is greater than a first preset color difference threshold and whose second color difference is greater than a second preset color difference threshold according to the first color difference and the second color difference of the target pixel point in the image to be quantized; and is specifically used to determine the width of the color edge according to the number of target pixel points whose first color difference is greater than the first preset color difference threshold and whose second color difference is greater than the second preset color difference threshold. Based on the above technical solution, the width of the color edge can be accurately calculated.

[0029] In a possible implementation of the second aspect, the processing module is specifically configured to determine a maximum value of a first color difference and a maximum value of a second color difference of a plurality of target pixels in the image to be quantized; and is specifically configured to determine a color difference of the color edge according to the maximum value of the first color difference and the maximum value of the second color difference. Based on the above technical solution, the color difference of the color edge can be accurately calculated.

[0030] In a possible implementation of the second aspect, the processing module is specifically configured to calculate an average value of the maximum value of the first color difference and the maximum value of the second color difference; and is specifically configured to determine the color difference of the color edge according to the average value. Based on the above technical solution, the color difference of the color edge can be accurately calculated.

[0031] In a possible implementation of the second aspect, the image to be quantized includes N rows and M columns of target pixels, where N and M are both integers greater than or equal to 2; the processing module is also used to, before determining the width of the color edge and / or the color difference of the color edge based on the first color difference and the second color difference of the target pixel in the image to be quantized, weighted average the first color component, the second color component and the third color component of each row or column of the target pixel in the image to be quantized with a preset weight coefficient, to obtain the weighted average first color component, the weighted average second color component and the weighted average third color component corresponding to each row or column of the target pixel; and is also used to determine the first color difference and the second color difference of each row or column of the target pixel based on the weighted average first color component, the weighted average second color component and the weighted average third color component corresponding to each row or column of the target pixel.

[0032] Based on the above technical solution, in this embodiment, the three color components of each row or column of target pixels are weighted averaged according to the preset weight coefficients to eliminate random errors, such as noise images when measuring electronic components.

[0033] In a possible implementation of the second aspect, the processing module is specifically used to normalize the difference between the weighted average of the first color component and the weighted average of the third color component corresponding to each row or column of target pixels to obtain a first color difference corresponding to each row or column of target pixels; and is specifically used to normalize the difference between the weighted average of the second color component and the weighted average of the third color component corresponding to each row or column of target pixels to obtain a second color difference corresponding to each row or column of target pixels.

[0034] Since the image to be quantized in the present application can be a RAW format image directly captured by an image sensor (the file extension of the RAW format image is such as: .raw, .DNG, .arw, etc.), it can also be a JPG or JPEG format image obtained after being processed by an image signal processing algorithm (the file extension of the JPG or JPEG format image is such as: .jpg, .jpeg, etc.), the number of bits of data in the RAW format image is generally 10 bits, 12 bits or 14 bits, etc., while the number of bits of data in the JPG or JPEG format image is generally 8 bits. In this embodiment, after the difference is normalized, the first color difference and the second color difference finally calculated for the image in any format are within the same value range, which facilitates the comparison between images in different formats.

[0035] In a possible implementation manner of the second aspect, the color of the color edge is purple; the first color component is a red component, the second color component is a blue component, and the third color component is a green component.

[0036] Based on the above technical solution, the color of the color edge is generally purple. The color edge is purple because the red and blue components deviate more significantly than the green component. When the color of the color edge is purple, the green component is selected as the third color component, that is, the third color component is determined in combination with the generation principle of the color edge. The width and / or color difference obtained subsequently based on the first color difference and the second color difference can accurately characterize the width and / or color difference of the color edge.

[0037] In a possible implementation manner of the second aspect, the image to be quantized further includes a highlight area and a low-brightness area, and a brightness difference between a target pixel in the highlight area and a target pixel in the low-brightness area is greater than a preset brightness difference.

[0038] Based on the above technical solution, since the color edge is generally located at the junction of the highlight area and the low-brightness area in the image, the image to be quantized also includes the highlight area and the low-brightness area to ensure that the width of the color edge in the image to be quantized is complete, thereby improving the accuracy of the calculation result of the width of the color edge.

[0039] In a possible implementation manner of the second aspect, the image to be quantized is a partial image in a target image.

[0040] Based on the above technical solution, the entire image can be used as the target image, and the partial area including the color edge in the target image can be used as the image to be quantized, thereby improving the processing speed of the color edge in the quantized image.

[0041] In a third aspect, an image color edge quantization device is provided, the device comprising a memory and a processor, the memory being used to store instructions, and when the instructions are executed by the processor, the image color edge quantization device executes the image color edge quantization method in the first aspect or any possible implementation of the first aspect.

[0042] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed, the image color edge quantization method in the first aspect or any possible implementation method of the first aspect is implemented.

[0043] In a fifth aspect, a computer program product is provided, comprising: a computer program code, which, when executed on a computer, enables the computer to execute the image color edge quantization method in the first aspect or any possible implementation of the first aspect.

[0044] Based on the implementations provided in the above aspects, this application can also be further combined to provide more implementations. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 is an exemplary flow chart of the first aspect of the image color edge quantization method provided by the embodiment of the present application;

[0046] Figure 2 It is a schematic diagram of image color edge provided by an embodiment of the present application;

[0047] Figure 3 The embodiment of this application provides Figure 1 A specific exemplary flow chart of step 130;

[0048] Figure 4 It is a curve diagram provided in an embodiment of the present application showing the three color components after weighted averaging in the same coordinate system;

[0049] Figure 5 is a graph provided in an embodiment of the present application showing the first color difference and the second color difference in the same coordinate system;

[0050] Figure 6 is a structural schematic diagram of an image color edge quantization device according to a second aspect provided by an embodiment of the present application;

[0051] Figure 7 It is a structural schematic diagram of the image color edge quantization device according to the third aspect provided in an embodiment of the present application. DETAILED DESCRIPTION

[0052] The technical solution in this application will be described below in conjunction with the accompanying drawings.

[0053] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or. For example, A / B can mean A or B. The “and / or” in this article is merely a way to describe the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0054] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.

[0055] The principle of image capture is as follows: first, an image sensor, such as a complementary metal-oxide-semiconductor (CMOS) or a charge-coupled device (CCD), is used to convert the captured light source signal into a raw data image of a digital signal. At this time, the raw data image obtained is a RAW format image (the file extension of the RAW format image is, for example: .raw, .DNG,

[0056] .arw, etc.); after that, the RAW format image output by the front-end image sensor will be processed by the image signal processing algorithm to obtain the commonly used JPG or JPEG format image (the file extension of JPG or JPEG format image is: .jpg, .jpeg, etc.).

[0057] Color fringing is a false color phenomenon that occurs at the junction of high-brightness and low-brightness areas of an image due to hardware reasons such as image sensors or algorithmic reasons such as image signal processing algorithms when the image acquisition device is shooting. Color fringing generally appears at the boundaries of objects. The appearance of color fringing leads to a decrease in image quality and seriously affects the visual experience. However, related color fringing detection methods are often based on subjective judgment and are unable to count and quantify the color fringing of images.

[0058] In view of this, an embodiment of the present application provides an image color edge quantization method, obtaining an image to be quantized, wherein the image to be quantized includes a color edge. The target pixel in the image to be quantized corresponds to three color components, namely, a first color component, a second color component and a third color component, the first color difference is the color difference of the first color component of the target pixel relative to the third color component of the target pixel, and the second color difference is the color difference of the second color component of the target pixel relative to the third color component of the target pixel. In this embodiment, the width of the color edge and / or the color difference of the color edge are first determined according to the first color difference and the second color difference of the target pixel in the image to be quantized; then, the intensity of the color edge in the image to be quantified is quantified according to the width of the color edge and / or the color difference of the color edge, so as to solve the problem that the intensity of the color edge in the image cannot be counted and quantified due to subjective judgment, thereby more objectively evaluating the impact of the color edge.

[0059] The following is a detailed description of an image color edge quantization method provided by an embodiment of the present application in conjunction with the accompanying drawings. Figure 1 The figure is an exemplary flow chart of the method for quantizing image color edges.

[0060] Step 110: Obtain an image to be quantized, where the image to be quantized includes a color edge.

[0061] The image to be quantized in the present application may be an original data image, that is, a RAW format image, or may be an image in a commonly used format such as JPG or JPEG obtained after being processed by an image signal processing algorithm.

[0062] The implementation of step 110 in the present application is not limited, and any method that can obtain the image to be quantified can be used as the implementation of step 110. In a possible implementation, the image to be quantified can be obtained by reading or receiving; in a possible implementation, the image to be quantified can be obtained by active shooting or other active acquisition methods.

[0063] like Figure 2 In the image shown, the dotted line area is the color edge area. Figure 2 The area where the middle color edge is located is in the shape of a square ring. It can be understood that Figure 2 The color edge area is only shown for illustration. The actual shape of the color edge varies depending on the shape of the object boundary.

[0064] It is possible to Figure 2 The entire image shown is used as the image to be quantized. Figure 2 The entire image shown in FIG. 1 is taken as the target image, and the partial area including the color edge in the target image is taken as the image to be quantized. For example, Figure 2 The region of interest (ROI) shown in the solid line box is used as the image to be quantified. For example, Figure 2 The ROI1 or ROI2 shown in the solid line frame is used as the image to be quantized, wherein w is the wide side of the ROI area, and h is the long side of the ROI area.

[0065] In one implementation, the image to be quantized also includes a highlight area and a low-brightness area, and the brightness difference between the target pixel point in the highlight area and the target pixel point in the low-brightness area is greater than a preset brightness difference, which can be set by the evaluator according to actual conditions.

[0066] like Figure 2 As shown, the image to be quantized is shown in the solid-line frame ROI1 or ROI2. It can be seen that the solid-line frame includes not only the color edge, but also includes part of the highlight area adjacent to the color edge and part of the low-brightness area adjacent to the color edge. The purpose of this is to ensure that the width of the color edge included in the image to be quantized (i.e., d) is complete. If the solid-line frame does not include the highlight area and the low-brightness area, the width of the color edge may be incomplete. This situation will affect the accuracy of the calculation result of the width of the color edge, thereby affecting the accuracy of the quantization result of the intensity of the color edge.

[0067] It can be seen that in this application Figure 2This is only an example for explaining the image to be quantized and is not intended to limit the content of the image to be quantized. In actual applications, the image to be quantized may include the sky, trees, etc. in a natural environment. In addition, the image to be quantized may not include highlight areas and / or low-brightness areas.

[0068] In the present application, the ROI region can be determined in the target image as the image to be quantified in the following manner.

[0069] Method 1: After obtaining the target image, the evaluator observes the area where the color edge is located in the target image with the naked eye, and uses the pre-selected box to frame the ROI area in the target image as the image to be quantified. When framing the ROI area as the image to be quantified, the evaluator can also include some of the highlight areas and some of the low-brightness areas on both sides of the color edge to ensure that the width of the color edge included in the image to be quantified is complete.

[0070] Method 2: Use the trained neural network to frame the ROI area in the target image as the image to be quantified.

[0071] Method 3: Pre-detection can be performed on the area where the color edge in the image to be quantized is located. After the area where the color edge in the target image is located is determined by pre-detection, the ROI area containing the area where the color edge is located is framed in the target image as the image to be quantized. It can be realized by obtaining the brightness of the pixels on both sides of the area where the color edge is located, comparing the brightness difference of the pixels on both sides with the preset brightness difference, and the pixels on both sides that meet the brightness difference greater than the preset brightness difference are determined to be pixels in the highlight area or the low-brightness area. At this time, the ROI area can be framed in the target image as the image to be quantized based on the pixels found to be in the highlight area or the low-brightness area.

[0072] Step 120: Obtain a first color component, a second color component, and a third color component of a target pixel in the image to be quantized.

[0073] In this embodiment, the ROI area in the target image is used as the image to be quantized, and the target pixel point is the pixel point in the ROI area, and is also the pixel point in the image to be quantized. Each single color channel of the target pixel point in the RGB color space in the image to be quantized corresponds to a pixel grayscale value. For example, the pixel grayscale value of a certain target pixel point is: R (red) 80, G (green) 90, B (blue) 130, and different pixel grayscale values ​​are expressed as the brightness of the corresponding color. The three color components in this application refer to the pixel grayscale values ​​corresponding to the three color channels in the RGB color space of the target pixel point in the image to be quantized, that is, the brightness values ​​corresponding to the three color channels.

[0074] Step 130: Determine a first color difference and a second color difference of the target pixel according to the first color component, the second color component and the third color component of the target pixel.

[0075] Realistically, the target pixels in the image to be quantized can be in a single row and multiple columns, multiple rows and a single column, or multiple rows and multiple columns. The more target pixels in the image to be quantized, the less the calculation result is affected by random errors.

[0076] In this application, the processing method of multiple rows and columns of target pixels is used as an example. Figure 3 for Figure 1 Further description of step 130 is provided below in conjunction with the attached Figure 3 Step 130 is described in detail:

[0077] Step 1301: perform weighted averaging on the first color component, the second color component and the third color component of each row or column of target pixels in the image to be quantized with preset weight coefficients, respectively, to obtain the weighted average first color component, the weighted average second color component and the weighted average third color component corresponding to each row or column of target pixels.

[0078] For example, Figure 2 In the figure, ROI2 is used as an example of the image to be quantized. When the first color component, the second color component and the third color component of each row of target pixels in the image to be quantized are weighted averaged with the pre-set weight coefficients, the weight coefficient can be set for this row of target pixels according to the color depth of the color edge. For example, in places where the color of the color edge is darker, the weight coefficient of the target pixel can be set larger, and in places where the color of the color edge is lighter, the weight coefficient of the target pixel can be set smaller.

[0079] from Figure 2 It can be seen that in the row (i.e., h direction), the color of the color edge at the middle target pixel position is darker, while the color of the color edge at the target pixel positions on both sides is lighter. Therefore, the weight coefficient set for the middle target pixel is larger, while the weight coefficient set for the target pixel points on both sides is smaller. For example: a row of the image to be quantized includes 10 target pixels, and the weight coefficients corresponding to each target pixel from left to right can be: 0, 0, 0, 0.15, 0.2, 0.3, 0.3, 0.05, 0, 0.

[0080] Realistically, for target pixels in the row direction (i.e., the h direction), the weight coefficient corresponding to a certain target pixel point can be applied to other target pixels in the column where the target pixel point is located. In other words, a weight coefficient can be set for a column of target pixels. Compared with setting a weight coefficient for each target pixel point, this method of setting a weight coefficient for a column of target pixels is simpler.

[0081] For example, the image to be quantized includes 10 rows and 10 columns of target pixels. The weight coefficients corresponding to the target pixels in the first row from left to right are: 0, 0, 0, 0.15, 0.2, 0.3, 0.3, 0.05, 0, 0. In this case, the weight coefficients of the target pixels in the first three columns can all be 0, the weight coefficients of the target pixels in the fourth column can all be 0.15, the weight coefficients of the target pixels in the fifth column can all be 0.2, and so on.

[0082] In this embodiment, by setting a weight coefficient for each row of target pixels in the image to be quantized and performing weighted averaging on the three color components of each row of target pixels according to the weight coefficient, random errors such as noise images during measurement of electronic components can be eliminated.

[0083] For example, Figure 2 In the figure, ROI1 is used as an example of the image to be quantized. When the first color component, the second color component and the third color component of each column of target pixels in the image to be quantized are weighted averaged with the preset weight coefficients, the weight coefficients can be set for the target pixels in this column according to the color depth of the color edge. For example, in places where the color of the color edge is darker, the weight coefficient of the target pixel can be set larger, and in places where the color of the color edge is lighter, the weight coefficient of the target pixel can be set smaller.

[0084] from Figure 2 It can be seen that in the column (i.e., h direction), the color of the color edge at the middle target pixel position is darker, while the color of the color edge at the target pixel positions on both sides is lighter. Therefore, the weight value set for the middle target pixel is larger, while the weight value set for the target pixel points on both sides is smaller. For example: a column of the image to be quantized includes 10 target pixels, and the weight coefficients corresponding to each target pixel from bottom to top can be: 0, 0, 0, 0.15, 0.2, 0.3, 0.3, 0.05, 0, 0.

[0085] Realistically, for target pixels in the column direction (i.e., the h direction), the weight coefficient corresponding to a certain target pixel point can be applied to other target pixels in the row where the target pixel point is located. In other words, a weight coefficient can be set for a row of target pixels. Compared with setting a weight coefficient for each target pixel point, this method of setting a weight coefficient for a row of target pixels is simpler.

[0086] For example: the image to be quantized includes 10 rows and 10 columns of target pixels. The corresponding weight coefficients of the first column of target pixels from bottom to top are: 0, 0, 0, 0.15, 0.2, 0.3, 0.3, 0.05, 0, 0. In this case, the weight coefficients of the target pixels in the first three rows can all be 0, the weight coefficients of the target pixels in the fourth row can all be 0.15, the weight coefficients of the target pixels in the fifth row can all be 0.2, and so on.

[0087] In this embodiment, by setting a weight coefficient for each column of target pixels in the image to be quantized and performing weighted averaging on the three color components of each column of target pixels according to the weight coefficient, random errors such as noise images during measurement of electronic components can be eliminated.

[0088] In one implementation, the weight coefficients of the target pixels corresponding to the three color components may be the same or different.

[0089] To Figure 2 In the figure, ROI1 is used as an example of the image to be quantized. Assuming that the weight coefficients of the target pixels corresponding to the three color components are the same, taking a column of the image to be quantized including 10 target pixels as an example, the weight coefficients of the target pixels from bottom to top corresponding to the three color components may all be: 0, 0, 0, 0.15, 0.2, 0.3, 0.3, 0.05, 0, 0.

[0090] Assuming that the weight coefficients of the target pixels corresponding to the three color components are different, taking a column in the image to be quantized including 10 target pixels as an example, the weight coefficients of the target pixels from bottom to top corresponding to the first color component may be: 0, 0, 0.05, 0.15, 0.2, 0.25, 0.3, 0.05, 0, 0; the weight coefficients of the target pixels from bottom to top corresponding to the second color component may be: 0, 0, 0.1, 0.15, 0.2, 0.2, 0.3, 0.05, 0, 0; the weight coefficients of the target pixels from bottom to top corresponding to the third color component may be: 0, 0, 0, 0.15, 0.2, 0.3, 0.3, 0.05, 0, 0.

[0091] Correspondingly, the arrangement in the row direction may refer to the arrangement in the column direction, which will not be described in detail here.

[0092] Step 1302: Determine the first color difference and the second color difference of each row or column of target pixels according to the weighted average first color component, the weighted average second color component and the weighted average third color component corresponding to each row or column of target pixels.

[0093] To Figure 2 Take ROI1 as an example to explain in detail:

[0094] In this embodiment, the first color difference is the color difference between the weighted average of the first color component corresponding to each column of target pixels and the weighted average of the third color component corresponding to each column of target pixels, and the second color difference is the color difference between the weighted average of the second color component corresponding to each column of target pixels and the weighted average of the third color component corresponding to each column of target pixels.

[0095] In one implementation, the first color difference and the second color difference may be values ​​obtained after normalization processing.

[0096] For example: the difference between the weighted average of the first color component corresponding to each row or column of target pixels and the weighted average of the third color component corresponding to each row or column of target pixels can be normalized, and the resulting value can be used as the first color difference; the difference between the weighted average of the second color component corresponding to each row or column of target pixels and the weighted average of the third color component can be normalized, and the resulting value can be used as the second color difference.

[0097] Alternatively, the weighted average of the first color component, the weighted average of the second color component, and the weighted average of the third color component corresponding to each row or column of target pixels may be normalized first, and then the difference between the normalized first color component and the normalized third color component may be used as the first color difference, and the difference between the normalized second color component and the normalized third color component may be used as the second color difference.

[0098] In this embodiment, the first color difference and the second color difference can be values ​​obtained after normalization processing. Regardless of the format of the image, the first color difference and the second color difference finally calculated are within the same value range, which is convenient for comparison between images of different formats. For example: the image to be quantized in the present application can be a RAW format image, or it can be a JPG or JPEG format image obtained after being processed by an image signal processing algorithm. The number of bits of data in the RAW format image is generally 10 bits, 12 bits or 14 bits, etc., while the number of bits of data in the JPG or JPEG format image is generally 8 bits. After normalization processing, the first color difference and the second color difference calculated from images with different data bits can be limited to the same value range.

[0099] The colors of the color fringes in this application are different, and the principles of their generation are also different. Color fringes are also called purple fringes. The color of the color fringes is generally purple. The color fringes are purple because the red and blue components deviate more than the green component. They can be roughly divided into two categories: blue-biased fringes and red-biased fringes. In blue-biased color fringes, there is a relationship of blue component>green component (the red component is not necessarily greater than the green component); in red-biased color fringes, there is a relationship of blue component>green component and red component>green component. The color of the color fringes may also be cyan or yellow. The color fringes are cyan because the blue and green components deviate more than the red component; the color fringes are yellow because the red and green components deviate more than the blue component.

[0100] Since the color of the color fringes is different, the principles of their generation are also different. In this embodiment, the third color component is determined in combination with the principle of color fringing generation, so that the width and / or color difference obtained based on the first color difference and the second color difference can accurately represent the width and / or color difference of the color fringes.

[0101] For example, if the color of the color edge in the image to be quantized is purple, purple with bluish color, or purple with reddish color, the green component can be selected as the third color component, the first color difference of the target pixel point is the difference between the red component and the green component, and the second color difference is the difference between the blue component and the green component; or the first color difference is the difference between the blue component and the green component, and the second color difference is the difference between the red component and the green component.

[0102] For example, if the color of the color edge in the image to be quantized is cyan, the red component is selected as the third color component, the first color difference of the target pixel is the difference between the green component and the red component, and the second color difference is the difference between the blue component and the red component; or the first color difference is the difference between the blue component and the red component, and the second color difference is the difference between the green component and the red component.

[0103] For example, if the color of the color edge in the image to be quantized is yellow, the blue component is selected as the third color component, the first color difference of the target pixel is the difference between the red component and the blue component, and the second color difference is the difference between the green component and the blue component; or the first color difference is the difference between the green component and the blue component, and the second color difference is the difference between the red component and the blue component.

[0104] The following describes in detail the calculation process of the first color difference and the second color difference, taking the case where the color edge color is purple and the third color component is a green component.

[0105] Assume that Figure 2 Here, ROI1 is used as the image to be quantized. The image to be quantized includes N rows and M columns of target pixels, where N and M are both integers greater than or equal to 2.

[0106] (1) Obtain the first color component, the second color component, and the third color component of the target pixel in the image to be quantized, and obtain a data matrix of the red R color component in the target pixel with N rows and M columns as follows:

[0107]

[0108] The data matrix of the blue B color component is as follows:

[0109]

[0110] The data matrix of the green G color component is as follows:

[0111]

[0112] Among them, (x 1 ,y 1 ) represents the coordinates of the first row and first column of the target pixel, (x N ,y M ) represents the coordinates of the target pixel at the Nth row and the Mth column.

[0113] (2) Perform weighted averaging on the three color components of each column of target pixels in the image to be quantized. Take the weighted averaging of the red component of the first column of target pixels as an example. Assuming that the preset weight coefficients of each row of target pixels are the same, and the weight coefficients of each row of target pixels corresponding to the three color components are also the same, the red component of the first column of target pixels after weighted averaging can be calculated by the following formula 1-1:

[0114]

[0115] Among them, μ 1 , μ 2 …μ N are the weights of target pixels in rows 1 to N, and μ 1 +μ 2 +…+μ N =1.

[0116] Thus, the data matrix of the red component after weighted average is as follows:

[0117]

[0118] Similarly, the data matrix of the blue component after weighted average is as follows:

[0119]

[0120] The data matrix of the green component after weighted average is as follows:

[0121]

[0122] like Figure 4 As shown, the weighted average of the first color component, the weighted average of the second color component, and the weighted average of the third color component obtained in the actual test are displayed in a curve chart in the same coordinate system, wherein the horizontal axis of the coordinate system is the position of the target pixel column, and the vertical axis is the value of the three color components after weighted averaging. Figure 4 Curve 1 in the middle is a curve formed by the weighted average red component, curve 2 is a curve formed by the weighted average blue component, and curve 3 is a curve formed by the weighted average green component.

[0123] It should be noted that Figure 4 In the figure, the three color components after weighted average are limited to the range of 0 to 100 for display, which is only for the convenience of illustration. In actual applications, the three color components after weighted average can also be directly displayed in the curve chart, and this application does not limit this.

[0124] (3) Normalizing the difference between the weighted average first color component and the weighted average third color component of each column of target pixels to obtain a first color difference corresponding to each column of target pixels. Normalizing the difference between the weighted average second color component and the weighted average third color component of each column of target pixels to obtain a second color difference corresponding to each column of target pixels.

[0125] Taking the normalization of the difference between the weighted average first color component and the weighted average third color component of the first column of target pixels as an example, the first color difference of the first column of target pixels calculated by the following formula 1-2 is:

[0126]

[0127] Thus, the data matrix L corresponding to the first color difference of each column of target pixels is R As shown below:

[0128]

[0129] Similarly, the data matrix L corresponding to the second color difference of each column of target pixels B As shown below:

[0130]

[0131] like Figure 5 As shown, it is a curve chart showing the first color difference and the second color difference in the same coordinate system in an actual test, wherein the horizontal axis of the coordinate system is the position of the pixel column, and the vertical axis is the normalized value of the difference between the other two color components and the green component. Figure 5 The middle curve 4 is a curve formed by the first color difference corresponding to each column of target pixel points, and the curve 5 is a curve formed by the second color difference corresponding to each column of target pixel points.

[0132] It should be noted that Figure 5 In the figure, the values ​​of the first color difference and the second color difference are limited to the range of 0 to 10 for display, which is only for the convenience of illustration. In actual applications, the first color difference and the second color difference can also be directly displayed in the curve chart, and this application does not limit this.

[0133] Step 140: Determine the width of the color edge and / or the color difference of the color edge based on the first color difference and the second color difference of the target pixel in the image to be quantized, wherein the target pixel corresponds to the first color component, the second color component and the third color component, the first color difference is the color difference of the first color component of the target pixel relative to the third color component of the target pixel, and the second color difference is the color difference of the second color component of the target pixel relative to the third color component of the target pixel.

[0134] Exemplarily, step 140 may be implemented in the following ways:

[0135] Method 1: Determine the width of the color edge according to the first color difference and the second color difference of the target pixel in the image to be quantized.

[0136] Specifically, based on the first color difference and the second color difference of the target pixel points in the image to be quantized, the number of target pixel points whose first color difference is greater than the first preset color difference threshold and whose second color difference is greater than the second preset color difference threshold is determined; based on the number of target pixel points whose first color difference is greater than the first preset color difference threshold and whose second color difference is greater than the second preset color difference threshold, the width of the color edge is determined.

[0137] Continue to Figure 2 ROI1 is used as an example to illustrate the image to be quantized. Assume that the first preset color difference threshold is α 1 , the number of target pixels whose first color difference is greater than the first preset color difference threshold can be determined first, that is, the width of the red color difference area can be determined. The width W of the red color difference area R It can be calculated by the following formula 1-3:

[0138]

[0139] Among them, t is the data matrix L corresponding to the first color difference of each column of target pixels. R The meaning of the signal() function is: if the calculation result in the brackets is positive, the result of signal() is 1; if the calculation result in the brackets is negative, the result of signal() is 0.

[0140] Similarly, assuming that the second preset color difference threshold is α2 , the number of target pixels whose second color difference is greater than the second preset color difference threshold can be determined first, that is, the width of the blue color difference area can be determined. The width W of the blue color difference area B It can be calculated by the following formula 1-4:

[0141]

[0142] Among them, t is the data matrix L corresponding to the second color difference of each column of target pixels. B The meaning of the signal() function is: if the calculation result in the brackets is positive, the result of signal() is 1; if the calculation result in the brackets is negative, the result of signal() is 0.

[0143] It should be noted that the values ​​of the first preset color difference threshold and the second preset color difference threshold can be the same or different, and can be set by the evaluator. When setting, the evaluator can select the minimum first color difference threshold at which a person can subjectively find a color edge as the first preset color difference threshold, and the minimum second color difference threshold as the second preset color difference threshold based on the experimental results. For example, the value of the first preset color difference threshold or the second preset color difference threshold can be 3%, 5%, etc.

[0144] The overlapping area of ​​the red color difference area and the blue color difference area is the area where the color edge is located, and the width of the color edge is the width of the overlapping area of ​​the red color difference area and the blue color difference area. Figure 5 As shown, W B The dotted area indicated is the blue color difference area obtained in the actual test, W R The indicated area is the red color difference area obtained in the actual test. The width of the overlapping area is the width of the color edge. Figure 5 As can be seen from the figure, the width W of the color edge purple The width W of the red color difference area R same.

[0145] Method 2: determining the color difference of the color edge according to the first color difference and the second color difference of the target pixel in the image to be quantized.

[0146] Specifically, the maximum value of the first color difference and the maximum value of the second color difference of multiple target pixels in the image to be quantized are determined; and the color difference of the color edge is determined according to the maximum value of the first color difference and the maximum value of the second color difference.

[0147] Determine the maximum value of the first color difference of multiple target pixels in the image to be quantized, that is, from the data matrix L of the first color difference R Find the maximum value of the first color difference ω R ; and from the data matrix L of the second color difference B Find the maximum value of the second color difference ωB , the color difference of the color edge can be determined according to the maximum value of the first color difference and the maximum value of the second color difference.

[0148] It is achievable to determine the color difference of the color edge according to the maximum value of the first color difference and the maximum value of the second color difference, including: calculating an average value of the maximum value of the first color difference and the maximum value of the second color difference, and determining the color difference of the color edge according to the average value.

[0149] Assume that the color difference of the color edge is ω purple , the color difference ω of the color edge can be calculated by the following formula 1-5 purple :

[0150] ω purple =(ω R +ω B ) / 2 (1-5)

[0151] It is feasible to determine the color difference of the color edge according to the maximum value of the first color difference and the maximum value of the second color difference, including: performing weighted average on the maximum value of the first color difference, the maximum value of the second color difference, and the pre-set weight coefficients corresponding to the first color difference and the second color difference to obtain the color difference of the color edge. Among them, the weight coefficient corresponding to the first color difference is not the same as the weight coefficient corresponding to the second color difference, and the size of the weight coefficient can be set by the evaluator. For example, it can be determined according to the color bias of the color edge. If the color of the color edge is biased towards red, the weight coefficient of the first color difference is set to be greater than the weight coefficient of the second color difference; if the color of the color edge is biased towards blue, the weight coefficient of the first color difference is set to be less than the weight coefficient of the second color difference.

[0152] Method three: determining the color difference and width of the color edge according to the first color difference and the second color difference of the target pixel in the image to be quantized.

[0153] The third method here is a combination of the first method and the second method. The width of the color edge can be determined by using the implementation method in the first method, and the color difference of the color edge can be determined by using the implementation method in the second method. It will not be repeated in this embodiment.

[0154] Step 150: Determine the intensity of the color fringing in the image to be quantized according to the width of the color fringing and / or the color difference of the color fringing.

[0155] This step corresponds to the previous step 140, and there are also three implementation methods:

[0156] Method 1, corresponding to method 1 in step 140, determines the intensity of the color fringing in the image to be quantized according to the width of the color fringing.

[0157] In this scheme, the intensity of the color edge in the image is quantified directly according to the calculated width of the color edge. The larger the width of the color edge, the stronger the intensity of the color edge.

[0158] It is feasible to set corresponding thresholds to measure the intensity of color fringing. For example, the intensity of color fringing is divided into three types: high, medium, and low. A corresponding color fringing width threshold interval is set for each type. When in the corresponding width threshold interval, the intensity of the color fringing can be determined to be high, medium, or low.

[0159] It is feasible to set the maximum score when the color fringing is the strongest to 100, and set the maximum color fringing width corresponding to the maximum score of 100. According to the actually calculated color fringing width and the maximum color fringing width corresponding to the maximum score of 100, the intensity of the color fringing is linearly scored. The intensity of the color fringing is reflected by the high and low scores, which makes it convenient to objectively evaluate the impact of the color fringing according to the results.

[0160] The above two implementations are only examples and are not intended to limit the present application. Any implementation that determines the intensity of the color fringing in the image to be quantized based on the width of the color fringing is within the protection scope of the present application.

[0161] In a possible implementation, the image to be quantized is a partial image of the target image. In this case, multiple images to be quantized of the target image can be obtained, the width of the color edge in each image to be quantized can be calculated, and the intensity of the color edge of each image to be quantized can be determined according to the width of the color edge in each image to be quantized. The intensity of the color edge in the target image can be evaluated by combining the intensity of the color edge of the multiple images to be quantized, so as to further improve the accuracy of the quantized color edge.

[0162] Method 2, corresponding to method 2 in step 140, determines the intensity of the color fringing in the image to be quantized according to the color difference of the color fringing.

[0163] In this scheme, the intensity of the color fringing in the image is quantified directly according to the calculated color difference of the color fringing. The larger the color difference of the color fringing, the stronger the intensity of the color fringing.

[0164] It is feasible to set corresponding thresholds to measure the intensity of color fringing. For example, the intensity of color fringing is divided into three types: high, medium, and low. A corresponding color difference threshold interval of color fringing is set for each type. When in the corresponding color difference threshold interval, the intensity of color fringing can be determined as high, medium, or low.

[0165] It is feasible to set the maximum score when the color fringing is the strongest to 100, and set the maximum color difference of the color fringing corresponding to the maximum score of 100. According to the color difference of the color fringing actually calculated and the maximum color difference of the color fringing corresponding to the maximum score of 100, the intensity of the color fringing is linearly scored. The intensity of the color fringing is reflected by the high and low scores, which makes it convenient to objectively evaluate the impact of the color fringing according to the results.

[0166] The above two implementations are only examples and are not intended to limit the present application. Any implementation that determines the intensity of the color fringing in the image to be quantized based on the color difference of the color fringing is within the protection scope of the present application.

[0167] In a possible implementation, the image to be quantized is a partial image of the target image. In this case, multiple images to be quantized of the target image can be obtained, the color difference of the color edge in each image to be quantized can be calculated, and the intensity of the color edge of each image to be quantized can be determined according to the color difference of the color edge in each image to be quantized. The intensity of the color edge in the target image can be evaluated by combining the intensity of the color edge of the multiple images to be quantized, so as to further improve the accuracy of the quantized color edge.

[0168] Method 3, corresponding to method 3 in step 140, determines the intensity of the color fringing in the image to be quantized based on the color difference and width of the color fringing.

[0169] It can be implemented that the intensity of the color fringing in the image to be quantized is determined based on the width of the color fringing and the color difference of the color fringing, including: taking a weighted average based on the width of the color fringing, the color difference of the color fringing, a pre-set first weight value corresponding to the width of the color fringing, and a pre-set second weight value corresponding to the color difference of the color edge to obtain a target value, wherein the target value represents the intensity of the color fringing in the image to be quantized.

[0170] Assuming that the target value representing the intensity of the color edge in the image to be quantized is represented by F, the target value F can be calculated by the following formula 1-6:

[0171] F=(W purple ×β 1 +ω purple ×β 2 ) / (β 1 + β 2 ) (1-6)

[0172] Among them, β 1 is the first weight value corresponding to the width of the color edge, β 2 is the second weight value of the color difference corresponding to the color edge.

[0173] In this application, the first weight value β 1 and the second weight value β 2 It is an adjustable parameter and can be set by the evaluator. For example: the first weight value β 1 and the second weight value β 2 can be the same; if the evaluator is more concerned about the width of the color edge, the first weight value β can be set 1 Greater than the second weight value β 2 ; If the evaluator is more concerned about the color difference of the color edge, the second weight value β can be set 2 Greater than the first weight value β 1Different evaluators set the first weight value and the second weight value according to different standards, so that different evaluators can quantify the intensity of the color edge according to different standards.

[0174] In one implementation, the image to be quantized is a partial image in the target image. In this case, multiple images to be quantized of the target image can be obtained, and the width of the color edge and the color difference of the color edge in each image to be quantized are calculated respectively to determine a target value representing the intensity of the color edge in the image to be quantized. The intensity of the color edge in the target image is comprehensively evaluated based on these multiple target values ​​to further improve the accuracy of quantizing the color edge.

[0175] It is feasible to pre-set a weight value corresponding to each image to be quantized, and perform weighted averaging of the target value corresponding to each image to be quantized and the weight value corresponding to each image to be quantized to obtain a total target value, which represents the intensity of the color edge in the target image. In the present application, the weight value corresponding to each image to be quantized can be set by the evaluator. For example, the weight value corresponding to each image to be quantized can be determined according to the position of the image to be quantized in the target image. The closer the image to be quantized is to the center of the target image, the greater the weight value.

[0176] The following is an example of a specific application scenario of the image color edge quantization method provided in this application:

[0177] Scenario 1: Used for longitudinal evaluation of images from different sources.

[0178] The shooting scenes of these images from different sources may be different. According to the image color edge quantization method provided in the present application, these images are quantized using the same threshold standard to quantify the intensity of the color edges in these images, thereby realizing a longitudinal evaluation of the intensity of the color edges in images from different sources.

[0179] Scenario 2: Used for horizontal evaluation of various image sensors.

[0180] Given a specific environment with a large contrast between light and dark, use each image sensor to capture images in the specific environment to obtain multiple RAW format images; quantize the multiple RAW format images according to the image color fringing quantization method provided in the present application, and quantify the intensity of the color fringing corresponding to each RAW format image; sort the hardware performance of the multiple image sensors according to the quantization results representing the intensity of the color fringing, so as to achieve a horizontal evaluation of the multiple image sensors.

[0181] Scenario 3: Used for factory inspection of image sensors, cameras, and other equipment.

[0182] A specific environment with a large contrast between light and dark is given, and an image in the specific environment is captured by a device under test to obtain an image of the specific environment; the image captured by the device under test is quantified according to the image color fringing quantization method provided in the present application, and the intensity of the color fringing corresponding to the device under test is quantified; the quantization result is compared with a pre-set standard value, and if it is less than or equal to the standard value, the device under test is qualified; if it is greater than the standard value, the device under test is unqualified and needs to be returned to the factory for rework.

[0183] Scenario 4: Used to determine whether the cause of obvious color fringing is hardware or algorithm-related.

[0184] Given a specific environment with a large contrast between light and dark, an image sensor is used to obtain a RAW format image in the specific environment, and a JPG or JPEG format image is obtained after the RAW format image is processed by an image signal processing algorithm. According to the image color edge quantization method provided by the present application, two formats of images are quantized respectively, and the intensity of the color edge in each format of the image is quantified. The quantization result can be compared with the corresponding pre-set standard value, and the difference between the quantization results of the two formats of the image is calculated, so as to comprehensively evaluate whether the hardware or the algorithm has a greater impact on the intensity of the color edge, and targeted improvements can be made.

[0185] It should be understood that the above examples are intended to help those skilled in the art understand the embodiments of the present application, rather than to limit the embodiments of the present application to the specific numerical values ​​or specific scenarios illustrated. Those skilled in the art can obviously make various equivalent modifications or changes based on the above examples, and such modifications or changes also fall within the scope of the embodiments of the present application.

[0186] Figure 6 An image color edge quantization device 200 provided in an embodiment of the present application includes an acquisition module 210 and a processing module 220 .

[0187] The acquisition module 210 is used to acquire an image to be quantized, wherein the image to be quantized includes a color edge. Optionally, in some embodiments, the image to be quantized is a partial image in a target image.

[0188] The processing module 220 is used to determine the width of the color edge and / or the color difference of the color edge according to the first color difference and the second color difference of the target pixel point in the image to be quantized, wherein the target pixel point corresponds to the first color component, the second color component and the third color component, the first color difference is the color difference of the first color component of the target pixel point relative to the third color component of the target pixel point, and the second color difference is the color difference of the second color component of the target pixel point relative to the third color component of the target pixel point.

[0189] The processing module 220 is further configured to determine the intensity of the color fringing in the image to be quantized according to the width of the color fringing and / or the color difference of the color fringing.

[0190] Optionally, in some embodiments, the processing module 220 is specifically used to perform weighted averaging based on the width of the color edge, the color difference of the color edge, a pre-set first weight value corresponding to the width of the color edge, and a pre-set second weight value corresponding to the color difference of the color edge to obtain a target value, wherein the target value represents the intensity of the color edge in the image to be quantized.

[0191] Optionally, in some embodiments, the processing module 220 is specifically used to determine the number of target pixel points whose first color difference is greater than a first preset color difference threshold and whose second color difference is greater than a second preset color difference threshold based on the first color difference and the second color difference of the target pixel points in the image to be quantized; and is specifically used to determine the width of the color edge based on the number of target pixel points whose first color difference is greater than the first preset color difference threshold and whose second color difference is greater than the second preset color difference threshold.

[0192] Optionally, in some embodiments, the processing module 220 is specifically used to determine the maximum value of the first color difference and the maximum value of the second color difference of multiple target pixels in the image to be quantized; and is specifically used to determine the color difference of the color edge based on the maximum value of the first color difference and the maximum value of the second color difference.

[0193] Optionally, in some embodiments, the processing module 220 is specifically configured to obtain an average value of the maximum value of the first color difference and the maximum value of the second color difference; and is specifically configured to determine the color difference of the color edge according to the average value.

[0194] Optionally, in some embodiments, the image to be quantized includes N rows and M columns of target pixels, where N and M are both integers greater than or equal to 2; the processing module 220 is also used to weighted average the first color component, the second color component and the third color component of each row or column of target pixels in the image to be quantized with a preset weight coefficient before determining the width of the color edge and / or the color difference of the color edge based on the first color difference and the second color difference of the target pixels in the image to be quantized, so as to obtain the weighted average first color component, the weighted average second color component and the weighted average third color component corresponding to each row or column of target pixels.

[0195] The processing module 220 is also used to determine the first color difference and the second color difference of each row or column of target pixels according to the weighted average first color component, the weighted average second color component and the weighted average third color component corresponding to each row or column of target pixels.

[0196] Optionally, in some embodiments, the processing module 220 is specifically used to normalize the difference between the weighted average of the first color component corresponding to each row or column of target pixels and the weighted average of the third color component to obtain a first color difference corresponding to each row or column of target pixels; and is specifically used to normalize the difference between the weighted average of the second color component corresponding to each row or column of target pixels and the weighted average of the third color component to obtain a second color difference corresponding to each row or column of target pixels.

[0197] Optionally, in some embodiments, the color of the color edge is purple; the first color component is a red component, the second color component is a blue component, and the third color component is a green component.

[0198] Optionally, in some embodiments, the image to be quantized further includes a highlight area and a low-brightness area, and the brightness difference between the target pixel point in the highlight area and the target pixel point in the low-brightness area is greater than a preset brightness difference.

[0199] The image color edge quantization device 200 of the embodiment of the present application may correspond to the image color edge quantization method described in the embodiment of the present application, and the above-mentioned and other operations and / or functions of each unit in the image color edge quantization device 200 are respectively to implement Figure 1 and Figure 3 For the sake of brevity, the corresponding process of the method in will not be repeated here.

[0200] Figure 7 3 is a schematic structural block diagram of an image color edge quantization device 300 provided in an embodiment of the present application. The image color edge quantization device 300 includes: a processor 310 , a memory 320 , a communication interface 330 , and a bus 340 .

[0201] It should be understood that Figure 7 The processor 310 in the image color edge quantization device 300 shown may correspond to Figure 6 The processing module 220 in the image color edge quantization device 200 and the communication interface 330 in the image color edge quantization device 300 may correspond to the acquisition module 210 in the image color edge quantization device 200 .

[0202] The processor 310 may be connected to a memory 320. The memory 320 may be used to store the program code and data. Therefore, the memory 320 may be a storage unit inside the processor 310, or an external storage unit independent of the processor 310, or a component including a storage unit inside the processor 310 and an external storage unit independent of the processor 310.

[0203] Optionally, the image color edge quantization device 300 may further include a bus 340. The memory 320 and the communication interface 330 may be connected to the processor 310 via the bus 340. The bus 340 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus 340 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 The fact that only one line is used in the diagram does not mean that there is only one bus or only one type of bus.

[0204] It should be understood that in the embodiment of the present application, the processor 310 may adopt a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. Alternatively, the processor 310 may adopt one or more integrated circuits to execute relevant programs to implement the technical solutions provided in the embodiment of the present application.

[0205] The memory 320 may include a read-only memory and a random access memory, and provides instructions and data to the processor 310. A portion of the processor 310 may also include a non-volatile random access memory. For example, the processor 310 may also store information on the device type.

[0206] When the image color edge quantization device is running, the processor 310 executes the computer-executable instructions in the memory 320 to use the hardware resources in the image color edge quantization device to perform the operation steps of the above-mentioned image color edge quantization method.

[0207] It should be understood that the image color edge quantization device 300 according to the embodiment of the present application may correspond to the image color edge quantization device 200 in the embodiment of the present application, and may correspond to the image color edge quantization device 200 in the embodiment of the present application. Figure 1 and Figure 3 The corresponding subjects in the method shown in the figure, and the above and other operations and / or functions of each module in the image color edge quantization device 300 are respectively to achieve Figure 1 and Figure 3 For the sake of brevity, the corresponding process of the method in will not be repeated here.

[0208] The present application also provides a computer-readable storage medium, which stores a computer program. The computer program includes program instructions. When the program instructions are executed, the image color edge quantization method provided in the embodiment of the present application is implemented.

[0209] The present application also provides a computer program product, which includes: computer program code, when the computer program code is run on a computer, the computer executes the image color edge quantization method provided by the embodiment of the present application.

[0210] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium can be a solid state drive (SSD).

[0211] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present application.

[0212] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0213] In the several embodiments provided in the embodiments of the present application, it should be understood that the disclosed systems, 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 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.

[0214] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, and 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.

[0215] 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.

[0216] If the function 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 embodiment of the present application is essentially or the part that contributes to the prior art or the 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 a number of instructions to enable a memory (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program code.

[0217] The above is only a specific implementation of the embodiment of the present application, but the protection scope of the embodiment of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed in the embodiment of the present application, which should be included in the protection scope of the embodiment of the present application. Therefore, the protection scope of the embodiment of the present application should be based on the protection scope of the claims.

Claims

1. A method for quantizing image color edges, characterized in that: The method comprises: Acquire an image to be quantized, wherein the image to be quantized includes a color edge, and the image to be quantized includes target pixel points in N rows and M columns, where N and M are both integers greater than or equal to 2; The first color component, the second color component and the third color component of each row or column of the target pixel in the image to be quantized are weighted averaged with a preset weight coefficient to obtain a weighted average first color component, a weighted average second color component and a weighted average third color component corresponding to each row or column of the target pixel; Determine a first color difference and a second color difference of each row or column of target pixels according to the weighted average first color component, the weighted average second color component, and the weighted average third color component corresponding to each row or column of target pixels, wherein the first color difference is the color difference of the first color component of the target pixel relative to the third color component of the target pixel, and the second color difference is the color difference of the second color component of the target pixel relative to the third color component of the target pixel; Determining the width of the color edge and the color difference of the color edge according to the first color difference and the second color difference of the target pixel in the image to be quantized; The step of determining the width of the color edge according to the first color difference and the second color difference of the target pixel in the image to be quantized includes: Determine, according to the first color difference and the second color difference of the target pixel in the image to be quantized, the number of target pixel points whose first color difference is greater than a first preset color difference threshold and whose second color difference is greater than a second preset color difference threshold; Determining the width of the color edge according to the number of target pixel points for which the first color difference is greater than a first preset color difference threshold and the second color difference is greater than a second preset color difference threshold; The intensity of the color fringing in the image to be quantized is determined according to the width of the color fringing and the color difference of the color fringing.

2. The image color edge quantization method according to claim 1, characterized in that: Determining the intensity of the color fringing in the image to be quantized according to the width of the color fringing and the color difference of the color fringing includes: A target value is obtained by performing weighted averaging based on the width of the color edge, the color difference of the color edge, a first weight value preset corresponding to the width of the color edge, and a second weight value preset corresponding to the color difference of the color edge, wherein the target value represents the intensity of the color edge in the image to be quantized.

3. The image color edge quantization method according to claim 1, characterized in that: The step of determining the color difference of the color edge according to the first color difference and the second color difference of the target pixel in the image to be quantized includes: Determine a maximum value of a first color difference and a maximum value of a second color difference of a plurality of target pixel points in the image to be quantized; The color difference of the color fringing is determined according to the maximum value of the first color difference and the maximum value of the second color difference.

4. The image color edge quantization method according to claim 3, characterized in that: Determining the color difference of the color edge according to the maximum value of the first color difference and the maximum value of the second color difference includes: Calculate an average value of the maximum value of the first color difference and the maximum value of the second color difference, The color difference of the color fringing is determined based on the average value.

5. The image color edge quantization method according to claim 1, characterized in that: Determining the first color difference and the second color difference of each row or column of target pixels according to the weighted average first color component, the weighted average second color component and the weighted average third color component corresponding to each row or column of target pixels includes: Normalizing the difference between the weighted average first color component and the weighted average third color component corresponding to each row or column of target pixels to obtain a first color difference corresponding to each row or column of target pixels; The difference between the weighted average second color component and the weighted average third color component corresponding to each row or column of target pixels is normalized to obtain a second color difference corresponding to each row or column of target pixels.

6. The image color edge quantization method according to any one of claims 1 to 5, characterized in that: The color of the color edge is purple; the first color component is a red component, the second color component is a blue component, and the third color component is a green component.

7. The image color edge quantization method according to any one of claims 1 to 5, characterized in that: The image to be quantized also includes a highlight area and a low-brightness area, and the brightness difference between the target pixel point in the highlight area and the target pixel point in the low-brightness area is greater than a preset brightness difference.

8. The image color edge quantization method according to any one of claims 1 to 5, characterized in that: The image to be quantized is a partial image in the target image.

9. An image color edge quantization device, characterized in that: include: An acquisition module is used to acquire an image to be quantized, wherein the image to be quantized includes a color edge, and the image to be quantized includes target pixels in N rows and M columns, where N and M are both integers greater than or equal to 2; A processing module, used for weighted averaging the first color component, the second color component and the third color component of each row or column of target pixels in the image to be quantized with a preset weight coefficient, respectively, to obtain the weighted average first color component, the weighted average second color component and the weighted average third color component corresponding to each row or column of target pixels; It is also used to determine the first color difference and the second color difference of each row or column of target pixels according to the weighted average first color component, the weighted average second color component and the weighted average third color component corresponding to each row or column of target pixels, wherein the first color difference is the color difference of the first color component of the target pixel relative to the third color component of the target pixel, and the second color difference is the color difference of the second color component of the target pixel relative to the third color component of the target pixel; It is also used to determine the width of the color edge and the color difference of the color edge according to the first color difference and the second color difference of the target pixel point in the image to be quantized; The processing module is specifically configured to determine, according to the first color difference and the second color difference of the target pixel in the image to be quantized, the number of target pixel points whose first color difference is greater than a first preset color difference threshold and whose second color difference is greater than a second preset color difference threshold; And is specifically used to determine the width of the color edge according to the number of target pixel points whose first color difference is greater than a first preset color difference threshold and whose second color difference is greater than a second preset color difference threshold; The processing module is further used to determine the intensity of the color fringing in the image to be quantized according to the width of the color fringing and the color difference of the color fringing.

10. The image color edge quantization device according to claim 9, characterized in that: The processing module is specifically used to perform weighted averaging based on the width of the color edge, the color difference of the color edge, a pre-set first weight value corresponding to the width of the color edge, and a pre-set second weight value corresponding to the color difference of the color edge to obtain a target value, wherein the target value represents the intensity of the color edge in the image to be quantized.

11. The image color edge quantization device according to claim 9, characterized in that: The processing module is specifically used to determine the maximum value of the first color difference and the maximum value of the second color difference of multiple target pixels in the image to be quantized; and is specifically used to determine the color difference of the color edge according to the maximum value of the first color difference and the maximum value of the second color difference.

12. The image color edge quantization device according to claim 11, characterized in that: The processing module is specifically used to calculate an average value of the maximum value of the first color difference and the maximum value of the second color difference; and is specifically used to determine the color difference of the color edge according to the average value.

13. The image color edge quantization device according to claim 9, characterized in that: The processing module is specifically used to normalize the difference between the weighted average of the first color component and the weighted average of the third color component corresponding to each row or column of target pixels to obtain the first color difference corresponding to each row or column of target pixels; and is specifically used to normalize the difference between the weighted average of the second color component and the weighted average of the third color component corresponding to each row or column of target pixels to obtain the second color difference corresponding to each row or column of target pixels.

14. The image color fringing quantization device according to any one of claims 9 to 13, characterized in that: The color of the color edge is purple; the first color component is a red component, the second color component is a blue component, and the third color component is a green component.

15. The image color fringing quantization device according to any one of claims 9 to 13, characterized in that: The image to be quantized also includes a highlight area and a low-brightness area, and the brightness difference between the target pixel point in the highlight area and the target pixel point in the low-brightness area is greater than a preset brightness difference.

16. The image color fringing quantization device according to any one of claims 9 to 13, characterized in that: The image to be quantized is a partial image in the target image.

17. An image color edge quantization device, characterized in that: The device comprises a memory and a processor, wherein the memory is used to store instructions, and when the instructions are executed by the processor, the image color edge quantization device executes the image color edge quantization method according to any one of claims 1 to 8.

18. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed, the image color edge quantization method according to any one of claims 1 to 8 is implemented.

19. A computer program product, characterized in that The computer program product comprises: a computer program code, and when the computer program code is run on a computer, the computer is enabled to perform the image color edge quantization method according to any one of claims 1 to 8.