A video compression method and device based on interest region enhancement
By detecting the area of interest and performing image enhancement in HSV space through YOLOv4, combined with the generative adversarial network to compress the brightness component, it solves the problem of difficulty in ensuring image quality in high-definition video compression and achieves efficient video compression and image detail improvement.
Patent Information
- Application Number
- CN202211006575.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-22
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-08-22
AI Technical Summary
In high-definition video compression, image quality is difficult to guarantee, and due to limitations of the shooting environment and transmission environment, image details are seriously distorted. It is urgent to break through the bottleneck of image compression technology and improve video compression efficiency and image quality.
A video compression method based on area of interest enhancement is used to detect the area of interest in the image through YOLOv4, convert the RGB color space into HSV space, enhance the area of interest, and compress only the brightness component, and use a generative adversarial network to decode the decoded image. Colorize and improve image quality.
It achieves improved video compression efficiency and image quality. YOLOv4 detection speed is fast. The image mean, variance and entropy after HSV space enhancement are better than those directly enhanced in RGB space. The generative adversarial network improves the image quality in the video coloring process.
Smart Images

Figure CN115396669B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of video compression, and in particular to a video compression method and device based on interest region enhancement. Background Art
[0002] With the widespread application of high-definition video in multimedia communication equipment, efficient video coding has attracted widespread attention at home and abroad. In practical applications, the demand for high-definition and high-contrast image processing is increasing. Due to the limitations of lighting conditions, exposure, transmission bandwidth, storage capacity, etc., image quality is difficult to guarantee, and the requirements for image quality and details are getting higher and higher. However, due to the limitations of shooting environment and transmission environment, the distortion of image details is still serious. Therefore, it is urgent to propose an image enhancement compression technology to break through the current technical bottleneck of image compression.
[0003] Image enhancement technology plays an important role in the wide application of images. The main purpose of image enhancement is to suppress the useless noise mixed into the image during the acquisition and transmission process, highlight the useful information in the image, make the image as consistent as possible with human visual effects, or transform the image into a form that is conducive to computer recognition and analysis, thereby improving the subsequent processing capabilities and application value of the image. Summary of the invention
[0004] In order to solve the above problems, the object of the present invention is to provide a video compression method and device based on region of interest enhancement, which can improve video compression efficiency and enhance image quality.
[0005] To solve the above problems, the technical solution of the present invention is:
[0006] A video compression method based on interest region enhancement comprises the following steps:
[0007] Transform and quantize video frames to remove spatial redundant information;
[0008] YOLOv4 is used to extract the region of interest of the image, and the RGB color space components are converted into HSV space components, and then the region of interest is enhanced;
[0009] After image enhancement, the brightness component of the data is compressed;
[0010] A portion of the image data after the region of interest is enhanced is used as training data, and the training data is used to train the generative adversarial network;
[0011] The compressed brightness component is decoded, the decoded image is input into the generative adversarial network, the image is colored, and the decoded enhanced image is obtained.
[0012] Optionally, the step of extracting the image region of interest by YOLOv4, converting the RGB color space components into HSV space components, and then enhancing the region of interest specifically includes the following steps:
[0013] Use YOLO v4 to detect people and vehicles in the image, and use the detected people and vehicles as regions of interest;
[0014] Convert the RGB color space image of the region of interest into an HSV space image;
[0015] The illumination light component and the reflected light component of the V component are separated by taking the logarithm method;
[0016] Enhance the V component;
[0017] Adaptively adjust the S component;
[0018] After the image is enhanced, the enhanced H, S, and V components are converted back to R, G, and B components.
[0019] Optionally, the conversion of the RGB color space image of the region of interest into the HSV color space image adopts the formula:
[0020]
[0021] Among them, R, G, B are the R, G, B components of the image respectively, H, S, V are the components of the image in the HSV space respectively, H∈[0,360], S∈[0,1], V∈[0,1], Tmax is the maximum value among R, G, B, and Tmin is the minimum value among R, G, B.
[0022] Optionally, the logarithmic method is used to separate the illumination light component and the reflected light component of the V component, and the formula used is:
[0023] V=L×R
[0024] Where V is the V component of the image in the HSV space, L is the ambient illumination image data, and R is the reflection image data.
[0025] Optionally, in the step of enhancing the V component, the enhanced V component may be expressed as V':
[0026]
[0027] Where ωn is the weight coefficient of the nth scale, and N is the number of scales.
[0028] Optionally, in the step of adaptively adjusting the S component, the adjusted S component may be expressed as S':
[0029] S′=S+t×(V′-V×λ)
[0030] Where t is the proportional constant and λ is the adaptive coefficient.
[0031] Optionally, in the step of compressing the brightness component in the data after image enhancement, the formula for compressing the brightness component of the enhanced image is:
[0032] Y′=C(Y)
[0033] Where C() is the image encoder, Y is the image brightness signal, and Y' is the compressed brightness signal.
[0034] Optionally, the step of using a portion of the image data after the region of interest is enhanced as training data and using the training data to train a generative adversarial network specifically includes the following steps:
[0035] Construct a chrominance component generative adversarial network to colorize the image;
[0036] Design the generator loss function.
[0037] Optionally, the generator loss function is:
[0038] L mixed =a1·L a +a2·L MSE +a3L content +a4L color
[0039] Where a1, a2, a3, and a4 are the weights of the loss function, and La is the adversarial loss term:
[0040] L a = -log D(G(Y))
[0041] Where log() is the log function, D() is the image discriminator model, and LMSE is the mean square error loss term:
[0042] L MSE =||G(Y)-X||2
[0043] Where || ||2 is the 2-norm, X is the target color image, and Lcontent is the feature loss term;
[0044]
[0045] In the formula, ||||1 is the 1 norm, Cj, Hj, and Wj represent the number of channels, length, and width of the feature map, respectively. is the j-th layer output of the network feature extraction layer;
[0046]
[0047] Where g(y) is the generated image, G0 and Gt are Gaussian filters.
[0048] Furthermore, the present invention also provides a video compression device based on region of interest enhancement, the device comprising a processor and a memory, the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the video compression method based on region of interest enhancement as described above.
[0049] Compared with the prior art, the present invention has the following beneficial effects:
[0050] 1. The present invention detects the region of interest through the YOLOv4 algorithm, which has a fast detection speed and can process video data in real time;
[0051] 2. The present invention converts RGB components into HSV components to enhance the region of interest. The mean, variance and entropy of the enhanced image are better than those directly enhancing the image in the RGB space.
[0052] 3. The present invention only compresses the brightness component of the image, and designs a generative adversarial network at the decoding end to color the image, thereby improving the video compression efficiency;
[0053] 4. The generative adversarial network hybrid loss function constructed by the present invention improves the quality of enhanced images during the video colorization process. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0055] Figure 1 A flowchart of a video compression method based on interest region enhancement provided by an embodiment of the present invention;
[0056] Figure 2 A diagram of the structure of a generative adversarial network provided by an embodiment of the present invention;
[0057] Figure 3 This is a structural block diagram of a video compression device based on interest region enhancement provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0058] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention and will make the technical solutions and beneficial effects of the present invention apparent.
[0059] The present invention proposes a video compression method based on interest region enhancement, which extracts the interest region in the video frame by using the YOLOV4 algorithm, enhances and compresses the video frame, and then colors the decoded image by using a generative adversarial network. Specifically, Figure 1 A flowchart of a video compression method based on interest region enhancement provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, the method comprises the following steps:
[0060] S1: transform and quantize the video frames to remove spatial redundant information;
[0061] S2: Extract the region of interest of the image through YOLOv4, convert the RGB color space components into HSV space components, and then enhance the region of interest;
[0062] Specifically, step S2 includes the following steps:
[0063] Step 21: Use YOLO v4 to detect people and vehicles in the image, and use the detected people and vehicles as regions of interest;
[0064] Step 22: Convert the RGB color space image of the region of interest into an HSV space image;
[0065] The specific formula is:
[0066]
[0067] Among them, R, G, B are the R, G, B components of the image respectively, H, S, V are the components of the image in HSV space respectively, H∈[0,360], S∈[0,1], V∈[0,1], Tmax is the maximum value among R, G, B, and Tmin is the minimum value among R, G, B;
[0068] Step 23: Separate the illumination light component and the reflected light component of the V component by taking a logarithm;
[0069] V=L×R (2)
[0070] Where V is the V component of the image in the HSV space, L is the ambient illumination image data, and R is the reflection image data;
[0071] Step 24: Enhance the V component. The enhanced V component can be expressed as V':
[0072]
[0073] Where ωn is the weight coefficient of the nth scale, and N is the number of scales;
[0074] Step 25: Adaptively adjust the S component. The adjusted S component can be expressed as S':
[0075] S′=S+t×(V′-V×λ) (4)
[0076] In the formula, t is the proportional constant, λ is the adaptive coefficient;
[0077] Step 26: After the image is enhanced, the enhanced H, S, and V components are converted back to R, G, and B components.
[0078] S3: After image enhancement, the brightness component in the data is compressed;
[0079] Specifically, the brightness component of the enhanced image is compressed:
[0080] Y′=C(Y) (5)
[0081] Where C() is the image encoder, Y is the image brightness signal, and Y' is the compressed brightness signal.
[0082] S4: using a portion of the image data after the region of interest is enhanced as training data, and using the training data to train a generative adversarial network;
[0083] Specifically, the structure diagram of the generative adversarial network is as follows: Figure 2 As shown, step S4 includes the following steps:
[0084] Step 41: Construct a chrominance component generation adversarial network to color the image;
[0085] The generator consists of a multi-scale feature extractor, a residual connection based on an attention mechanism, and a regularized feature reconstruction mechanism, and the discriminator adopts the PatchGAN structure.
[0086] Step 42: Design the generator loss function;
[0087] The specific formula is:
[0088] L mixed =a1·L a +a2·L MSE +a3L content +a4L color (6)
[0089] Where a1, a2, a3, and a4 are the weights of the loss function, and La is the adversarial loss term:
[0090] L a = -logD(G(Y)) (7)
[0091] Where log() is the log function, D() is the image discriminator model, and LMSE is the mean square error loss term:
[0092] L MSE =||G(Y)-X||2 (8)
[0093] Where || ||2 is the 2-norm, X is the target color image, and Lcontent is the feature loss term;
[0094]
[0095] In the formula, ||||1 is the 1 norm, Cj, Hj, and Wj represent the number of channels, length, and width of the feature map, respectively. is the j-th layer output of the network feature extraction layer;
[0096]
[0097] Where g(y) is the generated image, G0 and Gt are Gaussian filters.
[0098] S5: Decode the compressed brightness component, input the decoded image into the generative adversarial network, colorize the image, and obtain the decoded enhanced image.
[0099] like Figure 3 As shown, the present invention also provides a video compression device based on region of interest enhancement, the device includes a processor 31 and a memory 32, the processor 31 runs a program corresponding to the executable program code by reading the executable program code stored in the memory 32, so as to implement the video compression method based on region of interest enhancement as described in the above-mentioned embodiment.
[0100] Compared with the prior art, the present invention has the following beneficial effects:
[0101] 1. The present invention detects the region of interest through the YOLOv4 algorithm, which has a fast detection speed and can process video data in real time;
[0102] 2. The present invention converts RGB components into HSV components to enhance the region of interest. The mean, variance and entropy of the enhanced image are better than those directly enhancing the image in the RGB space.
[0103] 3. The present invention only compresses the brightness component of the image, and designs a generative adversarial network at the decoding end to color the image, thereby improving the video compression efficiency;
[0104] 4. The generative adversarial network hybrid loss function constructed by the present invention improves the quality of enhanced images during the video colorization process.
[0105] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essence of the present invention. In the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other arbitrarily.
Claims
1. A video compression method based on interest region enhancement, characterized in that: The method comprises the following steps: Transform and quantize video frames to remove spatial redundant information; YOLOv4 is used to extract the region of interest of the image, and the RGB color space components are converted into HSV space components, and then the region of interest is enhanced; After image enhancement, the brightness component of the data is compressed; The R, G, and B component image data after the enhancement of the region of interest are used as training data, and the training data are used to train the generative adversarial network; The step of extracting the image region of interest by YOLOv4, converting the RGB color space components into HSV space components, and then enhancing the region of interest specifically includes the following steps: Use YOLO v4 to detect people and vehicles in the image, and use the detected people and vehicles as regions of interest; Convert the RGB color space image of the region of interest into an HSV space image; The illumination light component and the reflected light component of the V component are separated by taking the logarithm method; Enhance the V component; Adaptively adjust the S component; After enhancing the image, the enhanced H, S, and V components are converted back into R, G, and B components; The formula used to convert the RGB color space image of the region of interest into the HSV space image is: Among them, R, G, B are the R, G, B components of the image respectively, H, S, V are the components of the image in the HSV space respectively, H∈[0,360], S∈[0,1], V∈[0,1], T max is the maximum value among R, G, B, T min It is the minimum value among R, G, and B; The method of taking logarithms is used to separate the illumination light component and the reflected light component of the V component, and the formula used is: V=L×R Where V is the V component of the image in the HSV space, L is the ambient illumination image data, and R is the reflection image data; In the step of enhancing the V component, the enhanced V component can be expressed as V': In the formula, ω n is the weighting coefficient of the nth scale, N is the number of scales; In the step of adaptively adjusting the S component, the adjusted S component can be expressed as S': S′=S+t×(V′-V×λ) In the formula, t is the proportional constant and λ is the adaptive coefficient; The step of using the image data after the enhancement of the region of interest as training data and using the training data to train the generative adversarial network specifically includes the following steps: Construct a chrominance component generative adversarial network to colorize the image; Design the generator loss function; In the step of compressing the brightness component in the data after image enhancement, the formula for compressing the brightness component of the enhanced image is: Y′=C(Y) In the formula, C() is the image encoder, Y is the image brightness signal, and Y' is the compressed brightness signal; The generator loss function is: <h2 style=";text-align:left;direction:ltr">L<h2 style=";text-align:left;direction:ltr"> mixed <h2 style=";text-align:left;direction:ltr"> =a1·L<h2 style=";text-align:left;direction:ltr"> a <h2 style=";text-align:left;direction:ltr"> +a2·L<h2 style=";text-align:left;direction:ltr"> MSE <h2 style=";text-align:left;direction:ltr"> +a3L<h2 style=";text-align:left;direction:ltr"> content <h2 style=";text-align:left;direction:ltr"> +a4L<h2 style=";text-align:left;direction:ltr"> color Where a1, a2, a3, a4 are the weights of the loss function, and L a To combat the loss term: L a =-logD(G(Y)) Where log() is the log function, D() is the image discriminator model, and L MSE is the mean square error loss term: L MSE =||G(Y)-X||2 In the formula, || ||2 is the 2-norm, X is the target color image, that is, the reference color image generated by the generator; G() is the output of the generative adversarial network, Y is the input of the generative adversarial network, and L content is the feature loss term: In the formula, || ||1 is the 1 norm, C j , H j , W j Respectively represent the number of channels, length and width of the feature map, is the j-th layer output of the network feature extraction layer; In the formula, g(y) is the generated image, G0 and G t is a Gaussian filter; The compressed brightness component is decoded, the decoded image is input into the generative adversarial network, the image is colored, and the decoded enhanced image is obtained.
2. A video compression device based on interest region enhancement, characterized in that: The device comprises a processor and a memory, wherein the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the video compression method based on interest region enhancement as claimed in claim 1.
Citation Information
Patent Citations
Video image enhancement method and device, video image analysis system and storage medium
CN109218695A
An image coloring method based on a self-attention generative adversarial network
CN109712203A
