An image color difference determination method, device, equipment, medium and product
Patent Information
- Application Number
- CN202510473719.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-15
- Publication Date
- 2026-10-23
AI Technical Summary
[0003]相关技术中,通过计算图像中所有像素的色差平均值来表征图像的色差,但这种方法的准确性较低,无法精确模拟人眼对色差的感知
[0023]本公开的实施例提供的技术方案可以包括以下有益效果:通过在HSV色彩空间中根据视觉感知度对色彩区间划分和映射,更准确地反映人眼对图像色差的感知。此外,通过对色彩值进行重新定义并映射到m个色彩区间中,并对m个色彩区间中的色彩值映射为单一色彩值,既保留了色彩特征,又减少了数据量,提升色差计算的效率。
Smart Images

Figure CN122966747A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of image processing technology, and in particular to a method, apparatus, device, medium and product for determining image color difference. Background Technology
[0002] With the continuous development of image processing technology, people have extremely high requirements for image quality and color accuracy. When evaluating image quality, color difference is a key indicator for measuring whether the image colors truly reflect the colors of the original scene.
[0003] In related technologies, color difference in an image is characterized by calculating the average color difference of all pixels in the image. However, this method has low accuracy and cannot accurately simulate the human eye's perception of color difference. Alternatively, color differences can be statistically analyzed based on the color ratios of the image pixels, and the statistical results are categorized and then weighted and summed to calculate the overall color difference of the image. However, this method also results in low accuracy in calculating image color difference.
[0004] In summary, the existing technologies cannot meet people's needs for high-precision color difference detection. Summary of the Invention
[0005] To overcome the problems existing in related technologies, this disclosure provides a method, apparatus, device, medium and product for determining image color difference.
[0006] According to some embodiments of this disclosure, an image color difference determination method is provided, comprising: converting a first image and a second image to be color-differentiated to HSV color space respectively, and determining the color values of the first image and the second image in the HSV color space respectively; dividing the color values in the HSV color space into m color intervals according to visual perception, and mapping the color values in each of the m color intervals to a single color value to obtain m color values; redetermining the color values in the HSV color space based on the m color values to obtain redetermined color values, wherein m is a positive integer; dividing the first image and the second image into regions based on the redetermined color values respectively to obtain n regions, wherein n is a positive integer; determining the color difference between the first image and the second image in each of the n regions, and obtaining the color difference between the first image and the second image based on the color difference between each of the n regions.
[0007] In one embodiment, mapping the color value in each of the m color intervals to a single color value includes: mapping the color value in each of the m color intervals to a single value in sequence according to the size of the corresponding color value in each color interval, to obtain m color values, wherein the m color values are integer values in [0, m].
[0008] In one embodiment, dividing the color values in the HSV color space into m color intervals according to visual perception includes: dividing the hue values, saturation values, and brightness values in the HSV color space into color intervals based on their respective visual perception, resulting in m1 hue value intervals, m2 saturation value intervals, and m3 brightness value intervals; the m color values include: m1 hue values corresponding to the m1 hue value intervals, m2 saturation values corresponding to the m2 saturation value intervals, and m3 brightness values corresponding to the m3 brightness value intervals; wherein m1, m2, and m3 are positive integers.
[0009] In one embodiment, the step of re-determining the color values in the HSV color space based on the m color values to obtain the re-determined color values includes: determining the hue weight corresponding to the m1 hue values, the saturation weight corresponding to the m2 saturation values, and the brightness weight corresponding to the m3 brightness values based on the human eye's visual perception of hue, saturation, and brightness values, respectively; weighting the m1 hue values based on the hue weights to obtain the re-determined m1 hue values; weighting the m2 saturation values based on the saturation weights to obtain the re-determined m2 saturation values; and weighting the m3 brightness values based on the brightness weights to obtain the re-determined m3 brightness values; wherein the hue weight is greater than the saturation weight, and the saturation weight is greater than the brightness weight.
[0010] In one embodiment, the step of dividing the region based on the redefined color values to obtain n regions includes: determining a seed pixel in the target image, the seed pixel being used to determine the starting pixel of the region, the target image being either the first image or the second image; merging other pixels whose similarity to the seed pixel is less than a first similarity threshold into the region where the seed pixel is located; using the other pixels as seed pixels, repeating the above steps until there are no other pixels whose similarity to the seed pixel is less than the first similarity threshold, obtaining connected regions, where the similarity between pixels in the connected regions is less than the first similarity threshold; redefined seed pixels, and repeating the above steps until all regions in the target image are divided, obtaining k connected regions, where k is a positive integer; and merging regions in the k connected regions whose color similarity is less than a second similarity threshold based on the color similarity between the k connected regions, obtaining n regions.
[0011] In one embodiment, determining the seed pixel in the target image includes: dividing the target image into multiple regions on an equal basis, and using the pixel at the center of any one of the multiple regions as the seed pixel, wherein the size of the region is a preset size; or, using a randomly selected pixel in the target image as the seed pixel.
[0012] In one embodiment, obtaining the color difference between the first image and the second image based on the color difference of each of the n regions includes: determining the number of pixels in each of the n regions, as well as the number of pixel rows and columns in each of the n regions; determining the pixel frequency of each region as the ratio of the number of pixels in each region to the product, wherein the product is the product of the number of pixel rows and the number of pixel columns; determining the weight of each region based on the pixel frequency; and obtaining the color difference between the first image and the second image by weighted summation based on the weight of each region and the color difference of each region.
[0013] According to some embodiments of this disclosure, an image color difference determination apparatus is provided, comprising: a conversion unit, configured to convert a first image and a second image to be color difference determined to HSV color space respectively, and determine the color values of the first image and the second image in the HSV color space respectively; a processing unit, configured to divide the color values in the HSV color space into m color intervals according to visual perception, and map the color values in each of the m color intervals to a single color value to obtain m color values, and redetermine the color values in the HSV color space based on the m color values to obtain redetermined color values, wherein m is a positive integer; and to divide the first image and the second image into regions based on the redetermined color values respectively, to obtain n regions, wherein n is a positive integer; and a determination unit, configured to determine the color difference between the first image and the second image in each of the n regions, and obtain the color difference between the first image and the second image based on the color difference between each of the n regions.
[0014] In one embodiment, the processing unit maps the color values in each of the m color intervals to a single color value in the following manner: the color values in each of the m color value intervals are mapped to a single value in sequence according to the size of the corresponding color value in each color value interval, so as to obtain m color values, wherein the m color values are integer values in [0, m].
[0015] In one embodiment, the processing unit divides the color values in the HSV color space into m color intervals according to visual perception as follows: the hue value, saturation value, and brightness value in the HSV space are divided into color intervals based on their respective visual perception, resulting in m1 hue value intervals, m2 saturation value intervals, and m3 brightness value intervals; the m color values include: m1 hue values corresponding to the m1 hue value intervals, m2 saturation values corresponding to the m2 saturation value intervals, and m3 brightness values corresponding to the m3 brightness value intervals; wherein m1, m2, and m3 are positive integers.
[0016] In one embodiment, the processing unit redetermines the color values in the HSV color space based on the m color values in the following manner to obtain the redetermined color values: Based on the human eye's visual perception of hue, saturation, and brightness values, it determines the hue weight corresponding to the m1 hue values, the saturation weight corresponding to the m2 saturation values, and the brightness weight corresponding to the m3 brightness values, respectively; it then weights the m1 hue values based on the hue weights to obtain the redetermined m1 hue values; it further weights the m2 saturation values based on the saturation weights to obtain the redetermined m2 saturation values; and finally, it weights the m3 brightness values based on the brightness weights to obtain the redetermined m3 brightness values; wherein the hue weight is greater than the saturation weight, and the saturation weight is greater than the brightness weight.
[0017] In one embodiment, the processing unit divides regions based on redefined color values to obtain n regions as follows: A seed pixel is determined in the target image, which is used to determine the starting pixel of the region; the target image is either the first image or the second image. Other pixels with a similarity less than a first similarity threshold to the seed pixel are merged into the region where the seed pixel is located. These other pixels are used as seed pixels, and the above steps are repeated until no other pixels with a similarity less than the first similarity threshold to the seed pixel are found, resulting in connected regions where the similarity between pixels in the connected regions is less than the first similarity threshold. A seed pixel is redefined, and the above steps are repeated until all regions in the target image are divided, resulting in k connected regions, where k is a positive integer. Based on the color similarity between the k connected regions, regions with a color similarity less than a second similarity threshold in the k connected regions are merged to obtain n regions.
[0018] In one embodiment, the processing unit determines the seed pixel in the target image in the following manner: the target image is divided into multiple regions on an equal basis, and the pixel at the center of any one of the multiple regions is taken as the seed pixel, wherein the size of the region is a preset size; or, a pixel randomly selected from the target image is taken as the seed pixel.
[0019] In one embodiment, the determining unit obtains the color difference between the first image and the second image based on the color difference of each region in the n regions as follows: determining the number of pixels in each region of the n regions, as well as the number of pixel rows and columns in each region of the n regions; determining the pixel frequency of each region as the ratio of the number of pixels in each region to the product, wherein the product is the product of the number of pixel rows and the number of pixel columns; determining the weight of each region based on the pixel frequency; and obtaining the color difference between the first image and the second image by weighted summation based on the weight of each region and the color difference of each region.
[0020] According to some embodiments of this disclosure, an electronic device is provided, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to: perform the steps of the image color difference determination method described in the first aspect or any embodiment of the first aspect.
[0021] According to some embodiments of this disclosure, a storage medium is provided, wherein a computer program or instructions are stored in the storage medium, and when the computer program or instructions in the storage medium are executed by a processor of an electronic device, the electronic device is able to perform the image color difference determination method described in the first aspect or any embodiment of the first aspect.
[0022] According to some embodiments of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the image color difference determination method described in the first aspect or any embodiment of the first aspect.
[0023] The technical solutions provided by the embodiments of this disclosure can include the following beneficial effects: by dividing and mapping color intervals in the HSV color space according to visual perception, the human eye's perception of image color differences can be reflected more accurately. Furthermore, by redefining color values and mapping them to m color intervals, and mapping the color values in the m color intervals to a single color value, color characteristics are preserved while reducing the amount of data, thus improving the efficiency of color difference calculation.
[0024] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0025] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0026] Figure 1 This is a flowchart illustrating an image color difference determination method according to some embodiments of the present disclosure.
[0027] Figure 2 This is a flowchart illustrating a method for determining color values in a color space according to some embodiments of the present disclosure.
[0028] Figure 3 This is a flowchart illustrating a method for redefining the HSV color space according to some embodiments of this disclosure.
[0029] Figure 4 This is a flowchart illustrating a method for redetermining color values according to some embodiments of the present disclosure.
[0030] Figure 5 This is a flowchart illustrating a method for determining seed pixels in a region according to some embodiments of the present disclosure.
[0031] Figure 6 This is a flowchart illustrating a method for dividing a region according to some embodiments of the present disclosure.
[0032] Figure 7 This is a flowchart illustrating a method for determining color difference according to some embodiments of the present disclosure.
[0033] Figure 8 This is a block diagram of an image color difference determination device according to some embodiments of the present disclosure.
[0034] Figure 9 This is a block diagram of an image color difference determination apparatus according to some embodiments of the present disclosure.
[0035] Figure 10 This is a block diagram of an image color difference determination device according to some embodiments disclosed in a book. Detailed Implementation
[0036] Some embodiments of this disclosure will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. Various changes, modifications, and equivalents of the methods, apparatus, and / or systems described herein will become apparent upon understanding this disclosure. For example, the order of operations described herein is merely illustrative and is not limited to those orders set forth herein, but can be changed as will become apparent upon understanding this disclosure, except for operations that must be performed in a particular order. Furthermore, for clarity and brevity, descriptions of features known in the art may be omitted.
[0037] The embodiments described in the following examples of this disclosure are not representative of all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0038] This disclosure provides an image color difference determination method according to some embodiments, which can be applied to image processing scenarios. For example, it can be applied to application scenarios where the color display effect of an image is evaluated based on the color difference between different images.
[0039] Color difference refers to the difference in color, specifically the difference in color perception.
[0040] In related technologies, when calculating the color difference between images displaying the same content, a color difference formula is typically used. For example, the color difference formula represents the color difference between images based on the average color difference of all pixels. However, this method has low accuracy and cannot analyze and process color differences in different regions of the image, thus failing to match human visual perception of color difference. Alternatively, histogram statistics can be used to count the number of pixels of different hues, giving higher weights to colors with more pixels. However, this method does not consider whether the pixels are adjacent and connected. Therefore, for a large number of pixels that are discretely distributed, if their distribution is not adjacent or connected, the calculated image color difference will have low accuracy and will not conform to human visual perception.
[0041] In view of this, some embodiments of this disclosure provide an image color difference determination method. The method reconstructs the HSV color space based on the human eye's visual perception of color, and determines the color difference based on the color values in the reconstructed HSV color space, thereby improving the accuracy of color difference calculation and making the image more consistent with visual perception.
[0042] For ease of description in this embodiment, the different images for which color difference determination is performed are referred to as the first image and the second image.
[0043] In this embodiment, the first image can be understood as an image captured by an electronic device, and the second image can be understood as an image whose color values in the captured image are more consistent with visual perception. For example, the first image is a captured image, and the second image is a true color image of the captured scene. The first and second images can also be images that have undergone spatial filtering based on the above understanding. Color values can be understood as the values representing the colors of different pixels in the image in the HSV space.
[0044] Figure 1 This is a flowchart illustrating an image color difference determination method according to some embodiments of the present disclosure. Figure 1 As shown, it includes the following steps.
[0045] In step S11, the first image and the second image to be determined for color difference are converted to the HSV color space, and the color values of the first image and the second image in the HSV color space are determined respectively.
[0046] In this embodiment of the disclosure, the first image and the second image are converted to the HSV color space, and the color values of the first image and the second image are determined in the HSV color space.
[0047] In one example, when the first image and the second image are in the RGB color space, the first image and the second image in the RGB color space are converted to the HSV color space respectively to obtain the first image and the second image in the HSV color space.
[0048] In step S12, the color values in the HSV color space are divided into m color intervals according to visual perception, and the color values in each of the m color intervals are mapped to a single color value to obtain m color values. Based on the m color values, the color values in the HSV color space are re-determined to obtain the re-determined color values.
[0049] In this embodiment of the disclosure, the color values in the first image and the second image are re-divided according to visual perception in the HSV color space to obtain m color intervals. The color values in each color interval are mapped to a single value, so that one color space corresponds to a single color value, thereby obtaining m color values corresponding to the m color intervals. A redefined color value is then obtained based on these m color values.
[0050] Where m is a positive integer.
[0051] In step S13, the first image and the second image are each divided into regions based on the newly determined color values to obtain n regions.
[0052] In this embodiment of the disclosure, the first image and the second image are each divided into regions using redefined color values, thereby obtaining n different regions.
[0053] Where n is a positive integer.
[0054] In step S14, the color difference between the first image and the second image in each of the n regions is determined, and the color difference between the first image and the second image is obtained based on the color difference between each of the n regions.
[0055] In this embodiment of the disclosure, the color difference between the first image and the second image is determined for each of the n regions, and then the color difference of each region is analyzed to obtain the overall color difference between the first image and the second image.
[0056] According to exemplary embodiments of this disclosure, by combining color gamut division and mapping based on visual perception within the HSV color space, the human eye's perception of color differences in an image is accurately reflected. By redefining color values and mapping them to a smaller number of representative color values, important characteristics of color information are preserved while reducing the amount of data for the original color values, thus improving the efficiency of color difference calculation.
[0057] In this embodiment of the disclosure, taking the first image and the second image as examples, which are images in the RGB color space, the following is an example: Figure 1 The content involved will be further explained.
[0058] In one example, the first and second images to be determined for color difference are converted to the HSV color space in the following manner.
[0059] In this embodiment, the maximum and minimum values of all pixels in the first and second images corresponding to the RGB channels in the RGB color space are determined, and the difference between the maximum and minimum values in the RGB channels is determined. The color value of each pixel in the HSV color space is determined using the difference and the values of different channels in the RGB color space.
[0060] In one example, the conversion of the first and second images to be color-differential determined to the HSV color space is further illustrated by the following formula.
[0061] delta=max(R,G,B)-min(R,G,B) (1)
[0062]
[0063] S = delta / max(R,G,B) (3)
[0064] V = max(R, G, B) / 255 (4)
[0065] H = H + 360, if H < 0 (5)
[0066] In this embodiment of the disclosure, when H calculated according to formula (2) is less than the minimum hue angle, the hue angle in the HSV color space is determined according to formula (5).
[0067] In the HSV color space, H represents the hue channel, S represents the saturation channel, and V represents the lightness channel. The values in the hue channel can be understood as hue values, hue angles, chroma, etc., and their representations are compatible; their meanings should be understood as consistent. For ease of understanding, this disclosure collectively refers to the values in the hue channel of the HSV color space as hue values. The values in the saturation channel can be understood as saturation values; for ease of understanding, this disclosure collectively refers to the values in the saturation channel of the HSV color space as saturation values. The values in the lightness channel can be understood as lightness values; for ease of understanding, this disclosure collectively refers to the values in the lightness channel of the HSV color space as lightness values.
[0068] In this embodiment of the disclosure, to improve the accuracy of subsequent color difference calculation, image spatial filtering can also be performed on the first image and the second image. The image spatial filtering process is as follows:
[0069] The first and second images are converted from the RGB color space to the XYZ color space using a first spatial transformation matrix, resulting in the first and second images in the XYZ color space. The first and second images in the XYZ color space are then converted to the O1O2O3 color space using a second spatial transformation matrix. A preset kernel function is then used to filter the data in each channel of the O1O2O3 color space, resulting in the first and second images after image spatial filtering.
[0070] In this context, both the first and second space transformation matrices can be understood as color transformation matrices, and this disclosure does not limit the method of determining the first and second space transformation matrices. The O1O2O3 color space can be understood as a color space containing luminance component channels, red-green component channels, and yellow-blue component channels.
[0071] In this embodiment of the disclosure, the first image and the second image after image space filtering can be converted to the HSV color space according to the above content, or the first image and the second image can be directly converted to the HSV color space. This disclosure does not limit the specific method.
[0072] In this embodiment of the disclosure, the following is adopted: Figure 2 The content shown redefines the color values in the HSV color space.
[0073] Figure 2This is a flowchart illustrating a method for determining color values in a color space according to some embodiments of this disclosure. Figure 2 As shown, it includes the following steps.
[0074] In step S21, the color values in the HSV color space are divided into m color intervals.
[0075] In this embodiment of the disclosure, m color intervals are obtained by dividing the color values in the HSV color space into intervals.
[0076] In some examples, the color values in the HSV color space are divided into m color intervals based on visual perception. This allows each interval to represent a set of similar but slightly different colors.
[0077] In one example, the hue values in the HSV color space are divided into m color intervals based on visual perception. For instance, in the HSV color space, when the hue value is in the color interval (25, 45), it can be understood that the human eye is not sensitive to the visual perception of color changes within this interval, and in this case, it is set to a single value, such as 2.
[0078] In step S22, the color values in each of the m color value intervals are mapped to a single value according to the size of the corresponding color value in each color value interval, resulting in m color values.
[0079] In this embodiment of the disclosure, the color values in each color range are mapped to a single numerical value, resulting in m color values.
[0080] In some examples, color values are divided into intervals based on visual perception, resulting in multiple distinct color intervals that are consecutive to each other. The color values corresponding to these multiple consecutive color spaces are then set to a single, consecutive value.
[0081] In one example, when the hue value is in the color range of (25, 55], the color range of (25, 55] is divided into two color ranges of (25, 45] and (45, 55] according to visual perception. The color value corresponding to the color range of (25, 45] is set to 2, and the color value corresponding to the color range of (45, 55] is set to 3.
[0082] Here, the m color values are integer values in the range [0, m]. m is an adjustable parameter based on the color evaluation requirements of the image.
[0083] According to an exemplary embodiment of this disclosure, since each color interval is mapped to a fixed numerical value, the problem of inconsistent color difference evaluation caused by subtle color differences can be reduced. This ensures consistency of evaluation results even when colors are close, improving the reliability of color difference calculation. Furthermore, by adjusting the number of color intervals m, the level of detail in color representation can be flexibly controlled.
[0084] In this embodiment of the disclosure, the following is adopted: Figure 3 The content shown is divided into values corresponding to different channels in the HSV color space based on visual perception.
[0085] Figure 3 This is a flowchart illustrating a method for redefining the HSV color space according to some embodiments of this disclosure. Figure 3 As shown, it includes the following steps.
[0086] In step S31, the hue value, saturation value, and brightness value in the HSV space are determined.
[0087] In this embodiment of the disclosure, for each pixel in the first image and the second image, the hue value, saturation value and luminance value of each pixel in the HSV space are determined.
[0088] The hue, saturation and brightness values of each pixel in the HSV space can be determined using the formulas (1)-(6) above, which will not be elaborated here.
[0089] In step S32, the hue value, saturation value and brightness value in the HSV space are divided into color intervals based on their respective visual perception, resulting in m1 hue value intervals, m2 saturation value intervals and m3 brightness value intervals.
[0090] In this embodiment of the disclosure, the hue value, saturation value and brightness value in the HSV space are divided into color intervals according to visual perception, resulting in m1 hue value intervals, m2 saturation value intervals and m3 brightness value intervals.
[0091] In one example, considering the varying sensitivities of the human eye to different colors, hue values are divided into intervals based on visual perception of hue. Similarly, visual perception based on saturation divides saturation values into m² intervals to reflect the different sensitivities of the human eye to color purity. Visual perception based on brightness values divides brightness values into m³ intervals to reflect the human eye's visual adaptability under different lighting conditions.
[0092] In this embodiment of the disclosure, m1+m2+m3 values are combined to form m color values. Wherein, m = m1+m2+m3 can represent the color values in the entire HSV color space based on visual perception.
[0093] The m color values include: m1 hue values corresponding to m1 hue value intervals, m2 saturation values corresponding to m2 saturation value intervals, and m3 luminance values corresponding to m3 luminance value intervals. m1, m2, and m3 are positive integers.
[0094] According to exemplary embodiments of this disclosure, by dividing the color space into intervals based on the visual perception of hue, saturation, and brightness values respectively, the human eye's perception of color differences is simulated more accurately, resulting in a more realistic color difference assessment. Furthermore, the complex color information in the HSV color space is simplified based on visual perception, reducing the complexity and computational load of data processing.
[0095] In one example, formulas (6)-(8) can be used to... Figure 3 The division of color gamuts within the HSV color space will be further explained.
[0096] In this embodiment of the disclosure, considering that colors with a hue value less than 360 but close to 360 are highly similar to colors with a hue value greater than 0 but close to 0, and in order to set similar colors to a single value to reduce the number of colors, the HSV color space is divided.
[0097] In an exemplary embodiment of this disclosure, the hue value range in the HSV color space is typically [0, 360]. Based on the human eye's visual perception of different hue values within the color range, this disclosure divides the hue values within the range in ascending order, resulting in m1 redefined hue value ranges and m1 redefined hue values. Furthermore, adjacent hue values within the redefined m1 hue value ranges are adjacent. The redefined hue values within the m1 hue value ranges are integer values between [0, m1-1].
[0098] In one example, as shown in formula (6), the hue value range of [0, 360] is divided into 16 intervals, each assigned a specific value to characterize the insensitivity of the human eye to hue changes within that interval. For example, starting from 0, the hue value range of [0, 360] is divided sequentially. All hue values in the hue value range of (0, 15) are set to the redefined hue value 0. Then, the hue value range of (15, 345) is divided sequentially in ascending order. For example, the hue values in the hue value range of (15, 25) are re-divided to obtain the re-divided hue value and defined as 1, the hue values in the hue value range of (25, 45) are re-divided to obtain the re-divided hue value and defined as 2, and so on, until the hue value range of [0, 360] is completely divided, and the hue value of [0, 15] is obtained after mapping.
[0099] In the exemplary embodiments of this disclosure, the saturation value range in the HSV color space is typically [0, 1]. Based on the human eye's visual perception of different saturation values within the color range, this disclosure divides the saturation values within the range in ascending order, resulting in m² redefined saturation value ranges and m² redefined saturation values. Furthermore, adjacent saturation values within the m² redefined saturation value ranges are adjacent. The redefined saturation values within the m² redefined saturation value ranges are integer values between [0, m²-1].
[0100] In one example, as shown in formula (7), based on the sensitivity of the human eye to different saturation values, the saturation value range of [0, 1] is divided into four intervals. Each interval is assigned a specific value to represent the insensitivity of the human eye to changes in saturation within that interval. For example, starting from 0, the saturation value range of [0, 1] is divided sequentially. The saturation value range of (0, 0.15] is set as the redefined saturation value 0. Then, the saturation value range of (0.15, 1] is divided sequentially in ascending order. For example, the saturation value range of (0.15, 0.4] is redivided to obtain the redivided saturation value and defined as 1. The saturation value range of (0.4, 0.75] is redivided to obtain the redivided saturation value and defined as 2. This process continues until the saturation value range of [0, 1] is completely divided, and the saturation value of [0, 3] is obtained after mapping.
[0101] In an exemplary embodiment of this disclosure, in the HSV color space, the brightness value range is divided according to the human eye's visual perception of different brightness values within the color range.
[0102] In one example, as shown in formula (8), the range of brightness values is usually [0, 1]. Based on the human eye's visual perception of different brightness values within a color range, this disclosure divides the brightness values within the range in ascending order, resulting in m³ redefined brightness value ranges and m³ redefined brightness values. Furthermore, adjacent brightness values within the m³ redefined brightness value ranges are adjacent. The redefined brightness values within the m³ brightness value ranges are integer values between [0, m³-].
[0103] In one example, as shown in formula (8), based on the sensitivity of the human eye to different brightness values, the brightness value range of [0, 1] is divided into 4 intervals. Each interval is assigned a specific value to represent the insensitivity of the human eye to changes in brightness within that interval. For example, starting from 0, the brightness value range of [0, 1] is divided sequentially. The brightness value in the (0, 0.15) interval is set as the redefined brightness value 0. Then, the brightness value range of (0.15, 1) is divided sequentially in ascending order. For example, the brightness value in the (0.15, 0.4) interval is re-divided to obtain the re-divided brightness value and defined as 1, and the brightness value in the (0.4, 0.75) interval is re-divided to obtain the re-divided brightness value and defined as 2. This process continues until the brightness value range of [0, 1] is completely divided, and the brightness value of [0, 3] is obtained after mapping.
[0104]
[0105] In this embodiment of the disclosure, before determining the color difference between the first image and the second image, a corresponding weight is assigned to redetermine the color values in the HSV color space to further conform to visual perception.
[0106] Figure 4 This is a flowchart illustrating a method for redetermining color values according to some embodiments of this disclosure. Figure 4 As shown, it includes the following steps.
[0107] In step S41, based on the human eye's visual perception of hue, saturation, and brightness values, the hue weights corresponding to m1 hue values, the saturation weights corresponding to m2 saturation values, and the brightness weights corresponding to m3 brightness values are determined.
[0108] In this embodiment of the disclosure, the weights corresponding to the hue value, saturation value, and brightness value in the redefined HSV space are determined based on visual perception.
[0109] In one example, considering that the human eye is highly sensitive to changes in hue, followed by saturation, and finally brightness, corresponding weight values are assigned.
[0110] Among them, hue weight is greater than saturation weight, and saturation weight is greater than brightness weight.
[0111] In step S42, the m1 hue values are weighted based on hue weight to obtain the newly determined m1 hue values, the m2 saturation values are weighted based on saturation weight to obtain the newly determined m2 saturation values, and the m3 luminance values are weighted based on luminance weight to obtain the newly determined m3 luminance values.
[0112] In one example, for the hue value, saturation value, and brightness value obtained from formulas (6)-(8) above, the hue weight (W) of the corresponding hue value is determined respectively. H ), corresponding to the saturation weight (W) of the saturation value S ), corresponding to the brightness weight (W) of the brightness value V The weighted hue value (H″), weighted saturation value (S″), and weighted brightness value (V″) are obtained.
[0113] In one example, based on the weights mentioned above, the m1 hue values, m2 saturation values, and m3 brightness values are determined using formulas (9)-(11).
[0114] H″=W H *H′ (9)
[0115] S″=W S *S′ (10)
[0116] V″=W V *V′ (11)
[0117] According to exemplary embodiments of this disclosure, by assigning different weights to hue, saturation, and brightness, and adjusting the color values accordingly, the human visual system can be simulated more accurately, thereby facilitating the provision of color difference assessment results that are more consistent with the actual perception of the human eye.
[0118] In this embodiment of the disclosure, seed pixels in the region are determined based on the newly determined m1 hue values, m2 saturation values, and m3 luminance values, thereby obtaining n regions in the first image and the second image, and thus determining the color difference between the first image and the second image based on the n regions.
[0119] Figure 5 This is a flowchart illustrating a method for determining seed pixels in a region according to some embodiments of this disclosure. Figure 5As shown, it includes the following steps.
[0120] In step S51, the first image and the second image after the color values have been redetermined are obtained.
[0121] In one example, the following can be used: Figure 4 The content shown is obtained by acquiring a first image and a second image after re-determining the color values, but this disclosure does not limit this.
[0122] In step S52, the target image is divided into multiple regions on an average basis, and the pixel at the center of any one of the multiple regions is used as the seed pixel.
[0123] In one embodiment of this disclosure, the target image is divided into multiple regions of preset size. From these regions, any one region is selected, and its central pixel is used as the seed pixel.
[0124] The size of the region is a preset size. The seed pixel can be understood as the starting pixel that determines the region to which the seed pixel belongs.
[0125] In step S53, a pixel randomly selected from the target image is used as a seed pixel.
[0126] In this embodiment of the disclosure, another approach is to directly and randomly select a pixel in the target image as a seed pixel.
[0127] According to exemplary embodiments of this disclosure, by dividing a first image or a second image into multiple regions and selecting seed pixels from them, the color features of the entire image can be fully considered, thereby avoiding the omission of color information. Different seed pixel selection methods enhance the flexibility in determining seed pixels.
[0128] In this embodiment of the disclosure, the regions are divided according to the seed pixels and the redefined color values to obtain n regions.
[0129] Figure 6 This is a flowchart illustrating a method for region division according to some embodiments of this disclosure. Figure 6 As shown, it includes the following steps.
[0130] In step S61, seed pixels are determined in the target image.
[0131] Among them, the following can be adopted: Figure 5 The seed pixel is determined in the manner shown, and will not be described in detail here.
[0132] In step S62, other pixels whose similarity to the seed pixel is less than the first similarity threshold are merged into the region where the seed pixel is located.
[0133] In this embodiment of the disclosure, pixels adjacent to the seed pixel are determined, and the similarity between the adjacent pixels and the seed pixel is calculated. If the similarity is less than a first similarity threshold, the pixels that are close to the seed pixel are merged into the region where the seed pixel is located.
[0134] In some examples, based on the seed pixel, the 8 neighboring pixels adjacent to the seed pixel are determined, the similarity between each of the 8 neighboring pixels and the seed pixel is determined, and then they are merged into the region where the seed pixel is located.
[0135] In one example, taking the color values of different pixels in the redefined HSV color space as an example, the Euclidean distance between other pixels and the seed pixel is determined according to formula (12). And the similarity between other pixels and the seed pixel is determined according to formula (13).
[0136]
[0137] d(C(i,j),C(i′,j′))≤S LHC (13)
[0138] Where C(i,j) represents the position of the seed pixel, C(i′,j′) represents the position of other pixels adjacent to the seed pixel, and H″ C H″ represents the redefined hue value of the seed pixel in the redefined HSV color space. C′ This represents the redefined hue value of the pixel adjacent to the seed pixel in the redefined HSV color space. C S″ represents the redetermined saturation value of the seed pixel in the redefined HSV color space. C′ This represents the redefined saturation value of the pixel adjacent to the seed pixel in the redefined HSV color space. V″ C V″ represents the redefined luminance value of the seed pixel in the redefined HSV color space. C′ This represents the redefined brightness value of the pixel adjacent to the seed pixel in the redefined HSV color space. LHC This represents the first similarity threshold.
[0139] In step S63, other pixels are used as seed pixels, and the above steps are repeated until there are no other pixels whose similarity to the seed pixels is less than the first similarity threshold, thus obtaining a connected region.
[0140] In this embodiment of the disclosure, based on the already obtained region, other pixels outside the region are used as seed pixels, and the above steps are continued until there are no other pixels whose similarity to the seed pixels is less than the first similarity threshold, thus obtaining a connected region.
[0141] In one example, taking the region determined in step S62 as the first region, the similarity between other pixels in the first region and the first region is determined according to formula (14) to obtain the connected region.
[0142]
[0143] in, S represents the average color value of all pixels in the first region. AHC This indicates the similarity threshold. The similarity threshold may be the same as or different from the first similarity threshold.
[0144] In step S64, the seed pixel is redefined, and the above steps are repeated until all regions in the target image are divided to obtain k connected regions.
[0145] In this embodiment of the disclosure, seed pixels are re-determined outside the already determined connected regions, and the above steps are repeated until all regions in the target image are divided to obtain k connected regions.
[0146] Where k is a positive integer.
[0147] In step S65, based on the color similarity among the k connected regions, regions with color similarity less than the second similarity threshold among the k connected regions are merged to obtain n regions.
[0148] For example, the color similarity in k connected regions can be determined according to formula (15).
[0149]
[0150] in, With C(X) j2 S represents the average color value of different connected regions in k connected regions. AHC This represents the second similarity threshold. The second similarity threshold may be the same as or different from the first similarity threshold.
[0151] According to an exemplary embodiment of this disclosure, connected regions with similar colors in an image are continuously identified based on seed pixels, taking into account the spatial adjacency between different pixels, thereby more accurately reflecting the actual perception of color difference by the human eye. Connected regions are determined by a first similarity threshold, and similar connected regions are merged based on a second similarity threshold, avoiding over-segmentation or merging, and improving the accuracy of color difference assessment between the first and second images during image processing.
[0152] In this embodiment of the disclosure, for the n regions mentioned above, the overall color difference between the first image and the second image is obtained based on the color difference of the n regions.
[0153] Figure 7 This is a flowchart illustrating a method for determining color difference according to some embodiments of the present disclosure. Figure 7 As shown, it includes the following steps.
[0154] In step S71, the number of pixels in each of the n regions, as well as the number of pixel rows and columns in each of the n regions, are determined.
[0155] In this embodiment of the disclosure, the number of pixels in each region, as well as the number of pixel rows and pixel columns in that region, are determined.
[0156] In step S72, the ratio of the number of pixels in each region to the product is determined as the pixel frequency of each region, and the product is the product of the number of rows of pixels and the number of columns of pixels.
[0157] In one example, formula (16) is used to determine the pixel frequency of each region.
[0158]
[0159] Among them, f i The pixel frequency of the i-th region, where w represents the number of pixels per row of the image, h represents the number of pixels per column, and ∑χ i This represents the total number of pixels in the i-th region.
[0160] In step S73, the weight of each region is determined based on the pixel frequency.
[0161] In one exemplary embodiment, the reciprocal of the pixel frequency of each region is processed by formula (17) to achieve weight gain for regions with high frequency and weight compression for regions with low frequency, thereby obtaining the weight of each region.
[0162] In one example, formula (17) is used to determine the weights of each region.
[0163]
[0164] In step S74, the color difference between the first image and the second image is obtained by weighted summation based on the weight of each region and the color difference of each region.
[0165] In one example, the color difference between the first image and the second image is obtained by formula (18).
[0166]
[0167] Where, ΔE i Characterizing the color difference in each region, w i The weight values of each region are represented, and ΔE represents the color difference between the first image and the second image.
[0168] According to an exemplary embodiment of this disclosure, different weights are assigned to each region based on the influence of pixel frequency on color difference, so that different color regions obtain corresponding weight values in color difference evaluation, thereby achieving weight gain for high-frequency regions and weight compression for low-frequency regions, thereby improving the accuracy of color difference between the first image and the second image.
[0169] Based on the same concept, embodiments of this disclosure also provide an image color difference determination device.
[0170] It is understood that the image color difference determination device provided in this disclosure includes hardware structures and / or software modules corresponding to each function in order to achieve the above-mentioned functions. In conjunction with the units and algorithm steps of the various examples disclosed in this disclosure, this disclosure can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the technical solution of this disclosure.
[0171] Figure 8 This is a block diagram of an image color difference determination apparatus according to some embodiments of the present disclosure. (Refer to...) Figure 8 The device 100 includes a conversion unit 101, a processing unit 102, and a determination unit 103.
[0172] The conversion unit 101 is used to convert the first image and the second image to be determined to the HSV color space respectively, and to determine the color values of the first image and the second image in the HSV color space respectively.
[0173] The processing unit 102 is used to divide the color values in the HSV color space into m color intervals according to visual perception, and map the color values in each of the m color intervals to a single color value to obtain m color values. Based on the m color values, the color values in the HSV color space are re-determined to obtain the re-determined color values, where m is a positive integer. The first image and the second image are respectively divided into regions based on the re-determined color values to obtain n regions, where n is a positive integer.
[0174] The determining unit 103 is used to determine the color difference between the first image and the second image in each of the n regions, and to obtain the color difference between the first image and the second image based on the color difference between each of the n regions.
[0175] In one embodiment, the processing unit 102 maps the color values in each of the m color intervals to a single color value in the following manner: the color values in each of the m color value intervals are mapped to a single value in sequence according to the size of the corresponding color value in each color value interval, so as to obtain m color values, where the m color values are integer values in [0, m].
[0176] In one embodiment, the processing unit 102 divides the color values in the HSV color space into m color intervals according to visual perception in the following manner: the hue value, saturation value, and brightness value in the HSV color space are divided into color intervals based on their respective visual perception, resulting in m1 hue value intervals, m2 saturation value intervals, and m3 brightness value intervals; the m color values include: m1 hue values corresponding to the m1 hue value intervals, m2 saturation values corresponding to the m2 saturation value intervals, and m3 brightness values corresponding to the m3 brightness value intervals; wherein m1, m2, and m3 are positive integers.
[0177] In one embodiment, the processing unit 102 redetermines the color values in the HSV color space based on m color values in the following manner to obtain the redetermined color values: based on the human eye's visual perception of hue, saturation, and brightness values, it determines the hue weight corresponding to m1 hue values, the saturation weight corresponding to m2 saturation values, and the brightness weight corresponding to m3 brightness values; it then weights the m1 hue values based on the hue weights to obtain the redetermined m1 hue values, weights the m2 saturation values based on the saturation weights to obtain the redetermined m2 saturation values, and weights the m3 brightness values based on the brightness weights to obtain the redetermined m3 brightness values; wherein, the hue weight is greater than the saturation weight, and the saturation weight is greater than the brightness weight.
[0178] In one embodiment, the processing unit 102 divides regions based on the redefined color values to obtain n regions as follows: A seed pixel is determined in the target image, used to determine the starting pixel of the region; the target image is either a first image or a second image. Other pixels with a similarity less than a first similarity threshold to the seed pixel are merged into the region where the seed pixel is located. Other pixels are used as seed pixels, and the above steps are repeated until no other pixels with a similarity less than the first similarity threshold to the seed pixel are found, resulting in connected regions where the similarity between pixels in the connected regions is less than the first similarity threshold. A seed pixel is redefined, and the above steps are repeated until all regions in the target image are divided, resulting in k connected regions, where k is a positive integer. Based on the color similarity between the k connected regions, regions with a color similarity less than a second similarity threshold in the k connected regions are merged to obtain n regions.
[0179] In one embodiment, the processing unit 102 determines the seed pixel in the target image in the following manner: the target image is divided into multiple regions on an average basis, and the pixel at the center of any one of the multiple regions is taken as the seed pixel, and the size of the region is a preset size; or, a pixel randomly selected in the target image is taken as the seed pixel.
[0180] In one embodiment, the determining unit 103 obtains the color difference between the first image and the second image based on the color difference of each region in n regions as follows: determining the number of pixels in each region of the n regions, as well as the number of pixel rows and columns in each region of the n regions; determining the pixel frequency of each region as the ratio of the number of pixels in each region to the product, and the product is the product of the number of pixel rows and the number of pixel columns; determining the weight of each region based on the pixel frequency; and obtaining the color difference between the first image and the second image by weighted summation based on the weight of each region and the color difference of each region.
[0181] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0182] Figure 9 This is a block diagram illustrating an apparatus 200 for determining image color difference according to some embodiments of the present disclosure. For example, apparatus 200 may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.
[0183] Reference Figure 9 The device 200 may include one or more of the following components: processing component 202, memory 204, power component 206, multimedia component 208, audio component 210, input / output (I / O) interface 212, sensor component 214, and communication component 216.
[0184] Processing component 202 typically controls the overall operation of device 200, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 202 may include one or more processors 220 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 202 may include one or more modules to facilitate interaction between processing component 202 and other components. For example, processing component 202 may include a multimedia module to facilitate interaction between multimedia component 208 and processing component 202.
[0185] Memory 204 is configured to store various types of data to support the operation of device 200. Examples of such data include instructions for any application or method operating on device 200, contact data, phonebook data, messages, pictures, videos, etc. Memory 204 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0186] The power supply component 206 provides power to the various components of the device 200. The power supply component 206 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to the device 200.
[0187] Multimedia component 208 includes a screen that provides an output interface between the device 200 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 208 includes a front-facing camera and / or a rear-facing camera. When the device 200 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0188] Audio component 210 is configured to output and / or input audio signals. For example, audio component 210 includes a microphone (MIC) configured to receive external audio signals when device 200 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 204 or transmitted via communication component 216. In some embodiments, audio component 210 also includes a speaker for outputting audio signals.
[0189] I / O interface 212 provides an interface between processing component 202 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0190] Sensor assembly 214 includes one or more sensors for providing status assessments of various aspects of device 200. For example, sensor assembly 214 may detect the on / off state of device 200, the relative positioning of components such as the display and keypad of device 200, changes in the position of device 200 or a component of device 200, the presence or absence of user contact with device 200, the orientation or acceleration / deceleration of device 200, and temperature changes of device 200. Sensor assembly 214 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 214 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 214 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.
[0191] Communication component 216 is configured to facilitate wired or wireless communication between device 200 and other devices. Device 200 can access wireless networks based on communication standards, such as WiFi, 3G, 4G, 5G, other communication standards, or combinations thereof. In some embodiments of this disclosure, communication component 216 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In some embodiments of this disclosure, communication component 216 further includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0192] In some embodiments of this disclosure, the apparatus 200 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.
[0193] In some embodiments of this disclosure, a storage medium including instructions is also provided, such as a memory 204 including instructions, which can be executed by the processor 220 of the device 200 to perform the above-described method. For example, the storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0194] In some embodiments of this disclosure, a storage medium is provided, which may be a non-transitory computer-readable storage medium.
[0195] In some embodiments of this disclosure, when instructions in the storage medium are executed by the processor of an electronic device, the electronic device is able to perform the methods described above.
[0196] Figure 10 This is a block diagram illustrating an image color difference determination apparatus 300 according to some embodiments disclosed in a publication. For example, apparatus 300 may be provided as a server. See also... Figure 10 The device 300 includes a processing component 322, which further includes one or more processors, and memory resources represented by memory 332 for storing instructions, such as application programs, that can be executed by the processing component 322. The application programs stored in memory 332 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 322 is configured to execute instructions to perform the methods described above.
[0197] Device 300 may also include a power supply component 326 configured to perform power management of device 300, a wired or wireless network interface 350 configured to connect device 300 to a network, and an input / output (I / O) interface 352. Device 300 may operate on an operating system stored in memory 332, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or similar.
[0198] In some embodiments of this disclosure, a storage medium including instructions is also provided, such as a memory 332 including instructions, which can be executed by the processing component 322 of the device 300 to perform the above-described method. For example, the storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0199] In some embodiments of this disclosure, a storage medium is provided, which may be a non-transitory computer-readable storage medium.
[0200] In some embodiments of this disclosure, when instructions in the storage medium are executed by the processor of an electronic device, the electronic device is able to perform the methods described above.
[0201] In some embodiments of this disclosure, a computer program product is also provided, including a computer program that, when executed by a processor, implements the image color difference determination method involved in any of the above embodiments.
[0202] In one exemplary embodiment, the processor executing the computer program may be deployed in an electronic device, for example.
[0203] Those skilled in the art will also understand that the various illustrative logical blocks and steps listed in the embodiments of this application can be implemented by electronic hardware, computer software, or a combination of both. Whether such functionality is implemented through hardware or software depends on the specific application and the overall system design requirements. Those skilled in the art can implement the described functionality using various methods for each specific application, but such implementation should not be construed as exceeding the scope of protection of the embodiments of this application.
[0204] In the above detailed description, reference has been made to the accompanying drawings, which illustrate specific aspects of this disclosure by way of illustration. In this regard, terms indicating direction or positional relationship, such as “center,” “longitudinal,” “lateral,” “length,” “width,” “thickness,” “upper,” “lower,” “front,” “rear,” “left,” “right,” “vertical,” “horizontal,” “top,” “bottom,” “inner,” “outer,” “clockwise,” “counterclockwise,” “axial,” “radial,” and “circumferential,” are used with reference to the orientation of the described figures. Since components of the described device can be positioned in multiple different orientations, directional terms are used for illustrative purposes and not for limitation. It should be understood that other aspects can be utilized and structural or logical changes can be made without departing from the concept of this disclosure. Therefore, the following detailed description should not be considered limiting.
[0205] It should be understood that, unless otherwise specifically indicated, features of various embodiments of this disclosure described herein can be combined with each other. As used herein, the term "and / or" includes any of the associated listed items and any combination of any two or more; it should be understood that, unless otherwise expressly specified and limited, the terms "joining," "attaching," "mounting," "connecting," "linking," "fixing," etc., used in the embodiments of this disclosure should be interpreted broadly, for example, as a fixed connection, a detachable connection, or an integral part; as a mechanical connection, an electrical connection, or a communicative connection; as a direct connection or an indirect connection through an intermediate medium; as a connection within two elements or an interaction between two elements, unless otherwise expressly limited. Those skilled in the art will understand the specific meaning of the above terms herein according to the specific circumstances.
[0206] Furthermore, the term "above" as used herein with respect to components, elements, or material layers formed or located "above" a surface may be used to indicate that the component, element, or material layer is "indirectly" positioned (e.g., placed, formed, deposited, etc.) on the surface such that one or more additional components, elements, or layers are arranged between the surface and the component, element, or material layer. However, the term "above" as used with respect to components, elements, or material layers formed or located "above" a surface may also optionally have a specific meaning: that the component, element, or material layer is "directly" positioned (e.g., placed, formed, deposited, etc.) on the surface, for example, in direct contact with the surface.
[0207] It should be understood that spatial relative terms, such as “above,” “upper,” “below,” and “lower,” are used herein to describe the relationship between one element and another shown in the figures. In addition to the orientation depicted in the figures, these spatial relative terms are also intended to encompass different orientations of the device in use or operation. For example, if the device in the figures is flipped, an element described as “above” or “upper” relative to another element would be “below” or “lower” relative to that other element. Thus, depending on the spatial orientation of the device, the term “above” encompasses both above and below orientations. Devices may have other orientations (e.g., rotated 90 degrees or in other orientations), and the spatial relative terms used herein should be interpreted accordingly.
[0208] Although terms such as “first,” “second,” and “third” may be used herein to describe various components, parts, regions, layers, or sections, these components, parts, regions, layers, or sections are not limited to these terms. Rather, these terms are used only to distinguish one component, part, region, layer, or section from another. Therefore, without departing from the teachings of the examples described herein, a first component, part, region, layer, or section mentioned in the examples may also be referred to as a second component, part, region, layer, or section. Furthermore, the terms “first” and “second” are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as “first” or “second” may explicitly or implicitly include at least one of that feature.
[0209] It is further understood that the terms "first," "second," etc., are used to describe various types of information, but this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another, and do not indicate a specific order or degree of importance. In fact, the expressions "first," "second," etc., are completely interchangeable. For example, without departing from the scope of this disclosure, first information can also be referred to as second information, and similarly, second information can also be referred to as first information.
[0210] In this description, "multiple" means at least two, referring to two or more, such as two, three, etc., unless otherwise explicitly specified. Other quantifiers are similar. The singular forms "a," "the," and "the" are also intended to include the plural forms unless the context clearly indicates otherwise. Furthermore, unless otherwise specified or clearly indicated from the context, the articles "a" and "an" as used in this application and the appended claims are generally understood to mean "one or more."
[0211] It should be understood that, unless otherwise specifically indicated, features of various embodiments of this disclosure described herein can be combined with each other. As used herein, the term "and / or" includes any one of the related listed items and any combination of two or more; "and / or" describes the association relationship between related objects, indicating that three relationships may exist, for example, A and / or B can represent: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. Similarly, "at least one of..." includes any one of the related listed items and any combination of two or more.
[0212] It is further understood that the terms "first," "second," etc., are used to describe various types of information, but this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another, and do not indicate a specific order or degree of importance. In fact, the expressions "first," "second," etc., are completely interchangeable. For example, without departing from the scope of this disclosure, first information can also be referred to as second information, and similarly, second information can also be referred to as first information.
[0213] Furthermore, the term "exemplary" is used herein to indicate that it serves as an example, instance, or illustration. Any aspect or design described herein as "exemplary" is not necessarily to be construed as advantageous compared to other aspects or designs. Rather, the use of the term "exemplary" is intended to present concepts in a concrete manner. As used herein, the term "or" is intended to indicate an inclusive "or" rather than an exclusive "or." That is, unless otherwise specified or clear from the context, "X applies A or B" is intended to indicate any of the natural inclusive permutations. That is, if X applies A; X applies B; or X applies both A and B, then applying A or B satisfies the condition under any of the foregoing instances.
[0214] Similarly, although this disclosure has been shown and described with respect to one or more implementations, equivalent variations and modifications will occur to those skilled in the art upon reading and understanding the specification and drawings. This disclosure includes all such modifications and variations and is limited only by the scope of the claims. In particular, with respect to the various functions performed by the components described above (e.g., elements, resources, etc.), unless otherwise indicated, the terminology used to describe such components is intended to correspond to any component (functionally equivalent) that performs the specific function of the described component, even if it is not structurally equivalent to the disclosed structure. Furthermore, although specific features of this disclosure may have been disclosed with respect to only one of several implementations, such features may be combined with one or more other features of other implementations, as may be desired and advantageous to any given or particular application. Moreover, with regard to the terms “comprising,” “owning,” “having,” “having,” or variations thereof as used in this disclosure, such terms are intended to be inclusive in a manner similar to the term “including.”
[0215] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein.
[0216] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A method for determining image color difference, characterized in that, include: The first image and the second image to be determined for color difference are converted to HSV color space, and the color values of the first image and the second image in the HSV color space are determined respectively. The color values in the HSV color space are divided into m color intervals according to visual perception, and the color values in each of the m color intervals are mapped to a single color value to obtain m color values. Based on the m color values, the color values in the HSV color space are re-determined to obtain the re-determined color values, where m is a positive integer. The first image and the second image are each divided into regions based on the newly determined color values, resulting in n regions, where n is a positive integer; Determine the color difference between the first image and the second image in each of the n regions, and obtain the color difference between the first image and the second image based on the color difference between each of the n regions.
2. The method according to claim 1, characterized in that, The step of mapping the color values in each of the m color intervals to a single color value includes: The color values in each of the m color value intervals are mapped to a single numerical value according to the size of the corresponding color value in each color value interval, resulting in m color values, where the m color values are integer values in [0, m].
3. The method according to claim 1 or 2, characterized in that, The step of dividing the color values in the HSV color space into m color intervals according to visual perception includes: The hue, saturation, and brightness values in the HSV space are divided into color intervals based on their respective visual perception, resulting in m1 hue value intervals, m2 saturation value intervals, and m3 brightness value intervals. The m color values include: m1 hue values corresponding to the m1 hue value intervals, m2 saturation values corresponding to the m2 saturation value intervals, and m3 brightness values corresponding to the m3 brightness value intervals; Wherein, m1, m2 and m3 are positive integers.
4. The method according to claim 3, characterized in that, The process of re-determining the color values in the HSV color space based on the m color values to obtain the re-determined color values includes: Based on the human eye's visual perception of hue, saturation, and brightness values, determine the hue weights corresponding to the m1 hue values, the saturation weights corresponding to the m2 saturation values, and the brightness weights corresponding to the m3 brightness values. Based on the hue weight, the m1 hue values are weighted to obtain the newly determined m1 hue values; based on the saturation weight, the m2 saturation values are weighted to obtain the newly determined m2 saturation values; based on the brightness weight, the m3 brightness values are weighted to obtain the newly determined m3 brightness values. Wherein, the hue weight is greater than the saturation weight, and the saturation weight is greater than the brightness weight.
5. The method according to claim 1, characterized in that, The region division based on the newly determined color values results in n regions, including: Seed pixels are determined in the target image, the seed pixels being used to determine the starting pixels of the region, the target image being either the first image or the second image; Other pixels whose similarity to the seed pixel is less than a first similarity threshold are merged into the region where the seed pixel is located; Using the other pixels as seed pixels, repeat the above steps until there are no other pixels whose similarity to the seed pixels is less than the first similarity threshold, thus obtaining a connected region where the similarity between pixels in the connected region is less than the first similarity threshold. Redetermine the seed pixels and repeat the above steps until all regions in the target image are divided, resulting in k connected regions, where k is a positive integer; Based on the color similarity among the k connected regions, regions with color similarity less than the second similarity threshold among the k connected regions are merged to obtain n regions.
6. The method according to claim 5, characterized in that, Determining seed pixels in the target image includes: The target image is divided into multiple regions, and the pixel at the center of any one of these regions is used as a seed pixel. The size of each region is a preset size; or A pixel is randomly selected from the target image as the seed pixel.
7. The method according to claim 1, characterized in that, The step of obtaining the color difference between the first image and the second image based on the color difference of each of the n regions includes: Determine the number of pixels in each of the n regions, as well as the number of pixel rows and columns in each of the n regions; The ratio of the number of pixels in each region to the product is determined as the pixel frequency of each region, where the product is the product of the number of rows and the number of columns of the pixel. The weights of each region are determined based on the pixel frequency; Based on the weights of each region and the color differences of each region, a weighted sum is calculated to obtain the color difference between the first image and the second image.
8. An image color difference determination device, characterized in that, include: The conversion unit is used to convert the first image and the second image to be determined to the HSV color space respectively, and to determine the color values of the first image and the second image in the HSV color space respectively; The processing unit is configured to divide the color values in the HSV color space into m color intervals according to visual perception, and map the color values in each of the m color intervals to a single color value to obtain m color values, and redetermine the color values in the HSV color space based on the m color values to obtain the redetermined color values, where m is a positive integer; The first image and the second image are each divided into regions based on the newly determined color values, resulting in n regions, where n is a positive integer; The determining unit is configured to determine the color difference between the first image and the second image in each of the n regions, and to obtain the color difference between the first image and the second image based on the color difference between each of the n regions.
9. The apparatus according to claim 8, characterized in that, The processing unit maps the color values in each of the m color intervals to a single color value in the following manner: The color values in each of the m color value intervals are mapped to a single numerical value according to the size of the corresponding color value in each color value interval, resulting in m color values, where the m color values are integer values in [0, m].
10. The apparatus according to claim 8 or 9, characterized in that, The processing unit divides the color values in the HSV color space into m color intervals according to visual perception in the following manner: The hue, saturation, and brightness values in the HSV space are divided into color intervals based on their respective visual perception, resulting in m1 hue value intervals, m2 saturation value intervals, and m3 brightness value intervals. The m color values include: m1 hue values corresponding to the m1 hue value intervals, m2 saturation values corresponding to the m2 saturation value intervals, and m3 brightness values corresponding to the m3 brightness value intervals; Wherein, m1, m2 and m3 are positive integers.
11. The apparatus according to claim 10, characterized in that, The processing unit redetermines the color values in the HSV color space based on the m color values in the following manner, to obtain the redetermined color values: Based on the human eye's visual perception of hue, saturation, and brightness values, determine the hue weights corresponding to the m1 hue values, the saturation weights corresponding to the m2 saturation values, and the brightness weights corresponding to the m3 brightness values. Based on the hue weight, the m1 hue values are weighted to obtain the newly determined m1 hue values; based on the saturation weight, the m2 saturation values are weighted to obtain the newly determined m2 saturation values; based on the brightness weight, the m3 brightness values are weighted to obtain the newly determined m3 brightness values. Wherein, the hue weight is greater than the saturation weight, and the saturation weight is greater than the brightness weight.
12. The apparatus according to claim 8, characterized in that, The processing unit divides the region based on the newly determined color values in the following manner to obtain n regions: Seed pixels are determined in the target image, the seed pixels being used to determine the starting pixels of the region, the target image being either the first image or the second image; Other pixels whose similarity to the seed pixel is less than a first similarity threshold are merged into the region where the seed pixel is located; Using the other pixels as seed pixels, repeat the above steps until there are no other pixels whose similarity to the seed pixels is less than the first similarity threshold, thus obtaining a connected region where the similarity between pixels in the connected region is less than the first similarity threshold. Redetermine the seed pixels and repeat the above steps until all regions in the target image are divided, resulting in k connected regions, where k is a positive integer; Based on the color similarity among the k connected regions, regions with color similarity less than the second similarity threshold among the k connected regions are merged to obtain n regions.
13. The apparatus according to claim 12, characterized in that, The processing unit determines the seed pixels in the target image in the following manner: The target image is divided into multiple regions, and the pixel at the center of any one of these regions is used as a seed pixel. The size of each region is a preset size; or A pixel is randomly selected from the target image as the seed pixel.
14. The apparatus according to claim 8, characterized in that, The determining unit obtains the color difference between the first image and the second image based on the color difference of each of the n regions in the following manner: Determine the number of pixels in each of the n regions, as well as the number of pixel rows and columns in each of the n regions; The ratio of the number of pixels in each region to the product is determined as the pixel frequency of each region, where the product is the product of the number of rows and the number of columns of the pixel. The weights of each region are determined based on the pixel frequency; Based on the weights of each region and the color differences of each region, a weighted sum is performed to obtain the color difference between the first image and the second image.
15. An electronic device, characterized in that, include: processor; Memory used to store computer programs or instructions that can be executed by a processor; The processor is configured to execute the computer program or instructions to implement the steps of the image color difference determination method according to any one of claims 1 to 7.
16. A storage medium, characterized in that, The storage medium stores a computer program or instructions that, when executed by a processor of an electronic device, enable the electronic device to perform the image color difference determination method according to any one of claims 1 to 7.
17. A computer program product, characterized in that, The method includes a computer program that, when executed by a processor, implements the image color difference determination method as described in any one of claims 1 to 7.