Image theme color extraction method based on visual focus

By calculating the HSV value and distance of pixels in a central rectangular area on the display screen, and combining the octree algorithm to select a theme color that conforms to human visual intuition, the problem of ambient light switching to the wrong theme color in the existing technology is solved, thus improving the visual effect.

CN117292000BActive Publication Date: 2026-07-21GUANGDONG ZHONGYUAN CREATIVE TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGDONG ZHONGYUAN CREATIVE TECH CO LTD
Filing Date
2023-10-12
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing image processing technology cannot accurately capture the theme color that matches the subjective visual impression of the human eye, causing the ambient light to switch to the wrong theme color, which affects visual perception and consumer experience.

Method used

By acquiring images from the display screen, defining a central rectangular area, calculating the HSV values ​​and distances of pixels, using an octree algorithm to form a color set, and combining the visual focus reference color to calculate the RGB distance, saturation, brightness, and quantity ratio of each color for weighted scoring, the theme color that conforms to human visual intuition is selected.

Benefits of technology

The system accurately extracts a large number of bright and vivid colors as the theme colors of the image, which conforms to the first impression and intuition of the human eye and enhances the visual effect of the ambient lighting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117292000B_ABST
    Figure CN117292000B_ABST
Patent Text Reader

Abstract

The application discloses an image theme color extraction method based on a visual focus, and especially can determine a visual focus reference color through steps S1-S3 according to two characteristics that a visual focus of a human eye is in a middle area and the human eye is sensitive to color brightness, then calculate a color distance between the RGB value of each color in a color set and the RGB value of the visual focus reference color, so as to score weights based on the saturation, brightness, color distance and quantity proportion of each color in the color set, finally take the color with the highest score as the image theme color, and in this way, the color which is bright and bright, close to the visual focus reference color and has a large quantity is found out as the image theme color, which accords with the first impression and intuition of the human eye.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method for extracting image theme colors based on visual focus. Background Technology

[0002] Currently, with the growth of the new generation, more and more families are setting up entertainment rooms such as home theaters and game rooms in their homes. Among these families, some have increasingly higher requirements for ambient lighting, especially the installation of more ambient lights. They require these ambient lights to dynamically change based on the image displayed on the screen, so that the surrounding lights switch to the same color effect as the screen image in a timely manner. This necessitates color analysis and processing of the screen image to determine the theme color of the image and control the ambient lights to dynamically switch to that theme color, as described in the existing patent "CN114266838A, Image Data Processing Method, Apparatus, Electronic Device and Storage Medium," which describes an image color processing method that "determines the target color space value of the color sampling area based on the RGB color space value and color weight of each pixel within the color sampling area."

[0003] Current image processing technologies suffer from the following defects and shortcomings: Because images contain a vast number of colors, images with only one color are rare. However, existing technologies often employ direct and simple methods, such as algorithms that calculate the average color value, saturation, and brightness of the color. This approach fails to capture the subjective theme color perceived by the human eye, contradicting first impressions and intuition. For example, a black image with a narrow red border might be interpreted as the theme color using the aforementioned simple algorithm, but subjectively, black is the true theme color to the human eye. Therefore, switching ambient lighting to an incorrectly selected theme color undoubtedly affects the visual experience and the overall consumer experience. Summary of the Invention

[0004] To address the shortcomings of existing technologies, the present invention aims to provide an image theme color extraction method based on visual focus, specifically, a method that can select theme colors that conform to the subjective first visual impression and intuition of the human eye based on two characteristics: the human eye's visual focus is in the middle area and the human eye is sensitive to color brightness.

[0005] To achieve the above objectives, the present invention provides a method for extracting image theme colors based on visual focus. The image theme color extraction method includes the following steps:

[0006] S1. Obtain the screen image of the display;

[0007] S2. Delineate a central rectangular area based on the center point of the screen image, and obtain and calculate the HSV value and pixel distance of each pixel within the central rectangular area, thereby assigning weight scores to each pixel;

[0008] S3. Compare the scores of each pixel and use the pixel with the highest score as the visual focus reference color;

[0009] S4. Use the octree algorithm to quantize and map each color in the screen image to form a color set;

[0010] S5. Calculate the color distance between the RGB value of each color in the color set and the RGB value of the visual focus reference color, and calculate the proportion of each color in the color set in the total number of colors;

[0011] S6. Obtain and calculate the saturation, brightness, color distance, and quantity ratio of each color in the color set, and then assign a weight score to each color;

[0012] S7. Compare the scores of each color and select the color with the highest score as the image theme color.

[0013] Furthermore, in step S1, after acquiring the screen image of the display screen, the pixels of the screen image are compressed, and the compressed screen image is used in steps S2 and S4.

[0014] Furthermore, in step S6, for black and / or white in the color set, the corresponding saturation, brightness and color distance are all set to zero before weighting and scoring.

[0015] Furthermore, in step S2, based on the obtained color, saturation, brightness, and the ratio between the pixel distance and the maximum distance of the central rectangular area for each pixel, the scores corresponding to each pixel are added together according to their respective weights to obtain the score corresponding to each pixel.

[0016] Furthermore, the pixel distance is the distance between a pixel and one of the endpoints of the central rectangular region.

[0017] Furthermore, the maximum distance of the central rectangular region is the distance between the center point and one of the endpoints of the central rectangular region.

[0018] Furthermore, in step S5, the calculated color distance for each color is divided by the preset maximum RGB distance to obtain the normalized color distance, and the normalized color distance is used in step S6.

[0019] Furthermore, in step S6, based on the saturation, brightness, color distance, and quantity ratio of each color, they are added together according to their respective weights to obtain the score corresponding to each color in the color set.

[0020] The beneficial effects of this invention are as follows: by determining the visual focus reference color through steps S1-S3, and then calculating the color distance between the RGB value of each color in the color set and the RGB value of the visual focus reference color, it is possible to assign weights and scores based on the saturation, brightness, color distance and quantity ratio of each color in the color set, and finally obtain the color with the highest score as the image theme color. In this way, a vivid and bright color that is close to the visual focus reference color and has a large quantity is found as the image body color, which conforms to the first impression and intuition of the human eye. Attached Figure Description

[0021] Figure 1 This is a flowchart illustrating the method for extracting the theme color of an image.

[0022] Figure 2 A reference sample image for obtaining the screen image of the display.

[0023] Figure 3 This is a reference image of the compressed screen. Implementation

[0024] To facilitate understanding of the present invention, a more complete description is given below with reference to the accompanying drawings. Preferred embodiments of the invention are shown in the drawings. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. These embodiments are provided so that this disclosure will be thorough and complete.

[0025] Reference Figure 1 In this embodiment, an image theme color extraction method based on visual focus is proposed. Based on the visual habits of human eyes when observing screen images, the human eye's visual focus is concentrated in the middle area of ​​the screen image and it is more sensitive to color and brightness. This method calculates the image theme color on the screen image that conforms to the first impression and intuition of human eyes, so as to facilitate the control of lighting such as ambient lights.

[0026] In this embodiment, the image theme color extraction method includes the following steps:

[0027] Step S1. Acquire the screen image of the display screen. For ease of explanation, use... Figure 2 The reference sample shown is an example.

[0028] Since only one image theme color is required, and a high-resolution image is not needed, in step S1, after acquiring the screen image of the display, the pixels of the screen image are compressed (for ease of explanation, ...). Figure 3 Taking the reference image shown as an example, the color data of the compressed screen image is reduced, and the compressed screen image is used in steps S2 and S4 to speed up the calculation and running efficiency in subsequent steps.

[0029] Step S2. Delineate a central rectangular area based on the center point of the screen image, and obtain and calculate the HSV value and pixel distance of each pixel within the central rectangular area, thereby assigning weight scores to each pixel;

[0030] For clarity, please refer to the appendix. Figure 3 The compressed screen image shown below defines the coordinates of the center point of the screen image as (X0, Y0) and the coordinates of one endpoint of the central rectangular region as (X1, Y2). Therefore, the distance between the center point and the endpoint of the central rectangular region is taken as the maximum distance Dmax of the central rectangular region, and the calculation formula is as follows: .

[0031] In this embodiment, the HSV value includes color, saturation, and brightness. Therefore, obtaining the HSV value of each pixel corresponds to obtaining the color, saturation, and brightness of each pixel. For ease of explanation, the saturation of each pixel is defined as Sat, and the brightness as Bright. Additionally, the pixel distance is the distance between a pixel and one of the endpoints of the central rectangular region. For ease of explanation, the coordinates of any pixel are defined as (X2, Y2), and the pixel distance D = ... .

[0032] In step S2, based on the obtained color, saturation, brightness, and the ratio between the pixel distance and the maximum distance of the central rectangular area for each pixel, the values ​​are added together according to their respective weights to obtain the score corresponding to each pixel. Specifically, the ratio between the pixel distance and the maximum distance of the central rectangular area is denoted as D / Dmax. The calculated value directly reflects the distance ratio between the pixel and the center point. The larger the ratio value, the closer the pixel coordinates are to the center point, and vice versa. For ease of explanation, we define the saturation weight as SatWeight, the brightness weight as BrightWeight, and the ratio weight between the pixel distance and the maximum distance of the central rectangular area as Dweight. Therefore, the formula for calculating the score V of each pixel is: V = Sat*SatWeight + Bright*BrightWeight + (D / Dmax)*Dweight, that is: for saturation Sat: the higher the pixel saturation, the more vivid the color, and the higher the score for this item; for brightness Bright: the higher the pixel brightness, the brighter the color, and the higher the score for this item; for ratio D / Dmax: the larger this ratio value, the closer the pixel coordinates are to the center point, and the higher the score for this item. Therefore, by considering the comprehensive score of each pixel, we can find pixels with vivid and bright colors that are close to the center point.

[0033] Step S3. Compare the scores of each pixel and use the pixel with the highest score as the visual focus reference color;

[0034] Step S4. Use the octree algorithm to quantize and map each color in the screen image to form a color set. At this time, record the number of each color in the color set and the total number of all colors.

[0035] Step S5. Calculate the color distance between the RGB values ​​of each color in the color set and the RGB values ​​of the visual focal point reference color, and calculate the proportion of each color in the total number of colors. Specifically, for ease of explanation, the RGB values ​​of each color in the color set are defined as R1, G1, B1; the RGB values ​​of the visual focal point reference color are defined as R2, G2, B2; therefore, the color distance D1 = The color distance at this point is to reflect the similarity between the color and the visual focal reference color. The smaller the calculated color distance D, the more similar the color is to the visual focal reference color.

[0036] Furthermore, to optimize and improve the calculation and running efficiency in subsequent steps, in step S5, the calculated color distance for each color is divided by a preset maximum RGB distance to obtain a normalized color distance. This normalized color distance is then used in step S6. Specifically, the maximum RGB distance here is the distance from black to white, i.e.: Dmax = The normalized color distance Dnorm = D1 / Dmax, where normalization maps the calculated color distance to the [0,1] interval, making it easier to calculate in subsequent steps.

[0037] Furthermore, for ease of explanation, the percentage of each color in the total number of colors is defined as Count, which is the ratio between the number of each color and the total number of all colors.

[0038] Step S6. Obtain and calculate the saturation, brightness, color distance, and quantity percentage of each color in the color set, thereby assigning a weighted score to each color. Specifically, for ease of explanation, the saturation of each color in the color set is defined as Sat1, and the brightness as Bright1; correspondingly, the saturation weight value of each color in the color set is denoted as SatWeight1, the brightness weight value as BrightWeight1, the color distance weight value as Dweight1, and the quantity percentage weight value as CountWeight. Therefore, the score F corresponding to each color is F = Sat1 * SatWeight1 + Bright1 * CountWeight1. The formula is: rightWeight1 + (1 - Dnorm) * Dweight1 + Count * CountWeight1, where: for saturation (Sat1): the higher the saturation of a color in the color set, the more vibrant the color, and the higher the score; for brightness (Bright1): the higher the brightness of a color in the color set, the more vibrant the color, and the higher the score; for normalized color distance (Dnorm): the smaller the distance between the RGB value of each color in the color set and the RGB value of the visual focus reference color, the more similar the color is to the visual focus reference color, and the higher the score; for quantity (Count): the more colors there are, the higher the score. Therefore, the formula considers the comprehensive score of each color to identify colors that are vibrant and bright, close to the visual focus reference color, and abundant.

[0039] Step S7. Compare the scores of each color and select the color with the highest score as the image theme color.

[0040] Therefore, the image theme colors selected based on the four dimensions of saturation, brightness, number of colors, and visual focus are more in line with the first impression and intuition of the human eye.

[0041] Furthermore, in screen images, black and white are often used as background colors to highlight other colors. Therefore, it is necessary to avoid selecting black or white as the image theme color as much as possible. Specifically, in step S6, for black and / or white in the color set, the corresponding saturation, brightness, and color distance are all set to zero before weighting. Thus, by setting the saturation, brightness, and color distance of black and / or white to zero before weighting, it is easier to calculate in subsequent steps, thereby making the scores of black and / or white lower, so that black or white is unlikely to be used as the image theme color (this does not exclude the possibility that black or white still gets the highest score after weighting, in which case black or white is selected as the image theme color).

[0042] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any way. Any modifications or variations made by those skilled in the art, without departing from the scope of the present invention, using the disclosed technical content, are equivalent embodiments of the present invention. Therefore, all equivalent changes made based on the concept of the present invention without departing from the scope of the present invention should be covered within the protection scope of the present invention.

Claims

1. A method for extracting image theme colors based on visual focus, characterized in that: The method for extracting the theme color of an image includes the following steps: S1. Obtain the screen image of the display; S2. Delineate a central rectangular region based on the center point of the screen image, obtain the HSV value of each pixel within the central rectangular region, and the pixel distance D between each pixel and the endpoint of the central rectangular region; based on the pixel's saturation (Sat), brightness (Brightness), and the ratio D / Dmax of the pixel distance to the maximum distance of the central rectangular region, calculate the weight score of each pixel according to a preset weight, using the following formula: V = Sat × SatWeight + Bright × BrightWeight + (D / Dmax) × Dweight Where SatWeight is the saturation weight value, BrightWeight is the brightness weight value, Dweight is the distance ratio weight value, and Dmax is the maximum distance between the center point and the endpoint of the central rectangular area; the higher the pixel saturation, the higher the brightness, and the larger the D / Dmax value, the higher the pixel weight score. S3. Compare the scores of each pixel and use the pixel with the highest score as the visual focus reference color; S4. Use the octree algorithm to quantize and map each color in the screen image to form a color set; S5. Calculate the color distance between the RGB value of each color in the color set and the RGB value of the visual focus reference color, and calculate the proportion of each color in the color set in the total number of colors; S6. Obtain and calculate the saturation, brightness, color distance, and quantity ratio of each color in the color set, and then assign a weight score to each color; S7. Compare the scores of each color and select the color with the highest score as the image's theme color.

2. The image theme color extraction method based on visual focus according to claim 1, characterized in that: In step S1, after acquiring the screen image of the display screen, the pixels of the screen image are compressed, and the compressed screen image is used in steps S2 and S4.

3. The image theme color extraction method based on visual focus according to claim 1, characterized in that: In step S6, for black and / or white in the color set, the corresponding saturation, brightness and color distance are all set to zero before weighting and scoring.

4. The image theme color extraction method based on visual focus according to claim 1, characterized in that: The pixel distance is the distance between a pixel and one of the endpoints of the central rectangular region.

5. The image theme color extraction method based on visual focus according to claim 1, characterized in that: The maximum distance of the central rectangular region is the distance between the center point and one of the endpoints of the central rectangular region.

6. The image theme color extraction method based on visual focus according to claim 1, characterized in that: In step S5, the calculated color distance for each color is divided by the preset maximum RGB distance to obtain the normalized color distance, and the normalized color distance is used in step S6.

7. The image theme color extraction method based on visual focus according to claim 1, characterized in that: In step S6, based on the saturation, brightness, color distance, and quantity ratio of each color, they are added together according to their respective weights to obtain the score corresponding to each color in the color set.