In-vehicle atmosphere lamp control method, storage medium, electronic device and program product

By analyzing the color and spatial relationships of images, the illumination of the ambient lighting inside the vehicle is controlled, solving the problem of monotonous lighting distribution in existing technologies and improving the user experience.

CN122054419APending Publication Date: 2026-05-15DONGFENG MOTOR CO LTD DONGFENG NISSAN PASSENGER VEHICLE CO
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
DONGFENG MOTOR CO LTD DONGFENG NISSAN PASSENGER VEHICLE CO
Filing Date
2026-01-30
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Existing ambient lighting control methods lack analysis of image color space and position information, resulting in a single lighting effect distribution, failing to fully utilize the multi-zone control capabilities of cabin ambient lighting, and thus providing an inadequate user experience.

Method used

By acquiring the color and spatial coordinate information of the image, the main hues of the image and their spatial relationships are analyzed to determine the representative color and control the illumination of the ambient lighting in the vehicle. The K-means clustering algorithm is used to optimize the color display of the lighting effect.

Benefits of technology

It achieves a high degree of matching between lighting effects and image content, enhancing the user's immersive experience in the cockpit and ensuring the accuracy of lighting color and visual effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122054419A_ABST
    Figure CN122054419A_ABST
Patent Text Reader

Abstract

The invention discloses an in-vehicle atmosphere lamp control method, a storage medium, electronic equipment and a program product, and the control method comprises the steps: obtaining a picture, and obtaining the color information and space coordinate information of each pixel point in the picture; performing color analysis on the picture according to the color information, and determining one or more main hues of the picture; determining a spatial position relationship of the main hues according to the spatial coordinate information of the main hues; determining a representative color for each of the main hues; and according to the representative color and the spatial position relation, the corresponding representative color is controlled to be lightened in the in-vehicle atmosphere. According to the method and the device, the obtained picture is subjected to color analysis, the corresponding cabin atmosphere lamp color distribution scheme is generated, the lamp effect is highly matched with the picture content, the picture is subjected to spatial position relation analysis, spatial distribution is restored, and the immersive experience of a user in a cabin is greatly enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of automotive technology, and in particular to a method for controlling ambient lighting in a vehicle, a storage medium, an electronic device, and a program product. Background Technology

[0002] With the increasing demand for intelligent and personalized vehicles, ambient lighting has become an important feature for enhancing user experience. In existing technologies, a common method for controlling ambient lighting is to generate corresponding lighting effects by analyzing the color characteristics of user-provided images or videos. For example, Chinese patent application CN202410536892.0 discloses a method for generating lighting effects from images, which determines the color of the ambient light by extracting the main colors (such as hue, saturation, and brightness) from the image.

[0003] However, existing ambient lighting control methods have the following shortcomings:

[0004] 1. Lack of color spatial location information analysis: After extracting the main colors of an image, existing algorithms usually only focus on the types and proportions of colors, and cannot analyze the spatial distribution of the main colors in the image.

[0005] 2. Monotonous Lighting Distribution: Due to the lack of spatial location information, existing technologies cannot adjust the color distribution scheme of the cabin ambient lighting according to the actual color distribution in the image (e.g., blue on the left and red on the right; or yellow at the top and green at the bottom). This results in insufficient immersion and matching of the lighting effects, and fails to fully utilize the multi-zone control capabilities of the cabin ambient lighting.

[0006] Therefore, existing technologies need a lighting control scheme that can combine image color information and its spatial relationship to generate a more immersive and matching lighting effect. Summary of the Invention

[0007] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method for controlling in-vehicle ambient lighting, a storage medium, an electronic device, and a program product. By performing color analysis on the acquired images, a corresponding cabin ambient lighting color distribution scheme is generated, so that the lighting effect is highly matched with the image content. Furthermore, the spatial position relationship of the images is analyzed to restore the spatial distribution, which greatly enhances the user's immersive experience in the cabin.

[0008] The present invention provides a method for controlling ambient lighting in a vehicle, comprising: Acquire an image, and obtain the color information and spatial coordinate information of each pixel in the image; Based on the color information, perform color analysis on the image to determine one or more primary hues of the image; Based on the spatial coordinate information of the primary hue, determine the spatial positional relationship of the primary hue; Determine the representative color for each of the primary hues; Based on the relationship between the representative color and the spatial position, the corresponding representative color is illuminated within the vehicle's interior atmosphere.

[0009] In one of the alternative technical solutions, the step of performing color analysis on the image based on the color information to determine one or more primary hues of the image includes: The RGB values ​​of each pixel in the image are processed, and RGB values ​​with saturation less than a first preset saturation threshold are deleted. Calculate the hue value of each RGB value after processing, and divide the hue value into a preset hue wheel; Count the number of RGB values ​​for each hue and calculate the percentage of each hue. The hues with a proportion greater than or equal to a preset proportion threshold are designated as the primary hues.

[0010] In one of the alternative technical solutions, determining the spatial positional relationship of the primary hue based on the spatial coordinate information of the primary hue includes: If there are two main hues, obtain the X coordinates of the pixels contained in the two main hues; Calculate the median coordinates of the pixels of the two main hues in the X direction respectively; If the ratio of the difference between the two median coordinates to the length of the image in the X direction is greater than a preset length threshold, it is determined that the two main hues satisfy a spatial positional relationship with clear left-right distinction.

[0011] In one of the alternative technical solutions, determining the spatial positional relationship of the primary hue based on the spatial coordinate information of the primary hue further includes: If the two main hues do not clearly distinguish between left and right, the image is divided into a left split screen and a right split screen along the middle position of the X direction. Calculate the Y coordinates of the pixels of the two primary hues in the left and right split screens respectively; Based on the Y coordinate, calculate the Y-direction median, first quartile, and third quartile of the two main hues in the left and right split screens, respectively. If the Y-axis median, the first quartile, and the third quartile satisfy a preset consistency condition, it is determined that the two main hues satisfy a spatial positional relationship with obvious vertical distribution.

[0012] In one of the optional technical solutions, if the Y-direction median, the first quartile, and the third quartile satisfy a preset consistency condition, and it is determined that the two main hues satisfy a clear vertical spatial relationship, the solution further includes: If the Y-axis median, the first quartile, and the third quartile do not meet the preset consistency condition, the two main hues are determined to have a clearly distinguishable spatial position relationship.

[0013] In one of the alternative technical solutions, determining the spatial positional relationship of the primary hue based on the spatial coordinate information of the primary hue includes: If there are three main hues, obtain the three hue combinations that include the hue with the largest proportion in sequence; Obtain the X coordinates of the pixels contained in the three primary hues; Calculate the median coordinates of each pair of adjacent pixels of the primary hue in the X direction; If the ratio of the difference between the median coordinates of any two adjacent pairs of the image to the length of the image in the X direction is greater than a preset length threshold, it is determined that the three main hues satisfy a clear spatial positional relationship with a left-center-right distinction.

[0014] In one of the alternative technical solutions, determining the spatial positional relationship of the primary hue based on the spatial coordinate information of the primary hue further includes: If the main hues of two adjacent pairs do not clearly distinguish between left, middle and right, the image is divided into a left split screen, a middle split screen and a right split screen along the middle position of the X direction. Calculate the Y coordinates of the pixels of the main hue that are adjacent to each other in the left split screen, the middle split screen, and the right split screen respectively; Based on the Y coordinate, calculate the Y-axis median, first quartile, and third quartile of each pair of adjacent primary hues in the left, middle, and right split screens respectively; If the Y-axis median, the first quartile, and the third quartile satisfy a preset consistency condition, it is determined that the three main hues satisfy a clear spatial positional relationship with a clear vertical distribution from top to bottom.

[0015] In one of the optional technical solutions, if the Y-axis median, the first quartile, and the third quartile satisfy a preset consistency condition, and it is determined that the three main hues satisfy a clear spatial positional relationship with a clear upper, middle, and lower vertical distribution, the solution further includes: If the Y-axis median, the first quartile, and the third quartile do not meet the preset consistency condition, the three main hues are determined to have a clear spatial positional relationship with left, center, and right distinctions.

[0016] In one of the alternative technical solutions, determining the representative color of the primary hue includes: Calculate the saturation of all RGB values ​​of the primary hue and divide them into at least two preset saturation regions; Count the number of RGB values ​​in each preset saturation region and calculate the region percentage of each preset saturation region; If the area proportion is greater than or equal to a preset proportion threshold, it is divided into multiple series of RGB values ​​according to the maximum value among the RGB values. The series of RGB values ​​include: R-series RGB values, G-series RGB values, and B-series RGB values. The RGB values ​​of the series containing the maximum value in the R-series RGB values ​​are taken as a group; The RGB value with the highest brightness is selected from the group as the representative color.

[0017] In one alternative technical solution, after determining the representative color for each of the primary hues, the method further includes: The R, G, and B values ​​of the representative colors are multiplied by a preset initial luminance factor to obtain the candidate RGB values. The saturation of the representative color is obtained, and the sum of the candidate RGB value multiplied by a preset RGB weight and the saturation multiplied by a preset saturation weight is calculated to obtain the representative color score. If the representative color score is greater than or equal to a preset score threshold, the candidate RGB value will be used as the target representative color.

[0018] In one alternative technical solution, after determining the representative color for each of the primary hues, the method further includes: If the representative color score is less than the preset score threshold, the initial brightness factor is updated according to the preset update factor until the representative color score is greater than or equal to the preset score threshold.

[0019] The present invention also provides a computer-readable storage medium that stores computer instructions, which, when executed by a computer, are used to perform all steps of the in-vehicle ambient lighting control method described above.

[0020] The present invention also provides an electronic device, comprising: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the in-vehicle ambient lighting control method as described above.

[0021] The present invention also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the in-vehicle ambient lighting control method as described above.

[0022] The above technical solution yields the following beneficial effects: By performing color analysis on the acquired images, a corresponding cabin ambient lighting color distribution scheme is generated, ensuring a high degree of matching between the lighting effects and the image content. Furthermore, spatial positional analysis of the images restores the spatial distribution, greatly enhancing the user's immersive experience within the cabin. Simultaneously, by optimizing the selected representative colors, the accuracy and visual effect of the lighting effects are ensured. Attached Figure Description

[0023] The disclosure of this invention will become more readily understood by referring to the accompanying drawings. It should be understood that these drawings are for illustrative purposes only and are not intended to limit the scope of protection of this invention. In the drawings: Figure 1 This is a flowchart illustrating a method for controlling ambient lighting in a vehicle according to an embodiment of the present invention. Figure 2 This is a flowchart illustrating the process of determining the main hue in one embodiment of the present invention; Figure 3 This is a schematic diagram of the hue of the present invention; Figure 4 This is a flowchart illustrating the steps for determining the spatial positional relationship of the primary hues in one embodiment of the present invention. Figure 5a This is a schematic diagram of a first example of the two main hues of the present invention; Figure 5b This is a schematic diagram of a second example of the two main hues of the present invention; Figure 6 This is a flowchart illustrating the step of determining the spatial positional relationship of the main hues in another embodiment of the present invention. Figure 7a This is a schematic diagram of a first example of the three main hues of the present invention; Figure 7b This is a schematic diagram of a second example of the three main hues of the present invention; Figure 8 This is a flowchart illustrating the process of determining the representative color of the primary hue in one embodiment of the present invention. Figure 9 This is a flowchart illustrating the process of determining the representative color of the primary hue in another embodiment of the present invention. Figure 10 A flowchart illustrating a method for controlling ambient lighting in a vehicle, provided as a preferred embodiment of the present invention; Figure 11 This is a schematic diagram of the hardware structure of an electronic device for controlling ambient lighting in a vehicle, provided as an embodiment of the present invention. Detailed Implementation

[0024] The specific embodiments of the present invention will be further described below with reference to the accompanying drawings.

[0025] It is readily understood that, based on the technical solution of this invention, various structural and implementation methods can be interchanged by those skilled in the art without altering the essential spirit of the invention. Therefore, the following detailed embodiments and accompanying drawings are merely illustrative examples of the technical solution of this invention and should not be considered as the entirety of the invention or as limitations or restrictions on the technical solution of the invention.

[0026] The directional terms such as up, down, left, right, front, back, front, back, top, and bottom mentioned or possibly used in this specification are defined relative to the structures shown in the accompanying drawings. They are relative concepts and may therefore vary depending on their location and usage. Therefore, these or other directional terms should not be interpreted as restrictive.

[0027] like Figure 1 As shown, a flowchart of a vehicle interior ambient lighting control method according to an embodiment of the present invention is provided, including: Step S101: Obtain an image, and obtain the color information and spatial coordinate information of each pixel in the image; Step S102: Based on the color information, perform color analysis on the image to determine one or more main hues of the image; Step S103: Determine the spatial positional relationship of the main hue based on the spatial coordinate information of the main hue; Step S104: Determine the representative color for each of the primary hues; Step S105: Based on the representative color and the spatial relationship, control the lighting of the corresponding representative color in the vehicle interior atmosphere.

[0028] This invention analyzes the colors of an image to determine its main colors and spatial relationships, and then responds to the ambient lighting in the corresponding locations of the vehicle interior.

[0029] Specifically, the present invention can be applied to electronic devices with processing capabilities, such as the electronic control unit (ECU) of a vehicle.

[0030] First, step S101 is executed to acquire an image. The image can be uploaded by the user, obtained from the network, or captured by the vehicle camera. After acquiring the image, the image is parsed to extract the color information (such as RGB values) and spatial coordinate information (such as (X, Y) coordinates) of each pixel. Then, step S102 is executed to perform color analysis on the image, identify the core color that contributes the most to the overall visual effect, and determine one or more main hues of the image.

[0031] Next, step S103 is executed to determine the distribution pattern of the main hue in the image based on the spatial coordinate information of the main hue, so as to realize regional ambient light control.

[0032] Next, step S104 is executed, in which the K-means clustering algorithm is used to extract representative colors from the color wheel to optimize the color display of the lighting effect.

[0033] Finally, step S105 is executed. Based on the determined spatial relationships and representative colors, the ambient lighting throughout the vehicle is illuminated. This achieves a corresponding cabin ambient lighting color distribution scheme based on the spatial distribution of colors in the image. For example, if the spatial relationship of the image is clearly distinguished left and right, the ambient lights in the left area are illuminated with the representative color of the left, and the ambient lights in the right area are illuminated with the representative color of the right; if the spatial relationship of the image is clearly distinguished up and down, the ambient lights in the upper area are illuminated with the representative color of the upper part, and the ambient lights in the lower area are illuminated with the representative color of the lower part; if the spatial relationship of the image is clearly distinguished left, middle, and right, the ambient lights in the left area are illuminated with the representative color of the left, the ambient lights in the middle area are illuminated with the representative color of the middle, and the ambient lights in the right area are illuminated with the representative color of the right; if the spatial relationship of the image is clearly distinguished up, middle, and down, the ambient lights in the upper area are illuminated with the representative color of the upper part, the ambient lights in the middle area are illuminated with the representative color of the middle, and the ambient lights in the lower area are illuminated with the representative color of the lower part, etc. This greatly enhances the immersive experience of the user in the cabin.

[0034] In this embodiment, color analysis is performed on the acquired images to generate a corresponding cabin ambient lighting color distribution scheme, which makes the lighting effect highly matched with the image content. Furthermore, spatial positional relationship analysis is performed on the images to restore the spatial distribution, greatly enhancing the user's immersive experience in the cabin.

[0035] like Figure 2 As shown, the step of performing color analysis on the image based on the color information to determine one or more primary hues of the image includes: Step S201: Process the RGB values ​​of each pixel in the image and delete RGB values ​​whose saturation is less than a first preset saturation threshold; Step S202: Calculate the hue value of each RGB value after processing, and divide the hue value into a preset hue wheel; Step S203: Count the number of RGB values ​​for each hue and calculate the percentage of each hue; Step S204: Select the hues with a proportion greater than or equal to a preset proportion threshold as the primary hues.

[0036] Specifically, to obtain the core color that contributes most to the overall visual effect, step S201 is first executed to extract the max, mid, and min values ​​of the RGB values ​​for each pixel, and then calculate the saturation of the RGB values ​​for each pixel. The process involves deleting RGB values ​​of each pixel in the image whose saturation is below a first preset saturation threshold. This removes low-saturation colors such as gray, white, and black, which typically contribute little to the color rendering of ambient lighting and help focus on the vibrant colors in the image. The first preset saturation threshold is preferably between 0.15 and 0.25.

[0037] Then, step S202 is executed to convert the retained RGB values ​​into hue (H) values. Hue (H) is typically represented as an angle of 0°-360°. For example... Figure 3 As shown, the preset color wheel can divide 360° into several color regions, such as dividing each 10° or 20° region into a color region, and assigning the calculated color value to the corresponding color region.

[0038] Next, step S203 is executed to count the number of RGB values ​​contained in each hue region and calculate the proportion of that RGB value to the total number of RGB values ​​in the entire image, thus obtaining the hue percentage.

[0039] Finally, step S204 is executed, whereby the hue regions with a proportion greater than or equal to a preset proportion threshold are determined as the main hue of the image. The preset proportion threshold is preferably 0.1.

[0040] In this embodiment, by deleting RGB values ​​with low saturation, colors with low saturation in the image are removed. The hue value of each RGB value after processing is calculated, and the proportion of each hue is calculated. The hue with a proportion exceeding a preset proportion threshold is determined as the main hue, thereby obtaining the core color that contributes the most to the overall visual effect.

[0041] like Figure 4 As shown, determining the spatial positional relationship of the primary hue based on its spatial coordinate information includes: Step S401: If there are two main hues, obtain the X coordinates of the pixels contained in the two main hues; Step S402: Calculate the median coordinates of the pixels of the two main hues in the X direction respectively; Step S403: If the ratio of the difference between the two median coordinates to the length of the image in the X direction is greater than a preset length threshold, it is determined that the two main hues satisfy a spatial positional relationship with a clear distinction between left and right. Step S404: If the two main hues do not satisfy the requirement of clear left-right distinction, divide the image into a left split screen and a right split screen along the middle position of the X direction; Step S405: Calculate the Y coordinates of the pixels of the two main hues in the left and right split screens respectively; Step S406: Based on the Y coordinate, calculate the Y-direction median, first quartile, and third quartile of the two main hues in the left and right split screens, respectively; Step S407: If the Y-direction median, the first quartile, and the third quartile satisfy a preset consistency condition, it is determined that the two main hues satisfy a spatial positional relationship with obvious vertical distribution. Step S408: If the Y-axis median, the first quartile, and the third quartile do not meet the preset consistency condition, the two main hues are determined to have a spatial positional relationship with a clear left-right distinction.

[0042] Specifically, when two primary hues (hue 1 and hue 2) are determined, step S401 is executed to determine the X coordinates of the pixels contained in the two primary hues.

[0043] Then, step S402 is executed to calculate the median X coordinates X1 and X2 of the hue 1 and hue 2 pixel set.

[0044] Next, step S403 is executed, and the judgment condition is: ,in This represents the total length of the image in the X direction. This is a preset length threshold.

[0045] If the conditions are met, it is determined that the left and right sides are clearly distinguishable, such as... Figure 5a As shown.

[0046] If the condition is not met, it means that the two main hues are not clearly distinguished. The hue on the left is defined as hue L, and the hue on the right is hue R. Step S404 is executed to split the image from the middle along the X direction into a left split screen and a right split screen. The left split screen is hue L, and the right split screen is hue R. If there is no hue in one of the split screens, the subsequent algorithm is performed according to the preset white.

[0047] Then, step S405 is executed to obtain the set of Y coordinates of the pixels in the left and right split screens for hue 1 and hue 2 respectively.

[0048] Next, step S406 is executed, where for each hue in each split screen, the statistics of its Y coordinate are calculated, including the Y-axis median, the first quartile, and the third quartile.

[0049] Finally, steps S407 and S408 are executed sequentially to determine whether the Y-direction median, the first quartile, and the third quartile satisfy the preset consistency condition. If all satisfy the preset consistency condition, hue 1 and hue 2 show a clear vertical distribution. Figure 5b As shown, if the preset consistency condition is not met, hue 1 and hue 2 will default to a spatial relationship with a clear left-right distinction, such as... Figure 5a As shown, this ensures that at least one regional lighting effect can be provided. Table 1 below serves as an example, comparing the median in the Y direction: The result can be positive, 0, or negative. A positive number indicates that the results on both sides are consistent; a 0 number indicates that at least one side is consistent, requiring further judgment; and a negative number indicates that the results on both sides are inconsistent. Similarly, the comparison between the first and fourth-ranked scores and the third and fourth-ranked scores is the same as that of the median in the Y-direction.

[0050] Table 1

[0051] like Figure 6 As shown, determining the spatial positional relationship of the primary hue based on its spatial coordinate information includes: Step S601: If there are three main hues, obtain the three hue combinations in sequence, including the hue with the largest proportion; Step S602: Obtain the X coordinates of the pixels contained in the three main hues; Step S603: Calculate the median coordinates of the pixels of each pair of adjacent primary hues in the X direction; Step S604: If the ratio of the difference between the median coordinates of two adjacent pairs of the image to the length of the image in the X direction is greater than a preset length threshold, it is determined that the three main hues satisfy a clear spatial positional relationship between left, center and right. Step S605: If the main hues of two adjacent pairs do not satisfy the requirement of clear distinction between left, middle and right, divide the image into a left split screen, a middle split screen and a right split screen along the middle position of the X direction; Step S606: Calculate the Y coordinates of the pixels of each pair of adjacent main hues in the left split screen, middle split screen and right split screen respectively; Step S607: Based on the Y coordinate, calculate the Y-axis median, first quartile, and third quartile of each pair of adjacent main hues in the left, middle, and right split screens respectively; Step S608: If the Y-direction median, the first quartile, and the third quartile satisfy a preset consistency condition, it is determined that the three main hues satisfy a clear spatial positional relationship with a clear vertical distribution from top to bottom. Step S609: If the Y-axis median, the first quartile, and the third quartile do not meet the preset consistency condition, the three main hues are determined to have a clear spatial positional relationship with left, center, and right distinctions.

[0052] Specifically, when three main hues (hue 1, hue 2, and hue 3) are determined, steps S601-S603 are executed. Assuming the three hues are arranged in ascending order of their X-coordinate medians as hue 1, hue 2, and hue 3, the median coordinates med1, med2, and med3 of the pixels of hue 1 and hue 2, hue 2 and hue 3, and hue 3 and hue 1 in the X direction are calculated respectively.

[0053] Then, step S604 is executed, and the judgment condition is: ,in This represents the total length of the image in the X direction. This is a preset length threshold.

[0054] If the conditions are met, proceed to step S604 to determine if the left, center, and right sides are clearly distinguishable, such as... Figure 7a As shown.

[0055] If the conditions are not met, proceed to step S605 to divide the image into a left split screen, a middle split screen, and a right split screen along the X direction.

[0056] Next, steps S606-S609 are executed, sequentially determining whether the Y-direction median, the first quartile, and the third quartile meet the preset consistency condition. If all meet the preset consistency condition, the vertical distribution of hue 1, hue 2, and hue 3 is obvious (upper, middle, lower). Figure 7b As shown, if the preset consistency condition is not met, hue 1, hue 2, and hue 3 will default to a clear spatial relationship with left, center, and right distinctions, such as... Figure 7a As shown, this is to ensure that at least one regional lighting effect can be provided.

[0057] like Figure 8 As shown, determining the representative color of the primary hue includes: Step S801: Calculate the saturation of all RGB values ​​of the main hue and divide them into at least two preset saturation regions; Step S802: Count the number of RGB values ​​in each preset saturation region and calculate the region percentage of each preset saturation region; Step S803: If the area proportion is greater than or equal to a preset proportion threshold, the area is divided into multiple series of RGB values ​​according to the maximum value among the RGB values. The series of RGB values ​​include: R series RGB values, G series RGB values, and B series RGB values. Step S804: Take the series of RGB values ​​containing the maximum value in the R-series RGB values ​​as a group; Step S805: Select the RGB value with the highest brightness from the group as the representative color.

[0058] Specifically, in order to select the RGB value that best represents the hue and is suitable as the ambient light color from each major hue region, step S801 is executed to calculate the saturation of all RGB values ​​of the major hue, and the saturation is divided into at least two preset saturation regions, such as a high saturation region and a low saturation region. Preferably, the saturation is divided into three preset saturation regions, such as region 1 being [0.8, 1.0], region 2 being [0.5, 0.8], and region 3 being [0.2, 0.5].

[0059] Then, steps S802-S803 are executed to calculate the region proportion of each preset saturation region. Within the saturation region with the largest region proportion (greater than or equal to a preset proportion threshold), pixels are grouped according to the maximum value among the three components R, G, and B. For example, if R > G and R > B, then the pixel belongs to the R series. The preset proportion threshold is preferably 0.1.

[0060] Next, step S804 is executed, taking the series of RGB values ​​with the largest R value in the region as the group. For example, if the series of RGB values ​​are (200, 190, 190), (230, 100, 100), and (230, 111, 112), take (230, 100, 100) and (230, 111, 112) as the group.

[0061] Finally, step S805 is executed to calculate the brightness according to the formula. The RGB value with the highest brightness L is taken as the representative color. If the brightness L is equal, any RGB value is taken as the representative color.

[0062] like Figure 9 As shown, the process of determining the representative color for each of the primary hues further includes: Step S901: Multiply the R value, G value and B value of the representative color by a preset initial brightness factor to obtain the candidate RGB values; Step S902: Obtain the saturation of the representative color, calculate the sum of the candidate RGB value multiplied by the preset RGB weight and the saturation multiplied by the preset saturation weight, and obtain the representative color score; Step S903: If the representative color score is greater than or equal to a preset score threshold, the candidate RGB value is taken as the target representative color; Step S904: If the representative color score is less than the preset score threshold, update the initial brightness factor according to the preset update factor until the representative color score is greater than or equal to the preset score threshold.

[0063] Specifically, if the image selected by the user is relatively dark, in order to ensure that the selected representative color has sufficient brightness and visual effect when displayed on the ambient light, the selected representative color can be optimized to ensure the accuracy of the lighting effect color and visual effect. Step S901 is executed to multiply the R value, G value and B value of the representative color by the preset initial brightness factor L′, and the initial brightness factor L′ is set to 1.0, thereby adjusting the overall brightness of the representative color.

[0064] Then, step S902 is executed to calculate the representative color score. , ,in, For the RGB values ​​to be selected, w1 represents the RGB weight, and w2 represents the saturation weight.

[0065] In one embodiment, w1 is preferably 0.7 and w2 is preferably 0.3.

[0066] Finally, steps S903 and S904 are executed to determine whether the representative color h is greater than or equal to the preset scoring threshold. If so, the candidate RGB value is used as the target representative color. Otherwise, the initial brightness factor L is set to L+0.1, and step S901 is executed to gradually increase the brightness factor by updating the initial brightness factor, recalculate the candidate RGB value and the representative color score, until the representative color score is greater than or equal to the preset scoring threshold, thereby obtaining the final target representative color.

[0067] In one embodiment, the preset scoring threshold is preferably 0.6.

[0068] like Figure 10 As shown, the flowchart of a vehicle interior ambient lighting control method provided in the preferred embodiment of the present invention includes: Step S1001: Obtain the image; Step S1002: Obtain the RGB values, coordinate information, and total number of pixels within the region; Step S1003: Extract the max, mid, and min values ​​of the RGB values ​​for each pixel and calculate the saturation; Specifically, saturation ; Step S1004: Saturation ≥ 0.2? Specifically, if step S1008 is not executed, step S1005 is executed otherwise.

[0069] Step S1005: Calculate the hue and, based on the hue calculation results, assign them to the predefined 24-hue color wheel; Specifically, hue ; Step S1006: Obtain the number of RGB values ​​in each hue and calculate the percentage of each hue; Step S1007: Percentage ≥ 0.1? Specifically, if step S1008 is executed, then step S1009 is executed.

[0070] Step S1008: Delete; Step S1009: Obtain the number of hues that are retained, and sort the hues according to their proportion, from largest to smallest: hue 1, hue 2... hue N; Step S1010: If there are two main hues, obtain the X coordinates of the pixels contained in the hues; Step S1011: Calculate and obtain the median coordinates X1 and X2 in the X direction respectively; Step S1012: ≥30%? Specifically, if step S1017 is executed, then step S1013 is executed.

[0071] Step S1013: The two colors are not clearly distinguishable on the left and right. The hue on the left is defined as hue L, and the hue on the right is defined as hue R. Step S1014: Divide the screen from the middle to the left and right, and calculate the dominant hue with the largest proportion for each screen. The left screen is the hue left and the right screen is the hue right. Step S1015: Are the hue on the left and hue on the right consistent? Specifically, if step S1017 is executed, then step S1016 is executed.

[0072] Step S1016: Hue left = Hue L && Hue right = Hue R? Specifically, if step S1017 is executed, then step S1018 is executed.

[0073] Step S1017: The two colors are clearly distinguishable from left to right, hue 1 and hue 2; Step S1018: Split the screen left and right, and extract the pixels of hue 1 and hue 2 in the left and right screens respectively; Step S1019: Obtain the Y-coordinate of each pixel; Step S1020: Calculate the Y-directed median, first quartile, and third quartile for hue 1L, hue 2L, and hue 2R respectively; Step S1021: If this hue is not present in the split screen, the Y-axis median, the first quartile, and the third quartile are all calculated based on the Y-axis median of the screen. Step S1022: Are the results of comparing the median, the first and fourth highest scores, and the third and fourth highest scores all consistent? Specifically, if step S1023 is executed, then step S1024 is executed.

[0074] Step S1023: Hue 1 and hue 2 are clearly vertically distributed; Step S1024: Distinguish hue 1 and hue 2 according to left and right; Step S1025: Obtain the values ​​and quantities of all RGB values ​​in the hue; Step S1026: Calculate the saturation of all RGB values ​​and divide the region according to saturation: Region 1 [0.8, 1.0], Region 2 [0.5, 0.8), Region 3 [0.2, 0.5]. Step S1027: Obtain the number of RGB values ​​in each region and calculate the region percentage; Specifically, the area proportion j = the number of RGB values ​​in each area / the total number of RGB values ​​for the entire hue.

[0075] Step S1028: Confirm whether region j satisfies the condition that the region proportion is ≥0.1. Initially, j=1, j≤3; Step S1029: Percentage ≥ 0.1? Specifically, if step S1031 is executed, then step S1030 is executed.

[0076] Step S1030: j = j + 1; Step S1031: Select the group of pixels in region j with the largest max(R,G,B); Step S1032: Calculate the brightness and take the RGB value with the highest brightness as the representative color; Specifically, brightness .

[0077] Step S1033: R, G, and B are multiplied by the initial luminance factor L′, where initial L′ = 1.0; Step S1034: Obtain the representative color max(R,G,B) and saturation s, and calculate the representative color score; Specifically, the representative color score , ,in, For the RGB values ​​to be selected, w1 represents the RGB weight, and w2 represents the saturation weight.

[0078] Step S1035: h≥0.6? Specifically, if step S1039 is executed, then step S1036 is executed.

[0079] Step S1036: Should representative color optimization be enabled? Specifically, if step S1037 is executed, then step S1038 is executed.

[0080] Step S1037: L′=L′+0.1; Step S1038: The UX system reports "Representative color does not meet requirements"; Step S1039: Obtain the target representative color and control the ambient lighting inside the vehicle to illuminate the corresponding target representative color.

[0081] One embodiment of the present invention provides a computer-readable storage medium for storing computer instructions, which, when executed by a computer, are used to perform all steps of the in-vehicle ambient lighting control method as described in any of the above method embodiments.

[0082] like Figure 11 As shown, a hardware structure diagram of an electronic device for controlling in-vehicle ambient lighting according to an embodiment of the present invention includes: At least one processor 1101; and, Memory 1102 is communicatively connected to at least one processor 1101; wherein, The memory 1102 stores instructions that can be executed by at least one processor 1101, which enables the at least one processor 1101 to perform the in-vehicle ambient lighting control method as described in any of the above method embodiments.

[0083] Figure 11 Take a processor 1101 as an example.

[0084] The electronic device is preferably an electronic control unit (ECU).

[0085] The electronic device may also include an input device 1103 and an output device 1104.

[0086] The processor 1101, memory 1102, input device 1103 and output device 1104 can be connected by a bus or other means. The figure shows an example of connection by bus.

[0087] The memory 1102, as a non-volatile computer-readable storage medium, can be used to obtain non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules corresponding to the in-vehicle ambient lighting control method in this application embodiment, for example, Figure 1 , Figure 2 , Figure 4 , Figure 6 , Figures 8-10The method flow is shown. The processor 1101 executes various functional applications and data processing by running non-volatile software programs, instructions, and modules acquired in the memory 1102, thereby realizing the in-vehicle ambient lighting control method in the above embodiment.

[0088] The memory 1102 may include a program acquisition area and a data acquisition area, wherein the program acquisition area may acquire the operating system and applications required for at least one function; the data acquisition area may acquire data created based on the use of the in-vehicle ambient lighting control method, etc. Furthermore, the memory 1102 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 1102 may optionally include memory remotely located relative to the processor 1101, and these remote memories may be connected via a network to the apparatus performing the in-vehicle ambient lighting control method. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0089] The input device 1103 can receive user clicks and generate signal inputs related to user settings and function control of the in-vehicle ambient lighting control method. The output device 1104 may include a display device such as a display screen.

[0090] When the one or more modules are accessed in the memory 1102 and are run by the one or more processors 1101, the in-vehicle ambient lighting control method in any of the above method embodiments is executed.

[0091] The above-described product can perform the methods provided in the embodiments of this application, and has the corresponding functional modules and beneficial effects for performing the methods. Technical details not described in detail in this embodiment can be found in the methods provided in the embodiments of this application.

[0092] The present invention also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the in-vehicle ambient lighting control method as described above.

[0093] The above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, and are not intended to limit them. Although the embodiments of the present invention have been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. An in-vehicle mood lamp control method characterized by comprising: include: Acquire an image, and obtain the color information and spatial coordinate information of each pixel in the image; Based on the color information, perform color analysis on the image to determine one or more primary hues of the image; Based on the spatial coordinate information of the primary hue, determine the spatial positional relationship of the primary hue; Determine the representative color for each of the primary hues; Based on the relationship between the representative color and the spatial position, the corresponding representative color is illuminated within the vehicle's interior atmosphere.

2. The in-vehicle mood lamp control method according to claim 1, characterized by, The step of performing color analysis on the image based on the color information to determine one or more primary hues of the image includes: The RGB values ​​of each pixel in the image are processed, and RGB values ​​with saturation less than a first preset saturation threshold are deleted. Calculate the hue value of each RGB value after processing, and divide the hue value into a preset hue wheel; Count the number of RGB values ​​for each hue and calculate the percentage of each hue. The hues with a proportion greater than or equal to a preset proportion threshold are designated as the primary hues.

3. The in-vehicle mood lamp control method according to claim 1, characterized by, The step of determining the spatial positional relationship of the primary hue based on the spatial coordinate information of the primary hue includes: If there are two main hues, obtain the X coordinates of the pixels contained in the two main hues; Calculate the median coordinates of the pixels of the two main hues in the X direction respectively; If the ratio of the difference between the two median coordinates to the length of the image in the X direction is greater than a preset length threshold, it is determined that the two main hues satisfy a spatial positional relationship with clear left-right distinction.

4. The in-vehicle mood lamp control method according to claim 3, characterized by, The step of determining the spatial positional relationship of the primary hue based on the spatial coordinate information of the primary hue further includes: If the two main hues do not clearly distinguish between left and right, the image is divided into a left split screen and a right split screen along the middle position of the X direction. Calculate the Y coordinates of the pixels of the two primary hues in the left and right split screens respectively; Based on the Y coordinate, calculate the Y-direction median, first quartile, and third quartile of the two main hues in the left and right split screens, respectively. If the Y-axis median, the first quartile, and the third quartile satisfy a preset consistency condition, it is determined that the two main hues satisfy a spatial positional relationship with obvious vertical distribution.

5. The in-vehicle ambient lighting control method as described in claim 4, characterized in that, If the Y-axis median, the first quartile, and the third quartile satisfy a preset consistency condition, and it is determined that the two main hues satisfy a clear vertical spatial relationship, then the process further includes: If the Y-axis median, the first quartile, and the third quartile do not meet the preset consistency condition, the two main hues are determined to have a clearly distinguishable spatial position relationship.

6. The in-vehicle ambient lighting control method as described in claim 1, characterized in that, The step of determining the spatial positional relationship of the primary hue based on the spatial coordinate information of the primary hue includes: If there are three main hues, obtain the three hue combinations that include the hue with the largest proportion in sequence; Obtain the X coordinates of the pixels contained in the three primary hues; Calculate the median coordinates of each pair of adjacent pixels of the primary hue in the X direction; If the ratio of the difference between the median coordinates of any two adjacent pairs of the image to the length of the image in the X direction is greater than a preset length threshold, it is determined that the three main hues satisfy a clear spatial positional relationship with a left-center-right distinction.

7. The in-vehicle ambient lighting control method as described in claim 6, characterized in that, The step of determining the spatial positional relationship of the primary hue based on the spatial coordinate information of the primary hue further includes: If the main hues of two adjacent pairs do not clearly distinguish between left, middle and right, the image is divided into a left split screen, a middle split screen and a right split screen along the middle position of the X direction. Calculate the Y coordinates of the pixels of the main hue that are adjacent to each other in the left split screen, the middle split screen, and the right split screen respectively; Based on the Y coordinate, calculate the Y-axis median, first quartile, and third quartile of each pair of adjacent primary hues in the left, middle, and right split screens respectively; If the Y-axis median, the first quartile, and the third quartile satisfy a preset consistency condition, it is determined that the three main hues satisfy a clear spatial positional relationship with a clear vertical distribution from top to bottom.

8. The in-vehicle ambient lighting control method as described in claim 7, characterized in that, If the Y-axis median, the first quartile, and the third quartile satisfy a preset consistency condition, and it is determined that the three main hues satisfy a clear spatial positional relationship with a clear upper, middle, and lower vertical distribution, then the process further includes: If the Y-axis median, the first quartile, and the third quartile do not meet the preset consistency condition, the three main hues are determined to have a clear spatial positional relationship with left, center, and right distinctions.

9. The in-vehicle ambient lighting control method according to any one of claims 1-8, characterized in that, Determining the representative color of the primary hue includes: Calculate the saturation of all RGB values ​​of the primary hue and divide them into at least two preset saturation regions; Count the number of RGB values ​​in each preset saturation region and calculate the region percentage of each preset saturation region; If the area proportion is greater than or equal to a preset proportion threshold, it is divided into multiple series of RGB values ​​according to the maximum value among the RGB values. The series of RGB values ​​include: R-series RGB values, G-series RGB values, and B-series RGB values. The RGB values ​​of the series containing the maximum value in the R-series RGB values ​​are taken as a group; The RGB value with the highest brightness is selected from the group as the representative color.

10. The in-vehicle ambient lighting control method as described in claim 9, characterized in that, The process of determining the representative color for each of the primary hues further includes: The R, G, and B values ​​of the representative colors are multiplied by a preset initial luminance factor to obtain the candidate RGB values. The saturation of the representative color is obtained, and the sum of the candidate RGB value multiplied by a preset RGB weight and the saturation multiplied by a preset saturation weight is calculated to obtain the representative color score. If the representative color score is greater than or equal to a preset score threshold, the candidate RGB value will be used as the target representative color.

11. The in-vehicle ambient lighting control method as described in claim 10, characterized in that, The process of determining the representative color for each of the primary hues further includes: If the representative color score is less than the preset score threshold, the initial brightness factor is updated according to the preset update factor until the representative color score is greater than or equal to the preset score threshold.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a computer, are used to perform all steps of the in-vehicle ambient lighting control method as described in any one of claims 1-11.

13. An electronic device, characterized in that, include: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the in-vehicle ambient lighting control method as described in any one of claims 1-11.

14. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the in-vehicle ambient lighting control method as described in any one of claims 1-11.