Adaptive color management method and device based on scene recognition
By combining deep learning and diffusion models, key image features are extracted and a dynamic color mapping table is generated, which solves the flexibility and real-time problems of existing color management systems in changing scenarios and achieves efficient and low-cost color management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- WUXI HENGHAN MICROELECTRONICS CO LTD
- Filing Date
- 2025-02-10
- Publication Date
- 2026-07-14
Smart Images

Figure CN120411548B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to an adaptive color management method and apparatus based on scene recognition. Background Technology
[0002] With the rapid development of digital media technology, the quality and visual effects of image content are increasingly becoming key factors in user experience, especially in fields such as digital photography, film production, video games, and virtual reality.
[0003] In traditional color management systems, color adjustments primarily rely on preset Look-Up Tables (LUTs, color maps) or manual adjustments to achieve specific visual effects. While this method can provide stable and predictable output to some extent, it generally lacks sufficient flexibility and struggles to automatically adapt to varying scene conditions. For example, these static methods cannot adjust in real time to changes in natural lighting or different indoor lighting conditions, making it difficult to ensure natural and accurate color representation.
[0004] With advancements in artificial intelligence and machine learning, automated and intelligent image processing technologies are increasingly becoming a hot topic in research and application. In particular, the use of deep learning models for scene recognition and color adjustment has demonstrated superior performance compared to traditional methods. These technologies can dynamically adjust color strategies based on image content and contextual information, providing a more human-centered and personalized visual experience in diverse visual environments. Even so, user demand for high-quality image processing technologies continues to grow, especially as content creation and consumption become increasingly diversified and personalized. Users and content creators require smarter, more automated image processing tools to reduce production costs and time consumption while maintaining visual quality. Furthermore, the widespread adoption of high-definition content such as 4K and 8K has increased the demands on color processing technologies, further driving the exploration and development of advanced image processing techniques. However, existing automatic color adjustment technologies often rely on large amounts of data input and complex parameter adjustments, which to some extent limits the flexibility and convenience of color adjustment. Secondly, many models still struggle to meet high-standard commercial requirements in terms of real-time performance, especially in applications such as real-time video processing and online content editing. In addition, these technologies often require high maintenance costs, which is especially evident when processing large-scale or ultra-high resolution images. Summary of the Invention
[0005] Therefore, it is necessary to provide a scene-based adaptive color management method and device that is highly flexible, has high real-time performance, and low operation and maintenance costs to address the above-mentioned technical problems.
[0006] This invention provides an adaptive color management method based on scene recognition, the method comprising:
[0007] Image data is acquired, and a deep learning model is invoked to process the image data in order to extract key visual features from the image data, including color distribution features, texture features, and edge features.
[0008] The key visual features are weighted and fused using an attention mechanism model to generate a fused feature vector. The fused feature vector contains scene information of the image data and is used for scene type mapping.
[0009] The scene type mapping is classified based on the fused feature vector to obtain the scene classification result. The Diffusion model is trained based on the scene classification result and the color mapping table corresponding to multiple scene types to fit the scene-color distribution features.
[0010] The scene type recognition result of the real-time scene is used as the input of the trained diffusion model to generate a dynamic color mapping table, and the color mapping table is adjusted based on the dynamic color mapping table to obtain the adjusted color mapping table.
[0011] The adjusted color map is applied to the image data to adjust the visual properties of the image data.
[0012] In one embodiment, the step of acquiring image data and processing the image data using a deep learning model to extract key visual features from the image data includes:
[0013] The number of pixels in the image data and the color value of each pixel are obtained. The Kronecker function is called to count the frequency of occurrence of pixels with the same color value in the image data, and a color histogram is obtained to characterize the color distribution features.
[0014] The number of pixel pairs and the gray value of each pixel pair in the image data at any distance and direction are obtained, and the texture features of the image data are generated by the gray-level co-occurrence matrix based on the number of pixel pairs and the gray value of each pixel pair.
[0015] In one embodiment, the step of acquiring image data and calling a deep learning model to process the image data to extract key visual features from the image data further includes:
[0016] The pixel intensity at any location in the image data is obtained, and the gradient of the pixel intensity is calculated to determine the location of the object boundary in the image data, thereby obtaining the edge feature;
[0017] The weight coefficients of the color distribution feature, texture feature, and edge feature are obtained respectively, and the integrated feature vector of the color distribution feature, texture feature, and edge feature is calculated based on the weight coefficients.
[0018] The weight coefficients are obtained by the YOLOv8 network through the extraction and setting of the color distribution features, texture features and edge features, and are used to adjust the contribution ratio of different features in the integrated feature vector.
[0019] In one embodiment, the step of weighting and fusing the various key visual features using an attention mechanism model to generate a fused feature vector includes:
[0020] Feature vectors are extracted from similar pixel regions in the image data, and the attention mechanism model is called to calculate the weights of the feature vectors. The weights are used to adjust the contribution ratio of each feature vector in the fused feature vector.
[0021] Each feature vector and its corresponding weight are obtained by training with labeled data. All feature vectors in the image data are then weighted and fused to solidify the fused feature vector matrix.
[0022] The similar pixel region is a region composed of pixels whose similarity exceeds a first threshold after the image data is processed by the image segmentation model. The feature vector includes the color distribution features, texture features, and edge features of the similar pixel region.
[0023] In one embodiment, the step of classifying the scene type mapping based on the fused feature vector to obtain a scene classification result, and training the Diffusion model based on the scene classification result and a color mapping table corresponding to multiple scene types to fit the scene-color distribution features, includes:
[0024] The fused feature vector matrix is used as the input to the meta-learning model and the multi-class classifier to output the classification output probability that characterizes the first type of scene in the image data, and the preset color distribution information and adjustment factor of the first type of scene are obtained according to the existing color mapping table under the first type of scene.
[0025] Based on the classification output probability, preset color distribution information, adjustment factor, scene illumination intensity variable and color mapping table label corresponding to each type of scene in the image data, the Diffusion model is trained to generate the dynamic color mapping table, and the trained diffusion model is obtained.
[0026] Wherein, the first type of scene is any scene of a certain scene type in the image data, the classification output probability is the probability that the first type of scene is the certain scene type, and the adjustment factor is used to adjust the contribution of the scene classification result to the color mapping table.
[0027] In one embodiment, the step of using the scene type recognition result of the real-time scene as input to the trained diffusion model to generate a dynamic color mapping table, and adjusting the color mapping table based on the dynamic color mapping table to obtain an adjusted color mapping table, includes:
[0028] The trained diffusion model is invoked to process the real-time data of the current scene to generate the dynamic color mapping table, and the color mapping table is adjusted in combination with the learning rate parameter to obtain the adjusted color mapping table.
[0029] The learning rate parameter is used to control the speed and magnitude of the color map adjustment.
[0030] In one embodiment, applying the adjusted color map to the image data to adjust the visual properties of the image data includes:
[0031] The transformation function is called to calculate the color distribution of the adjusted color map table and the image data, so as to map the color distribution in the image data to the color space of the adjusted color map table, thereby obtaining the color-adjusted image data.
[0032] The present invention also provides an adaptive color management device based on scene recognition, the device comprising:
[0033] The feature extraction module is used to acquire image data and call a deep learning model to process the image data in order to extract key visual features from the image data. The key visual features include color distribution features, texture features, and edge features.
[0034] The feature fusion module is used to perform weighted and fused processing on various key visual features through an attention mechanism model to generate a fused feature vector. The fused feature vector contains scene information of the image data and is used for scene type mapping.
[0035] The color mapping table generation module is used to classify the scene type mapping based on the fusion feature vector to obtain the scene classification result, and to train the Diffusion model based on the scene classification result and the color mapping table corresponding to multiple scene types to fit the scene-color distribution features.
[0036] The color map adjustment module is used to take the scene type recognition result of the real-time scene as the input of the trained diffusion model to generate a dynamic color map, and adjust the color map based on the dynamic color map to obtain the adjusted color map.
[0037] An image color adjustment module is used to apply the adjusted color map to the image data to adjust the visual attributes of the image data.
[0038] The present invention also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the scene recognition-based adaptive color management method as described above.
[0039] The present invention also provides a computer storage medium storing a computer program, which, when executed by a processor, implements the scene recognition-based adaptive color management method as described above.
[0040] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the scene recognition-based adaptive color management method as described above.
[0041] The aforementioned scene recognition-based adaptive color management method and apparatus acquires the original image and processes it using a deep learning model to extract key visual features, including color distribution features, texture features, and edge features. Then, an attention mechanism model is used to weight and fuse these key visual features to generate a fused feature vector. This fused feature vector contains scene information from the original image and can be used for scene type mapping. Subsequently, the scene type mapping is classified based on the fused feature vector to obtain the corresponding scene classification results. Then, the scene type recognition results of the real-time scene are used as input to a trained diffusion model to generate a dynamic color mapping table. This dynamic color mapping table is then adjusted to obtain an adjusted color mapping table. Finally, the adjusted color mapping table is applied to the original image to adjust its visual attributes, resulting in a new image with new visual attributes. This method introduces scene recognition technology and a dynamic LUT adjustment mechanism. By analyzing the visual features of images and scene data in real time, it can dynamically generate and adjust LUTs to achieve scene-adaptive color management. This improves the accuracy and flexibility of color adjustment, and does not rely on a large amount of data input and complex parameter adjustments. It has lower operation and maintenance costs, greatly expands the application scope and user base, and meets a wider range of market demands. Attached Figure Description
[0042] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0043] Figure 1 This is one of the flowcharts illustrating the adaptive color management method based on scene recognition provided by the present invention;
[0044] Figure 2 A schematic diagram of the overall image color management process of the scene recognition-based adaptive color management method provided in a specific embodiment of the present invention;
[0045] Figure 3 The second flowchart illustrates the adaptive color management method based on scene recognition provided by this invention.
[0046] Figure 4 The third flowchart illustrating the adaptive color management method based on scene recognition provided by this invention;
[0047] Figure 5 The fourth flowchart illustrating the adaptive color management method based on scene recognition provided by this invention;
[0048] Figure 6 The fifth flowchart illustrating the adaptive color management method based on scene recognition provided by this invention;
[0049] Figure 7 The sixth flowchart illustrating the adaptive color management method based on scene recognition provided by this invention;
[0050] Figure 8 A schematic diagram of the adaptive color management device based on scene recognition provided by the present invention;
[0051] Figure 9 This is a diagram of the internal structure of the electronic device provided by the present invention. Detailed Implementation
[0052] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0053] The following is combined with Figures 1 to 9The present invention describes an adaptive color management method and apparatus based on scene recognition.
[0054] like Figure 1 As shown, in one embodiment, an adaptive color management method based on scene recognition includes the following steps:
[0055] Step S110: Acquire image data and call a deep learning model to process the image data in order to extract key visual features from the image data. Key visual features include color distribution features, texture features and edge features.
[0056] Specifically, the server acquires the raw image data and calls a deep learning model (such as UNet or YOLOv8) to process the image data in order to extract color distribution features, texture features, and edge features, i.e., key visual features.
[0057] Combination Figure 2 As shown in the specific embodiments, the scene recognition-based adaptive color management method provided by this invention relies heavily on effective visual feature extraction in advanced image processing and scene understanding applications. The process of extracting visual features typically involves using advanced deep learning models (such as UNet or YOLOv8) to process the input image data and extract key visual features describing the image. These features include color histograms, texture, and edge information, which help the system better understand image content and context.
[0058] Among them, the color histogram is a fundamental method for describing the color distribution of an image, and its algorithm formula is as follows:
[0059] H(c)=1 / N*sum(i=1to N)delta(c-c_i).
[0060] In the formula, H(c) is the color histogram, N is the total number of pixels in the image, c_i is the color value of the i-th pixel, and delta is the Kronecker function, used to count the frequency of color c in the image. This feature can help identify the dominant color and color distribution patterns in the image, which can be used for scene classification and analysis.
[0061] Texture features are described by analyzing the spatial layout of pixels, reflecting the structure and appearance of an image surface. Texture features can be calculated using the Gray-Level Co-occurrence Matrix (GLCM) or similar methods. The algorithm formula is as follows:
[0062] G(p,q)=1 / M*sum(j=1to M)(I(p_j)-mean(I))*(I(q_j)-mean(I)).
[0063] In the formula, G(p,q) is the gray-level co-occurrence matrix, M is the total number of pixel pairs considered at a specific distance and direction, and I(p_j) and I(q_j) are the gray values of the pixel pairs, respectively. This metric reflects the regularity and complexity of the texture within the image.
[0064] Edge features are a method used in image analysis to identify the boundaries of objects in an image. The algorithm formula is as follows:
[0065] S(x,y)=sqrt((I(x+1,y)-I(x-1,y))^2+(I(x,y+1)-I(x,y-1))^2).
[0066] In the formula, S(x,y) represents the edge feature, and I(x,y) represents the pixel intensity at position (x,y). This algorithm determines the edge position by calculating the gradient of the pixel intensity, and is used to capture the shape and contour information in the image.
[0067] Feature ensemble, which integrates all extracted feature vectors, can be represented as:
[0068] F=w1*H(c)+w2*G(p,q)+w3*S(x,y).
[0069] Here, F is the integrated feature vector, and w1, w2, and w3 are weight coefficients used to adjust the contribution ratio of different features in the final feature vector. This weighted combination allows the system to adjust the importance of features according to the needs of different scenarios to optimize performance.
[0070] In practical applications, this includes automatic image classification, scene understanding, and content-based image retrieval. For example, in autonomous driving systems, this feature extraction technology can help vehicles recognize and understand their surroundings, such as road signs, traffic lights, and other vehicles, thereby making appropriate driving decisions. In medical imaging, it can help identify and classify different types of tissues and lesions, improving the accuracy and efficiency of diagnosis.
[0071] In this embodiment, YOLO (You Only Look Once) models such as YOLOv5 or YOLOv8 can be used as deep learning models to extract key visual features from images. During feature vector extraction, image preprocessing is performed first. Before being input into the YOLO model, the image data undergoes a series of preprocessing steps, including scaling to a fixed size (typically the size used during model training, such as 416x416 pixels) and normalization to ensure the uniformity of the input data and the efficiency of the model processing. Subsequently, the YOLO model is used to extract features. The YOLO model performs a series of convolutions, batch normalization, and activation operations on the input image through its convolutional layer structure, thereby extracting image features at multiple scales. These operations include using convolutional kernels of different sizes to capture features from fine-grained to coarse-grained, enabling the model to understand image content at both global and local scales. YOLOv5 and YOLOv8 particularly emphasize speed and accuracy in the feature extraction process, improving the efficiency and effectiveness of feature extraction through techniques such as depthwise separable convolution and residual connections.
[0072] In this embodiment, the feature maps obtained from the YOLO model can be directly used as the basis for scene classification, or further processed to generate more refined fused feature vectors. For example, the spatial information of each feature map can be compressed into a fixed-length vector using methods such as global average pooling or max pooling. These vectors are then further weighted and fused using an attention mechanism model to obtain the final fused feature vector. The attention mechanism learns the importance of each feature and dynamically adjusts the contribution ratio of each feature vector to maximize the accuracy of scene recognition.
[0073] For example, in autonomous driving systems, the YOLO model can quickly identify objects such as vehicles, pedestrians, and road signs in images, providing their location and category information to aid the driving system in decision-making. In medical imaging, YOLO can help identify and classify different types of tissues and lesions in images, such as tumor detection, thereby providing more accurate diagnostic information. In this way, the YOLO model not only provides fast and accurate feature extraction capabilities but also, through its combination with attention mechanisms, offers powerful technical support for dynamic color management systems.
[0074] Step S120: Weight and fuse various key visual features using an attention mechanism model to generate a fused feature vector. The fused feature vector contains scene information from the image data and is used for scene type mapping.
[0075] Specifically, the server uses a self-attention mechanism model to perform weighted and feature fusion processing on the various key visual features extracted in step S110 to generate a comprehensive feature vector containing scene information from image data and used for scene type mapping, namely the fused feature vector.
[0076] Combination Figure 2 As shown in the specific embodiments, the adaptive color management method based on scene recognition provided by this invention utilizes feature fusion, a crucial step in image processing and computer vision. Feature fusion combines multiple features extracted from different sources or algorithms to achieve a more comprehensive understanding of image content. In many advanced applications, such as automatic scene recognition, face recognition, and intelligent video surveillance, the effectiveness of feature fusion directly impacts system performance and the accuracy of scene recognition.
[0077] In this embodiment, feature fusion can be achieved through weighted summation, where each type of feature is assigned a weight to reflect its importance to the final task (such as classification or recognition). The algorithm formula is as follows:
[0078] V=sum(k=1to K)alpha_k*F_k.
[0079] Where V represents the fused feature vector, F_k is the k-th feature vector extracted from the image, and alpha_k is the weight of the feature calculated through the attention mechanism.
[0080] It should be noted that F_k represents the k-th feature vector, such as a color histogram, texture descriptor, edge features, etc., which are extracted from visual features. alpha_k is a weight value determined by an attention mechanism model, used to adjust the contribution of each feature to the fused vector. This weight not only reflects the importance of the features but can also be dynamically adjusted according to the current task or dataset to optimize performance.
[0081] It's important to further explain that the attention mechanism model plays a role in feature fusion by automatically adjusting the weights of features based on their relevance and information content. This mechanism allows the model to focus on the information most useful for the current task, thereby improving processing efficiency and the accuracy of the results. For example, when processing images with complex backgrounds, texture and edge features may be more informative than color histograms and therefore will be given higher weights.
[0082] In practical applications, feature fusion technology is widely used to improve the adaptability and robustness of systems in complex environments. For example, in the vision systems of autonomous vehicles, different features extracted from the road environment (such as edge features of road markings, texture features of vehicles and pedestrians, etc.) need to be effectively fused to ensure accurate scene understanding and decision support. Through feature fusion, the system can more accurately detect and identify different objects, such as pedestrians, vehicles, and traffic signs, maintaining a high recognition rate even under conditions of changing lighting, occlusion, or poor weather. In security monitoring systems, by fusing visual features from multiple cameras, the monitoring system can better identify and track moving objects in a scene, improving the ability to detect abnormal behavior. For example, in airport or shopping mall surveillance, feature fusion technology allows security monitoring systems to more effectively identify security threats such as leftover luggage and abnormal crowd gatherings, thus enabling timely responses to potential security incidents. Therefore, feature fusion not only enhances the overall performance of image analysis but also improves adaptability and accuracy in changing environments, making it an indispensable component.
[0083] Step S130: Classify the scene type mapping based on the fused feature vector to obtain the scene classification result, and train the Diffusion model based on the scene classification result and the color mapping table corresponding to multiple types of scenes to fit the scene-color distribution features.
[0084] Specifically, the server classifies the scene type mapping in the image data based on the fused feature vector obtained by feature fusion in step S120, and trains the Diffusion model based on the scene classification results and the color mapping table corresponding to multiple scene types to fit the scene-color distribution features.
[0085] Combination Figure 2 As shown in the illustration, in a specific embodiment, the scene-recognition-based adaptive color management method provided by the present invention involves scene type mapping, which associates extracted visual features with specific scene types and applies this information to adjust the visual representation of an image. This process is particularly important in applications such as content recognition, augmented reality, and automatic color adjustment.
[0086] In this embodiment, scene type mapping can be achieved by combining a multi-class classifier and a meta-learning model. The algorithm formula can be expressed as follows:
[0087] L=beta*sum(r=1to R)M_r(V)*P_r.
[0088] In the formula, L represents the final generated scene-specific lookup table (LUT), V is the fused feature vector, M_r is the classification model output (usually the probability) corresponding to the r-th scene, R is the total number of scene types, P_r is the preset color distribution scheme for the r-th scene, and beta is an adjustment factor used to adjust the influence of the model output on the final color distribution scheme.
[0089] It should be noted that M_r(V) is a function or model that takes the fused feature vector V as input and outputs a numerical value representing the probability that the input image belongs to the r-th scene class. P_r is a predefined color distribution scheme for a specific scene type, aiming to optimize image performance in that scene. These color distribution schemes can be based on art direction, historical data, or prior knowledge. The adjustment factor beta is used to adjust the contribution of the scene classification result to the final color mapping. By changing the value of beta, the conservative or aggressive nature of the color adjustment can be controlled.
[0090] In this embodiment, the core purpose of scene type mapping is to ensure that images are visually more consistent with their content and context. For example, a scene may have different visual requirements due to its lighting conditions, primary colors, or included objects (such as beaches, forests, city nightscapes, etc.). By using color distribution schemes optimized for different scenes, the visual quality of images can be improved, enhancing the user experience.
[0091] In practical applications, such as in film post-production, different scenes require different hues and brightness levels to convey the correct emotions and timing. Scene type mapping allows these parameters to be automatically adjusted, ensuring that each scene visually conveys the user's intent. For example, a nighttime scene might use a LUT that makes colors cooler and has higher contrast, while a sunrise scene might use a LUT that enhances warmth and increases brightness. In smart home systems, scene type mapping can be used to automatically adjust the color temperature and brightness of ambient light to suit different daylight conditions or household activities at different times. For example, a soft lighting scheme can be selected when watching a movie at night, while a brighter, more natural-light-like scheme can be chosen when reading or working. In this way, scene type mapping not only improves the visual effect of images and environments but also increases the dynamism and personalization of user interaction, making it more aligned with people's lives and feelings.
[0092] Step S140: The scene type recognition result of the real-time scene is used as the input of the trained diffusion model to generate a dynamic color mapping table, and the color mapping table is adjusted based on the dynamic color mapping table to obtain the adjusted color mapping table.
[0093] Specifically, the server uses the scene type recognition result of the real-time scene as input to the trained diffusion model, thereby generating a real-time dynamic color map, and adjusts the original color map based on the dynamic color map to obtain the adjusted color map.
[0094] Combination Figure 2 As shown in the specific embodiment, the scene recognition-based adaptive color management method provided by this invention, which generates and adjusts the DLUT (Dynamic Look-Up Table) mapping, aims to dynamically adjust the color mapping table according to real-time scene data to achieve optimal image output. This process not only considers the initial scene classification results but also includes real-time responses to environmental changes, thereby improving the adaptability and flexibility of image processing.
[0095] In this embodiment, the algorithm formula for generating and adjusting DLUT is as follows:
[0096] LUT = L + gamma * (D'(C_s) - L).
[0097] Here, LUT stands for Adjusted Color Map, where L is the LUT obtained from the initial scene recognition, typically a predefined color map or a color map optimized for a specific scene using machine learning algorithms. D' is a Diffusion model adjusted based on real-time scene data C_s, used to dynamically generate color maps according to the specific conditions of the current scene. C_s represents the real-time data of the current scene, which may include variables such as lighting conditions, color distribution, and principal elements. gamma is a learning rate parameter that controls the speed and magnitude of LUT adjustment to ensure a smooth transition in the color map.
[0098] In this embodiment, the core of DLUT mapping is real-time optimization based on the original model. Specifically, by introducing a Diffusion model D', the specific needs of the current scene can be analyzed in real time, and the LUT can be adjusted accordingly. The advantage of this method lies in its dynamic nature, enabling it to handle real-time changes such as lighting variations and scene transitions. The Diffusion model proposes new color mapping suggestions by analyzing real-time data C_s, and the learning rate parameter gamma controls the speed and extent of these suggestions' application, allowing the LUT to smoothly adapt to scene changes.
[0099] In practical applications such as dynamic video editing and live broadcasting, the dynamic generation and adjustment of DLUT mappings are crucial. For example, in live sports broadcasts, lighting conditions may change due to time of day (day and night) or weather (sunny or rainy). DLUT allows for real-time adjustment of video color reproduction, ensuring viewers always have the best visual experience. Furthermore, in security monitoring, surveillance systems need to operate under varying ambient lighting conditions, from dawn to dusk, and from indoors to outdoors. DLUT allows the system to adjust image color and contrast in real-time based on current lighting conditions and scene content, improving image clarity and legibility. In addition, DLUT plays a vital role in mobile photography. Smartphone camera apps, using DLUT-like technologies, can automatically adjust color settings based on the scene (such as portraits, landscapes, and night scenes), enabling even non-professional users to capture high-quality photos. Therefore, DLUT not only improves image visual quality but also enhances usability and flexibility across various application environments, providing users with the best visual experience in different visual scenarios.
[0100] Step S150: Apply the adjusted color map to the image data to adjust the visual properties of the image data.
[0101] Specifically, the server calls a transformation function to calculate the color distribution of the adjusted color map and the image data, so as to map the color distribution in the image data to the color space of the adjusted color map, and finally obtain the color-adjusted image data.
[0102] Combination Figure 2 As shown in the specific embodiment, the scene recognition-based adaptive color management method provided by the present invention places color application and output as a crucial step in the final stage of image processing, ensuring that the final image meets the expected visual effect. This step involves applying the previously calculated Look-Up Table (LUT) to the original image to adjust the color and other visual attributes of the original image, thereby achieving a specific visual effect.
[0103] In this embodiment, the algorithm formula for color application is:
[0104] I_f=I_o+mu*(T(LUT,I_o)-I_o).
[0105] Where I_o is the original image, i.e., the image before color adjustment. T(LUT, I_o) is the transformation function applying the LUT. This transformation function takes the LUT and the original image I_o as input and outputs the adjusted image by mapping the colors in the original image to a new color space. mu is the application intensity, a coefficient between 0 and 1, used to control the degree of color adjustment. The larger the value of mu, the more obvious the color change. I_f is the final image, i.e., the image output after color adjustment.
[0106] In this embodiment, by applying a LUT, each color value of the original image I_o is mapped to a new color value according to the instructions in the LUT. This process involves not only adjustments to hue and saturation but also changes to brightness and contrast. The role of the transformation function T is to ensure that these mappings are correctly implemented to reflect the desired visual style or to cope with specific ambient lighting conditions.
[0107] It's important to note that the generation of the DLUT is not simply an adjustment of the existing LUT, but rather a completely new DLUT created based on data obtained from scene classification results. This is driven by real-time scene type recognition results, obtained using a trained diffusion model. This model utilizes the correlation data between scene classification and color maps to predict and generate a new color map best suited for the current scene. Compared to existing color management methods, this method's advantage lies in the fact that each generated DLUT is optimized for the specific current scene, ensuring maximum relevance and effectiveness of color adjustments. Furthermore, existing color management methods may require modifications or adjustments to existing LUTs to adapt to new scenes, which can be inefficient or inaccurate in dynamic or changing environments. In this embodiment, the real-time generated DLUT is directly optimized for the current scene information, ensuring that each color adjustment is optimal. Crucially, the DLUT generation is based on real-time data analysis using deep learning and scene recognition technologies, allowing for more flexible responses to environmental changes without relying on previous color configurations.
[0108] In this embodiment, during the application of DLUT to the original image (I_o), the transformation function T(LUT,I_o) used does not simply map colors, but comprehensively adjusts the image's color, brightness, contrast, and saturation according to the guidance provided by DLUT. The parameter mu controls the intensity of this adjustment, ensuring that the image can be optimized according to the needs of the specific application scenario. Therefore, the final output image (I_f) can thus exhibit a visual effect more suitable for the current scene while maintaining the original details and texture.
[0109] It's worth noting that the introduction of the parameter `mu` allows for fine-tuning of the color adjustments. In some applications, such as artistic photography or advertising design, more radical color changes may be needed to convey specific visual effects or emotions. In other cases, such as medical imaging or security surveillance, more conservative adjustments may be required to maintain the naturalness and accuracy of the image.
[0110] For example:
[0111] Film and video production: In post-production, LUTs are used to adjust the color of a film to convey specific time periods or enhance a certain mood. For example, warm tones can be used to enhance the atmosphere of a romantic scene, while cool tones can be used to emphasize the severity of a scene.
[0112] Medical Imaging: In medical imaging, accurate color mapping can help doctors better identify lesion areas. For example, in thermal imaging, different colors can be used to represent areas of different temperatures, helping doctors diagnose inflammation or other conditions.
[0113] Real-time video surveillance: In the field of security monitoring, color adjustment can be used to enhance video images at night or in low-light conditions, improving visibility and recognition accuracy.
[0114] The aforementioned scene recognition-based adaptive color management method acquires the original image and processes it using a deep learning model to extract key visual features, including color distribution, texture, and edge features. An attention mechanism model then weights and fuses these key visual features to generate a fused feature vector. This fused feature vector contains scene information from the original image and can be used for scene type mapping. Subsequently, the scene type mapping is classified based on the fused feature vector to obtain the corresponding scene classification result, and a color mapping table for the corresponding scene is generated based on this classification result. Then, the scene type recognition result of the real-time scene is used as input to a trained diffusion model to generate a dynamic color mapping table, which is then adjusted to obtain a revised color mapping table. Finally, the revised color mapping table is applied to the original image to adjust its visual attributes, resulting in a new image with new visual attributes. This method introduces scene recognition technology and a dynamic LUT adjustment mechanism. By analyzing the visual features of images and scene data in real time, it can dynamically generate and adjust LUTs to achieve scene-adaptive color management. This improves the accuracy and flexibility of color adjustment, and does not rely on a large amount of data input and complex parameter adjustments. It has lower operation and maintenance costs, greatly expands the application scope and user base, and meets a wider range of market demands.
[0115] like Figure 3As shown, in one embodiment, the adaptive color management method based on scene recognition provided by the present invention acquires image data and calls a deep learning model to process the image data to extract key visual features from the image data, specifically including the following steps:
[0116] Step S112: Obtain the number of pixels in the image data and the color value of each pixel. Call the Kronecker function to count the frequency of occurrence of pixels with the same color value in the image data to obtain a color histogram used to characterize the color distribution features.
[0117] Step S114: Obtain the number of pixel pairs and the gray value of each pixel pair in the image data at any distance and direction, and generate the texture features of the image data based on the number of pixel pairs and the gray value of each pixel pair using the gray-level co-occurrence matrix.
[0118] like Figure 4 As shown, in one embodiment, the adaptive color management method based on scene recognition provided by the present invention acquires image data and calls a deep learning model to process the image data to extract key visual features from the image data. Specifically, it further includes the following steps:
[0119] Step S116: Obtain the pixel intensity at any location in the image data and calculate the gradient of the pixel intensity to determine the location of the object boundary in the image data and obtain the edge features.
[0120] Step S118: Obtain the weight coefficients of color distribution features, texture features and edge features respectively, and calculate the integrated feature vector of color distribution features, texture features and edge features based on the weight coefficients.
[0121] The weight coefficients are obtained by the YOLOv8 network through the extraction and setting of color distribution features, texture features, and edge features, and are used to adjust the contribution ratio of different features in the integrated feature vector.
[0122] like Figure 5 As shown, in one embodiment, the scene-recognition-based adaptive color management method provided by the present invention performs weighted and fused processing on various key visual features through an attention mechanism model to generate a fused feature vector, specifically including the following steps:
[0123] Step S122: Extract feature vectors from similar pixel regions in the image data, and call the attention mechanism model to calculate the weights of the feature vectors. The weights are used to adjust the contribution ratio of each feature vector in the fused feature vector.
[0124] Step S124: Each feature vector and its corresponding weight are obtained through training with the label data. All feature vectors in the image data are weighted and fused to solidify the fused feature vector matrix.
[0125] The similar pixel region is the region formed by pixels whose similarity exceeds the first threshold after the image data is processed by the image segmentation model. The feature vector includes the color distribution features, texture features and edge features of the similar pixel region.
[0126] like Figure 6 As shown, in one embodiment, the adaptive color management method based on scene recognition provided by the present invention classifies scene type mappings based on fused feature vectors to obtain scene classification results, and trains a Diffusion model based on the scene classification results and color mapping tables corresponding to multiple scene types to fit scene-color distribution features. Specifically, the method includes the following steps:
[0127] Step S132: The fused feature vector matrix is used as the input to the meta-learning model and the multi-class classifier to output the classification output probability used to characterize the first type of scene in the image data. Based on the existing color mapping table under the first type of scene, the preset color distribution information and adjustment factor of the first type of scene are obtained.
[0128] Step S134: Based on the classification output probability, preset color distribution information, adjustment factor, scene illumination intensity variable and color map label corresponding to each type of scene in the image data, train the Diffusion model to generate a dynamic color map, and obtain the trained diffusion model.
[0129] The first type of scene is any scene of a certain type in the image data. The classification output probability is the probability that the first type of scene is a certain scene type. The adjustment factor is used to adjust the contribution of the scene classification result to the color mapping table.
[0130] like Figure 7 As shown, in one embodiment, the adaptive color management method based on scene recognition provided by the present invention uses the scene type recognition result of the real-time scene as the input of the trained diffusion model to generate a dynamic color mapping table, and adjusts the color mapping table based on the dynamic color mapping table to obtain an adjusted color mapping table. Specifically, the method includes the following steps:
[0131] Step S142: Call the trained diffusion model to process the real-time data of the current scene to generate a dynamic color mapping table.
[0132] Step S144: Adjust the color map table based on the learning rate parameter to obtain the adjusted color map table.
[0133] The learning rate parameter controls the speed and magnitude of color map adjustment.
[0134] The adaptive color management device based on scene recognition provided by the present invention will be described below. The adaptive color management device based on scene recognition described below can be referred to in correspondence with the adaptive color management method based on scene recognition described above.
[0135] like Figure 8 As shown, in one embodiment, an adaptive color management device based on scene recognition includes a feature extraction module 810, a feature fusion module 820, a color map generation module 830, a color map adjustment module 840, and an image color adjustment module 850.
[0136] The feature extraction module 810 is used to acquire image data and call a deep learning model to process the image data in order to extract key visual features from the image data. Key visual features include color distribution features, texture features and edge features.
[0137] The feature fusion module 820 is used to weight and fuse various key visual features through an attention mechanism model to generate a fused feature vector. The fused feature vector contains scene information of the image data and is used for scene type mapping.
[0138] The color mapping table generation module 830 is used to classify scene type mappings based on fused feature vectors, obtain scene classification results, and train the Diffusion model based on the scene classification results and color mapping tables corresponding to multiple scene types to fit scene-color distribution features.
[0139] The color map adjustment module 840 is used to take the scene type recognition result of the real-time scene as the input of the trained diffusion model to generate a dynamic color map, and adjust the color map based on the dynamic color map to obtain the adjusted color map.
[0140] The image color adjustment module 850 is used to apply the adjusted color map to the image data to adjust the visual properties of the image data.
[0141] In this embodiment, the adaptive color management device based on scene recognition provided by the present invention has a feature extraction module specifically used for:
[0142] The number of pixels in the image data and the color value of each pixel are obtained. The Kronecker function is called to count the frequency of pixels with the same color value in the image data, and a color histogram is obtained to characterize the color distribution features.
[0143] The number of pixel pairs and the gray value of each pixel pair in the image data at any distance and direction are obtained, and the texture features of the image data are generated by the gray-level co-occurrence matrix based on the number of pixel pairs and the gray value of each pixel pair.
[0144] In this embodiment, the feature extraction module of the scene recognition-based adaptive color management device provided by the present invention is further used for:
[0145] The pixel intensity at any location in the image data is obtained, and the gradient of the pixel intensity is calculated to determine the location of the object boundary in the image data, thus obtaining the edge features.
[0146] The weight coefficients of color distribution features, texture features, and edge features are obtained respectively, and the integrated feature vector of color distribution features, texture features, and edge features is calculated based on the weight coefficients.
[0147] The weight coefficients are obtained by the YOLOv8 network through the extraction and setting of color distribution features, texture features, and edge features, and are used to adjust the contribution ratio of different features in the integrated feature vector.
[0148] In this embodiment, the feature fusion module of the scene recognition-based adaptive color management device provided by the present invention is specifically used for:
[0149] Feature vectors are extracted from similar pixel regions in the image data, and an attention mechanism model is called to calculate the weights of the feature vectors. The weights are used to adjust the contribution ratio of each feature vector in the fused feature vector.
[0150] Each feature vector and its corresponding weight are obtained by training with labeled data. All feature vectors in the image data are then weighted and fused to solidify the fused feature vector matrix.
[0151] The similar pixel region is the region formed by pixels whose similarity exceeds the first threshold after the image data is processed by the image segmentation model. The feature vector includes the color distribution features, texture features and edge features of the similar pixel region.
[0152] In this embodiment, the color mapping table generation module of the scene recognition-based adaptive color management device provided by the present invention is specifically used for:
[0153] The fused feature vector matrix is used as input to the meta-learning model and the multi-class classifier to output the classification output probability for representing the first type of scene in the image data. Based on the existing color mapping table under the first type of scene, the preset color distribution information and adjustment factor of the first type of scene are obtained.
[0154] Based on the classification output probability of each type of scene in the image data, the preset color distribution information, the adjustment factor, the scene's illumination intensity variable, and the color map label, the Diffusion model is trained to generate a dynamic color map, thus obtaining the trained diffusion model.
[0155] The first type of scene is any scene of a certain type in the image data. The classification output probability is the probability that the first type of scene is a certain scene type. The adjustment factor is used to adjust the contribution of the scene classification result to the color mapping table.
[0156] In this embodiment, the color mapping table adjustment module of the scene recognition-based adaptive color management device provided by the present invention is specifically used for:
[0157] The trained diffusion model is invoked to process the real-time data of the current scene in order to generate a dynamic color mapping table.
[0158] The color map is adjusted by combining the learning rate parameter to obtain the adjusted color map.
[0159] The learning rate parameter controls the speed and magnitude of color map adjustment.
[0160] In this embodiment, the scene recognition-based adaptive color management device provided by the present invention includes an image color adjustment module specifically used for:
[0161] The transformation function is called to calculate the color distribution of the adjusted color map table and the image data, so as to map the color distribution in the image data to the color space of the adjusted color map table, and obtain the color-adjusted image data.
[0162] Figure 9 This example illustrates a schematic diagram of the physical structure of an electronic device, which can be a smart terminal. Its internal structure diagram can be as follows: Figure 9 As shown. The electronic device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a scene-recognition-based adaptive color management method, which includes:
[0163] Acquire image data and call a deep learning model to process the image data in order to extract key visual features from the image data, including color distribution features, texture features and edge features;
[0164] The attention mechanism model is used to weight and fuse various key visual features to generate a fused feature vector. The fused feature vector contains scene information of the image data and is used for scene type mapping.
[0165] The scene type mapping is classified based on the fused feature vector to obtain the scene classification result. The Diffusion model is then trained based on the scene classification result and the color mapping table corresponding to multiple scene types to fit the scene-color distribution features.
[0166] The scene type recognition result of the real-time scene is used as the input of the trained diffusion model to generate a dynamic color map table, and the color map table is adjusted based on the dynamic color map table to obtain the adjusted color map table.
[0167] The adjusted color map is applied to the image data to adjust its visual properties.
[0168] Those skilled in the art will understand that Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present invention and does not constitute a limitation on the electronic device to which the present invention is applied. A specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0169] On the other hand, the present invention also provides a computer storage medium storing a computer program, which, when executed by a processor, implements an adaptive color management method based on scene recognition, the method comprising:
[0170] Acquire image data and call a deep learning model to process the image data in order to extract key visual features from the image data, including color distribution features, texture features and edge features;
[0171] The attention mechanism model is used to weight and fuse various key visual features to generate a fused feature vector. The fused feature vector contains scene information of the image data and is used for scene type mapping.
[0172] The scene type mapping is classified based on the fused feature vector to obtain the scene classification result. The Diffusion model is then trained based on the scene classification result and the color mapping table corresponding to multiple scene types to fit the scene-color distribution features.
[0173] The scene type recognition result of the real-time scene is used as the input of the trained diffusion model to generate a dynamic color map table, and the color map table is adjusted based on the dynamic color map table to obtain the adjusted color map table.
[0174] The adjusted color map is applied to the image data to adjust its visual properties.
[0175] In another aspect, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and when the processor executes the computer instructions, it implements a scene-recognition-based adaptive color management method, the method comprising:
[0176] Acquire image data and call a deep learning model to process the image data in order to extract key visual features from the image data, including color distribution features, texture features and edge features;
[0177] The attention mechanism model is used to weight and fuse various key visual features to generate a fused feature vector. The fused feature vector contains scene information of the image data and is used for scene type mapping.
[0178] The scene type mapping is classified based on the fused feature vector to obtain the scene classification result. The Diffusion model is then trained based on the scene classification result and the color mapping table corresponding to multiple scene types to fit the scene-color distribution features.
[0179] The scene type recognition result of the real-time scene is used as the input of the trained diffusion model to generate a dynamic color map table, and the color map table is adjusted based on the dynamic color map table to obtain the adjusted color map table.
[0180] The adjusted color map is applied to the image data to adjust its visual properties.
[0181] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided by this invention can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory.
[0182] By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0183] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0184] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of this patent should be determined by the appended claims.
Claims
1. An adaptive color management method based on scene recognition, characterized in that, The method includes: Image data is acquired, and a deep learning model is invoked to process the image data in order to extract key visual features from the image data, including color distribution features, texture features, and edge features. The key visual features are weighted and fused using an attention mechanism model to generate a fused feature vector. The fused feature vector contains scene information of the image data and is used for scene type mapping. The scene type mapping is classified based on the fused feature vector to obtain the scene classification result. The Diffusion model is trained based on the scene classification result and the color mapping table corresponding to multiple scene types to fit the scene-color distribution features. The scene type recognition result of the real-time scene is used as the input of the trained diffusion model to generate a dynamic color mapping table, and the color mapping table is adjusted based on the dynamic color mapping table to obtain the adjusted color mapping table. The adjusted color map is applied to the image data to adjust the visual properties of the image data; The step of acquiring image data and processing the image data using a deep learning model to extract key visual features from the image data includes: The number of pixels in the image data and the color value of each pixel are obtained. The Kronecker function is called to count the frequency of occurrence of pixels with the same color value in the image data, and a color histogram is obtained to characterize the color distribution features. The number of pixel pairs and the gray value of each pixel pair in the image data at any distance and direction are obtained, and the texture features of the image data are generated by the gray-level co-occurrence matrix based on the number of pixel pairs and the gray value of each pixel pair. The pixel intensity at any location in the image data is obtained, and the gradient of the pixel intensity is calculated to determine the location of the object boundary in the image data, thereby obtaining the edge feature; The weight coefficients of the color distribution feature, texture feature, and edge feature are obtained respectively, and the integrated feature vector of the color distribution feature, texture feature, and edge feature is calculated based on the weight coefficients. The weight coefficients are obtained by the YOLOv8 network through the extraction and setting of the color distribution features, texture features and edge features, and are used to adjust the contribution ratio of different features in the integrated feature vector. The step of weighting and fusing various key visual features using an attention mechanism model to generate a fused feature vector includes: Feature vectors are extracted from similar pixel regions in the image data, and the attention mechanism model is called to calculate the weights of the feature vectors. The weights are used to adjust the contribution ratio of each feature vector in the fused feature vector. Each feature vector and its corresponding weight are obtained by training with labeled data. All feature vectors in the image data are then weighted and fused to solidify the fused feature vector matrix. The similar pixel region is a region composed of pixels whose similarity exceeds a first threshold after the image data is processed by the image segmentation model. The feature vector includes the color distribution features, texture features and edge features of the similar pixel region. The process of classifying the scene type mapping based on the fused feature vector to obtain scene classification results, and training the Diffusion model based on the scene classification results and color mapping tables corresponding to multiple scene types to fit the scene-color distribution features, includes: The fused feature vector matrix is used as the input to the meta-learning model and the multi-class classifier to output the classification output probability that characterizes the first type of scene in the image data, and the preset color distribution information and adjustment factor of the first type of scene are obtained according to the existing color mapping table under the first type of scene. Based on the classification output probability, preset color distribution information, adjustment factor, scene illumination intensity variable and color mapping table label corresponding to each type of scene in the image data, the Diffusion model is trained to generate the dynamic color mapping table, and the trained diffusion model is obtained. Wherein, the first type of scene is any scene of a certain scene type in the image data, the classification output probability is the probability that the first type of scene is the certain scene type, and the adjustment factor is used to adjust the contribution of the scene classification result to the color mapping table.
2. The adaptive color management method based on scene recognition according to claim 1, characterized in that, The step of using the scene type recognition result of the real-time scene as input to the trained diffusion model to generate a dynamic color mapping table, and adjusting the color mapping table based on the dynamic color mapping table to obtain an adjusted color mapping table, includes: The trained diffusion model is invoked to process the real-time data of the current scene to generate the dynamic color mapping table, and the color mapping table is adjusted in combination with the learning rate parameter to obtain the adjusted color mapping table. The learning rate parameter is used to control the speed and magnitude of the color map adjustment.
3. The adaptive color management method based on scene recognition according to claim 2, characterized in that, Applying the adjusted color map to the image data to adjust the visual attributes of the image data includes: The transformation function is called to calculate the color distribution of the adjusted color map table and the image data, so as to map the color distribution in the image data to the color space of the adjusted color map table, thereby obtaining the color-adjusted image data.
4. An adaptive color management device based on scene recognition, characterized in that, The apparatus for implementing the scene recognition-based adaptive color management method according to any one of claims 1 to 3, the apparatus comprising: The feature extraction module is used to acquire image data and call a deep learning model to process the image data in order to extract key visual features from the image data. The key visual features include color distribution features, texture features, and edge features. The feature fusion module is used to perform weighted and fused processing on various key visual features through an attention mechanism model to generate a fused feature vector. The fused feature vector contains scene information of the image data and is used for scene type mapping. The color mapping table generation module is used to classify the scene type mapping based on the fusion feature vector to obtain the scene classification result, and to train the Diffusion model based on the scene classification result and the color mapping table corresponding to multiple scene types to fit the scene-color distribution features. The color map adjustment module is used to take the scene type recognition result of the real-time scene as the input of the trained diffusion model to generate a dynamic color map, and adjust the color map based on the dynamic color map to obtain the adjusted color map. An image color adjustment module is used to apply the adjusted color map to the image data to adjust the visual attributes of the image data.
5. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 3.
6. A computer storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 3.