Wide gamut color space compression method, system, apparatus, medium and program product

By performing segmented compression and correction of the brightness and saturation data of video frames, combined with global compression and local contrast enhancement of frequency domain, the blurring and loss of details caused by the wide color space compression method in the existing technology is solved, and the problem of blurring and loss of details is realized. Higher quality video compression effect.

CN119277036APending Publication Date: 2025-01-07MIGU VIDEO TECH CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411413601.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-10
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

The existing wide color space compression method cannot effectively preserve the richness of the picture, resulting in blurred picture, loss of details and reduced color brightness after compression, especially in low-dark and high-bright scenes.

Method used

By performing segment compression and correction of the brightness data and saturation data of the video frame to be processed, combined with global compression, adjust the interval range and brightness compression amplitude of each grayscale interval, and maintain the color of most areas during saturation segmentation compression. The brightness remains unchanged, solving the problem of inconsistent compression directions of brightness and saturation, and adopting local contrast enhancement treatment in the frequency domain.

Benefits of technology

On the basis of maintaining the richness of the picture, retain the brightness and saturation information of local areas to the greatest extent, avoid blur and detail loss, improve the quality of compressed video, enhance the brightness of colors, and ensure rich and realistic details of the compressed picture.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119277036A_ABST
    Figure CN119277036A_ABST
Patent Text Reader

Abstract

The invention provides a wide-color-gamut color space compression method, system and device, a medium and a program product. The method comprises the following steps: acquiring first color space data of a to-be-processed video frame; processing the brightness data of the to-be-processed video frame according to a preset rule to obtain the processed brightness data of the to-be-processed video frame; performing segmented compression on the saturation data of the to-be-processed video frame to obtain the processed saturation data of the to-be-processed video frame; according to the brightness data of the processed to-be-processed video frame, the saturation data of the processed to-be-processed video frame and the tone data of the processed to-be-processed video frame, obtaining second color space data after the to-be-processed video frame is processed; and obtaining a target video according to the second color space data. According to the method, detail textures are enhanced in a segmented compression mode, the brightness degree of colors is enhanced, and the richness of the whole picture can be kept to the maximum extent after the whole picture is compressed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of video technology, and in particular to a wide color gamut color space compression method, system, device, medium and program product. Background Art

[0002] Wide color gamut color space is a three-dimensional color space with a larger coverage range / space volume than the traditional sRGB color gamut, which makes the stored colors closer to the visible color range of the human eye and more realistically restores the brightness and chromaticity information of the real scene. It is used in a wide range of fields such as entertainment, medicine, education, aviation, military, engineering robots, music, home entertainment, virtual communities, fine arts, archeology, etc. At the same time, with the improvement of video shooting capabilities, there are more and more wide color gamut sources, but the display capabilities of display terminals are still at the original sRGB display level. Therefore, how to compress the wide color gamut color space of the video to the sRGB color space supported by traditional display devices while maximizing the retention of the effects and details of the wide color gamut has become very necessary. Common application scenarios include: High Dynamic Range (HDR) video playback on the terminal. At present, the terminal display industry is limited in capabilities, and the color gamut is smaller than BT.2020. On display terminals such as mobile phones and TVs, color gamut compression technology must be used to play HDR videos.

[0003] There are currently color gamut compression schemes for wide color gamut color spaces, which are divided into global compression algorithms and global + local compression algorithms. The global compression algorithm is the most mainstream algorithm at present, and the more typical ones are the HPMINDE and SGCK algorithms. They use the method of defining the saturation and brightness boundaries under a certain hue angle, and compress the wide color gamut through vertex mapping or interval mapping, using a linear proportional mapping method. The other type is the global + local compression algorithm, the global + local color gamut mapping algorithm, which fuses the global mapping results with the multi-scale local histogram equalization results.

[0004] However, HPMINDE, SGCK and other algorithms such as HPMINDE use global compression algorithms, which will inevitably lead to blurring of local areas after compression and loss of detail textures. Therefore, the compressed image is blurred and the detail richness is significantly reduced. In addition, the inconsistency between the brightness compression and saturation compression directions is not considered, resulting in color jumps, which affects the image quality after color space compression. Global compression such as HPMINDE and SGCK algorithms use a fixed mapping curve, which is difficult to apply to all scenes, especially: scenes where low-light scenes and high-light scenes coexist, which will make the low-gray area too dark and cause blurred details; overexposure of the highlight area and loss of detail will seriously affect the video quality after color space compression. HPMINDE and SGCK algorithms use compression methods to uniformly compress all colors, resulting in obvious problems of bleak colors and reduced vividness.

[0005] Therefore, there are currently color gamut compression schemes for wide color gamut color spaces. Regardless of whether a global compression algorithm or a global + local compression algorithm is used, the contrast enhancement is limited, the enhancement of details and textures is not obvious, and the richness of the picture cannot be guaranteed. Summary of the invention

[0006] The embodiments of the present application provide a wide color gamut color space compression method, system, device, medium and program product to solve the problem that the existing wide color gamut color space compression method cannot ensure the richness of the picture.

[0007] In order to solve the above technical problems, this application is implemented as follows:

[0008] In a first aspect, an embodiment of the present application provides a wide color gamut color space compression method, comprising:

[0009] Acquire first color space data of a video frame to be processed, wherein the first color space data at least includes brightness data, saturation data and hue data;

[0010] Processing the brightness data of the to-be-processed video frame according to a preset rule to obtain the processed brightness data of the to-be-processed video frame;

[0011] Segmentally compressing the saturation data of the video frame to be processed to obtain processed saturation data of the video frame to be processed;

[0012] Obtaining second color space data of the processed video frame according to the processed brightness data of the processed video frame, the processed saturation data of the processed video frame and the hue data;

[0013] The second color space data after the processing of the video frame to be processed is converted into a color space to obtain a target video.

[0014] Optionally, after obtaining the saturation data of the processed video frame to be processed, the step further includes:

[0015] The saturation data of the video frame to be processed is corrected; the compression direction of the brightness data of the video frame to be processed after the processing is consistent with the compression direction of the saturation data of the video frame to be processed after the correction.

[0016] Optionally, the processing the brightness data of the to-be-processed video frame according to a preset rule to obtain the processed brightness data of the to-be-processed video frame includes:

[0017] Dividing the brightness data of the video frame to be processed into a plurality of grayscale intervals;

[0018] Count the percentage of pixels in each grayscale interval;

[0019] According to the proportion of the number of pixels in each grayscale interval, the interval range and the brightness compression amplitude of each grayscale interval are adjusted.

[0020] Optionally, adjusting the interval range and brightness compression amplitude of each grayscale interval according to the proportion of the number of pixels in each grayscale interval includes:

[0021] Expanding the range of the first grayscale interval and reducing the brightness compression amplitude of the first grayscale interval, wherein the proportion of the number of pixels in the first grayscale interval is greater than or equal to a first proportion threshold;

[0022] The range of the second grayscale interval is reduced, and the brightness compression amplitude of the second grayscale interval is expanded, wherein the proportion of the number of pixels in the second grayscale interval is less than or equal to the second proportion threshold.

[0023] Optionally, the step of compressing the saturation data of the to-be-processed video frame in sections to obtain the processed saturation data of the to-be-processed video frame includes:

[0024] Determine a saturation interval in which saturation data of a current pixel in the video frame to be processed is located;

[0025] If the saturation data of the current pixel is in the first saturation interval, the saturation of the current pixel is kept unchanged, and the saturation data of the first saturation interval is less than or equal to a critical value;

[0026] If the saturation data of the current pixel is in a second saturation interval, the saturation data of the current pixel is compressed, and the saturation data in the second saturation interval is greater than a critical value.

[0027] Optionally, after obtaining the target video, the step further includes:

[0028] Dividing the image frame in the target video into a plurality of image blocks;

[0029] Obtaining time domain output results of the multiple image blocks;

[0030] Performing weighted fusion on the time domain output results of the multiple image blocks and the time domain output results of the neighboring image blocks respectively corresponding to the multiple image blocks to obtain an image result of the image frame;

[0031] An optimized target video is obtained according to the image result of the image frame.

[0032] In a second aspect, an embodiment of the present application provides a wide color gamut color space compression system, including:

[0033] An acquisition module, used to acquire first color space data of a video frame to be processed, wherein the first color space data at least includes brightness data, saturation data and hue data;

[0034] A brightness module, used for processing the brightness data of the video frame to be processed according to a preset rule to obtain the brightness data of the video frame to be processed after processing;

[0035] A saturation module, used for performing segmented compression on the saturation data of the video frame to be processed to obtain processed saturation data of the video frame to be processed;

[0036] A processing module, used for obtaining the processed second color space data of the to-be-processed video frame according to the processed brightness data of the to-be-processed video frame, the processed saturation data of the to-be-processed video frame and the hue data;

[0037] The conversion module is used to perform color space conversion on the second color space data after the processing of the video frame to be processed to obtain a target video.

[0038] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the steps of the wide color gamut color space compression method described in the first aspect above are implemented.

[0039] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the wide color gamut color space compression method described in the first aspect above are implemented.

[0040] In a fifth aspect, a computer program product is provided, comprising computer instructions, which, when executed by a processor, implement the steps of the wide color gamut color space compression method as described in the first aspect.

[0041] In the present application, according to the multiple grayscale intervals, the brightness data of the video frame to be processed is processed according to the preset rules to obtain the brightness data of the processed video frame to be processed; the saturation data of the video frame to be processed is segmented compressed to obtain the saturation data of the processed video frame to be processed; then according to the brightness data of the processed video frame to be processed, the saturation data of the processed video frame to be processed and the hue data, the second color space data of the processed video to be processed is obtained; finally, the second color space data of the processed video frame to be processed is converted into a color space to obtain the target video. In the embodiment of the present application, the brightness data is adjusted according to the preset rules, and the saturation data is also segmented compressed. When the global compression is performed, the brightness compression and the saturation segmented compression are combined. On the basis of the global compression, the key information of the brightness and saturation of the local area can be retained to the greatest extent, avoiding the local area blurring caused by the global unified compression, the loss of detail texture, the bleak color and the obvious decrease in the vividness, etc., and the detail texture is enhanced and the vividness of the color is enhanced by the segmented compression method, so that the overall picture can also maintain the richness to the greatest extent after compression. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0043] Figure 1 is a flow chart of a wide color gamut color space compression method provided by an embodiment of the present application;

[0044] Figure 2 is a schematic diagram of a brightness compression curve effect provided by an embodiment of the present application;

[0045] Figure 3 is a frequency domain diagram of a contrast enhancement filter transfer function provided in an embodiment of the present application;

[0046] Figure 4 It is a structural schematic diagram of a wide color gamut color space compression system provided by an embodiment of the present application;

[0047] Figure 5 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0049] Please refer to Figure 1 , the embodiment of the present application provides a wide color gamut color space compression method, including:

[0050] Step 11: Acquire first color space data of the video frame to be processed, wherein the first color space data at least includes brightness data, saturation data and hue data;

[0051] Step 12: Processing the brightness data of the to-be-processed video frame according to a preset rule to obtain the processed brightness data of the to-be-processed video frame;

[0052] Step 13: compressing the saturation data of the video frame to be processed in sections to obtain processed saturation data of the video frame to be processed;

[0053] Step 14: obtaining the processed second color space data of the video to be processed according to the processed brightness data of the video frame to be processed, the processed saturation data of the video frame to be processed and the hue data;

[0054] Step 15: Perform color space conversion on the second color space data of the processed video frame to obtain a target video.

[0055] In the present application, according to the multiple grayscale intervals, the brightness data of the video frame to be processed is processed according to the preset rules to obtain the brightness data of the processed video frame to be processed; the saturation data of the video frame to be processed is segmented compressed to obtain the saturation data of the processed video frame to be processed; then according to the brightness data of the processed video frame to be processed, the saturation data of the processed video frame to be processed and the hue data, the second color space data of the processed video to be processed is obtained; finally, the second color space data of the processed video frame to be processed is converted into a color space to obtain the target video. In the embodiment of the present application, the brightness data is adjusted according to the preset rules, and the saturation data is also segmented compressed. When the global compression is performed, the brightness compression and the saturation segmented compression are combined. On the basis of the global compression, the key information of the brightness and saturation of the local area can be retained to the greatest extent, avoiding the local area blurring caused by the global unified compression, the loss of detail texture, the bleak color and the obvious decrease in the vividness, etc., and the detail texture is enhanced and the vividness of the color is enhanced by the segmented compression method, so that the overall picture can also maintain the richness to the greatest extent after compression.

[0056] In step 11, optionally, the video data to be processed is converted from nonlinear R`G`B` to linear RGB, and the linear RGB is converted to Lab color space through color space conversion to obtain first color space data of the video frame to be processed.

[0057] Optionally, the electronic optical transfer function (EOTF) can be used to convert the video data to be processed from nonlinear R'G'B' to linear RGB. The specific parameters can be selected according to the input video HDR format. The formula is as follows: {R, G, B} = EOTF (R , ,G , ,B , ).

[0058] Optionally, after obtaining the linear RGB, the linear RGB is converted to the Lab color space through color space conversion to obtain the brightness L, color components a and b, and then the saturation data S1, the brightness data L and the hue data H1 are obtained by the following formula:

[0059]

[0060] H1=tan -1 (b / a)

[0061] Among them, a represents the component from green to red, and b represents the component from blue to yellow.

[0062] In step 12, in an embodiment of the present application, optionally, the brightness data of the to-be-processed video frame is processed according to a preset rule to obtain the processed brightness data of the to-be-processed video frame, including:

[0063] Dividing the brightness data of the video frame to be processed into a plurality of grayscale intervals;

[0064] Count the percentage of pixels in each grayscale interval;

[0065] According to the proportion of the number of pixels in each grayscale interval, the interval range and the brightness compression amplitude of each grayscale interval are adjusted.

[0066] Optionally, the brightness can be divided into 4 grayscale intervals, and the current frame brightness data is used to count the proportion of the number of pixels in each grayscale interval, and dynamically adjust the interval range of each grayscale interval, the brightness compression amplitude or the shape of the interval brightness compression function, etc. Specifically, the global brightness data can be divided into 4 intervals, the first interval is a low gray interval; the second interval is a dark interval; the third interval is a medium bright interval; and the fourth interval is a high bright interval.

[0067] Among them, L1, L2, L3, and L4 are the critical values ​​of the four intervals. There are various methods for determining the critical values, which can be customized. You can also analyze the proportion of highlights and low darks in the picture based on the current frame brightness histogram, mean, peak and other statistical information, and then adaptively adjust the values ​​of L1, L2, L3, and L4. The embodiment of the present application does not limit the automatic adjustment of the critical value of the brightness interval. Adopting an adaptive segmented compression method, the parameters L1, L2, L3, and L4 are preliminarily preset to divide the brightness into four intervals. According to the current frame brightness histogram, mean, peak and other statistical information, the proportion of highlights and low darks in the picture is analyzed, and then the values ​​of L1, L2, L3, and L4 are adaptively adjusted, so as to realize the adaptive division of brightness intervals.

[0068] The adjusting the interval range and brightness compression amplitude of each grayscale interval according to the proportion of the number of pixels in each grayscale interval includes:

[0069] Expanding the range of the first grayscale interval and reducing the brightness compression amplitude of the first grayscale interval, wherein the proportion of the number of pixels in the first grayscale interval is greater than or equal to a first proportion threshold;

[0070] The range of the second grayscale interval is reduced, and the brightness compression amplitude of the second grayscale interval is expanded, wherein the proportion of the number of pixels in the second grayscale interval is less than or equal to the second proportion threshold.

[0071] Optionally, the adjustment method in the embodiment of the present application can retain the details of the picture in the area with a large proportion of brightness as much as possible. That is, for the first grayscale interval with a large proportion of picture brightness, the range of the divided interval can be expanded and the brightness compression amplitude can be reduced. For example, if the proportion of low-gray pictures is high, the proportion of low-gray areas is expanded, and the brightness of the dark area after the brightness compression of the area is increased, thereby brightening the dark detail information. If the proportion of highlight pictures is high, the range of the grayscale interval is expanded by expanding the L4 value while reducing the L3 value, and at the same time increasing the slope of the highlight interval function to expand the proportion of the highlight area after the brightness compression of the highlight area, increase the brightness of the highlight area, and ensure the details of the highlight area. Similarly, for the second grayscale interval with a small proportion of picture brightness, the range of the divided interval should be reduced accordingly, and the brightness compression amplitude should be increased.

[0072] More specifically, if the proportion of low-gray images in the current video frame to be processed is high, such as: the proportion of brightness L in the L1 and L2 area histogram statistics exceeds 30%, then the interval critical values ​​L1 and L2 of the interval are expanded. Optionally, there are many numerical expansion methods, such as: expanding by the same multiple according to the proportion of brightness L in the L1 and L2 areas. For example, if the proportion exceeds 30%, the L1 and L2 values ​​are expanded by 30%. At the same time, the slope of the low-gray interval function is L1 / H1. When L1 increases, the slope of the low-gray interval function increases to expand the proportion of low-gray areas, increase the brightness of dark areas, and ensure dark details; if the proportion of highlight images in the current video frame to be processed is high, then the L4 value is expanded and the L3 value is reduced at the same time. The method is similar to the above-mentioned L1 and L2 modifications. For example: the proportion of brightness L in the L3 and L4 area histogram statistics exceeds 30%, and the proportion of brightness L in the L3 and L4 areas is adjusted by the same multiple, L3 is reduced by 30%, and L4 is expanded by 30%. At the same time, the slope of the highlight interval function is increased to expand the proportion of the highlight area, improve the brightness of the highlight area, and ensure the details of the highlight area.

[0073] Optionally, the above adaptive dynamic compression can be achieved for brightness data in different grayscale intervals through piecewise functions, which can be represented by piecewise function L_glob(x). The first interval is the low gray interval, which uses a linear mapping; the second interval is the dark interval, which is mainly used to adjust the dark area, ensure the distribution of dark grayscale intervals, and improve the performance of dark details; the third interval is the medium-bright interval; the fourth interval is the highlight interval, which is used to adjust the highlight area, ensure the distribution of highlight grayscale intervals, and improve the texture of the highlight area.

[0074]

[0075] The input parameter x is the original brightness value L of the pixel (ie, the brightness data before processing), p, i, and w are curve adjustment coefficients, and the reference values ​​are: p=2.2, i=0.8, and w=0.77.

[0076] In the embodiment of the present application, the problems of low-gray areas being too dark, causing blurred details, overexposure of highlight areas, and loss of details caused by global compression of the brightness compression algorithm in the prior art are solved. The brightness is divided into 4 adjustable intervals by using adaptive segmented dynamic compression of brightness. The shape of the mapping curve is adjusted according to the proportion of different intervals to maximize the retention of texture details in the intervals with a large proportion of the original image, thereby improving the visual effect after compression. By adaptively adjusting the brightness, the brightness data of the area with a large proportion can be effectively retained, which is suitable for various scenes.

[0077] In step 14, in the embodiment of the present application, optionally, the saturation data of the video frame to be processed is compressed in sections to obtain the processed saturation data of the video frame to be processed, including:

[0078] Determine a saturation interval in which saturation data of a current pixel in the video frame to be processed is located;

[0079] If the saturation data of the current pixel is in the first saturation interval, the saturation of the current pixel is kept unchanged, and the saturation data of the first saturation interval is less than or equal to a critical value;

[0080] If the saturation data of the current pixel is in a second saturation interval, the saturation data of the current pixel is compressed, and the saturation data in the second saturation interval is greater than a critical value.

[0081] Optional, please refer to Figure 2 , the saturation range to be compressed is [0, max], the target saturation range is [0, 1]. In the first saturation interval [0, t] where the saturation is set constant, the output and input are equal, ensuring that the color vividness is not affected. In the second saturation interval (t, max] that needs to be compressed beyond the ultra-high critical t value, the horizontal axis is compressed to the remaining space of the target saturation [t, 1] using a piecewise function. The compression curve effect is as follows Figure 2 As shown, it is a continuous and smooth convex curve.

[0082] The global saturation is divided into two intervals, represented by the piecewise function S_glob(x). The first interval is the first saturation interval that is not compressed, protecting the color from compression; the second interval is the second saturation interval that is mainly compressed, greatly compressing the saturation value that exceeds the target color space into the target color space. Both the compression interval and the compression amplitude are adjustable.

[0083]

[0084] Among them, max is the approximate limit value of the curve, reference parameter max=1; t is the critical value of the first and second segments, the larger t is, the larger the uncompressed protection area is, reference parameter t=0.85, and the function input value x is the saturation data S1 before pixel processing.

[0085] In the embodiment of the present application, a segmented compression method is used, and most saturation areas are not compressed to ensure that the color vividness of most areas is not affected; a small part of the colors within the saturation boundary and exceeding the saturation boundary are reasonably compressed to the reserved saturation interval with a smooth curve, and the values ​​are continuous to avoid overflow. The problem of saturation compression causing bleak colors and a significant decrease in vividness is solved; at the same time, the problem of color overflow caused by directly compressing colors exceeding the boundary to the saturation boundary is solved. By segmented compression of saturation, the saturation of most areas in the image frame can be retained to the greatest extent, improving the overall image frame quality, thereby enhancing the quality of the final target video.

[0086] After the brightness data and saturation data are compressed by the above embodiment, there may be a color jump problem caused by the inconsistency between the brightness compression and the saturation compression direction. For example, if the brightness of the current pixel is increased while the saturation is compressed, it will cause color jump.

[0087] Therefore, in the embodiment of the present application, optionally, after obtaining the saturation data of the processed video frame to be processed, the method further includes:

[0088] The saturation data of the video frame to be processed is corrected; the compression direction of the brightness data of the video frame to be processed after the processing is consistent with the compression direction of the saturation data of the video frame to be processed after the correction.

[0089] Optionally, the saturation data can be further corrected using the following formula:

[0090]

[0091] Wherein, α is the correction coefficient, which is adjustable, and the reference value α=0.5.

[0092] In the embodiment of the present application, in order to solve the color jump problem caused by the inconsistency between the brightness compression and the saturation compression directions, saturation correction is added to ensure that the overall direction of the saturation compression is consistent with the brightness, thereby ensuring color consistency before and after compression.

[0093] In step 15, optionally, second color space data of the processed video frame to be processed is obtained according to the brightness data of the processed video frame to be processed, the saturation data of the processed video frame to be processed and the hue data.

[0094] Optionally, on the basis of correcting the saturation data, processed second color space data can be obtained through L_glob, S_glob1, and H1.

[0095] In step 16, optionally, the second color space is converted back to RGB, and then subjected to inverse EOTF transformation to obtain a nonlinear R`G`B` after global mapping, that is, the target video.

[0096] In the embodiment of the present application, optionally, after obtaining the target video in step 16, the following steps are further included:

[0097] Performing frequency domain local contrast enhancement processing on the image frames in the target video to obtain an optimized target video.

[0098] Specifically, in the embodiment of the present application, optionally, the performing frequency domain local contrast enhancement processing on the image frames in the target video to obtain the optimized target video includes:

[0099] Dividing the image frame in the target video into a plurality of image blocks;

[0100] Optionally, the image frame f(x, y) in the target video after global mapping is divided into 16 4*4 image blocks.

[0101] Convert the plurality of image blocks from the spatial domain to the frequency domain by Fourier transform to obtain a first Fourier transform result;

[0102] Optionally, the spatial domain is also called the airspace domain. Processing in the airspace domain is processing at the pixel level. The airspace domain mentioned above refers to pixel-level processing of a single-frame image. In the frequency domain, the closer the current area is to the center of the frequency domain plane, the lower the frequency of the area, that is, the flat area of ​​the picture. On the contrary, the farther from the center of the frequency domain plane, the higher the frequency of the area, that is, the edge or texture of the image, or the detail area. In order to more easily separate the details (high-frequency components) and the overall structure (low-frequency components) of the image, the present application converts each image block from the airspace domain to the frequency domain by taking the logarithm of the original image as Ln(f(x,y)) n , n represents the nth image block (0≤n≤16). Perform Fourier transform in the logarithmic domain, and the first Fourier transform result is Fn(Ln(f(x,y))) n .

[0103] Performing contrast enhancement filtering on the Fourier transform result based on the transfer function to obtain a second Fourier transform result;

[0104] Obtaining a third Fourier transform result according to the first Fourier transform result and the second Fourier transform result;

[0105] Performing inverse transformation and exponential transformation on the third Fourier transform result to obtain time domain output results of the multiple image blocks;

[0106] Performing weighted fusion on the time domain output results of the multiple image blocks and the time domain output results of the neighboring image blocks respectively corresponding to the multiple image blocks to obtain an image result of the image frame;

[0107] An optimized target video is obtained according to the image result of the image frame.

[0108] Optionally, the contrast enhancement filter transfer function is as follows:

[0109]

[0110] Dist(x,y)=(X-Cent_x) 2 +(Y-Cent_y) 2

[0111] Among them, (Cent_x, Cent_y) is the coordinate of the center point in the frequency domain plane, Dist(x,y) represents the distance of the current coordinate point (x,y) in the image relative to the center point in the frequency domain plane; L_high and L_low are high-frequency and low-frequency gains, which can be set manually, L_high>1, L_low<0.5; γ is the cutoff frequency, the reference value is 800; δ is the constant coefficient, the reference value is 2. Please refer to Figure 3 This is a frequency domain diagram of the contrast enhancement filter transfer function provided in an embodiment of the present application.

[0112] Optionally, the second Fourier transform result obtained by the frequency domain transfer function is multiplied by the first Fourier transform result of the image block n to obtain the third Fourier transform result FFT_fout(x,y) after the frequency domain local contrast enhancement. n .

[0113] FFT_fout(x,y) n =H(x,y).Fn(Ln(f(x,y))) n

[0114] According to the filter formula designed in the embodiment of the present application, after the contrast enhancement frequency domain transfer function, if the original image is in the low-frequency area, the transfer function value is small (close to L_low, the value is less than 0.5), and the transfer function and the original image are multiplied by the dot to reduce the original image frequency and compress the flat area. On the contrary, if the original image is in the high-frequency area, the transfer function value is large (close to L_high, the value is greater than 1), and the original image frequency is further increased by the dot multiplication of the transfer function and the original image.

[0115] Optionally, I inverse Fourier transform the result Fn -1 (FFT_fout(x,y) n ) and exponential transformation to obtain the time domain output result fout(x,y)n of image block n.

[0116] Optionally, each of the 16 image blocks is weighted and fused with its neighboring image blocks. For example, if the first image block starting from the origin has 2 neighbors, the final output of the image block is fout_final(x,y)1. After all the image blocks are re-fused, the final image result fout_final(x,y) is output.

[0117] fout_final(x,y)1=θ1×fout(x,y)1+θ2×fout(x,y)2+θ3×fout(x,y)3

[0118] Among them, θ1, θ2, and θ3 are weight parameters, which can be customized and require the sum to be 1. fout(x, y)2 and fout(x, y)3 are the output results of the two image blocks adjacent to fout(x, y)1.

[0119] In the embodiment of the present application, a local method rather than a global method is used for contrast enhancement, which can better preserve the smooth picture, enhance the high-frequency details in the local area, ensure the overall effect of the picture, and highlight the enhanced texture details; select the frequency domain rather than the spatial domain for enhancement filtering to avoid the ringing effect. In general, through the transfer function in the embodiment of the present application, the frequency of the high-frequency area in the original image can be made higher, and the frequency of the low-frequency area can be made lower, thereby specifically enhancing the high-frequency details and reducing the low-frequency ratio, which has a significant effect on dark image enhancement. After local contrast enhancement, the dark details are further increased, and the compressed picture is closer to reality.

[0120] In this application, in order to solve the problem of blurring and loss of texture details in local areas after compression caused by the global compression algorithm, global compression and local contrast enhancement are combined to enhance the texture details in high-frequency areas, so that the richness of the picture is not affected by compression. Adopting adaptive segmented dynamic compression of brightness, the brightness is divided into 4 adjustable intervals. According to the proportion of different intervals, the shape of the mapping curve is adjusted to maximize the retention of texture details in the intervals with a large proportion of the original image, and improve the visual effect after compression. Adopting the saturation segmented compression method, most of the saturation areas are not compressed to ensure that the color vividness of most areas is not affected; a small part of the color is reasonably compressed into the reserved interval, and the value is continuous to avoid the overflow problem, so as to ensure that the color is bright and there is no abnormality after saturation compression. Saturation correction is used to solve the color jump problem caused by the inconsistency between the brightness compression and the saturation compression direction. Ensure that the overall direction of saturation compression is consistent with the brightness, and ensure the color consistency before and after compression. Adopting frequency domain local contrast enhancement: Using logarithmic domain to split illumination and reflection into linear, enhancing filtering in frequency domain instead of time domain, the contrast enhancement amplitude is much larger than that in time domain, and the picture clarity is higher; through the designed filter formula, high-frequency details are enhanced, low-frequency proportion is reduced, and picture texture details are increased. The contrast enhancement amplitude is large, while dark details are increased, and the compressed picture is closer to reality.

[0121] Please refer to Figure 4 The embodiment of the present application further provides a wide color gamut color space compression system 20, comprising:

[0122] An acquisition module 21 is used to acquire first color space data of a video frame to be processed, wherein the first color space data at least includes brightness data, saturation data and hue data;

[0123] The brightness module 22 is used to process the brightness data of the video frame to be processed according to a preset rule to obtain the brightness data of the video frame to be processed after processing;

[0124] The saturation module 23 is used to compress the saturation data of the video frame to be processed in sections to obtain the saturation data of the video frame to be processed after processing;

[0125] A processing module 24, configured to obtain the processed second color space data of the to-be-processed video frame according to the processed brightness data of the to-be-processed video frame, the processed saturation data of the to-be-processed video frame and the hue data;

[0126] The conversion module 25 is used to perform color space conversion on the second color space data after the processing of the video frame to be processed to obtain a target video.

[0127] Optionally, the wide color gamut color space compression system 20 further includes:

[0128] A correction module is used to correct the saturation data of the video frame to be processed; the compression direction of the brightness data of the processed video frame to be processed is consistent with the compression direction of the saturation data of the corrected video frame to be processed.

[0129] Optionally, the brightness module 22 includes:

[0130] A brightness submodule, used for dividing the brightness data of the video frame to be processed into a plurality of grayscale intervals;

[0131] Count the percentage of pixels in each grayscale interval;

[0132] According to the proportion of the number of pixels in each grayscale interval, the interval range and the brightness compression amplitude of each grayscale interval are adjusted.

[0133] Optionally, the brightness submodule includes:

[0134] A grayscale interval module, used to expand the interval range of a first grayscale interval and reduce the brightness compression amplitude of the first grayscale interval, wherein the proportion of the number of pixels in the first grayscale interval is greater than or equal to a first proportion threshold;

[0135] The range of the second grayscale interval is reduced, and the brightness compression amplitude of the second grayscale interval is expanded, wherein the proportion of the number of pixels in the second grayscale interval is less than or equal to the second proportion threshold.

[0136] Optionally, the saturation module 23 includes:

[0137] A saturation submodule, used to determine a saturation interval in which the saturation data of the current pixel in the video frame to be processed is located;

[0138] If the saturation data of the current pixel is in the first saturation interval, the saturation of the current pixel is kept unchanged, and the saturation data of the first saturation interval is less than or equal to a critical value;

[0139] If the saturation data of the current pixel is in a second saturation interval, the saturation data of the current pixel is compressed, and the saturation data in the second saturation interval is greater than a critical value.

[0140] Optionally, the wide color gamut color space compression system 20 further includes:

[0141] An enhancement module, used for dividing an image frame in the target video into a plurality of image blocks;

[0142] Obtaining time domain output results of the multiple image blocks;

[0143] Performing weighted fusion on the time domain output results of the multiple image blocks and the time domain output results of the neighboring image blocks respectively corresponding to the multiple image blocks to obtain an image result of the image frame;

[0144] An optimized target video is obtained according to the image result of the image frame.

[0145] The wide color gamut color space compression system provided by the embodiment of the present application can achieve Figure 1 The various processes implemented by the method embodiment and achieving the same technical effect are not described here to avoid repetition.

[0146] The present application embodiment provides an electronic device 30, see Figure 5 As shown, Figure 5 This is a principle block diagram of an electronic device 30 according to an embodiment of the present application, including a processor 31, a memory 32, and a program or instruction stored in the memory 32 and executable on the processor 31. When the program or instruction is executed by the processor, the steps in any wide color gamut color space compression method of the present application are implemented.

[0147] An embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of an embodiment of a wide color gamut color space compression method such as any one of the above-mentioned ones is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0148] Computer readable media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0149] The present application also provides a computer program product, including computer instructions, which, when executed by a processor, implement the above Figure 1The various processes of the wide color gamut color space compression method embodiment shown can achieve the same technical effect, and will not be described again here to avoid repetition.

[0150] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0151] It should be noted that the collection, collection, updating, analysis, processing, use, transmission, storage and other aspects of user personal information involved in the technical solution of this disclosure are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information and network security.

[0152] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0153] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a service classification device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0154] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A wide color gamut color space compression method, characterized in that: include: Acquire first color space data of a video frame to be processed, wherein the first color space data at least includes brightness data, saturation data and hue data; Processing the brightness data of the to-be-processed video frame according to a preset rule to obtain the processed brightness data of the to-be-processed video frame; Segmentally compressing the saturation data of the to-be-processed video frame to obtain processed saturation data of the to-be-processed video frame; Obtaining second color space data of the processed video frame according to the processed brightness data of the processed video frame, the processed saturation data of the processed video frame and the hue data; The second color space data after the processing of the video frame to be processed is converted into a color space to obtain a target video.

2. The method according to claim 1, characterized in that After obtaining the saturation data of the processed video frame to be processed, the method further includes: The saturation data of the video frame to be processed is corrected; the compression direction of the brightness data of the video frame to be processed after the processing is consistent with the compression direction of the saturation data of the video frame to be processed after the correction.

3. The method according to claim 1, characterized in that The step of processing the brightness data of the video frame to be processed according to a preset rule to obtain the brightness data of the video frame to be processed after processing comprises: Dividing the brightness data of the video frame to be processed into a plurality of grayscale intervals; Count the percentage of pixels in each grayscale interval; According to the proportion of the number of pixels in each grayscale interval, the interval range and the brightness compression amplitude of each grayscale interval are adjusted.

4. The method according to claim 3, characterized in that: The adjusting the range and brightness compression amplitude of each grayscale interval according to the proportion of the number of pixels in each grayscale interval includes: Expanding the range of the first grayscale interval and reducing the brightness compression amplitude of the first grayscale interval, wherein the proportion of the number of pixels in the first grayscale interval is greater than or equal to a first proportion threshold; The range of the second grayscale interval is reduced, and the brightness compression amplitude of the second grayscale interval is expanded, wherein the proportion of the number of pixels in the second grayscale interval is less than or equal to the second proportion threshold.

5. The method according to claim 1, characterized in that: The step of compressing the saturation data of the video frame to be processed in sections to obtain the saturation data of the video frame to be processed after processing comprises: Determine a saturation interval in which saturation data of a current pixel in the video frame to be processed is located; If the saturation data of the current pixel is in the first saturation interval, the saturation of the current pixel is kept unchanged, and the saturation data of the first saturation interval is less than or equal to a critical value; If the saturation data of the current pixel is in a second saturation interval, the saturation data of the current pixel is compressed, and the saturation data in the second saturation interval is greater than a critical value.

6. The method according to claim 1, characterized in that After obtaining the target video, the following steps are further included: Dividing the image frame in the target video into a plurality of image blocks; Obtaining time domain output results of the multiple image blocks; Performing weighted fusion on the time domain output results of the multiple image blocks and the time domain output results of the neighboring image blocks respectively corresponding to the multiple image blocks to obtain an image result of the image frame; An optimized target video is obtained according to the image result of the image frame.

7. A wide color gamut color space compression system, characterized in that: include: An acquisition module, used to acquire first color space data of a video frame to be processed, wherein the first color space data at least includes brightness data, saturation data and hue data; A brightness module, used for processing the brightness data of the video frame to be processed according to a preset rule to obtain the brightness data of the video frame to be processed after processing; A saturation module, used for performing segmented compression on the saturation data of the video frame to be processed to obtain processed saturation data of the video frame to be processed; A processing module, used for obtaining the processed second color space data of the to-be-processed video frame according to the processed brightness data of the to-be-processed video frame, the processed saturation data of the to-be-processed video frame and the hue data; The conversion module is used to perform color space conversion on the second color space data after the processing of the video frame to be processed to obtain a target video.

8. An electronic device, characterized in that: include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the steps of the wide color gamut color space compression method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium, characterized in that: A computer program is stored on a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the wide color gamut color space compression method according to any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the steps of the wide color gamut color space compression method according to any one of claims 1 to 6.