A multimedia image optimization method and system

By performing HSI color space conversion, brightness enhancement, contrast adjustment and edge enhancement on multimedia images, the problem that the existing technology cannot optimize image brightness, contrast and edge details in all aspects is solved, and a higher quality multimedia image optimization effect is achieved.

CN119359606BActive Publication Date: 2025-04-18中央广播电视总台
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411930713.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-04-18
Estimated Expiration
2044-12-26

Smart Images

  • Figure CN119359606B_ABST
    Figure CN119359606B_ABST
Patent Text Reader

Abstract

This invention discloses a multimedia image optimization method and system, relating to the field of image optimization technology. The method includes acquiring the multimedia image to be optimized and performing HSI color space conversion; extracting the luminance component from the HSI color space and enhancing its luminance; adjusting the contrast of the enhanced luminance component and performing luminance region segmentation and dynamic range optimization; enhancing the edges of the optimized luminance component and recombining them to generate an enhanced HSI image; and converting the enhanced HSI image back to the RGB color space to obtain the optimized multimedia image. This invention achieves comprehensive optimization of image brightness, contrast, and detail, improving the sense of brightness hierarchy, solving the problem of detail loss in bright and dark areas, improving edge sharpness and color fidelity, and significantly enhancing the visual quality of multimedia images to meet the practical application needs of various scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image optimization, and in particular to a multimedia image optimization method and system. Background Art

[0002] With the rapid development and widespread application of multimedia technology, image quality optimization has become a research field that has attracted much attention. The quality of multimedia images directly affects the user's visual experience, especially in scenarios such as high-definition video, virtual reality (VR), and augmented reality (AR), where the requirements for image clarity, brightness details, and color performance are getting higher and higher. Traditional image optimization techniques usually focus on single-dimensional processing, such as brightness enhancement, contrast adjustment, or color optimization. However, since multimedia images are usually affected by acquisition device noise, uneven lighting, and color distortion, these single optimization methods cannot comprehensively improve image quality, and are prone to problems such as over-enhancement, detail loss, or unnatural colors. In recent years, image processing methods based on color space have gradually attracted attention, especially the HSI color space, which can separate brightness from hue and saturation, providing a new technical path for image quality optimization. However, most existing methods only adjust a single channel or specific parameters, and cannot achieve full-scale optimization of brightness, contrast, and edge details. Summary of the invention

[0003] In view of the problems existing in the above-mentioned existing multimedia image optimization methods and systems, the present invention is proposed.

[0004] Therefore, the problem to be solved by the present invention is that most of the existing methods only adjust a single channel or specific parameters, and cannot achieve all-round optimization of brightness, contrast and edge details.

[0005] To solve the above technical problems, the present invention provides the following technical solutions: a multimedia image optimization method, which includes obtaining a multimedia image to be optimized and performing HSI color space conversion, extracting a brightness component in the HSI color space and performing brightness enhancement; adjusting the contrast of the enhanced brightness component, and performing brightness area division and dynamic range optimization; performing edge enhancement on the optimized brightness component, and recombining to generate an enhanced HSI image, and converting the enhanced HSI image back to RGB color space to obtain an optimized multimedia image.

[0006] As a preferred solution of the multimedia image optimization method of the present invention, wherein: the obtaining of the multimedia image to be optimized and performing HSI color space conversion refers to extracting original image data from a multimedia device, converting the obtained image format into a standard format, and performing noise smoothing on the image through mean filtering;

[0007] Normalize the color channel data of the preprocessed original image, and calculate the brightness component I, saturation S and hue H of the image based on the normalized color channel data;

[0008] Get the converted HSI color space and the corresponding HSI image.

[0009] As a preferred solution of the multimedia image optimization method of the present invention, wherein: the extracting the brightness component in the HSI color space and performing brightness enhancement refers to extracting the brightness component I from the HSI color space and using it as an independent channel, normalizing the extracted brightness component I and then smoothing the brightness component through a bilateral filter, and outputting the final brightness component after completing edge smoothing and normalization processing;

[0010] Apply a brightness conversion function to the brightness component to enhance the contrast and depth of the original brightness:

[0011]

[0012] Where A is the pixel brightness value after brightness conversion, a(x) is the brightness enhancement adjustment parameter, and I(x) is the brightness component;

[0013] A Gaussian pyramid is constructed for the brightness component after brightness conversion. The pyramid is set to n layers to generate images at multiple resolution levels. The initial layer directly takes the converted brightness component. From the second layer onwards, the previous layer image is Gaussian blurred and downsampled layer by layer to generate low-resolution images at each layer until the nth layer is reached.

[0014] After reaching the nth layer, a multi-layer Gaussian pyramid is obtained, each layer represents the low-frequency information of brightness at different spatial scales;

[0015] Construct a Laplacian pyramid based on the Gaussian pyramid, extract high-frequency information from each layer of the Gaussian pyramid image, upsample the Gaussian pyramid image of the l+1th layer by bilinear interpolation, and calculate the Laplacian pyramid image L of the lth layer using the following formula l (x,y):

[0016]

[0017] In the formula, G l (x, y) is the lth layer image of the Gaussian pyramid, G l+1 (x, y) is the l+1th layer image of the Gaussian pyramid, U() is the upsampling operation, G l+1 (x,y) is enlarged to the lth layer G l (x, y) have the same resolution, method indicates the interpolation method used for upsampling;

[0018] The calculated Stored as the high-frequency component of the l-th layer of the Laplacian pyramid;

[0019] The last layer of the Gaussian pyramid is used as the lowest frequency information of the Laplace pyramid, and the high frequency information of each layer is integrated with the low frequency basic brightness information to form a complete Laplace pyramid structure. is the multi-scale brightness component;

[0020] The brightness component of each layer is input into the initial convolution layer of DCNN to capture the basic brightness features through convolution operation, and the convolution structure is processed using the ReLU activation function to extract the basic details of brightness;

[0021] In the middle layer of DCNN, the output of the initial convolutional layer H(z) is processed by multiple layers of convolution, and each layer of convolution is based on the output of the previous layer:

[0022]

[0023] In the formula, represents the brightness feature of the k-th layer output, is the k-th convolution kernel weight, is the brightness feature output from the k-1th layer, is the bias item of the current layer;

[0024] The output of each convolution layer is batch normalized and then the ReLU activation function is used:

[0025]

[0026] In the formula, Represents the brightness feature output after the k-th layer of convolution, batch normalization and activation processing. BN() is the batch normalization operation;

[0027] After multiple layers of convolution, batch normalization and activation function, the deep extracted brightness features are finally obtained;

[0028] Based on the brightness component I, at each pixel x in the image, take N The local brightness mean and standard deviation of pixel x are calculated for the pixels in the N windows, and the local brightness mean and local standard deviation of all pixels are combined to generate the final illumination estimation map T(x). The weight matrix W(x) is generated based on the illumination estimation map.

[0029] The multi-scale brightness components and deep brightness features are adjusted to the same resolution through upsampling and downsampling methods;

[0030] The multi-channel depth brightness features are merged using the mean of all channels and converted into single-channel brightness features. After the format is unified, weighted fusion is performed through the weight matrix to obtain the fused brightness component. Starting from the lowest frequency layer, the Laplacian pyramid components of each layer are upsampled and superimposed in turn to gradually reconstruct the complete brightness component to obtain the enhanced brightness component. .

[0031] As a preferred solution of the multimedia image optimization method of the present invention, wherein: the adjusting the contrast of the enhanced brightness component refers to obtaining the enhanced brightness component and performing normalization processing, defining the solution group size of the water cycle algorithm as P, and each solution represents a set of contrast parameters (s, d), wherein s refers to the contrast scaling factor, and d refers to the brightness offset;

[0032] Initialize the river solution and the stream solution, and simulate the process of water flow to find the optimal solution;

[0033] According to the parameters (s, d) of the current solution, the contrast of the normalized brightness component is adjusted:

[0034]

[0035] In the formula, is the adjusted brightness value, is the normalized brightness value;

[0036] Calculate the objective function value J for the adjusted brightness component to evaluate the optimization effect of the current solution:

[0037]

[0038] Where M and N are the width and height of the image, representing the total range of pixels. is the local brightness mean, x represents the horizontal position of the pixel, and y represents the vertical position of the pixel;

[0039] Update the river solution and the stream solution according to the objective function value;

[0040] Set the maximum number of iterations until the maximum number of iterations is reached and stop the iteration. After the water cycle algorithm completes the iteration, select the solution with the smallest objective function value and use its parameters as the final optimal solution. Use the optimal solution to adjust the brightness component and perform range clipping on the optimized brightness value to obtain the brightness component after contrast adjustment. .

[0041] As a preferred solution of the multimedia image optimization method of the present invention, the brightness region division and dynamic range optimization refers to dividing the brightness component Divide into bright, dark and mid-tone areas, set the threshold H and , if the brightness value , then the pixel is classified as a brightness area. If the brightness value , then the pixel is classified as a dark area. If the brightness value , then the pixel is classified as the midtone area;

[0042] For the brightness area, a nonlinear compression function is used to reduce the output of the brightness of the bright part. For the dark area, a logarithmic transformation is used to enhance the dark details. For the mid-tone area, a linear adjustment is performed to balance the brightness transition.

[0043] Combines adjustments to the highlight, shadow, and midtone areas into a final dynamic range optimized luminance component.

[0044] As a preferred solution of the multimedia image optimization method of the present invention, wherein: the edge enhancement of the optimized brightness component and the recombining to generate the enhanced HSI image refers to using the Laplace operator to enhance the edge details of the brightness component after dynamic range optimization, keeping the brightness component consistent with the hue and saturation in the original HSI image, and The brightness channel in the original HSI image is replaced, and the enhanced brightness component is recombined with the hue and saturation components in the HSI color space to form the final HSI image.

[0045] As a preferred solution of the multimedia image optimization method described in the present invention, wherein: converting the enhanced HSI image back to the RGB color space to obtain the optimized multimedia image means converting the HSI image into an RGB image through the image processing library OpenCV to obtain the optimized multimedia image, saving the generated multimedia image in a standard format and performing data backup.

[0046] Another object of the present invention is to provide a multimedia image optimization system, which comprises:

[0047] An image acquisition module is used to extract raw image data from multimedia devices and generate HSI color space and corresponding images;

[0048] A brightness enhancement module, used for extracting and enhancing brightness components;

[0049] A contrast adjustment module, used for adjusting the contrast of the enhanced brightness component;

[0050] A range optimization module, used for dividing the optimized brightness components into regions and adjusting the dynamic range;

[0051] The conversion output module is used to perform edge enhancement on the brightness component after range adjustment and convert the HSI image into an RGB image for saving.

[0052] A computer device comprises: a memory and a processor; the memory stores a computer program, and the processor implements the steps of a multimedia image optimization method when executing the computer program.

[0053] A computer-readable storage medium stores a computer program, which implements the steps of a multimedia image optimization method when executed by a processor.

[0054] The beneficial effects of the present invention are as follows: the present invention realizes the comprehensive optimization of image brightness, contrast and details, improves the brightness hierarchy, solves the problem of detail loss in highlight and dark areas of the image, improves the edge clarity and color fidelity of the image, and can significantly improve the visual quality of multimedia images to meet the actual application needs of multiple scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0056] Figure 1 A flowchart diagram of a multimedia image optimization method;

[0057] Figure 2 This is a structural diagram of the multimedia image optimization system. DETAILED DESCRIPTION

[0058] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings.

[0059] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0060] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor is it a separate or selective embodiment that is mutually exclusive with other embodiments.

[0061] Example 1, reference Figure 1, which is the first embodiment of the present invention, and provides a multimedia image optimization method, the multimedia image optimization method comprising:

[0062] S1, obtaining a multimedia image to be optimized and performing HSI color space conversion, extracting a brightness component in the HSI color space and performing brightness enhancement;

[0063] Specifically, obtaining the multimedia image to be optimized and performing HSI color space conversion refers to extracting original image data from the multimedia device, converting the obtained image format into a standard format, and performing noise smoothing on the image through mean filtering;

[0064] Normalize the color channel data of the preprocessed original image, and calculate the brightness component I of the image based on the normalized color channel data:

[0065]

[0066] In the formula, R, G, and B are the normalized red, green, and blue channel values, respectively;

[0067] Calculate the saturation S of the image:

[0068]

[0069] Calculate the hue H of the image:

[0070]

[0071] In the formula, is the inverse cosine function;

[0072] Get the converted HSI color space and the corresponding HSI image.

[0073] By uniformly converting the image data in multimedia devices into a standard format, the format differences between devices are reduced, laying a foundation for consistency in subsequent image processing. The application of mean filtering removes high-frequency noise in the image while retaining the edge information of the image, providing clean data input for the normalization of the image color channel data. Normalization makes the image data of different devices distributed within the same standard range, reducing the brightness or contrast differences introduced by different devices. The brightness component I represents the brightness of the image and is one of the core goals of image optimization. By extracting brightness information from the normalized data, the interference of image illumination and color factors is avoided. The generated HSI image separates brightness and color information, which is convenient for subsequent independent enhancement operations on the brightness component while avoiding affecting the color. In the process of generating the HSI image, the hue and saturation information of the original image is retained, laying a foundation for the consistent display effect of the optimized image on different devices.

[0074] Further, extracting the brightness component in the HSI color space and performing brightness enhancement refers to extracting the brightness component I from the HSI color space and using it as an independent channel, normalizing the extracted brightness component I, smoothing the brightness component through a bilateral filter, and outputting the final brightness component after completing edge smoothing and normalization processing;

[0075] Apply a brightness conversion function to the brightness component to enhance the contrast and depth of the original brightness:

[0076]

[0077] Where A is the pixel brightness value after brightness conversion, which represents the enhanced brightness component and is used to generate different brightness levels and enhance contrast. a(x) is the brightness enhancement adjustment parameter, which is dynamically associated with the pixel brightness I(x) and is used to control the enhancement intensity of different brightness areas. I(x) is the brightness component.

[0078]

[0079] In the formula, c is a constant without unit, which is used to control the overall enhancement strength and is set according to the enhancement requirements. For example, k=1 is taken to ensure that the enhancement effect is obvious at low brightness, while the enhancement is suppressed at high brightness. It is a positive number used to avoid division by zero errors in calculations. It is usually set to a very small value (such as 0.01). Its main function is to avoid division by zero errors caused by the brightness being zero.

[0080] A Gaussian pyramid is constructed for the brightness component after brightness conversion. The pyramid is set to n layers to generate images at multiple resolution levels. The initial layer directly takes the converted brightness component. From the second layer onwards, the previous layer image is Gaussian blurred and downsampled layer by layer to generate low-resolution images at each layer until the nth layer is reached.

[0081] After reaching the nth layer, a multi-layer Gaussian pyramid is obtained, each layer represents the low-frequency information of brightness at different spatial scales;

[0082] Construct a Laplacian pyramid based on the Gaussian pyramid, extract high-frequency information from each layer of the Gaussian pyramid image, upsample the Gaussian pyramid image of the l+1th layer by bilinear interpolation, and calculate the Laplacian pyramid image L of the lth layer using the following formula l (x,y):

[0083]

[0084] In the formula, G l (x, y) is the lth layer image of the Gaussian pyramid, which represents the low-frequency brightness component, mainly containing smooth and blurred brightness information.l+1 (x, y) is the l+1th layer image of the Gaussian pyramid, U() is the upsampling operation, G l+1 (x,y) is enlarged to the lth layer G l (x, y) have the same resolution, method represents the interpolation method used for upsampling. Common methods include bilinear interpolation, bicubic interpolation, and nearest neighbor interpolation. Bilinear interpolation is preferred in this solution.

[0085] The calculated Stored as the high-frequency component of the l-th layer of the Laplacian pyramid;

[0086] Calculating high-frequency information layer by layer allows each layer of the Laplacian pyramid image to extract high-frequency details of a specific scale, which helps to preserve the subtle brightness changes of the image at each scale;

[0087] The last layer of the Gaussian pyramid is used as the lowest frequency information of the Laplace pyramid, and the high frequency information of each layer is integrated with the low frequency basic brightness information to form a complete Laplace pyramid structure. is the multi-scale brightness component;

[0088] Constructing a complete Laplacian pyramid structure provides hierarchical information for image reconstruction and detail enhancement, so that details of different scales can be refined and reconstructed in subsequent processing;

[0089] High-frequency brightness information represents the details of each layer of the image, and low-frequency brightness information represents the overall brightness trend of the image;

[0090] The brightness component of each layer is input into the initial convolution layer of DCNN, the basic brightness features are captured through convolution operation, and the convolution structure is processed using ReLU activation function to extract the basic details of brightness:

[0091]

[0092] In the formula, is the brightness feature extracted by the initial convolutional layer, and is the basic feature expression of brightness at the current scale. is the convolution kernel weight matrix, which is used to extract the basic details of brightness information in the convolution operation. is a bias term used to adjust the brightness eigenvalue after convolution to ensure balanced data distribution. is the ReLU activation function, which removes negative values ​​and retains the positive part of the brightness information to ensure the nonlinear expression of the brightness feature. I is the brightness component;

[0093] The initial convolutional layer is mainly used to capture the basic details of the brightness component. The ReLU activation function is used to remove negative values, which can improve the nonlinear expression ability and avoid the loss of brightness information.

[0094] In the middle layer of DCNN, the output of the initial convolutional layer H(z) is processed by multiple layers of convolution, and each layer of convolution is based on the output of the previous layer:

[0095]

[0096] In the formula, Represents the brightness feature of the k-th layer output, including the more subtle brightness information extracted by this layer, is the k-th convolution kernel weight, which is used to extract refined brightness details at the current level. is the brightness feature output by the k-1th layer, which is used as the input of the current layer. is the bias item of the current layer, which is used to further adjust the brightness value;

[0097] Multi-layer convolution enables the brightness features to be progressively extracted and refined at different levels, making the details richer;

[0098] The output of each convolution layer is batch normalized and then the ReLU activation function is used:

[0099]

[0100] In the formula, Represents the brightness feature output after the k-th layer of convolution, batch normalization and activation processing. BN() is the batch normalization operation;

[0101] Batch normalization standardizes features to ensure stable data distribution and avoid gradient vanishing or explosion. ReLU activation retains the positive part of brightness and enhances nonlinear expression.

[0102] After multiple layers of convolution, batch normalization and activation function, the deep extracted brightness features are finally obtained;

[0103] This feature contains the brightness information after multi-scale decomposition and is refined at different levels;

[0104] Based on the brightness component I, at each pixel x in the image, take N The local brightness mean and standard deviation of pixel x are calculated for the pixels in the N windows, and the local brightness mean and local standard deviation of all pixels are combined to generate the final illumination estimation map T(x). The weight matrix W(x) is generated based on the illumination estimation map.

[0105] The multi-scale brightness component and the depth brightness feature are adjusted to the same resolution by upsampling and downsampling methods. In this embodiment, the specific adjustment method is:

[0106] Get the width w and height h of L(x,y) and H(x) respectively, and compare and ,like , then L(x,y) is high resolution and H(x) is low resolution, otherwise H(x) is high resolution and L(x,y) is low resolution;

[0107] Upsample the low-resolution multi-scale brightness component L(x,y) to match the resolution of the deep brightness feature H(x). If the resolution of the deep brightness feature H(x) is high, downsample H(x) to ensure that it is consistent with the multi-scale component.

[0108] The multi-channel deep brightness features are merged using the mean of all channels and converted into single-channel brightness features. After the format is unified, weighted fusion is performed through the weight matrix. The deep brightness features extracted by DCNN are weightedly fused with the multi-scale brightness components. The weight matrix generated by the illumination estimation map can dynamically balance the details of the bright and dark parts, making the fused brightness effect more natural. The fused brightness component is obtained. Starting from the lowest frequency layer, the Laplace pyramid components of each layer are upsampled and superimposed in turn to gradually reconstruct the complete brightness component to obtain the enhanced brightness component. ;

[0109] Combining the deep brightness features and the reconstruction process of multi-scale components can effectively integrate the detailed information of brightness at different scales, making the brightness enhanced image more layered and with natural details.

[0110] By considering the spatial position and intensity difference of pixels at the same time, the bilateral filter can achieve efficient noise reduction while effectively protecting the edge and texture information of the image. This method avoids the edge blurring problem caused by traditional filters and provides a high-quality foundation for subsequent image processing. The brightness conversion function is used to realize nonlinear adjustment of the original brightness, which can enhance the contrast of the image, making the bright area brighter and the dark area richer in details. The introduction of brightness adjustment parameters enables the brightness conversion process to be flexibly adjusted according to different scenes and image requirements, thereby achieving an image optimization effect that is more in line with human visual perception. The Gaussian pyramid extracts multi-level low-frequency information of the image, so that the brightness enhancement processing can be optimized for image features of different scales respectively, thereby avoiding the problem of local over-brightness or over-darkness caused by single-scale processing during the brightness enhancement process. The Laplacian pyramid extracts high-frequency information of the image, so that the edge features are processed in the enhancement process, effectively improving the sharpness and edge clarity of the image. Through multi-layer convolution and batch normalization operations, DCNN can extract multi-level detail features from the original brightness component, including local brightness information and global brightness mode, making the image more layered. The introduction of ReLU activation function and batch normalization technology enhances the nonlinear expression ability of neural networks, while improving the convergence speed and stability of network training, ensuring that the extracted brightness features have higher reliability. The multi-layer feature extraction mechanism of DCNN can restore the subtle texture in the image while enhancing the brightness, making the optimized image closer to the real scene. By generating the illumination estimation map T(x), the illumination conditions of each pixel in the image can be accurately described, and the dynamic adjustment of the brightness component can be achieved by combining the weight matrix W(x), which effectively solves the problem of dark or overexposed images caused by uneven illumination. In the process of brightness fusion, the weight matrix can balance the prominence of local details and the uniformity of global brightness distribution, so that the final image has both local clarity and overall visual consistency. By sampling and fusing the components of each layer of the Laplacian pyramid, the detailed information in the multi-scale brightness features can be fully restored, ensuring that the optimized brightness components show high-quality details at any resolution.

[0111] S2, adjusting the contrast of the enhanced brightness component, and performing brightness area division and dynamic range optimization;

[0112] Specifically, adjusting the contrast of the enhanced brightness component refers to obtaining the enhanced brightness component and performing normalization processing, defining the solution population size of the water cycle algorithm as P, and each solution represents a set of contrast parameters (s, d), where s refers to the contrast scaling factor, which is used to adjust the contrast of the image brightness and control the difference between the brightness values, and d refers to the brightness offset, which is used to adjust the overall brightness level of the image, determines the offset of the brightness value in the entire image, and sets the initial range of the parameter;

[0113] Initialize the river solution and the stream solution, and simulate the process of water flow to find the optimal solution;

[0114] According to the parameters (s, d) of the current solution, the contrast of the normalized brightness component is adjusted:

[0115]

[0116] In the formula, is the adjusted brightness value, is the normalized brightness value, ranging from [0,1];

[0117] Calculate the objective function value J for the adjusted brightness component to evaluate the optimization effect of the current solution:

[0118]

[0119] Where M and N are the width and height of the image, representing the total range of pixels. is the local brightness mean, x represents the horizontal position of the pixel, and y represents the vertical position of the pixel;

[0120] Update the river solution and creek solution according to the objective function value:

[0121]

[0122] In the formula, and are the new values ​​of the contrast scaling factor s and brightness offset d in the updated river solution, and are the new values ​​of the contrast scaling factor s and the brightness offset d in the updated creek solution, and are the original values ​​of the contrast scaling factor s and brightness offset d in the current river solution, and are the original values ​​of the contrast scaling factor s and brightness offset d in the current creek solution, and is the solution with the smallest objective function value in the current solution group, indicating the optimal solution for contrast scaling factor and brightness offset, r and is a random disturbance factor, ranging from [0,1], which is used to simulate the uncertainty in natural water flow and increase the diversity of search. r is calculated by random number generation technology;

[0123] Set the maximum number of iterations until the maximum number of iterations is reached and stop the iteration. After the water cycle algorithm completes the iteration, select the solution with the smallest objective function value and use its parameters as the final optimal solution. Use the optimal solution to adjust the brightness component and perform range clipping on the optimized brightness value to obtain the brightness component after contrast adjustment. .

[0124] Normalization processing unifies the value range of the brightness component to [0,1], eliminating the difference in the brightness range of different images, making the subsequent contrast adjustment more unified and standardized. Global search is achieved through the river solution to ensure that the contrast optimization can cover a larger solution space and avoid falling into the local optimal solution. The stream solution is responsible for local detail adjustment, so as to accurately adjust the brightness details on the basis of global optimization, simulate the dynamic process of water flow to find the optimal solution, and have both global search capabilities and local optimization capabilities, making the optimization results more accurate. The contrast adjustment function dynamically adjusts the brightness range and overall brightness level through s and d, so that the image presents a more vivid visual effect, adapts to a variety of image characteristics (such as high-contrast scenes or low-contrast scenes), and improves the overall visual quality. The objective function value J quantifies the brightness adjustment effect. The reliability of the optimization result is ensured by comprehensively evaluating the brightness uniformity and local details. The maximum number of iterations limits the algorithm running time to avoid low computational efficiency caused by too large a solution space. By selecting the solution with the smallest objective function value, the brightness distribution of the image after contrast adjustment is more uniform and the visual effect is optimal. The optimized brightness component is range-cropped to ensure that the pixel value is within the display range supported by the device, thereby improving the compatibility of the image on different devices and ensuring the display effect of the optimized image.

[0125] Furthermore, the brightness region division and dynamic range optimization refer to dividing the brightness component Divide into bright, dark and mid-tone areas, set the threshold H and , if the brightness value , then the pixel is classified as a brightness area. If the brightness value , then the pixel is classified as a dark area. If the brightness value , then the pixel is classified as the midtone area;

[0126] For the brightness area, a nonlinear compression function is used to reduce the output of the brightness of the bright part. For the dark area, a logarithmic transformation is used to enhance the dark details. For the mid-tone area, a linear adjustment is performed to balance the brightness transition.

[0127] Combines adjustments to the highlight, shadow, and midtone areas into a final dynamic range optimized luminance component.

[0128] This combination ensures that the details of different brightness areas can be clearly displayed visually, the bright areas will not be overexposed, the dark details are enhanced, and the mid-tone area has a natural transition. Finally, the resulting brightness component has been adaptively adjusted to the area, with a higher sense of detail and balanced light and dark contrast.

[0129] By dividing the brightness area, accurate adjustments can be made to different brightness areas without affecting the details of other areas. After dividing the image into bright, dark and mid-tone areas, the most suitable optimization method can be used for each area to retain image details to the greatest extent. Brightness area division helps to improve the efficiency of dynamic range optimization and enhance the local contrast and overall layering of the image. The nonlinear compression function can effectively reduce the excessive brightness of the bright areas and avoid the loss of details in the highlight areas of the image. Through nonlinear adjustment, the details of the bright areas can be effectively enhanced while maintaining a natural transition, improving the overall look and feel of the image and making the highlight areas transition more smoothly to the mid-tone areas. The logarithmic transformation stretches the brightness range of the dark areas, making the details easier to see in low light conditions. It is easy to be identified. The logarithmic transformation avoids interference from highlight areas and only enhances low-brightness areas, which makes the optimization more efficient. The linear adjustment of the mid-tone area balances the contrast difference between bright and dark areas through smooth transition, making the image more natural and maintaining the integrity of key details in the image. At the same time, it provides a good transition for the optimization of bright and dark areas. The dynamic range optimization achieves a balanced overall brightness distribution of the image through the adjustment of bright, dark and mid-tone areas, avoiding overexposure in bright areas and underexposure in dark areas, so that all parts of the image can be clearly presented. After integrating the adjustment results of bright, dark and mid-tone areas, the overall consistency and naturalness of the image are ensured. The merging process smoothes the transition between different areas to avoid abrupt visual effects.

[0130] S3, performing edge enhancement on the optimized brightness component, and recombining to generate an enhanced HSI image, and converting the enhanced HSI image back to RGB color space to obtain an optimized multimedia image;

[0131] Specifically, edge enhancement is performed on the optimized brightness component, and the enhanced HSI image is generated by recombining the image. The Laplace operator is used to enhance the edge details of the brightness component after dynamic range optimization, and the brightness component is kept consistent with the hue and saturation in the original HSI image. The brightness channel in the original HSI image is replaced, and the enhanced brightness component is recombined with the hue and saturation components in the HSI color space to form the final HSI image.

[0132] By extracting and superimposing high-frequency information of brightness, the edge contour is sharper, which is conducive to the rapid transmission of visual information. After edge enhancement, the structural features of the image are clearer, which is suitable for image analysis of complex scenes, such as object recognition or image segmentation. Edge enhancement only operates on the brightness component and does not directly process hue and saturation, avoiding unnatural changes in image color. By replacing only the brightness channel, the hue and saturation information is not affected, making the image color more natural. The enhanced brightness channel is merged with the hue and saturation components of the HSI image to generate a complete HSI image. The enhanced HSI image can be directly used in visual perception systems (such as autonomous driving or remote sensing image processing) or converted to RGB images for display. After HSI image enhancement, it is suitable for display effects under different lighting conditions, enhancing the universality of multimedia images.

[0133] Further, the enhanced HSI image is converted back to the RGB color space to obtain an optimized multimedia image, which means that the HSI image is converted into an RGB image through the image processing library OpenCV to obtain the optimized multimedia image, and the generated multimedia image is saved in a standard format and data is backed up.

[0134] Through the built-in optimization algorithm of OpenCV, fast and high-precision color space conversion is achieved, reducing manual calculations and potential errors. RGB format is the mainstream standard for current display devices. The converted images can be used directly on multimedia devices. Through precise color space mapping, the color hierarchy of the image is retained, and the brightness and contrast are optimized without affecting the hue and saturation. The backup mechanism ensures that data will not be lost due to equipment failure or human error. Images with metadata facilitate version management and subsequent optimization work, which improves the application efficiency of multimedia images.

[0135] Example 2, reference Figure 2 , which is the second embodiment of the present invention, and which is different from the previous embodiment, provides a multimedia image optimization system, which includes:

[0136] An image acquisition module is used to extract raw image data from multimedia devices and generate HSI color space and corresponding images;

[0137] A brightness enhancement module, used for extracting and enhancing brightness components;

[0138] A contrast adjustment module, used for adjusting the contrast of the enhanced brightness component;

[0139] A range optimization module, used for dividing the optimized brightness components into regions and adjusting the dynamic range;

[0140] The conversion output module is used to perform edge enhancement on the brightness component after range adjustment and convert the HSI image into an RGB image for saving.

[0141] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.

[0142] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.

[0143] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0144] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit with a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit with a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

Claims

1. A multimedia image optimization method, characterized in that: include, Acquire the multimedia image to be optimized and perform HSI color space conversion, extract the brightness component in the HSI color space and perform brightness enhancement; Adjust the contrast of the enhanced brightness component, and perform brightness area division and dynamic range optimization; Perform edge enhancement on the optimized brightness component and reassemble to generate an enhanced HSI image, convert the enhanced HSI image back to RGB color space to obtain an optimized multimedia image; The obtaining of the multimedia image to be optimized and performing HSI color space conversion refers to extracting original image data from the multimedia device, converting the obtained image format into a standard format, and performing noise smoothing on the image by mean filtering; Normalize the color channel data of the preprocessed original image, and calculate the brightness component I, saturation S and hue H of the image based on the normalized color channel data; Get the converted HSI color space and the corresponding HSI image; Extracting the brightness component in the HSI color space and performing brightness enhancement refers to extracting the brightness component I from the HSI color space and using it as an independent channel, normalizing the extracted brightness component I, smoothing the brightness component through a bilateral filter, and outputting the final brightness component after completing edge smoothing and normalization processing; Apply a brightness conversion function to the brightness component to enhance the contrast and depth of the original brightness: ; Where A is the pixel brightness value after brightness conversion, a(x) is the brightness enhancement adjustment parameter, and I(x) is the brightness component; A Gaussian pyramid is constructed for the brightness component after brightness conversion. The pyramid is set to n layers to generate images at multiple resolution levels. The initial layer directly takes the converted brightness component. From the second layer onwards, the previous layer image is Gaussian blurred and downsampled layer by layer to generate low-resolution images at each layer until the nth layer is reached. After reaching the nth layer, a multi-layer Gaussian pyramid is obtained, each layer represents the low-frequency information of brightness at different spatial scales; Construct a Laplacian pyramid based on the Gaussian pyramid, extract high-frequency information from each layer of the Gaussian pyramid image, upsample the Gaussian pyramid image of the l+1th layer by bilinear interpolation, and calculate the Laplacian pyramid image L of the lth layer using the following formula l (x,y): ; In the formula, G l (x, y) is the lth layer image of the Gaussian pyramid, G l+1 (x, y) is the l+1th layer image of the Gaussian pyramid, U() is the upsampling operation, G l+1 (x,y) is enlarged to the lth layer G l (x, y) have the same resolution, method indicates the interpolation method used for upsampling; The calculated Stored as the high-frequency component of the l-th layer of the Laplacian pyramid; The last layer of the Gaussian pyramid is used as the lowest frequency information of the Laplace pyramid, and the high frequency information of each layer is integrated with the low frequency basic brightness information to form a complete Laplace pyramid structure. is the multi-scale brightness component; The brightness component of each layer is input into the initial convolution layer of DCNN to capture the basic brightness features through convolution operation, and the convolution structure is processed using the ReLU activation function to extract the basic details of brightness; In the middle layer of DCNN, the output of the initial convolutional layer H(z) is processed by multiple layers of convolution, and each layer of convolution is based on the output of the previous layer: ; In the formula, represents the brightness feature of the k-th layer output, is the k-th convolution kernel weight, is the brightness feature output from the k-1th layer, is the bias item of the current layer; The output of each convolution layer is batch normalized and then the ReLU activation function is used: ; In the formula, Represents the brightness feature output after the k-th layer of convolution, batch normalization and activation processing. BN() is the batch normalization operation; After multiple layers of convolution, batch normalization and activation function, the deep extracted brightness features are finally obtained; Based on the brightness component I, at each pixel x in the image, take N The local brightness mean and standard deviation of pixel x are calculated for the pixels in the N windows, and the local brightness mean and local standard deviation of all pixels are combined to generate the final illumination estimation map T(x). The weight matrix W(x) is generated based on the illumination estimation map. The multi-scale brightness components and deep brightness features are adjusted to the same resolution through upsampling and downsampling methods; The multi-channel depth brightness features are merged using the mean of all channels and converted into single-channel brightness features. After the format is unified, weighted fusion is performed through the weight matrix to obtain the fused brightness component. Starting from the lowest frequency layer, the Laplacian pyramid components of each layer are upsampled and superimposed in turn to gradually reconstruct the complete brightness component to obtain the enhanced brightness component. .

2. The multimedia image optimization method according to claim 1, wherein: After the adjustment is enhanced The contrast of the brightness component refers to obtaining the enhanced brightness component and normalizing it. The solution group size of the water cycle algorithm is defined as P, and each solution represents a set of contrast parameters (s, d), where s refers to the contrast scaling factor and d refers to the brightness offset; Initialize the river solution and the stream solution, and simulate the process of water flow to find the optimal solution; According to the parameters (s, d) of the current solution, the contrast of the normalized brightness component is adjusted: ; In the formula, is the adjusted brightness value, is the normalized brightness value; Calculate the objective function value J for the adjusted brightness component to evaluate the optimization effect of the current solution: ; Where M and N are the width and height of the image, representing the total range of pixels. is the local brightness mean, x represents the horizontal position of the pixel, and y represents the vertical position of the pixel; Update the river solution and the stream solution according to the objective function value; Set the maximum number of iterations until the maximum number of iterations is reached and stop the iteration. After the water cycle algorithm completes the iteration, select the solution with the smallest objective function value and use its parameters as the final optimal solution. Use the optimal solution to adjust the brightness component and perform range clipping on the optimized brightness value to obtain the brightness component after contrast adjustment. .

3. The multimedia image optimization method according to claim 1, wherein: The brightness region division and dynamic range optimization refer to Divide into bright, dark and mid-tone areas, set the threshold H and , if the brightness value , then the pixel is classified as a brightness area. If the brightness value , then the pixel is classified as a dark area. If the brightness value , then the pixel is classified as a midtone area; For the brightness area, a nonlinear compression function is used to reduce the output of the brightness of the bright part. For the dark area, a logarithmic transformation is used to enhance the dark details. For the mid-tone area, a linear adjustment is performed to balance the brightness transition. Combines adjustments to the highlight, shadow, and midtone areas into a final dynamic range optimized luminance component.

4. The multimedia image optimization method according to claim 3, characterized in that: The edge enhancement of the optimized brightness component and the recombining to generate the enhanced HSI image refers to using the Laplace operator to enhance the edge details of the brightness component after dynamic range optimization, keeping the brightness component consistent with the hue and saturation in the original HSI image, and The brightness channel in the original HSI image is replaced, and the enhanced brightness component is recombined with the hue and saturation components in the HSI color space to form the final HSI image.

5. The multimedia image optimization method according to claim 4, characterized in that: Converting the enhanced HSI image back to the RGB color space to obtain the optimized multimedia image means converting the HSI image into an RGB image through the image processing library OpenCV to obtain the optimized multimedia image, saving the generated multimedia image in a standard format and performing data backup.

6. A computer device comprising: Memory and processor; The memory stores a computer program, wherein the processor implements the steps of the multimedia image optimization method according to any one of claims 1 to 5 when executing the computer program.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the multimedia image optimization method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Adaptive colour image processing method and system

    CN101951523A

  • Degraded image enhancement method for foggy environment

    CN112465711A

  • Depth-Based Image Enhancement

    US20100080485A1