A pixelated vehicle light control method, apparatus, medium, and electronic device
By automatically determining the grayscale of pixelated headlights through a brightness grayscale mapping algorithm, the problems of low efficiency and high cost in pixelated headlight control are solved, achieving efficient and low-cost pixelated headlight control.
Patent Information
- Application Number
- CN202211035724.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-26
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2042-08-26
AI Technical Summary
The existing technology for pixelated headlights has low grayscale setting efficiency and high control costs, making it difficult to meet the diverse and personalized needs of users.
A brightness grayscale mapping algorithm is adopted to automatically determine the grayscale of the pixel lamp by reading the pixel brightness in the image frame, so as to control the pixelated car lights to display the effect pattern described by the image frame.
It achieves automated control of pixelated headlights, improving control efficiency, reducing control costs, and meeting users' diverse and personalized automotive interaction needs.
Smart Images

Figure CN115376449B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of automobile, and in particular to a pixelated car lamp control method, device, medium and electronic equipment. BACKGROUND
[0002] Pixelated car lamp refers to a car lamp composed of multiple rendering units (pixel lamps), such as multiple pixel light emitting diode (LED) lamps or organic light emitting diode (OLED) lamps, which can form imaging lighting effects similar to images to improve driving safety and visibility. By adjusting the gray scale of each pixel lamp, the car lamp can present different dynamic effect patterns.
[0003] In related technologies, the gray scale of pixel lamps is generally set one by one by manual input. With the increasing requirements of car interaction and personalization, the number of pixel lamps is increasing, and the pattern effects that can be presented by pixelated car lamps are more dazzling. At the same time, the manual setting of pixel lamp gray scale has the disadvantages of low gray scale setting efficiency, high control cost of pixelated car lamps, and difficulty in improving control efficiency. There is an urgent need for a pixelated car lamp control method that can automatically set the gray scale of pixel lamps. SUMMARY
[0004] The present application provides a pixelated car lamp control method, device, medium and electronic equipment, which can automatically set the gray scale of pixel lamps, improve the control efficiency of pixelated car lamps, and reduce the control cost of pixelated car lamps.
[0005] According to a first aspect of the present application, a pixelated car lamp control method is provided, the method comprising:
[0006] reading an image frame to be rendered and determining the pixel brightness of a pixel unit in the image frame; wherein the pixel unit in the image frame corresponds to a pixel lamp in the pixelated car lamp;
[0007] determining the pixel gray scale of the pixel lamp according to the pixel brightness of the pixel unit based on a lightness gray scale mapping algorithm; wherein the pixel gray scale of the pixel lamp is used to control the pixelated car lamp to display the effect pattern described by the image frame.
[0008] According to a second aspect of the present application, a pixelated car lamp control device is provided, the device comprising:
[0009] a pixel brightness determination module configured to read an image frame to be rendered and determine the pixel brightness of a pixel unit in the image frame; wherein the pixel unit in the image frame corresponds to a pixel lamp in the pixelated car lamp;
[0010] a pixel gray scale determination module, configured to determine a pixel gray scale of the pixel lamp according to a pixel brightness of the pixel unit based on the lightness gray scale mapping algorithm, wherein the pixel gray scale of the pixel lamp is used to control the pixelized vehicle lamp to display the effect pattern described by the image frame.
[0011] According to a third aspect of the present application, the embodiments of the present application provide a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the pixelized vehicle lamp control method according to the embodiments of the present application.
[0012] According to a fourth aspect of the present application, the embodiments of the present application provide an electronic device, which comprises a memory, a processor and a computer program stored in the memory and executable by the processor, and the processor implements the pixelized vehicle lamp control method according to the embodiments of the present application when executing the computer program.
[0013] The technical scheme of the embodiments of the present application maps the pixel lightness of the pixel unit in the image frame to the pixel gray scale of the pixel lamp in the pixelized vehicle lamp based on the lightness gray scale mapping algorithm, controls the pixelized vehicle lamp to display the effect pattern described by the image frame based on the pixel gray scale of the pixel lamp, and can meet the diversified automobile interaction needs and individual needs of users. The technical scheme of the present application realizes automatic determination of the pixel gray scale of the pixel lamp in the pixelized vehicle lamp through the lightness gray scale mapping algorithm, improves the control efficiency of the pixelized vehicle lamp, and reduces the control cost of the pixelized vehicle lamp.
[0014] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present application, nor is it used to limit the scope of the present application. Other features of the present application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.
[0016] Figure 1 is a flowchart of the pixelized vehicle lamp control method according to embodiment one;
[0017] Figure 2 is a flowchart of the pixelized vehicle lamp control method according to embodiment two;
[0018] Figure 3 is a flowchart of the pixelized vehicle lamp control method according to embodiment three;
[0019] Figure 4 is a structural schematic diagram of a pixelated vehicle lamp control device provided in Embodiment Four of the present application;
[0020] Figure 5 is a structural schematic diagram of an electronic device provided in Embodiment Five of the present application. DETAILED DESCRIPTION
[0021] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should fall within the scope of protection of the present application.
[0022] It should be noted that the terms "first", "second", "target" and "candidate" and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not have to be limited to only those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0023] Embodiment One
[0024] Figure 1 is a flowchart of a pixelated vehicle lamp control method provided according to Embodiment One. The present embodiment can be applied to the case where the pixelated vehicle lamp is caused to present different effect patterns by adjusting the pixel gray scale of the pixel lamps in the pixelated vehicle lamp. The method can be executed by a pixelated vehicle lamp control device, which can be realized in the form of hardware and / or software and can be integrated into an electronic device running this system.
[0025] As shown in Figure 1 , the method comprises:
[0026] S110, reading an image frame to be rendered and determining the pixel brightness of a pixel unit in the image frame; wherein the pixel unit in the image frame corresponds to a pixel lamp in the pixelated vehicle lamp.
[0027] The image frame is an image frame to be rendered, and the effect pattern is determined in the image frame. The image frame to be rendered refers to an image frame in which the effect pattern has not been mapped to the pixelized vehicle lamp. The number of image frames and the effect pattern in the image frames are determined according to actual business requirements, and are not limited herein.
[0028] The image frame to be rendered includes at least two pixel units. By adjusting the pixel brightness of the pixel units in the image frame, a plurality of different effect patterns can be obtained. That is, in the case where the effect pattern in the image frame is determined, the pixel brightness of each pixel unit in the image frame is determined. The pixel unit includes a plurality of pixels. That is, one pixel lamp corresponds to a plurality of pixels in the image frame.
[0029] The pixel brightness refers to the brightness of the pixel in the image frame to be rendered, and the pixel brightness is an inherent attribute of the pixel in the image frame. Each pixel in the image frame has brightness, and the brightness of the pixel is independent of the hue. The pixel unit belongs to the image frame, and the pixel unit is the basic unit of the effect pattern. The pixels belonging to the same pixel unit have the same pixel brightness.
[0030] The pixel unit in the image frame corresponds to the pixel lamp in the pixelized vehicle lamp, which means that in the case where any pixel unit in the image frame is determined, the corresponding pixel lamp in the pixelized vehicle lamp can be determined.
[0031] The pixel lamp is a basic light-emitting unit in the pixelized vehicle lamp, and the pixelized vehicle lamp includes at least two pixel lamps. Optionally, the pixelized vehicle lamp can be an OLED vehicle lamp (Organic Light-Emitting Diode). By controlling the pixel gray scale of the pixel lamp in the pixelized vehicle lamp, different pattern effects can be displayed. By mapping the pixel brightness in the image frame to the pixel gray scale of the pixelized vehicle lamp, the effect pattern in the image frame can be displayed through the pixelized vehicle lamp, which can meet the diversified automobile interaction requirements and individual requirements of users.
[0032] The gray scale represents different levels of brightness from the darkest to the brightest; and the pixel gray scale refers to the brightness level corresponding to the pixel lamp.
[0033] S120, determining the pixel gray scale of the pixel lamp according to the pixel brightness of the pixel unit based on the brightness gray scale mapping algorithm.
[0034] The pixel gray scale of the pixel lamp is used to control the pixelized vehicle lamp to display the effect pattern described by the image frame.
[0035] The luminance gray scale mapping algorithm is used to map the pixel brightness of the pixel unit in the image frame to the pixel gray scale of the pixel lamp in the pixelized vehicle lamp. The pixel gray scale of the pixel lamp can be determined by using the luminance gray scale mapping algorithm, given the pixel brightness of the pixel unit in the image frame. The pixel gray scale of the pixel lamp refers to the brightness of the pixel lamp. The pixel gray scale of the pixel lamp is determined according to the pixel brightness of the pixel unit. Based on the pixel brightness of the pixel unit in the image frame, the pixel gray scale of the pixel lamp in the pixelized vehicle lamp is controlled, so that the pixelized vehicle lamp can display the effect pattern described by the image frame.
[0036] The technical scheme of the embodiment of the present application maps the pixel luminance of the pixel unit in the image frame to the pixel gray scale of the pixel lamp in the pixelized vehicle lamp based on the luminance gray scale mapping algorithm, controls the pixelized vehicle lamp to display the effect pattern described by the image frame based on the pixel gray scale of the pixel lamp, and can meet the diversified automobile interaction needs and individual needs of users. The technical scheme of the present application realizes automatic determination of the pixel gray scale of the pixel lamp in the pixelized vehicle lamp by using the luminance gray scale mapping algorithm, improves the control efficiency of the pixelized vehicle lamp, and at the same time reduces the control cost of the pixelized vehicle lamp.
[0037] In an optional embodiment, determining the pixel brightness of the pixel unit in the image frame comprises: determining a color model to which the image frame belongs as a current color model; in the case where the current color model is different from a target color model, converting the current color model into the target color model; wherein the target color model is used to separate the luminance parameter of the image frame; and determining the pixel brightness of the pixel unit in the image frame according to the luminance parameter.
[0038] The color model refers to a mathematical model for describing colors by using a set of numerical values. The color model is a visible light subset in a certain three-dimensional color space, which contains all colors in a certain color domain.
[0039] Different color models have different color description angles and different application scenarios. For example, the RGB model is a color model for hardware devices, and is usually used in display systems. The HSV (Hue Saturation Value, hue, saturation, and luminance) model is more consistent with the visual characteristics of the human eye. In the embodiment of the present application, the luminance component of the image frame is focused on, and therefore, the image model needs to separate the luminance parameter of the image frame. The current color model is the color model actually used by the image frame to be rendered. The current color model can be any color model. For example, the current image model is the RGB model, the HSV model, or other color models.
[0040] The target color model is used to separate the luminance parameter of the image frame. The luminance parameter is used to determine the pixel brightness of the pixel unit in the image frame. There is no necessary connection between the current color model and the target color model, and the current color model and the target color model can be the same or different. In the case that the current color model is different from the target color model, the current color model is converted to the target color model to separate the luminance parameter from the image frame. According to the luminance parameter, the pixel brightness of the pixel unit in the image frame is determined. Optionally, the target color model can be an HSV model.
[0041] The above technical solution converts the current color model to the target color model in the case that the current color model is different from the target color model, separates the luminance parameter of the image frame from the image frame, determines the pixel brightness of the pixel unit in the image frame according to the luminance parameter, and ensures the accuracy of the pixel brightness, thereby ensuring the accuracy of the pixel gray scale and the pattern display effect of the pixelized car lamp.
[0042] In an optional embodiment, before reading the image frame to be rendered and determining the pixel brightness of the pixel unit in the image frame, the method further comprises: determining the arrangement mode of the pixel lamp in the pixelized car lamp and assigning a pixel index to the pixel lamp; generating a rendering design template based on the arrangement mode of the pixel lamp and the pixel index of the pixel lamp; the rendering design template is used to generate the image frame to be rendered; determining the pixel index of the pixel unit in the image frame according to the pixel index of the pixel lamp; determining the correspondence between the pixel unit and the pixel lamp based on the pixel index of the pixel lamp and the pixel index of the pixel unit, and associating the correspondence to the image frame to be rendered.
[0043] It can be known that the pixelized car lamp generally includes a plurality of pixel lamps, the pixel lamp is an independent light-emitting unit in the pixelized car lamp, the pixel lamp is arranged in the pixelized car lamp in a certain mode, and different pattern effects can be obtained by controlling the pixel gray scale of the pixel lamp at different positions in the pixelized car lamp. In order to facilitate positioning and distinguishing the pixel lamp in the pixelized car lamp, the pixel index is assigned to the pixel lamp in the pixelized car lamp.
[0044] Based on the arrangement mode of the pixel lamp in the pixelized car lamp and the pixel index of the pixel lamp, a rendering design template is generated. Optionally, according to the arrangement mode of the pixel lamp in the pixelized car lamp and the pixel index of the pixel lamp, the size such as length and width of the rendering design template is determined.
[0045] The rendering design template is used to generate an image frame to be rendered. The image frame generated based on the rendering design template has pixel units corresponding to pixel lights in the pixelated vehicle lamp. According to the pixel index of the pixel light, the pixel index of the pixel unit in the image frame is determined, and optionally, the arrangement position of the pixel light in the pixelated vehicle lamp and the arrangement position of the pixel unit in the image frame are determined. The pixel index of the pixel light is assigned to the pixel unit at the corresponding position in the image frame. Based on the correspondence between the pixel index of the pixel light and the pixel index of the pixel unit, the correspondence between the pixel light and the pixel unit is determined, and the correspondence between the pixel light and the pixel unit is associated with the image frame. In the case where the pixel index of the image frame and the pixel unit is known, the pixel index of the pixel light can be determined, which provides technical support for mapping the pixel brightness of the pixel unit to the pixel gray scale of the pixel light.
[0046] Embodiment Two
[0047] Figure 2 is a flowchart of the pixelated vehicle lamp control method according to Embodiment Two. This embodiment is further optimized on the basis of the above-mentioned embodiments.
[0048] As shown in Figure 2 , the method comprises:
[0049] S210, reading an image frame to be rendered, and determining the pixel brightness of the pixel unit in the image frame; wherein the pixel unit in the image frame corresponds to the pixel light in the pixelated vehicle lamp.
[0050] S220, determining the candidate gray scale and the gray scale threshold between adjacent candidate gray scales according to the pixel brightness of the pixel unit and the number of gray scales of the pixel light.
[0051] The gray scale represents the level of different brightness from the darkest to the brightest, and the number of gray scales refers to the number of levels required to achieve the pattern effect described by the image frame. It can be understood that within a certain number range, the number of gray scales is positively correlated with the pattern effect presented by the pixelated vehicle lamp, and in the case where the number of gray scales exceeds the number range, the image effect presented by the pixelated vehicle lamp will not be significantly improved. The number of gray scales of the pixel light is related to the pattern effect described by the image frame, and is determined according to the actual situation, which is not limited here.
[0052] The pixel gray scale upper limit and the pixel gray scale lower limit can be determined according to the pixel brightness, and the candidate gray scale includes the pixel gray scale upper limit, the pixel gray scale lower limit, and other pixel gray scales between the pixel gray scale upper limit and the pixel gray scale lower limit. The number of candidate gray scales can be determined according to the number of gray scales. The candidate gray scale is other gray scales between the pixel gray scale upper limit and the pixel gray scale lower limit, which can be uniformly distributed or non-uniformly distributed, and is determined according to the actual business requirements, which is not limited here.
[0053] The gray scale threshold refers to a gray scale difference between adjacent candidate gray scales. The adjacent candidate gray scales are determined based on the gray scale values. For example, the candidate gray scales can be sorted according to the relative size relationship of the gray scale values, for example, the candidate gray scales can be sorted in ascending order, and the adjacent candidate gray scales are determined according to the arrangement order to obtain a candidate gray scale pair.
[0054] In a specific embodiment, when the number of gray scales (number gray) and the maximum luminance (Vmax) and the minimum luminance (Vmin) of the pixel luminance of the pixel unit are determined, the candidate gray scales can be obtained according to the pixel luminance and the number of gray scales: 0, 0+1×A / (number gray-1), 0+2×A / (number gray-1),..., 0+(number gray-2)×A / (number gray-1). Wherein, A represents the upper limit of the gray scale, which is a positive number greater than 0, and the upper limit of the gray scale is determined according to the actual business requirement, which is not limited here. For example, A can be 100.
[0055] When the candidate gray scales are determined, the gray scale threshold between the adjacent candidate gray scales can be determined. In the case of uneven distribution of candidate gray scales, the gray scale threshold of different candidate gray scale pairs may be different. In the case of uniform distribution of candidate gray scales, the gray scale threshold between any adjacent candidate gray scales is the same. For example, in the case of uniform distribution of candidate gray scales, the gray scale threshold (interval) can be calculated by the formula interval=(Vmax-Vmin) / (number gray-1). Of course, it can be understood that there is no certain order relationship between the determination of the candidate gray scale and the gray scale threshold. The candidate gray scale can be determined first, and then the gray scale threshold can be determined based on the gray scale threshold. The candidate gray scale can be determined first, and then the gray scale threshold can be determined based on the candidate gray scale. The order of determination of the candidate gray scale and the gray scale threshold can be determined according to the actual situation, which is not limited here.
[0056] S230, determining a pixel gray scale for the pixel lamp corresponding to the pixel unit from the candidate gray scales according to the pixel luminance of the pixel unit and the gray scale threshold.
[0057] According to the correspondence between the pixel unit and the pixel lamp and the pixel index of the pixel unit, the pixel lamp corresponding to the pixel unit is determined. The pixel luminance of the pixel unit is matched with the candidate gray scale, and the pixel gray scale of the pixel lamp corresponding to the pixel unit is determined according to the matching between the pixel luminance and the candidate gray scale and the gray scale threshold.
[0058] In an optional embodiment, the pixel gray scale of the pixel lamp corresponding to the pixel unit is determined from the candidate gray scales according to the pixel brightness of the pixel unit and the gray scale threshold, including: determining a target pixel unit in the pixel units of the image frame, and taking the pixel lamp corresponding to the target pixel unit as a target pixel lamp; matching the pixel brightness of the target pixel unit with the candidate gray scales one by one; if the matching is successful, taking the candidate gray scale matched with the pixel brightness as a target gray scale, and determining the pixel gray scale of the target pixel lamp according to the target gray scale.
[0059] In the image frame, there are at least two pixel units. The pixel units in the image frame are traversed, and an unprocessed pixel unit in the image frame is determined as a target pixel unit. A pixel lamp corresponding to the target pixel unit is determined as a target pixel lamp. Optionally, the pixel lamp corresponding to the target pixel unit is determined as the target pixel lamp according to the pixel index of the target pixel unit. The pixel brightness of the target pixel unit is matched with the candidate gray scales one by one. If the pixel brightness of the target pixel unit is matched with the candidate gray scale successfully, the candidate gray scale matched with the pixel brightness is taken as a target gray scale. The pixel gray scale of the target pixel lamp is determined according to the target gray scale.
[0060] In the image frame, there are at least two pixel units. The pixel units in the image frame are traversed, and an unprocessed pixel unit in the image frame is determined as a target pixel unit. A pixel lamp corresponding to the target pixel unit is determined as a target pixel lamp. Optionally, the pixel lamp corresponding to the target pixel unit is determined as the target pixel lamp according to the pixel index of the target pixel unit. The pixel brightness of the target pixel unit is matched with the candidate gray scales one by one. If the pixel brightness of the target pixel unit is matched with the candidate gray scale successfully, the candidate gray scale matched with the pixel brightness is taken as a target gray scale. The pixel gray scale of the target pixel lamp is determined according to the target gray scale.
[0061] In an optional embodiment, if the matching fails, at least two backup gray scales are determined from the candidate gray scales according to the relative size relationship between the pixel brightness of the target pixel unit and the candidate gray scales; the relative distances between the pixel brightness and the backup gray scales are respectively determined based on the gray scale threshold; the target gray scale is determined in the backup gray scales based on the relative distances, and the pixel gray scale of the target pixel lamp is determined according to the target gray scale.
[0062] If the pixel brightness of the target pixel unit fails to match the candidate pixel, the relative size relationship between the pixel brightness of the target pixel unit and the candidate gray scale is determined, wherein the relative size relationship is used to measure the closeness between the pixel brightness of the target pixel unit and the candidate gray scale. At least two backup gray scales are determined from the candidate gray scales according to the relative size relationship. Optionally, the candidate gray scale closest to the pixel brightness is selected as the backup gray scale.
[0063] The relative distance between the pixel brightness and the backup gray scale is determined, which is actually a process of determining the closeness between the backup gray scale and the pixel brightness of the target pixel unit. The gray scale threshold is used as a reference scale to measure the closeness between the backup gray scale and the pixel brightness of the target pixel unit. Optionally, the relative difference between the target pixel unit and the backup gray scale is calculated, and the ratio between the relative difference and the gray scale threshold is determined as the relative distance between the pixel brightness and the backup gray scale. For example, when the pixel index of the pixel unit is i and the pixel index of the pixel lamp is j, the pixel brightness of the target pixel unit is V(i), and the backup gray scale is gray(j) and gray(j+1) respectively. Wherein, i and j are positive integers.
[0064] Specifically, the relative distance between V(i) and gray(j) is determined based on the formula (V(i)-gray(j)) / interval. Wherein, interval=gray(j+1)-gray(j). The calculated relative distance is compared with the distance threshold, and the target gray scale is determined in the backup gray scale according to the comparison result of the relative distance and the distance threshold. Optionally, the distance threshold is a threshold interval determined by the upper limit of the distance and the lower limit of the distance. The upper limit and the lower limit of the distance are determined according to the actual situation, which is not limited here.
[0065] For example, the upper limit of the distance is 0.6, and the lower limit of the distance is 0.4. If the relative distance is less than or equal to 0.4, it indicates that the pixel brightness of the target pixel unit is closer to the backup gray scale gray(j), and gray(j) is determined as the target gray scale. The pixel gray scale of the target pixel lamp is determined as gray(j). If the relative distance is greater than or equal to 0.6, it indicates that the pixel brightness of the target pixel unit is closer to the backup gray scale gray(j+1), and gray(j+1) is determined as the target gray scale, and the pixel gray scale of the target pixel lamp is determined as gray(j+1). If the relative distance is greater than 0.4 and less than 0.6, it indicates that the pixel brightness of the target pixel unit is comparable to the backup gray scale gray(j) and gray(j+1), so the target gray scale is determined by integrating the backup gray scale gray(j) and gray(j+1). Specifically, the average of the backup gray scale gray(j) and gray(j+1) is determined as the target gray scale.
[0066] It is worth noting that if the pixel brightness of the target pixel unit is greater than the candidate gray scale with the largest gray scale value, the candidate gray scale with the largest gray scale value is determined as the target gray scale. On the contrary, if the pixel brightness of the target pixel unit is less than the candidate gray scale with the smallest gray scale value, the candidate gray scale with the smallest gray scale value is determined as the target gray scale.
[0067] Optionally, according to the relative size of the pixel index, the target pixel unit is determined in the unprocessed pixel unit of the image frame in a certain order, such as in the order of the index number of the pixel index from small to large, the pixel gray scale of the pixel lamp is determined according to the pixel brightness of the pixel unit by using the brightness gray scale mapping algorithm, and the pixel gray scale of the pixel lamp is stored in the gray scale array. Optionally, the gray scale array is a two-dimensional array, each row of the gray scale array corresponds to an image frame, and the number of columns of the gray scale array is determined according to the number of pixel units in the image frame. Optionally, the pixel gray scale of the pixel lamp is written into the corresponding row of the gray scale array according to the pixel index of the pixel lamp. For example, the pixel gray scale corresponding to the first frame of image frame to be rendered can be written into the first row of the gray scale array according to the pixel index of the pixel lamp. Then, the pixel gray scale corresponding to the second frame of image frame to be rendered is written into the second row of the gray scale array according to the pixel index of the pixel lamp, and so on, until all the image frames to be rendered are processed, and the final gray scale array is obtained. Based on the gray scale array, the pixelization car lamp can realize the dynamic pattern effect.
[0068] Optionally, the embodiment of the present application supports changing the number of bits of the gray scale array to obtain the user required radix data. For example, the array elements in the gray scale array can be transformed into binary, decimal or hexadecimal as needed.
[0069] According to the pixel brightness of the pixel unit and the number of gray scales of the pixel lamp, the present application determines the candidate gray scale and the gray scale threshold between adjacent candidate gray scales; according to the pixel brightness of the pixel unit and the gray scale threshold, the pixel gray scale of the pixel lamp corresponding to the pixel unit is determined from the candidate gray scale, which ensures the accuracy of the pixel gray scale, so that the pixelization car lamp can display the pattern effect described by the image frame with higher restoration degree, and the user experience is improved.
[0070] Embodiment three
[0071] Figure 3 is a flowchart of the pixelization car lamp control method provided in embodiment three. The present embodiment is further optimized on the basis of the above-mentioned embodiments.
[0072] As Figure 3 shown, the method comprises:
[0073] S310, according to the pixel brightness of the pixel unit in the image frame, determining the effect pattern described by the image frame, and determining the pattern unit in the effect pattern; wherein the effect pattern is obtained by position transformation on the pattern unit.
[0074] It is known that the pixel brightness of a pixel unit in an image frame directly affects the pattern effect described by the image frame. In other words, the effect pattern described by the image frame can be determined based on the pixel brightness of the pixel units in the image frame. Determining the pattern units in the effect pattern is essentially determining the variation pattern of pixel brightness in the pixel units of the image frame. The pattern unit is the basic building block of the effect pattern; the effect image can be obtained by transforming the position of the pattern units. The pattern unit belongs to the image frame.
[0075] Generally, regular-shaped patterns can be obtained by changing the position of pattern units. Optionally, changing the position of pattern units includes performing translation, rotation, and flip transformations.
[0076] S320. Based on the brightness grayscale mapping algorithm, determine the pixel grayscale of each pixel lamp in the rendering unit corresponding to the pattern unit.
[0077] When the effect pattern can be obtained by transforming the position of pattern units, it is unnecessary to traverse all pixel units in the image frame and use a lightness-grayscale mapping algorithm to determine the pixel grayscale of each pixel light based on the pixel brightness of each pixel unit. Instead, it is only necessary to determine the pixel grayscale of the rendering unit corresponding to the pattern unit based on the lightness-grayscale mapping algorithm. The rendering unit is determined based on the pattern unit; specifically, the corresponding pixel light can be determined in the pixelated car light based on the pixel index of the pixel unit in the pattern unit, further determining the rendering unit corresponding to the pattern unit.
[0078] Based on a lightness-grayscale mapping algorithm, the pixel grayscale of each pixel lamp in the rendering unit corresponding to the pattern unit is determined. Specifically, the pixel grayscale of the pixel lamp in the rendering unit is determined according to the pixel brightness of the pixel unit in the rendering unit.
[0079] S330. Perform the position transformation on the rendering unit, determine the associated unit in the pixelated headlights, and determine the pixel grayscale of the associated unit based on the pixel grayscale of the rendering unit.
[0080] In this design, the association unit and the rendering unit together form the effect pattern described in the image frame. The association unit is obtained by performing positional transformations on the rendering unit, such as translation or rotation. Both the rendering unit and the association unit belong to the pixelated headlights. The relative positions of the rendering unit and the association unit within the pixelated headlights are different. The number of pixels in the association unit is the same as the number of pixels in the rendering unit. The pixel grayscale of the association unit can be determined based on the pixel grayscale of the rendering unit. It is worth noting that the positional transformation performed on the rendering unit is consistent with the positional transformation performed on the pattern units in the image frame.
[0081] Based on the pixel gray scale of the rendering unit and the pixel gray scale of the associated unit, the pixel lamp in the pixelized car lamp can show the effect pattern described by the image frame.
[0082] Of course, it can be understood that for two image frames which are symmetrical to each other in the described effect pattern, in the case that the pixel lamp gray scale corresponding to one of the image frames is determined by using the lightness gray scale mapping algorithm, the pixel gray scale corresponding to the other image frame can be obtained by symmetrical transformation of the obtained pixel gray scale.
[0083] In the case that the effect pattern can be obtained by position transformation based on the pattern unit, the technical solution of the present application determines the pattern unit in the effect pattern, determines the pixel gray scale of each pixel lamp in the rendering unit corresponding to the pattern unit based on the lightness gray scale mapping algorithm, and then determines the pixel gray scale of the associated unit based on the pixel gray scale of the rendering unit. According to the pixel gray scale of the rendering unit and the pixel gray scale of the associated unit, the pixelized car lamp shows the effect pattern described by the image frame. The embodiment of the present application does not need to traverse all pixel units in the image frame to determine the pixel gray scale of the corresponding pixel lamp one by one, but only needs to determine the pixel gray scale of the rendering unit corresponding to the pattern unit based on the lightness gray scale mapping algorithm, which greatly reduces the calculation amount, reduces the calculation cost of the determination of the pixel gray scale, and improves the determination efficiency of the pixel gray scale.
[0084] Embodiment Four
[0085] Figure 4 is a structural schematic diagram of the pixelized car lamp control device provided by the fourth embodiment of the present application. The present embodiment can be applied to the case that the pixelized car lamp presents different effect patterns by adjusting the gray scale of the pixel lamp in the pixelized car lamp. The device can be realized by software and / or hardware, and can be integrated into an electronic device such as a smart terminal.
[0086] As Figure 4 indicated, the device can include:
[0087] The pixel brightness determination module 410 is configured to read an image frame to be rendered and determine the pixel brightness of the pixel unit in the image frame; wherein the pixel unit in the image frame corresponds to the pixel lamp in the pixelized car lamp;
[0088] The pixel gray scale determination module 420 is configured to determine the pixel gray scale of the pixel lamp based on the lightness gray scale mapping algorithm according to the pixel brightness of the pixel unit; wherein the pixel gray scale of the pixel lamp is used to control the pixelized car lamp to show the effect pattern described by the image frame.
[0089] The technical scheme of the embodiment of the present application maps the pixel brightness of a pixel unit in an image frame to the pixel gray scale of a pixel lamp in a pixelized car lamp based on a brightness gray scale mapping algorithm, controls the pixelized car lamp to display the effect pattern described by the image frame based on the pixel gray scale of the pixel lamp, and can meet the diversified automobile interaction needs and individual needs of users. The technical scheme of the present application realizes automatic determination of the pixel gray scale of the pixel lamp in the pixelized car lamp through the brightness gray scale mapping algorithm, improves the control efficiency of the pixelized car lamp, and reduces the control cost of the pixelized car lamp.
[0090] Optionally, the pixel gray scale determination module 420 comprises: a candidate gray scale determination submodule, configured to determine candidate gray scales and a gray scale threshold between adjacent candidate gray scales according to the pixel brightness of the pixel unit and the number of gray scales of the pixel lamp; and a pixel gray scale determination submodule, configured to determine a pixel gray scale for the pixel lamp corresponding to the pixel unit from the candidate gray scales according to the pixel brightness of the pixel unit and the gray scale threshold.
[0091] Optionally, the pixel gray scale determination submodule comprises: a target pixel lamp determination unit, configured to determine a target pixel unit in the pixel unit of the image frame, and take the pixel lamp corresponding to the target pixel unit as a target pixel lamp; a brightness gray scale matching module, configured to match the pixel brightness of the target pixel unit with the candidate gray scales one by one; and a pixel gray scale determination unit, configured to, if the matching is successful, take the candidate gray scale matched with the pixel brightness as a target gray scale, and determine the pixel gray scale of the target pixel lamp according to the target gray scale.
[0092] Optionally, the device further comprises: a backup gray scale determination module, configured to, if the matching fails, determine at least two backup gray scales from the candidate gray scales according to the relative size relationship between the pixel brightness of the target pixel unit and the candidate gray scales; a relative distance determination module, configured to determine the relative distance between the pixel brightness and the backup gray scales based on the gray scale threshold; and a target gray scale determination module, configured to determine a target gray scale from the backup gray scales based on the relative distance, and determine the pixel gray scale of the target pixel lamp according to the target gray scale.
[0093] Optionally, the pixel brightness determination module 410 comprises: a current color model determination submodule, configured to determine a color model to which the image frame belongs as a current color model; a color model conversion submodule, configured to convert the current color model into a target color model in the case where the current color model is different from the target color model; wherein the target color model is used to separate the brightness parameter of an image frame; and a pixel brightness determination submodule, configured to determine the pixel brightness of a pixel unit in the image frame according to the brightness parameter.
[0094] Optionally, the device further comprises: an arrangement mode determining module, configured to determine an arrangement mode of the pixel lamp in the pixelated vehicle lamp and assign a pixel index to the pixel lamp before reading an image frame to be rendered and determining pixel brightness of a pixel unit in the image frame; a rendering design template generating module, configured to generate a rendering design template based on the arrangement mode of the pixel lamp and the pixel index of the pixel lamp; the rendering design template is used to generate the image frame to be rendered; a pixel index determining module, configured to determine a pixel index of the pixel unit in the image frame according to the pixel index of the pixel lamp; a corresponding relationship determining module, configured to determine a corresponding relationship between the pixel unit and the pixel lamp based on the pixel index of the pixel lamp and the pixel index of the pixel unit, and associate the corresponding relationship to the image frame to be rendered.
[0095] Optionally, the device further comprises: a pattern unit determining module, configured to determine an effect pattern described by the image frame and determine a pattern unit in the effect pattern according to the pixel brightness of the pixel unit in the image frame; wherein the effect pattern is obtained by position transformation on the pattern unit; a rendering unit pixel gray scale determining module, configured to determine pixel gray scales of each pixel lamp in a rendering unit corresponding to the pattern unit based on the brightness gray scale mapping algorithm; and an associated unit determining module, configured to determine an associated unit in the pixelated vehicle lamp by performing the position transformation on the rendering unit and determine pixel gray scales of the associated unit based on the pixel gray scales of the rendering unit.
[0096] The pixelated vehicle lamp control device provided by the embodiments can execute the pixelated vehicle lamp control method provided by any of the embodiments, and has the corresponding performance modules and beneficial effects of executing the pixelated vehicle lamp control method.
[0097] In the technical solutions of the present disclosure, the acquisition, storage and application of user personal information comply with relevant laws and regulations and do not violate public order and good customs.
[0098] Embodiment five
[0099] Figure 5A structural diagram of an electronic device 510 that can be used to implement the embodiments is shown. The electronic device 510 includes at least one processor 511, and a memory, such as a read-only memory (ROM) 512, a random access memory (RAM) 513, and the like, which is communicatively connected to the at least one processor 511, wherein the memory stores a computer program that can be executed by the at least one processor. The processor 511 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 512 or loaded into the random access memory (RAM) 513 from the storage unit 518. In the RAM 513, various programs and data required for the operation of the electronic device 510 can also be stored. The processor 511, the ROM 512, and the RAM 513 are connected to each other through a bus 514. An input / output (I / O) interface 515 is also connected to the bus 514.
[0100] A plurality of components in the electronic device 510 are connected to the I / O interface 515, including an input unit 516, such as a keyboard, a mouse, and the like, an output unit 517, such as various types of displays, a speaker, and the like, a storage unit 518, such as a magnetic disk, an optical disk, and the like, and a communication unit 519, such as a network card, a modem, a wireless communication transceiver, and the like. The communication unit 519 allows the electronic device 510 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.
[0101] The processor 511 can be various general and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 511 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, and the like. The processor 511 performs various methods and processes described above, such as the pixelated vehicle light control method.
[0102] In some embodiments, the pixelated vehicle light control method can be implemented as a computer program that is tangibly embodied in a computer-readable storage medium, such as the storage unit 518. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 510 via the ROM 512 and / or the communication unit 519. When the computer program is loaded into the RAM 513 and executed by the processor 511, one or more steps of the pixelated vehicle light control method described above can be performed. Alternatively, in other embodiments, the processor 511 can be configured to perform the pixelated vehicle light control method by any other appropriate means, such as by means of firmware.
[0103] The various embodiments of the systems and techniques described above can be implemented in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a complex programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0104] Computer programs used to implement the processes of the present application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer program
[0105] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store computer programs for use by or in connection with an instruction execution system, apparatus, or device. Computer-readable storage media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium will include one or more lines of a program of instructions in a transitory signal, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0106] To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
[0107] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0108] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. A server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.
[0109] It should be understood that various forms of flow shown above can be used, with steps reordered, added, or removed. For example, the steps recited in the present application can be performed in parallel, in series, or in a different order, without limitation herein, as long as the desired results of the present application are achieved.
[0110] The specific embodiments described above are not intended to be limiting, and persons skilled in the art will appreciate that various modifications, combinations, sub-combinations and alternatives can be made to the specific embodiments without departing from the spirit and scope of the disclosure. Any modifications, equivalent substitutions, improvements, and the like, made within the spirit and principles of the present application should be included in the scope of the present application.
Claims
1. A method of pixelated vehicle light control, characterized in that, The method comprises: reading an image frame to be rendered, and determining the pixel brightness of a pixel unit in the image frame; wherein the pixel unit in the image frame corresponds to a pixel lamp in a pixelated car lamp; determining the pixel gray scale of the pixel lamp according to the pixel brightness of the pixel unit based on a lightness gray scale mapping algorithm; wherein the pixel gray scale of the pixel lamp is used to control the pixelated car lamp to display the effect pattern described by the image frame; wherein the determination of the pixel gray scale of the pixel lamp according to the pixel brightness of the pixel unit based on the lightness gray scale mapping algorithm comprises: determining a candidate gray scale and a gray scale threshold between adjacent candidate gray scales according to the pixel brightness of the pixel unit and the number of gray scales of the pixel lamp; determining the pixel gray scale of the pixel lamp corresponding to the pixel unit from the candidate gray scales according to the pixel brightness of the pixel unit and the gray scale threshold; wherein the determination of the pixel gray scale of the pixel lamp corresponding to the pixel unit from the candidate gray scales according to the pixel brightness of the pixel unit and the gray scale threshold comprises: determining a target pixel unit in the pixel unit of the image frame, and taking the pixel lamp corresponding to the target pixel unit as a target pixel lamp; matching the pixel brightness of the target pixel unit with the candidate gray scales one by one; if the matching fails, determining at least two backup gray scales from the candidate gray scales according to the relative size relationship between the pixel brightness of the target pixel unit and the candidate gray scales; determining the relative distance between the pixel brightness and the backup gray scales based on the gray scale threshold; determining a target gray scale from the backup gray scales based on the relative distance, and determining the pixel gray scale of the target pixel lamp according to the target gray scale.
2. The method of claim 1, wherein, The determination of the pixel gray scale of the pixel lamp corresponding to the pixel unit from the candidate gray scales according to the pixel brightness of the pixel unit and the gray scale threshold further comprises: if the matching succeeds, taking the candidate gray scale matched with the pixel brightness as a target gray scale, and determining the pixel gray scale of the target pixel lamp according to the target gray scale.
3. The method of claim 1, wherein, The determination of the pixel brightness of the pixel unit in the image frame comprises: determining the color model to which the image frame belongs as a current color model; in the case where the current color model is different from a target color model, converting the current color model into the target color model; wherein the target color model is used to separate the lightness parameter of the image frame; determining the pixel brightness of the pixel unit in the image frame according to the lightness parameter.
4. The method of claim 1, wherein, Before reading the image frame to be rendered and determining the pixel brightness of the pixel unit in the image frame, the method further comprises: determining the arrangement mode of the pixel lamp in the pixelated car lamp, and assigning a pixel index to the pixel lamp; generating a rendering design template based on the arrangement mode of the pixel lamp and the pixel index of the pixel lamp; the rendering design template is used to generate the image frame to be rendered; determining the pixel index of the pixel unit in the image frame according to the pixel index of the pixel lamp; determine a correspondence between the pixel unit and the pixel lamp based on a pixel index of the pixel lamp and a pixel index of the pixel unit, and associate the correspondence to the image frame to be rendered.
5. The method according to any one of claims 1 to 4, characterized in that, The method further comprises: determine an effect pattern described by the image frame according to the pixel brightness of the pixel unit in the image frame, and determine a pattern unit in the effect pattern; wherein the effect pattern is obtained by position transformation on the pattern unit; determine the pixel gray scale of each pixel lamp in the rendering unit corresponding to the pattern unit based on the lightness gray scale mapping algorithm; perform the position transformation on the rendering unit, determine an associated unit in the pixelized vehicle lamp, and determine the pixel gray scale of the associated unit based on the pixel gray scale of the rendering unit.
6. A pixelated vehicle lamp control device, characterized by The device comprises: a pixel brightness determination module configured to read an image frame to be rendered, and determine a pixel brightness of a pixel unit in the image frame; wherein the pixel unit in the image frame corresponds to a pixel lamp in a pixelized vehicle lamp; a pixel gray scale determination module configured to determine a pixel gray scale of the pixel lamp based on a lightness gray scale mapping algorithm according to the pixel brightness of the pixel unit; wherein the pixel gray scale of the pixel lamp is used to control the pixelized vehicle lamp to display an effect pattern described by the image frame; wherein the pixel gray scale determination module comprises: a candidate gray scale determination submodule configured to determine a candidate gray scale and a gray scale threshold between adjacent candidate gray scales according to the pixel brightness of the pixel unit and a gray scale number of the pixel lamp; and a pixel gray scale determination submodule configured to determine a pixel gray scale of the pixel lamp corresponding to the pixel unit from the candidate gray scales according to the pixel brightness of the pixel unit and the gray scale threshold; wherein the pixel gray scale determination submodule comprises: a target pixel lamp determination unit configured to determine a target pixel unit in the pixel unit of the image frame, and take the pixel lamp corresponding to the target pixel unit as a target pixel lamp; a lightness gray scale matching module configured to match the pixel brightness of the target pixel unit with the candidate gray scales one by one; a backup gray scale determination module configured to, if the matching fails, determine at least two backup gray scales from the candidate gray scales according to a relative size relationship between the pixel brightness of the target pixel unit and the candidate gray scales; a relative distance determination module configured to determine a relative distance between the pixel brightness and the backup gray scales based on the gray scale threshold; and a target gray scale determination module configured to determine a target gray scale from the backup gray scales based on the relative distance, and determine the pixel gray scale of the target pixel lamp according to the target gray scale.
7. A computer-readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the pixelized vehicle lamp control method of any one of claims 1-5.
8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the pixelized vehicle lamp control method of any one of claims 1-5.
Citation Information
Patent Citations
Screen brightness control method and device and terminal equipment
CN110473502A
Pixelized vehicle lamp control method, editing method, equipment, terminal and storage medium
CN113823218A