Lamp curtain image display control method and device and electronic equipment
By using an image generation model and a near-black pixel recognition algorithm, the light curtain pattern is automatically generated, solving the problems of cumbersome operation and poor display effect of traditional methods, and realizing a pure and deep black background and bright and vivid light effect for the light curtain pattern.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHEN ZHEN NEEWER TECH CO LTD
- Filing Date
- 2026-02-12
- Publication Date
- 2026-04-24
AI Technical Summary
Traditional methods for controlling light curtain patterns are cumbersome to operate, rely on the user's drawing skills, and produce poor image display effects. In particular, near-black pixels make black backgrounds appear dull and fail to create a clear contrast between light and dark.
The initial image matrix data is automatically generated based on the user's text description data through an image generation model. Near-black pixels are identified and blackened to ensure that the light curtain displays a pure and deep black background. The initial image matrix is generated using a large language model and a text-generated image diffusion model. The image matrix data is optimized by combining various near-black pixel recognition algorithms such as brightness threshold, texture complexity, and connected component analysis.
It significantly enhances the visual appeal and overall effect of the light curtain display, creating a striking and bright contrast, ensuring a pure and deep black background, and enhancing the sense of layering and visual fidelity of the light effect.
Smart Images

Figure CN121922065A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of light curtain technology, and in particular to a light curtain image display control method, device and electronic device. Background Technology
[0002] As a display medium composed of multiple strings of vertically arranged LEDs, light curtains can present various patterned lighting effects by controlling the brightness and color of each LED, and are widely used in decoration, advertising, and other fields. Traditional methods for controlling light curtain patterns typically require users to manually draw using a dedicated app or select and combine elements from a limited image library to generate the target pattern. This method is cumbersome, time-consuming, and dependent on the user's drawing or design skills. Related technologies utilize text-based image models, allowing users to easily generate corresponding patterns by inputting text descriptions. However, the generic images generated by these models often contain a large number of pixels that are close to black but not pure black. When such images are directly mapped onto the light curtain display, these near-black pixels cause the otherwise pure black background to appear dull and murky, failing to create a clear contrast between light and dark. This severely weakens the light curtain's ability to express patterned lighting effects as a self-emissive display medium, resulting in poor display quality. Summary of the Invention
[0003] This application aims to provide a method, device, and electronic device for controlling the display of images on a light curtain, which can improve the display effect of the light curtain.
[0004] In a first aspect, embodiments of this application provide a method for controlling the display of an image in a light curtain, including: Obtain textual descriptions of the image input by the user; The text description data is input into a preset image generation model to obtain the corresponding initial image matrix data; Based on the color data of the initial image matrix data, identify the target pixel data to be blacked out; The RGB values of all pixels in the target pixel data are set to the target values representing black to obtain the target image matrix data; The light curtain is controlled to display based on the target image matrix data.
[0005] According to some embodiments of this application, the image generation model includes a large language model and a text-based image diffusion model; The step of inputting the text description data into a preset image generation model to obtain the corresponding initial image matrix data includes: The text description data is input into the large language model to generate text-based graphic prompt text data; The text prompt data of the text image is input into the text image diffusion model to generate the initial image matrix data.
[0006] According to some embodiments of this application, identifying the target pixel data to be blacked out based on the color data of the initial image matrix data includes: For each pixel in the initial image matrix data, a corresponding first brightness value is calculated based on the color data of the pixel; The texture complexity value of the local neighborhood is calculated based on the color data of all pixels in a local neighborhood of a preset window size centered on the pixel. If the first brightness value is lower than a preset brightness threshold and the texture complexity value is lower than a preset texture complexity threshold, the pixel is determined to be the target pixel data.
[0007] According to some embodiments of this application, identifying the target pixel data to be blacked out based on the color data of the initial image matrix data includes: Based on the color data of each pixel in the initial image matrix data, determine whether the red component value, green component value and blue component value of each pixel are all lower than the corresponding preset channel threshold; Construct a first binary mask corresponding to the initial image matrix data; wherein, if the red component value, the green component value, and the blue component value of the pixel are all lower than the corresponding preset channel threshold, then in the first binary mask, the position of the corresponding pixel is marked as a first value, otherwise it is marked as a second value; Starting from the position corresponding to the boundary of the initial image matrix data, a connected component analysis is performed on the first binary mask to obtain the connected component analysis result. Based on the connected component analysis results, the pixels in the first binary mask that are marked with the first value and connected to the boundary are determined as the target pixel data.
[0008] According to some embodiments of this application, identifying the target pixel data to be blacked out based on the color data of the initial image matrix data includes: Based on the color data of multiple pixels located in the preset edge region in the initial image matrix data, calculate the brightness values corresponding to the multiple pixels; A global brightness threshold is determined based on the multiple brightness values; For each pixel in the initial image matrix data, the corresponding pixel brightness value is calculated based on the color data of the pixel; If the pixel brightness value is lower than the global brightness threshold, then the pixel is determined to be the target pixel data.
[0009] According to some embodiments of this application, identifying the target pixel data to be blacked out based on the color data of the initial image matrix data includes: For each pixel in the initial image matrix data, the red component value, green component value, and blue component value of the pixel are obtained according to the color data of the pixel; Based on the red component value, the green component value, and the blue component value, calculate the Euclidean distance of the pixel from the origin in the RGB color space; If the Euclidean distance is less than a preset distance threshold, then the pixel is determined to be the target pixel data.
[0010] According to some embodiments of this application, identifying the target pixel data to be blacked out based on the color data of the initial image matrix data includes: For each pixel in the initial image matrix data, a feature value representing the brightness of the pixel is calculated based on the color data of the pixel; If the feature value is lower than the preset brightness feature threshold, the pixel is determined to be the target pixel data.
[0011] According to some embodiments of this application, it also includes: Based on the target pixel data, a second binary mask with the same size as the initial image matrix data is generated, wherein the position in the second binary mask corresponding to the target pixel data is set to a first value, and the remaining positions in the second binary mask are set to a second value; The second binary mask is subjected to morphological closing and morphological opening operations in sequence to obtain the optimized binary mask. The target pixel data is updated based on the optimized binary mask.
[0012] Secondly, embodiments of this application provide a light curtain image display control device, comprising: The acquisition module is used to acquire textual description data about the image input by the user; A generation module is used to input the text description data into a preset image generation model to obtain the corresponding initial image matrix data. The recognition module is used to identify the target pixel data to be blacked out based on the color data of the initial image matrix data; The setting module is used to set the RGB values of all pixels in the target pixel data to the target value representing black, thereby obtaining target image matrix data; A control module is used to control the light curtain to display based on the target image matrix data.
[0013] Thirdly, embodiments of this application provide an electronic device, including: At least one processor; At least one memory for storing at least one program; The above-described method for controlling the display of light curtain images is implemented when at least one of the programs is executed by at least one of the processors.
[0014] Fourthly, embodiments of this application provide a computer-readable storage medium storing a processor-executable program, which, when executed by a processor, is used to implement the light curtain image display control method described above.
[0015] In this embodiment, an initial image matrix is automatically generated based on user text description data using an image generation model. Then, based on the color data of the initial image matrix, near-black pixels in the initial image matrix are identified to obtain target pixel data to be set to black. The RGB values of the pixels in the target pixel data are uniformly set to target values representing black, thereby obtaining the final target image matrix data used to drive the display. This ensures that the pattern displayed by the light curtain has a purer and deeper black background and a bright and vivid main light effect, thus significantly improving the overall visual performance and display effect.
[0016] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0017] The present application will be further described below with reference to the accompanying drawings and embodiments, wherein: Figure 1 A flowchart illustrating an embodiment of the light curtain image display control method provided in this application; Figure 2 A schematic diagram of an embodiment of the electronic device provided in this application.
[0018] Figure label: Electronic device 100, processor 110, memory 120. Detailed Implementation
[0019] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.
[0020] In the description of this application, it should be understood that the orientation descriptions, such as up, down, etc., are based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application.
[0021] In the description of this application, "multiple" refers to two or more. The use of "first" and "second" is for the purpose of distinguishing technical features only and should not be construed as indicating or implying relative importance, or implicitly indicating the number of technical features indicated, or the order in which the technical features are indicated.
[0022] In the description of this application, unless otherwise expressly defined, terms such as "setup," "installation," and "connection" should be interpreted broadly, and those skilled in the art can reasonably determine the specific meaning of the above terms in this application in conjunction with the specific content of the technical solution.
[0023] The following is based on Figures 1 to 2 This application describes a method, apparatus, and electronic device for controlling the display of images in a light curtain.
[0024] This application provides a method for controlling the display of images in a light curtain, such as... Figure 1 As shown, it includes: Step S100: Obtain the text description data about the image input by the user; Step S200: Input the text description data into the preset image generation model to obtain the corresponding initial image matrix data; Step S300: Identify the target pixel data to be blacked out based on the color data of the initial image matrix data; Step S400: Set the RGB values of all pixels in the target pixel data to the target values representing black to obtain the target image matrix data; Step S500: Control the light curtain to display based on the target image matrix data.
[0025] In this embodiment, an initial image matrix is automatically generated based on user text description data using an image generation model. Then, based on the color data of the initial image matrix, near-black pixels in the initial image matrix are identified to obtain target pixel data to be set to black. The RGB values of the pixels in the target pixel data are uniformly set to target values representing black, thereby obtaining the final target image matrix data used to drive the display. This ensures that the pattern displayed by the light curtain has a purer and deeper black background and a bright and vivid main light effect, thus significantly improving the overall visual performance and display effect.
[0026] This embodiment applies to an intelligent light curtain system, which includes a user terminal (such as a smartphone with a dedicated APP installed), a server, and a light curtain composed of an M×N LED array, where M represents the number of horizontal LEDs and N represents the number of vertical LEDs, for example, a specification of 300 horizontal LEDs and 400 vertical LEDs. The executing entity in this embodiment can be the user terminal, a local controller communicating with the light curtain, or a cloud server.
[0027] In step S100 above, the user inputs textual description data corresponding to the pattern they wish to display on the light curtain through the interactive interface of the terminal APP, such as "Christmas tree". This textual description data is natural language text.
[0028] In step S200 above, the system inputs the text description data into a preset image generation model for processing to obtain the corresponding initial image matrix data. The image generation model includes a concatenated Large Language Model (LLM) and a text-based image diffusion model. Specifically, the Large Language Model (such as the GPT series, DeepSeek-R1, etc.) first performs semantic understanding and enrichment on the user-input text description, rewriting or expanding it into more suitable prompt text data with detailed descriptions for the text-based image model. For example, "Christmas tree" is expanded to "a green Christmas tree decorated with lights and stars, pixel art style." Next, the prompt text data is input into the text-based image diffusion model (such as the Stable Diffusion model). The text-based image diffusion model generates a digital image based on the prompt and converts it into initial image matrix data that matches the physical resolution of the light curtain (e.g., 300×400). Each element in the initial image matrix data corresponds to an LED "pixel" on the light curtain, and its color is defined by the values of the RGB three color channels.
[0029] In step S300 above, after obtaining the initial image matrix data, the system performs near-black pixel identification and blackening processing. Specifically, the system identifies the target pixel data to be blackened based on the color data of each pixel in the initial image matrix data. In a specific example, the system calls a preset near-black threshold normalization algorithm model. The near-black threshold normalization algorithm model sets an RGB threshold, for example, fixing the preset RGB values to (20, 20, 20). Then, it iterates through each pixel in the initial image matrix data, comparing its RGB channel values (R, G, B) with the preset threshold (20, 20, 20). If the R, G, and B values of a pixel are all less than or equal to the corresponding threshold (i.e., R≤20, G≤20, B≤20), then the pixel is determined to be a near-black pixel and is included in the target pixel data set to be blackened. This process can effectively filter out pixels that are close to black but not pure black, such as (1,3,5) and (2,5,2).
[0030] In step S400 above, after identifying the target pixel data, the system performs a blackening operation, which sets the RGB values of all pixels in the target pixel data set to the target value (0, 0, 0) representing pure black. After this step, all identified near-black pixels are corrected to pure black, while other pixels remain unchanged, thus obtaining the optimized target image matrix data.
[0031] In step S500 above, the system sends the target image matrix data to the controller of the light curtain. Based on the target image matrix data, the controller drives the LED beads at the corresponding positions on the light curtain to display the image according to the color and brightness specified by the target image matrix data. Since the near-black noise in the background has been set to pure black, the corresponding LED beads will be completely turned off, thus visually forming a deep and pure black background, creating a sharp contrast with the illuminated pattern, greatly enhancing the sense of depth and expressiveness of the light effect.
[0032] In some embodiments of this application, the image generation model in step S200 includes a large language model and a text-based image diffusion model; Further explanation is needed regarding step S200, which involves "inputting textual description data into a preset image generation model to obtain the corresponding initial image matrix data." Step S200 includes: Step S210: Input the text description data into the large language model to generate text-based graphic prompt text data; Step S220: Input the text prompt data of the Wensheng image into the Wensheng image diffusion model to generate the initial image matrix data.
[0033] In this implementation, the powerful semantic understanding and context generation capabilities of the large language model are leveraged to semantically expand and refine brief or ambiguous user inputs, generating detailed textual prompts that conform to the grammatical rules of the textual graph diffusion model. This significantly improves the accuracy and depth of the subsequent textual graph model's understanding of user intent. Subsequently, the textual graph diffusion model generates images based on the optimized textual prompts, ensuring that the generated initial image matrix data better meets user expectations in terms of content matching, compositional rationality, and visual detail.
[0034] In step S210 above, after the system obtains the text description data (e.g., "Christmas tree") input by the user, it first inputs it into a large language model deployed in the cloud or locally. This large language model is configured as an AI model with instruction following and text optimization capabilities, such as a pre-trained model based on the Transformer architecture. Its core task is to perform semantic recognition and deep understanding of the user input, and rewrite and expand it into a more refined "text-generated image prompt text data" suitable for driving the text-generated image model. For example, the large language model may recognize the simple "Christmas tree" as requiring the generation of a pixel-style image with a holiday theme, and automatically supplement key attributes, outputting prompt text such as "A green Christmas tree with stars and colored lights, minimalist pixel art style, white background." This process essentially transforms the user's abstract intention into a concrete creative instruction that the image generation model can accurately execute.
[0035] In step S220 above, the system inputs the textual image prompt data generated by the large language model into the textual image diffusion model. The textual image diffusion model is a generative artificial intelligence model based on a diffusion process, such as Stable Diffusion. After receiving the textual image prompt data, the textual image diffusion model gradually generates a color digital image that highly matches the semantic content of the prompt text through its internal denoising diffusion process. Subsequently, the system parses and formats this digital image into initial image matrix data corresponding to the physical pixel specifications of the light curtain. Each element in the initial image matrix data represents a pixel and contains the values of its RGB color channels.
[0036] In some embodiments of this application, the step S300 of "identifying the target pixel data to be black based on the color data of the initial image matrix data" is further described. Step S300 includes: Step S310: For each pixel in the initial image matrix data, calculate the corresponding first brightness value based on the pixel's color data; Step S311: Calculate the texture complexity value of the local neighborhood based on the color data of all pixels in the local neighborhood of a preset window size centered on the pixel. Step S312: If the first brightness value is lower than the preset brightness threshold and the texture complexity value is lower than the preset texture complexity threshold, determine the pixel as the target pixel data.
[0037] In this embodiment, for each pixel in the initial image matrix data, its first brightness value based on color data is first calculated, and simultaneously the brightness distribution characteristics of all pixels within a preset local neighborhood centered on that pixel are analyzed to quantify the texture complexity of that region. The texture complexity value can effectively characterize the richness or uniformity of detail in the local neighborhood. When determining near-black, a pixel is only identified as a target pixel to be blacked out when its brightness value is lower than a preset brightness threshold and the texture complexity value of its local neighborhood is also lower than a preset texture complexity threshold. This solves the problem that relying solely on the brightness threshold may misjudge low-brightness but high-texture-detail areas (such as shadows and dark textures) within the main image as background. Through texture complexity, the system can more accurately distinguish between the dark image details that need to be retained and the large-area uniform near-black background that needs to be purified, thereby optimizing the contrast of the light curtain display while maximizing the preservation of the visual information integrity and detail expression of the generated pattern.
[0038] Specifically, the system first iterates through each pixel in the initial image matrix data. For the pixel to be determined, the system calculates a first brightness value representing its lightness or darkness based on its color data (i.e., R, G, and B component values). This calculation can be performed according to a standard brightness formula, for example: Y = 0.2126 * R + 0.7152 * G + 0.0722 * B; Where Y is the first luminance, and R, G, and B are the normalized color component values.
[0039] Define a local neighborhood with a preset window size, such as a 3x3 or 5x5 rectangular pixel area centered on the current pixel. The system acquires the color data of all pixels within the local neighborhood and calculates their respective brightness values. Based on these brightness values, the system further calculates the texture complexity value of the local neighborhood to quantify the drastic degree of brightness variation within the neighborhood. A typical calculation method is to calculate the variance or standard deviation of the brightness values of all pixels within the local neighborhood relative to their average brightness. The smaller the variance or standard deviation, the more uniform the brightness and the simpler the texture in the area; conversely, the richer the details and the more complex the texture.
[0040] Subsequently, the system executes a dual-condition judgment logic. It compares the calculated first brightness value with a preset brightness threshold, and the calculated texture complexity value with a preset texture complexity threshold. The system determines that the current pixel belongs to the background noise that needs to be cleaned and identifies it as the target pixel data only when both of the following conditions are met: the first brightness value is lower than the preset brightness threshold; and the texture complexity value is lower than the preset texture complexity threshold.
[0041] In some embodiments of this application, the step S300 of "identifying the target pixel data to be black based on the color data of the initial image matrix data" is further described. Step S300 includes: Step S321: Based on the color data of each pixel in the initial image matrix data, determine whether the red component value, green component value and blue component value of each pixel are all lower than the corresponding preset channel threshold; Step S322: Construct a first binary mask corresponding to the initial image matrix data; wherein, if the red component value, green component value and blue component value of a pixel are all lower than the corresponding preset channel threshold, then in the first binary mask, the position of the corresponding pixel is marked as the first value, otherwise it is marked as the second value; Step S323: Starting from the position corresponding to the boundary of the initial image matrix data, perform connected component analysis on the first binary mask to obtain the connected component analysis results; Step S324: Based on the connected component analysis results, the pixels marked as the first value and connected to the boundary in the first binary mask are determined as target pixel data.
[0042] In this embodiment, the red, green, and blue component values of each pixel are first determined based on a preset channel threshold, and a first binary mask is constructed accordingly to initially mark potential near-black pixels. Connectivity analysis is then performed starting from the boundary positions of the initial image matrix data. This allows the system to further distinguish the set of pixels connected to the image boundary from all pixels marked with the first value, based on the relationship between the pixel's label value in the first binary mask and its spatial position. This effectively solves the problem that relying solely on color thresholds may misidentify areas within the image subject that are close to black in color but spatially independent as background. By strictly limiting the target pixel data to pixels that both meet the color threshold conditions and are spatially connected to the boundary, this invention ensures that during the display of the light curtain, only the true, continuous background areas in the image are optimized for blackening. This enhances background purity and contrast while reliably preserving all details and structures within the foreground subject, significantly improving the visual fidelity and sense of depth of the final displayed pattern.
[0043] Specifically, the system first performs initial screening based on preset channel thresholds for the color components. The system iterates through each pixel in the initial image matrix data, reading its color data, namely the red, green, and blue component values. For each pixel, the system determines whether its red, green, and blue component values are simultaneously lower than their respective preset channel thresholds. Based on the determination, the system constructs a first binary mask with the exact same size as the initial image matrix data. In the first binary mask, if the red, green, and blue component values of a pixel are all lower than their corresponding preset channel thresholds, the corresponding position of that pixel in the first binary mask is marked with a first value (e.g., 1); otherwise, it is marked with a second value (e.g., 0). The first binary mask marks all pixel positions that meet the near-black condition in color.
[0044] Next, the system starts from the position corresponding to the boundary of the initial image matrix data (e.g., the position of the outermost ring of pixels in the initial image matrix data in the first binary mask) and performs connected component analysis on the first binary mask. Specifically, a seed filling algorithm can be used: using all pixels marked with the first value on the boundary as initial seed points, region growing is performed in the first binary mask according to a preset connectivity rule (e.g., 4-connectivity or 8-connectivity) to find all regions in the first binary mask that are connected to the image boundary through the path of the first value pixels. The result of the connected component analysis is to identify which pixels marked with the first value are connected to the boundary. Based on the results of the connected component analysis, the system finally determines the target pixel data: that is, only those pixels in the first binary mask marked with the first value and determined to be connected to the boundary through connected component analysis are included in the target pixel data set. Pixels that are also marked with the first value but are located inside the image and are isolated or closed regions without a connected path to the boundary are excluded from the target pixel data.
[0045] In some embodiments of this application, the step S300 of "identifying the target pixel data to be black based on the color data of the initial image matrix data" is further described. Step S300 includes: Step S331: Calculate the brightness values corresponding to multiple pixels based on the color data of multiple pixels located in the preset edge region in the initial image matrix data; Step S332: Determine the global brightness threshold based on multiple brightness values; Step S333: For each pixel in the initial image matrix data, calculate the corresponding pixel brightness value based on the pixel's color data; Step S334: If the pixel brightness value is lower than the global brightness threshold, then the pixel is determined to be the target pixel data.
[0046] In this embodiment, color data of multiple pixels located in preset edge regions are first extracted from the initial image matrix data, and the set of brightness values corresponding to these pixels is calculated. Then, a global brightness threshold is dynamically determined based on the statistical characteristics of this brightness value set (e.g., taking a specific percentile), allowing the global brightness threshold to adapt to the actual content and tone of the current image. For images that are generally bright, the generated global brightness threshold will be correspondingly higher, avoiding misclassification of normal dark areas as background; for images that are generally dark or have low contrast, the generated global brightness threshold will be relatively lower, ensuring effective identification of near-black background areas. Finally, by comparing the pixel brightness value of each pixel with the adaptively generated global brightness threshold one by one, the system can objectively and consistently determine whether the pixel belongs to the target pixel data to be set to black. This adaptive global brightness threshold determination method overcomes the problem of unstable background recognition results caused by differences in the output of the text-based image model or different user-described themes, thus ensuring consistent, reliable, and accurate background optimization results in various application scenarios, ultimately improving the visual quality of the light curtain display.
[0047] Specifically, the system selects multiple pixels located in a preset edge region from the initial image matrix data. The preset edge region is typically defined as the outermost ring of pixels in the image matrix, or a boundary region of a specified width (e.g., 2-3 pixels wide). The system acquires the color data of these preset edge region pixels and calculates the corresponding brightness value for each edge pixel according to the standard brightness calculation formula, thereby obtaining a set of edge pixel brightness values.
[0048] Next, the system determines a global brightness threshold based on multiple brightness values. Specifically, it performs statistical analysis on the set of brightness values to extract a feature value that can represent the brightness of the edge background. A typical implementation is to calculate a specific percentile of the set, such as the 75th percentile (i.e., 75% of edge pixels are brighter than this value), and use this percentile directly as the global brightness threshold; another implementation is to add a preset offset to this percentile to form the final global brightness threshold.
[0049] Then, the system iterates through and processes each pixel in the initial image matrix data. For each pixel, the system calculates the corresponding pixel brightness value based on its own color data using the same brightness calculation formula as described above.
[0050] Finally, the system performs a judgment operation: it compares the pixel brightness value calculated for each pixel with the global brightness threshold determined in the previous step. If the pixel brightness value is lower than the global brightness threshold, the pixel is determined to meet the near-black condition and is identified as the target pixel data; otherwise, it is retained.
[0051] In some embodiments of this application, the step S300 of "identifying the target pixel data to be black based on the color data of the initial image matrix data" is further described. Step S300 includes: Step S341: For each pixel in the initial image matrix data, obtain the red component value, green component value and blue component value of the pixel according to the pixel's color data; Step S342: Calculate the Euclidean distance of the pixel from the origin in the RGB color space based on the red component value, green component value, and blue component value; Step S343: If the Euclidean distance is less than the preset distance threshold, then the pixel is determined to be the target pixel data.
[0052] In this embodiment, for each pixel in the initial image matrix data, the Euclidean distance from that pixel to the origin (0,0,0) in the RGB three-dimensional color space is calculated directly based on its red, green, and blue component values. The Euclidean distance comprehensively and equally considers the contributions of all color channels, forming a scalar measure of how close a color is to pure black. By comparing the calculated Euclidean distance with a preset distance threshold, the system can directly and objectively determine whether the pixel belongs to the target pixel data to be set to black. This is suitable for light curtain display control scenarios that require high color fidelity and real-time computation. It ensures that all pixels in the generated pattern that are sufficiently close to pure black in the overall color vector are reliably identified and optimized, thereby significantly improving the visual purity of the background and the processing efficiency of the display system.
[0053] Specifically, the system first presets a distance threshold, which defines the maximum allowable vector length for a pixel to be classified as near-black in the RGB three-dimensional color space. Next, the system iterates through each pixel in the initial image matrix data. For the pixel to be processed, the system reads its color data, obtaining the red, green, and blue component values. These component values are typically integers between 0 and 255. Subsequently, the system calculates the Euclidean distance of the pixel to the origin in the RGB color space. The origin corresponds to pure black, with coordinates (0, 0, 0). The distance calculation formula is: d = sqrt(R^2 + G^2 + B^2); Where d is the Euclidean distance, and R, G, and B are the red, green, and blue component values, respectively.
[0054] The system executes the following decision logic: It compares the calculated Euclidean distance with a preset distance threshold. If the Euclidean distance is less than the preset threshold, the pixel's color is determined to be sufficiently close to pure black overall, and thus it is identified as target pixel data. Conversely, if the distance is greater than or equal to the threshold, the pixel is excluded from the target pixel data.
[0055] In some embodiments of this application, the step S300 of "identifying the target pixel data to be black based on the color data of the initial image matrix data" is further described. Step S300 includes: Step S351: For each pixel in the initial image matrix data, calculate the feature value representing the brightness of the pixel based on the pixel's color data; Step S352: If the feature value is lower than the preset brightness feature threshold, the pixel is determined to be the target pixel data.
[0056] In this embodiment, for each pixel in the initial image matrix data, a scalar feature value characterizing its brightness is first calculated based on its color data. This feature value can be a numerical value that directly reflects brightness, or it can be other derived measures that can effectively indicate how close a pixel is to black. By directly comparing the calculated feature value with a preset brightness feature threshold, the system can efficiently and consistently complete the determination: if the feature value is lower than the threshold, the pixel is determined to be the target pixel data to be set to black. This simplifies complex color data processing to a threshold comparison of a single feature value, forming a clear and computationally low-burden core judgment logic. This ensures the effective implementation of the core function while also considering ease of implementation and system adaptability.
[0057] Specifically, the system first presets a brightness feature threshold, which defines the upper limit of brightness required to determine if a pixel is near black. Next, the system iterates through each pixel in the initial image matrix data. For the pixel to be processed, the system reads its color data, namely the red, green, and blue component values. Then, based on the pixel's color data, the system calculates the corresponding feature value representing the pixel's brightness. In a specific example, this calculation process is as follows: first, the red, green, and blue component values are normalized (e.g., divided by 255); then, according to the standard brightness calculation formula, the brightness value of the pixel is calculated as the feature value. The calculated feature value ranges from 0 to 1, with smaller values representing lower brightness and closer to black. The calculated feature value is compared with the preset brightness feature threshold. If the feature value is lower than the preset brightness feature threshold, the pixel is determined to have sufficiently low brightness, meeting the near-black condition, and thus identified as the target pixel data.
[0058] In some embodiments of this application, it also includes: Step S360: Based on the target pixel data, generate a second binary mask with the same size as the initial image matrix data, wherein the position corresponding to the target pixel data in the second binary mask is set to the first value, and the remaining positions in the second binary mask are set to the second value; Step S370: Perform morphological closing and morphological opening operations sequentially on the second binary mask to obtain the optimized binary mask; Step S380: Update the target pixel data based on the optimized binary mask.
[0059] In this embodiment, after obtaining the target pixel data through any of the above methods, a corresponding second binary mask is generated based on the target pixel data, and morphological closing and opening operations are sequentially performed on it. The closing operation can effectively fill small holes and gaps in the target area of the second binary mask caused by subtle color differences or noise, making the near-black background area appear more continuous and complete on the mask. The subsequent opening operation can smooth the area boundaries and eliminate isolated small noise points that may exist in the second binary mask due to misjudgment. The optimized binary mask obtained after this series of morphological purification processes defines a background area that is more spatially coherent and has clearer and more regular boundaries. Updating the target pixel data based on this optimized mask and finally controlling the light curtain display can effectively avoid sporadic, mislit interference pixels or unwanted dark spots and holes in the final image background, thereby ensuring that the displayed black background achieves a highly uniform, pure, and well-defined ideal effect, and improving the professional texture and visual experience of the light curtain display pattern.
[0060] Specifically, firstly, the system generates a second binary mask with the same size as the initial image matrix data based on the target pixel data. Specifically, it iterates through each pixel position in the initial image matrix data; if the pixel at that position is included in the target pixel data, the corresponding position in the second binary mask is set to a first value (e.g., 1); otherwise, it is set to a second value (e.g., 0). Next, the system performs morphological processing on the second binary mask to cleanse the mask area. This processing is performed in two sequential steps: Morphological closing operation: First, a dilation operation is performed on the second binary mask, followed by an erosion operation on the dilation result. Both operations use the same structuring element (e.g., a 3x3 rectangular kernel). This operation can fill in small holes and narrow gaps inside the mask area caused by color fluctuations or noise, making the target area more continuous and complete.
[0061] Morphological opening operation: After the closing operation, the intermediate mask result is first eroded, and then dilated (using the same or different structuring elements). This operation can smooth the boundaries of the region and eliminate burrs at the mask edges and any isolated fine noise that may exist (single or a small number of discrete first-value pixels caused by misjudgment).
[0062] After the above two steps, an optimized binary mask with a more optimized structure and clearer boundaries is obtained.
[0063] Finally, the system updates the target pixel data based on the optimized binary mask. Specifically, the system determines the positions of all pixels in the optimized binary mask with the first value as the new, optimized set of target pixel data.
[0064] In addition, this application provides a light curtain image display control device, including: The acquisition module is used to acquire textual description data about the image input by the user; The generation module is used to input textual description data into a preset image generation model to obtain the corresponding initial image matrix data. The recognition module is used to identify the target pixel data to be blacked out based on the color data of the initial image matrix data. The setting module is used to set the RGB values of all pixels in the target pixel data to the target value representing black, thereby obtaining the target image matrix data; The control module is used to control the light curtain to display based on the target image matrix data.
[0065] The light curtain image display control device provided in this application embodiment can realize the various processes implemented in the above method embodiment and achieve the same beneficial effects. To avoid repetition, it will not be described again here.
[0066] In addition, one embodiment of this application also discloses an electronic device 100, such as... Figure 2 As shown, it includes: At least one processor 110; At least one memory 120 is used to store at least one program; The above-described method for controlling the display of light curtain images is implemented when at least one program is executed by at least one processor 110.
[0067] The electronic device 100 provided in this application embodiment can implement the various processes implemented in the above method embodiments and achieve the same beneficial effects. To avoid repetition, it will not be described again here.
[0068] In addition, embodiments of this application provide a computer-readable storage medium storing a processor-executable program, which, when executed by a processor, is used to implement the light curtain image display control method described above.
[0069] The computer-readable storage medium provided in this application embodiment can implement the various processes implemented in the above method embodiments and achieve the same beneficial effects. To avoid repetition, it will not be described again here.
[0070] It will be understood by those skilled in the art that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0071] The embodiments of this application have been described in detail above with reference to the accompanying drawings. However, this application is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of this application.
Claims
1. A method for controlling the display of images on a light curtain, characterized in that, include: Obtain textual descriptions of the image input by the user; The text description data is input into a preset image generation model to obtain the corresponding initial image matrix data; Based on the color data of the initial image matrix data, identify the target pixel data to be blacked out; The RGB values of all pixels in the target pixel data are set to the target values representing black to obtain the target image matrix data; The light curtain is controlled to display based on the target image matrix data.
2. The light curtain image display control method according to claim 1, characterized in that, The image generation model includes a large language model and a text-based image diffusion model; The step of inputting the text description data into a preset image generation model to obtain the corresponding initial image matrix data includes: The text description data is input into the large language model to generate text-based graphic prompt text data; The text prompt data of the text image is input into the text image diffusion model to generate the initial image matrix data.
3. The light curtain image display control method according to claim 1, characterized in that, The step of identifying the target pixel data to be blacked out based on the color data of the initial image matrix data includes: For each pixel in the initial image matrix data, a corresponding first brightness value is calculated based on the color data of the pixel; The texture complexity value of the local neighborhood is calculated based on the color data of all pixels in a local neighborhood of a preset window size centered on the pixel. If the first brightness value is lower than a preset brightness threshold and the texture complexity value is lower than a preset texture complexity threshold, the pixel is determined to be the target pixel data.
4. The light curtain image display control method according to claim 1, characterized in that, The step of identifying the target pixel data to be blacked out based on the color data of the initial image matrix data includes: Based on the color data of each pixel in the initial image matrix data, determine whether the red component value, green component value and blue component value of each pixel are all lower than the corresponding preset channel threshold; Construct a first binary mask corresponding to the initial image matrix data; wherein, if the red component value, the green component value, and the blue component value of the pixel are all lower than the corresponding preset channel threshold, then in the first binary mask, the position of the corresponding pixel is marked as a first value, otherwise it is marked as a second value; Starting from the position corresponding to the boundary of the initial image matrix data, a connected component analysis is performed on the first binary mask to obtain the connected component analysis result. Based on the connected component analysis results, the pixels in the first binary mask that are marked with the first value and connected to the boundary are determined as the target pixel data.
5. The light curtain image display control method according to claim 1, characterized in that, The step of identifying the target pixel data to be blacked out based on the color data of the initial image matrix data includes: Based on the color data of multiple pixels located in the preset edge region in the initial image matrix data, calculate the brightness values corresponding to the multiple pixels; A global brightness threshold is determined based on the multiple brightness values; For each pixel in the initial image matrix data, the corresponding pixel brightness value is calculated based on the color data of the pixel; If the pixel brightness value is lower than the global brightness threshold, then the pixel is determined to be the target pixel data.
6. The light curtain image display control method according to claim 1, characterized in that, The step of identifying the target pixel data to be blacked out based on the color data of the initial image matrix data includes: For each pixel in the initial image matrix data, the red component value, green component value, and blue component value of the pixel are obtained according to the color data of the pixel; Based on the red component value, the green component value, and the blue component value, calculate the Euclidean distance of the pixel from the origin in the RGB color space; If the Euclidean distance is less than a preset distance threshold, then the pixel is determined to be the target pixel data.
7. The light curtain image display control method according to claim 1, characterized in that, The step of identifying the target pixel data to be blacked out based on the color data of the initial image matrix data includes: For each pixel in the initial image matrix data, a feature value representing the brightness of the pixel is calculated based on the color data of the pixel; If the feature value is lower than the preset brightness feature threshold, the pixel is determined to be the target pixel data.
8. The light curtain image display control method according to claim 1, characterized in that, Also includes: Based on the target pixel data, a second binary mask with the same size as the initial image matrix data is generated, wherein the position in the second binary mask corresponding to the target pixel data is set to a first value, and the remaining positions in the second binary mask are set to a second value; The second binary mask is subjected to morphological closing and morphological opening operations in sequence to obtain the optimized binary mask. The target pixel data is updated based on the optimized binary mask.
9. A light curtain image display control device, characterized in that, include: The acquisition module is used to acquire textual description data about the image input by the user; A generation module is used to input the text description data into a preset image generation model to obtain the corresponding initial image matrix data. The recognition module is used to identify the target pixel data to be blacked out based on the color data of the initial image matrix data; The setting module is used to set the RGB values of all pixels in the target pixel data to the target value representing black, thereby obtaining target image matrix data; A control module is used to control the light curtain to display based on the target image matrix data.
10. An electronic device, characterized in that, include: At least one processor; At least one memory for storing at least one program; The curtain image display control method as described in any one of claims 1 to 8 is implemented when at least one of the programs is executed by at least one of the processors.