Disclosure of Invention
The present invention has been made in view of the above-mentioned problems occurring in the conventional multimedia image optimization method and system.
Therefore, the problem to be solved by the present invention is that the existing method mostly adjusts only a single channel or specific parameters, and cannot realize the omnibearing optimization of brightness, contrast and edge details.
The technical scheme includes that the multimedia image optimization method comprises the steps of obtaining a multimedia image to be optimized, performing HSI color space conversion, extracting brightness components in the HSI color space, performing brightness enhancement, adjusting contrast of the enhanced brightness components, performing brightness region division and dynamic range optimization, performing edge enhancement on the optimized brightness components, recombining to generate an enhanced HSI image, and converting the enhanced HSI image back to an RGB color space to obtain the optimized multimedia image.
The method comprises the steps of obtaining a multimedia image to be optimized, performing HSI color space conversion, namely extracting original image data from multimedia equipment, uniformly converting the obtained image format into a standard format, and performing noise smoothing on the image through mean value filtering;
Normalizing the color channel data of the preprocessed original image, and calculating the brightness component I, the saturation S and the tone H of the image according to the normalized color channel data;
and obtaining a converted HSI color space and a corresponding HSI image.
The method comprises the steps of extracting a brightness component in an HSI color space and carrying out brightness enhancement, namely extracting a brightness component I from the HSI color space and taking the brightness component I as an independent channel, carrying out standardization on the extracted brightness component I, carrying out smoothing treatment on the brightness component through a bilateral filter, and outputting a final brightness component after finishing edge smoothing and standardization treatment;
applying a luminance transfer function to the luminance component enhances contrast and gradation of the original luminance:
Wherein A is the brightness value of the pixel after brightness conversion, a (x) is the brightness enhancement adjustment parameter, and I (x) is the brightness component;
Constructing a Gaussian pyramid for brightness components after brightness conversion, setting the pyramid as n layers, generating a plurality of resolution-level images, directly taking the converted brightness components by an initial layer, and carrying out Gaussian blur and downsampling on the previous layer image layer by layer from a second layer to generate each layer of low-resolution images until the n layer is reached;
after reaching the nth layer, obtaining a plurality of layers of Gaussian pyramids, wherein each layer represents low-frequency information with brightness in different spatial scales;
constructing a Laplacian pyramid based on the Gaussian pyramid, extracting high-frequency information from each layer of image of the Gaussian pyramid, upsampling the Gaussian pyramid image of the (l+1) th layer by a bilinear interpolation method, and calculating a Laplacian pyramid image L l (x, y) of the (L) th layer by using the following formula:
Where G l (x, y) is the first layer image of the gaussian pyramid, G l+1 (x, y) is the first +1 layer image of the gaussian pyramid, U () is an upsampling operation, G l+1 (x, y) is enlarged to the same resolution as the first layer G l (x, y), and method represents the interpolation method used for upsampling;
To be calculated to obtain Storing the high frequency component as a layer I Laplacian pyramid;
the last layer of the Gaussian pyramid is used as the lowest frequency information of the Laplacian pyramid, the high frequency information and the low frequency basic brightness information of each layer are integrated to form a complete Laplacian pyramid structure, and each layer of the Laplacian pyramid Is a multi-scale luminance component;
Inputting the brightness component of each layer into an initial convolution layer of the DCNN, capturing basic brightness characteristics through convolution operation, processing a convolution structure by using a ReLU activation function, and extracting basic details of brightness;
in the middle layer of DCNN, the output of the initial convolution layer H (z) is subjected to a multi-layer convolution process, each layer convolution being based on the output of the previous layer:
In the formula, Representing the luminance characteristics of the k-th layer output,For the layer k convolution kernel weights,For the luminance characteristics of the k-1 layer output,A bias term for the current layer;
Batch normalization of the output of each layer of convolution, and then using the ReLU activation function:
In the formula, Representing brightness characteristic output after the k-th layer convolution, batch normalization and activation processing, BN () being a batch normalization operation;
the brightness characteristics of the depth extraction are finally obtained through the layer-by-layer progressive processing of multi-layer convolution, batch normalization and activation functions;
based on the brightness component I, N is taken from each pixel point x in the image Calculating local brightness mean and standard deviation of pixel points x by pixel points in the N window, combining the local brightness mean and the local standard deviation of all the pixel points to generate a final illumination estimation graph T (x), and generating a weight matrix W (x) based on the illumination estimation graph;
The multi-scale brightness component and the depth brightness characteristic are adjusted to the same resolution through an up-sampling method and a down-sampling method;
channel combination is carried out on depth brightness characteristics of multiple channels by using an average value of all channels, the depth brightness characteristics are converted into single-channel brightness characteristics, after the formats are unified, weighted fusion is carried out through a weight matrix, so that fused brightness components are obtained, from the lowest frequency layer, laplacian pyramid components of each layer are sequentially subjected to up-sampling superposition, complete brightness components are gradually reconstructed, and the enhanced brightness components are obtained 。
The invention is used as a preferable scheme of the multimedia image optimization method, wherein the contrast of the enhanced brightness component is obtained and normalized by adjusting the enhanced brightness component, the solution group scale of the water circulation algorithm is defined as P, each solution represents a group of contrast parameters (s, d), wherein s is a contrast scaling factor, and d is a brightness offset;
initializing river solutions and streams, and simulating a process of searching an optimal solution by water flow;
And (3) carrying out contrast adjustment on the normalized brightness component according to the parameters (s, d) of the current solution:
In the formula, Is the luminance value after the adjustment,Is the normalized brightness value;
calculating an objective function value J for the adjusted brightness component, and evaluating 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 luminance mean, x represents the position of the pixel in the horizontal direction, y represents the position of the pixel in the vertical direction;
updating river solutions and creek solutions according to the objective function values;
Setting the maximum iteration times, stopping iteration until the maximum iteration times are reached, selecting a solution with the minimum objective function value after the water circulation algorithm completes iteration, taking the parameter as the final optimal solution, using the optimal demodulation integral brightness component, and performing range clipping on the optimized brightness value to obtain the brightness component with the adjusted contrast 。
As a preferable scheme of the multimedia image optimization method, the method comprises the steps of dividing brightness areas and optimizing dynamic range, namely, dividing brightness componentsDivided into bright part, dark part and middle regulating area, threshold H andIf the brightness valueClassifying the pixel as a luminance region if the luminance valueClassifying the pixel as a dark region if the brightness value isClassifying the pixel as a middle adjustment region;
For a brightness region, reducing the output of brightness of a bright part by using a nonlinear compression function, for a dark part region, lifting dark part details by using logarithmic transformation, linearly adjusting an intermediate adjustment region, and balancing brightness transition;
The adjustment results of the bright portion, the dark portion and the intermediate tone region are combined into a final dynamic range optimized luminance component.
As a preferable scheme of the multimedia image optimization method, the method comprises the steps of carrying out edge enhancement on the optimized brightness component, and recombining to generate an enhanced HSI image, namely carrying out edge detail enhancement on the brightness component with optimized dynamic range by using a Laplacian operator, keeping the brightness component consistent with the tone and saturation in the original HSI image, and carrying out detail enhancement on the brightness componentReplacing the brightness channel in the original HSI image, and recombining the enhanced brightness component with the hue and saturation components in the HSI color space to form a final HSI image.
The method for optimizing the multimedia image comprises the steps of converting the enhanced HSI image back to an RGB color space, obtaining an optimized multimedia image, converting the HSI image into the RGB image through an image processing library OpenCV, obtaining the optimized multimedia image, storing the generated multimedia image into a standard format, and carrying out data backup.
It is another object of the present invention to provide a multimedia image optimizing system, which includes,
The image acquisition module is used for extracting original image data from the multimedia equipment and generating an HSI color space and a corresponding image;
the brightness enhancement module is used for extracting brightness components and enhancing the brightness components;
A contrast adjustment module for adjusting the contrast of the enhanced luminance component;
The range optimization module is used for carrying out region division on the optimized brightness components and carrying out dynamic range adjustment;
And the conversion output module is used for carrying out edge enhancement on the brightness component with the adjusted range, converting the HSI image into an RGB image and then storing the RGB image.
A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor realizes the steps of a multimedia image optimization method when executing the computer program.
A computer readable storage medium having stored thereon a computer program which when executed by a processor implements the steps of a method of optimizing a multimedia image.
The invention has the beneficial effects that the comprehensive optimization of the brightness, contrast and details of the image is realized, the brightness layering sense is improved, the problem of detail loss of the image in the highlight and dark part areas is solved, the edge definition and color fidelity of the image are improved, the visual quality of the multimedia image can be obviously improved, and the practical application requirements of multiple scenes are met.
Detailed Description
In order that the above-recited objects, features and advantages of the present invention will become more readily apparent, a more particular description of the invention will be rendered by reference to specific embodiments thereof which are illustrated in the appended drawings.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, but the present invention may be practiced in other ways other than those described, and persons skilled in the art will readily appreciate that the present invention is not limited to the specific embodiments disclosed below.
Further, reference herein to "one embodiment" or "an embodiment" means that a particular feature, structure, or characteristic can be included in at least one implementation of the invention. The appearances of the phrase "in one embodiment" in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments.
Embodiment 1, referring to fig. 1, is a first embodiment of the present invention, which provides a multimedia image optimization method, including,
S1, acquiring a multimedia image to be optimized, performing HSI color space conversion, extracting a brightness component in the HSI color space, and performing brightness enhancement;
specifically, acquiring a multimedia image to be optimized and performing HSI color space conversion refers to extracting original image data from multimedia equipment, uniformly converting the obtained image format into a standard format, and performing noise smoothing on the image through mean value filtering;
Normalizing the color channel data of the preprocessed original image, and calculating the brightness component I of the image according to the normalized color channel data:
wherein R, G, B is the normalized red, green and blue channel values respectively;
Calculating the saturation S of the image:
calculating the hue H of the image:
In the formula, Is an inverse cosine function;
and obtaining a converted HSI color space and a corresponding HSI image.
The method has the advantages that the image data in the multimedia equipment are uniformly converted into the standard format, format differences among the equipment are reduced, a consistency foundation is laid for subsequent image processing, high-frequency noise in the image is removed by means of average filtering, meanwhile, edge information of the image is reserved, clean data input is provided for normalization of the image color channel data, the image data of different equipment are distributed in the same standard range by means of normalization, brightness or contrast differences caused by the fact that the equipment is different are reduced, brightness component I represents brightness of the image, and the method is one of core targets of image optimization. The brightness information is extracted from the normalized data, so that the interference of image illumination and color factors is avoided, the generated HSI image separates brightness from color information, the subsequent independent enhancement operation on brightness components is facilitated, meanwhile, the influence on colors is avoided, in the process of generating the HSI image, the tone and saturation information of an original image are reserved, and a foundation is laid for the consistent display effect of the optimized image on different devices.
Further, extracting a luminance component in the HSI color space and performing luminance enhancement refers to extracting the luminance component I from the HSI color space and taking the luminance component I as an independent channel, performing smoothing on the luminance component through a bilateral filter after normalizing the extracted luminance component I, and outputting a final luminance component after finishing edge smoothing and normalization;
applying a luminance transfer function to the luminance component enhances contrast and gradation of the original luminance:
Wherein A is a brightness value of a pixel after brightness conversion, represents a brightness component after enhancement, is used for generating different brightness levels and enhancing contrast, a (x) is a brightness enhancement adjusting parameter and is dynamically associated with the brightness I (x) of the pixel, and is used for controlling the enhancement intensity of different brightness areas, and I (x) is the brightness component;
where c is a constant, no unit, for controlling the overall enhancement intensity, and is set according to enhancement requirements, for example, k=1 is taken to ensure that enhancement is significant at low luminance and enhancement is suppressed at high luminance, Is a positive number, is used for avoiding zero removal errors during calculation, is usually set to be a minimum value (such as 0.01), and has the main function of avoiding zero removal errors caused by the condition that the brightness is zero;
Constructing a Gaussian pyramid for brightness components after brightness conversion, setting the pyramid as n layers, generating a plurality of resolution-level images, directly taking the converted brightness components by an initial layer, and carrying out Gaussian blur and downsampling on the previous layer image layer by layer from a second layer to generate each layer of low-resolution images until the n layer is reached;
after reaching the nth layer, obtaining a plurality of layers of Gaussian pyramids, wherein each layer represents low-frequency information with brightness in different spatial scales;
constructing a Laplacian pyramid based on the Gaussian pyramid, extracting high-frequency information from each layer of image of the Gaussian pyramid, upsampling the Gaussian pyramid image of the (l+1) th layer by a bilinear interpolation method, and calculating a Laplacian pyramid image L l (x, y) of the (L) th layer by using the following formula:
Where G l (x, y) is the first layer image of the gaussian pyramid, representing the low frequency luminance component, mainly containing smooth and blurred luminance information, G l+1 (x, y) is the first +1 layer image of the gaussian pyramid, U () is the upsampling operation, G l+1 (x, y) is amplified to the same resolution as the first layer G l (x, y), and method represents the interpolation method used for upsampling, common methods include bilinear interpolation, bicubic interpolation and nearest neighbor interpolation, and bilinear interpolation is preferred in this scheme;
To be calculated to obtain Storing the high frequency component as a layer I Laplacian pyramid;
The high-frequency information is calculated layer by layer, so that each layer of Laplacian pyramid image extracts high-frequency details of a specific scale, and the fine brightness change of the image on each scale is reserved;
the last layer of the Gaussian pyramid is used as the lowest frequency information of the Laplacian pyramid, the high frequency information and the low frequency basic brightness information of each layer are integrated to form a complete Laplacian pyramid structure, and each layer of the Laplacian pyramid Is a multi-scale luminance component;
constructing a complete Laplacian pyramid structure to provide layering information for image reconstruction and detail enhancement so as to refine and reconstruct details with different scales in subsequent processing;
the high-frequency brightness information represents the detail part of each layer of image, and the low-frequency brightness information represents the overall brightness trend of the image;
The luminance component of each layer is input to an initial convolution layer of the DCNN, basic luminance characteristics are captured through convolution operation, a convolution structure is processed by using a ReLU activation function, and basic details of luminance are extracted:
In the formula, Is the brightness characteristic extracted by the initial convolution layer, is the basic characteristic expression of brightness under the current scale,Is a convolution kernel weight matrix used to extract the basic details of luminance information in the convolution operation,Is an offset term used for adjusting the brightness characteristic value after convolution to ensure the data distribution balance,Removing the negative value for the ReLU activation function, and reserving the positive part of the brightness information to ensure the nonlinear expression of the brightness characteristics, wherein I is a brightness component;
the initial convolution layer is mainly used for capturing basic details of the brightness component, and a ReLU activation function is used for removing negative values, so that nonlinear expression capacity can be improved, and loss of brightness information is avoided;
in the middle layer of DCNN, the output of the initial convolution layer H (z) is subjected to a multi-layer convolution process, each layer convolution being based on the output of the previous layer:
In the formula, Representing the luminance characteristics of the k-th layer output, including finer luminance information extracted by that layer,For the k-th layer convolution kernel weight, for extracting refined luminance details at the current level,The luminance characteristics of the output for the k-1 layer, as input to the current layer,The bias item is used for further adjusting the brightness value;
the multi-layer convolution enables the brightness characteristics to be progressively extracted and refined on different layers, so that details are more abundant;
Batch normalization of the output of each layer of convolution, and then using the ReLU activation function:
In the formula, Representing brightness characteristic output after the k-th layer convolution, batch normalization and activation processing, BN () being a batch normalization operation;
batch normalization normalizes features, ensures data distribution stability, and avoids gradient extinction or explosion. ReLU activation retains the positive part of brightness, enhancing nonlinear expression;
the brightness characteristics of the depth extraction are finally obtained through the layer-by-layer progressive processing of multi-layer convolution, batch normalization and activation functions;
the characteristic contains brightness information after multi-scale decomposition, and is refined on different levels;
based on the brightness component I, N is taken from each pixel point x in the image Calculating local brightness mean and standard deviation of pixel points x by pixel points in the N window, combining the local brightness mean and the local standard deviation of all the pixel points to generate a final illumination estimation graph T (x), and generating a weight matrix W (x) based on the illumination estimation graph;
the multi-scale luminance component and the depth luminance feature are adjusted to the same resolution by up-sampling and down-sampling methods, and in this embodiment, the specific adjustment method is:
Acquiring width w and height H of L (x, y) and H (x), respectively, comparing AndIf (if)L (x, y) is high resolution, H (x) is low resolution, otherwise H (x) is high resolution, L (x, y) is low resolution;
upsampling the low-resolution multi-scale luminance component L (x, y) to match the resolution of the depth luminance feature H (x), if the resolution of the depth luminance feature H (x) is high, downsampling the H (x) to ensure that it is consistent with the multi-scale component;
Channel combination is carried out on depth brightness characteristics of multiple channels by using an average value of all channels, the depth brightness characteristics are converted into single-channel brightness characteristics, after the formats are unified, weighted fusion is carried out through a weight matrix, the depth brightness characteristics extracted by DCNN (direct digital network) and multi-scale brightness components are weighted and fused, details of a bright part and a dark part can be dynamically balanced through the weight matrix generated by an illumination estimation graph, the fused brightness effect is more natural, the fused brightness components are obtained, the Laplace pyramid components of each layer are sequentially subjected to up-sampling superposition from the lowest frequency layer, the complete brightness components are gradually reconstructed, and the enhanced brightness components are obtained ;
By combining the depth brightness characteristics and the reconstruction process of the multi-scale components, the detail information of the brightness in different scales can be effectively integrated, so that the image with the enhanced brightness has more layering sense and the detail is natural.
The spatial position and the intensity difference of the pixels are simultaneously considered through the bilateral filter, so that the edge and texture information of the image can be effectively protected while high-efficiency noise reduction is realized. The method avoids the problem of edge blurring caused by the traditional filter and provides a high-quality basis for the subsequent processing of the image. The nonlinear adjustment of the original brightness is realized through the brightness conversion function, so that the contrast of the brightness of the image can be enhanced, and the bright area is brighter and the details of the dark area are richer. The introduction of the brightness adjustment parameters enables the brightness conversion process to be flexibly adjusted according to different scenes and image requirements, so that the image optimization effect which is more in line with the visual perception of human eyes is achieved. The multi-level low-frequency information of the image is extracted through the Gaussian pyramid, so that the brightness enhancement processing can be optimized for the image features of different scales, and the problem of local over-brightness or over-darkness caused by single-scale processing in the brightness enhancement process is avoided. The Laplacian pyramid is used for extracting high-frequency information of the image, so that edge features are subjected to key treatment in the enhancement process, and the sharpness and edge definition of the image are effectively improved. Through multi-layer convolution and batch normalization operation, the DCNN can extract multi-level detail features from the original brightness component, wherein the multi-level detail features comprise local brightness information and global brightness modes, so that the image is more layered. And a ReLU activation function and a batch normalization technology are introduced, so that the nonlinear expression capability of the neural network is enhanced, the convergence speed and stability of network training are improved, and the extracted brightness characteristics are ensured to have higher reliability. The multi-layer feature extraction mechanism of the DCNN can restore fine textures in the image while the brightness is enhanced, so that the optimized image is more similar to a real scene. The illumination condition of each pixel point in the image can be accurately described through the generation of the illumination estimation graph T (x), and the dynamic adjustment of the brightness component is realized by combining the weight matrix W (x), so that the problem of dark image or overexposure caused by uneven illumination is effectively solved. In the brightness fusion process, the weight matrix can balance the prominence of local details and the uniformity of global brightness distribution, so that the final image has local definition and maintains the overall visual consistency. By sampling and fusing the Laplacian pyramid components of each layer, detail information in the multi-scale brightness characteristics can be completely restored, and the optimized brightness components are ensured to show high-quality details under any resolution.
S2, adjusting the contrast of the enhanced brightness component, and dividing a brightness area and optimizing a dynamic range;
Specifically, adjusting the contrast of the enhanced luminance component refers to obtaining the enhanced luminance component and performing normalization processing, defining the solution population scale of the water circulation algorithm as P, wherein each solution represents a group of contrast parameters (s, d), s refers to a contrast scaling factor, which is used for adjusting the contrast of the image luminance, controlling the difference between luminance values, d refers to a luminance offset, which is used for adjusting the overall luminance level of the image, determining the offset of the luminance value in the whole image, and setting the initial range of the parameters;
initializing river solutions and streams, and simulating a process of searching an optimal solution by water flow;
And (3) carrying out contrast adjustment on the normalized brightness component according to the parameters (s, d) of the current solution:
In the formula, Is the luminance value after the adjustment,The normalized brightness value is in the range of 0, 1;
calculating an objective function value J for the adjusted brightness component, and evaluating 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 luminance mean, x represents the position of the pixel in the horizontal direction, y represents the position of the pixel in the vertical direction;
updating river solutions and streams according to objective function values:
In the formula, AndIs a new value for the contrast scaling factor s and the brightness offset d in the updated river solution,AndIs the new value of the contrast scaling factor s and the brightness offset d in the updated streams solution,AndIs the original value of the contrast scaling factor s and the brightness offset d in the current river solution,AndIs the original value of the contrast scaling factor s and the brightness offset d in the current stream solution,AndIs the solution with the minimum objective function value in the current solution group, and represents the optimal solution of contrast scaling coefficient and brightness offset, r andThe random disturbance factor is in the range of 0,1 and is used for simulating uncertainty in natural water flow, increasing the diversity of searching, and r is calculated by a random number generation technology;
Setting the maximum iteration times, stopping iteration until the maximum iteration times are reached, selecting a solution with the minimum objective function value after the water circulation algorithm completes iteration, taking the parameter as the final optimal solution, using the optimal demodulation integral brightness component, and performing range clipping on the optimized brightness value to obtain the brightness component with the adjusted contrast 。
The normalization processing unifies the value ranges of the brightness components to 0,1, so that the difference of brightness ranges of different images is eliminated, and the subsequent contrast adjustment is more unified and standardized. The global search is realized through river solutions, the contrast optimization is ensured to cover a larger solution space, the situation that a local optimal solution is trapped in is avoided, the stream solution is responsible for local detail adjustment, so that the brightness detail is accurately adjusted on the basis of global optimization, the dynamic process of searching the optimal solution by simulating water flow is simulated, the global search capability and the local optimization capability are achieved, the optimization result is more accurate, the contrast adjustment function dynamically adjusts the brightness range and the overall brightness level through s and d, the image shows a clearer visual effect, the method is suitable for various image characteristics (such as a high-contrast scene or a low-contrast scene), and the overall visual quality is improved. The objective function value J quantifies the brightness adjustment effect, ensures the reliability of an optimization result through comprehensive evaluation of brightness uniformity and local details, limits the operation time of an algorithm by the maximum iteration times, avoids low calculation efficiency caused by overlarge solution space, ensures more uniform brightness distribution of an image after contrast adjustment through selecting a solution with the minimum objective function value, has optimal visual effect, performs range clipping on the optimized brightness component, ensures that pixel values are in a display range supported by equipment, improves the compatibility of the image on different equipment, and ensures the display effect of the optimized image.
Further, performing the division of the luminance area and the dynamic range optimization means to divide the luminance componentDivided into bright part, dark part and middle regulating area, threshold H andIf the brightness valueClassifying the pixel as a luminance region if the luminance valueClassifying the pixel as a dark region if the brightness value isClassifying the pixel as a middle adjustment region;
For a brightness region, reducing the output of brightness of a bright part by using a nonlinear compression function, for a dark part region, lifting dark part details by using logarithmic transformation, linearly adjusting an intermediate adjustment region, and balancing brightness transition;
The adjustment results of the bright portion, the dark portion and the intermediate tone region are combined into a final dynamic range optimized luminance component.
The combination mode ensures that details of different brightness areas can be clearly expressed visually, bright parts cannot be overexposed, dark part details are promoted, the intermediate adjustment area is natural in transition, and finally, the obtained brightness component is subjected to area self-adaptive adjustment, so that the brightness component has higher detail level sense and balanced brightness contrast.
Through the brightness region division, the accurate adjustment of different brightness regions can be realized without influencing the details of other regions, after an image is divided into a bright part, a dark part and a middle adjusting region, the most suitable optimization method can be adopted for each region, the details of the image are reserved to the greatest extent, the brightness region division is beneficial to the high efficiency of dynamic range optimization, the local contrast and the whole layering sense of the image are improved, the nonlinear compression function can effectively reduce the brightness of the excessively high bright part, the loss of the details of the high bright part in the image is avoided, the details of the bright part can be effectively enhanced while the natural transition is maintained, the overall impression of the image is improved, the high bright part is more smoothly transited to the middle adjusting region, the brightness range of the dark part region is stretched by logarithmic transformation, the details are easier to distinguish under the condition of dark light, the logarithmic transformation avoids the interference of a highlight region, enhances the low-brightness region, has higher optimization efficiency, linearly adjusts the intermediate adjustment region through smooth transition, balances the contrast difference between the bright part and the dark part, makes the image more natural, keeps the integrity of key details in the image, simultaneously provides good transition for the optimization of the bright part and the dark part, realizes the balance of the overall brightness distribution of the image through the adjustment of the bright part, the dark part and the intermediate adjustment region by dynamic range optimization, avoids the overexposure of the bright part region and the underexposure of the dark part region, ensures that each part of the image can be clearly presented, ensures the integral consistency and the naturalness of the image after integrating the adjustment results of the bright part, the dark part and the intermediate adjustment region, and has smooth transition of different regions in the merging process, thereby avoiding abrupt visual effects.
S3, carrying out edge enhancement on the optimized brightness component, and recombining to generate an enhanced HSI image, and converting the enhanced HSI image back to an RGB color space to obtain an optimized multimedia image;
Specifically, edge enhancement is performed on the optimized luminance component, and the enhanced HSI image is generated by recombination, namely, edge detail enhancement is performed on the luminance component with optimized dynamic range by using the Laplacian, the luminance component is consistent with the tone and saturation in the original HSI image, and the detail-enhanced luminance component is maintained Replacing the brightness channel in the original HSI image, and recombining the enhanced brightness component with the hue and saturation components in the HSI color space to form a final HSI image.
The method has the advantages that the edge outline is sharper through the extraction and superposition of the brightness high-frequency information, the quick transmission of visual information is facilitated, the structural characteristics of the image are clearer after the edge enhancement, the method is suitable for the image analysis of complex scenes, such as object recognition or image segmentation, the edge enhancement is only operated on brightness components, the color tone and the saturation are not directly processed, the unnatural change of the color of the image is avoided, the color tone and the saturation information are not affected through the replacement of the brightness channel, and the color of the image is more natural. And combining the enhanced brightness channel with hue and saturation components of the HSI image to generate a complete HSI image. The enhanced HSI image may be used directly in a visual perception system (such as autopilot or remote sensing image processing) or converted to an RGB image for display. The enhanced HSI image is suitable for display effects under different illumination conditions, and universality of the multimedia image is enhanced.
Further, the enhanced HSI image is converted back into an RGB color space, the optimized multimedia image is obtained by converting the HSI image into the RGB image through an image processing library OpenCV, and the generated multimedia image is stored as a standard format and is subjected to data backup.
Through the built-in optimization algorithm of OpenCV, realize quick and high-accuracy color space conversion, reduce manual calculation and potential error, RGB format is the mainstream standard of current display device, the image after the conversion can directly use on multimedia device, through accurate color space mapping, keep the color gradation of image, not influence tone and saturation when optimizing luminance and contrast, ensure through backup mechanism that data can not lose because of equipment failure or manual maloperation, the image with metadata is convenient for version management and follow-up optimization work, the application efficiency of multimedia image has been promoted.
Embodiment 2, referring to fig. 2, which is a second embodiment of the present invention, which is different from the previous embodiment, there is provided a multimedia image optimizing system, which includes,
The image acquisition module is used for extracting original image data from the multimedia equipment and generating an HSI color space and a corresponding image;
the brightness enhancement module is used for extracting brightness components and enhancing the brightness components;
A contrast adjustment module for adjusting the contrast of the enhanced luminance component;
The range optimization module is used for carrying out region division on the optimized brightness components and carrying out dynamic range adjustment;
And the conversion output module is used for carrying out edge enhancement on the brightness component with the adjusted range, converting the HSI image into an RGB image and then storing the RGB image.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. The storage medium includes a U disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, an optical disk, or other various media capable of storing program codes.
Logic and/or steps represented in the flowcharts or otherwise described herein, e.g., a ordered listing of executable instructions for implementing logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
More specific examples (a non-exhaustive list) of the computer-readable medium include an electrical connection (an electronic device) having one or more wires, a portable computer diskette (a magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). In addition, the computer readable medium may even be paper or other suitable medium on which the program is printed, as the program may be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.
It is to be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, may be implemented using any one or combination of techniques known in the art, discrete logic circuits with logic gates for implementing logic functions on data signals, application specific integrated circuits with appropriate combinational logic gates, programmable Gate Arrays (PGAs), field Programmable Gate Arrays (FPGAs), and the like.