Video processing method and related products
By performing multi-scale transformation and inverse transformation on the image, decomposing and enhancing the coefficients of high-frequency subband images, the problem of improving the quality of the image taken by electronic devices is solved, especially the significance of image details, and the image enhancement effect is achieved.
Patent Information
- Application Number
- CN202110496076.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-07
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2041-05-07
AI Technical Summary
How to improve the quality of the photographed images of electronic devices, especially the significance of image details.
By performing multi-scale transformation on the image, decompose it into low-frequency subband and high-frequency subband images, the enhancement coefficient of the high-frequency subband image is determined, and inverse transformation is performed to enhance image details.
Improve the significance of the detailed information of the image, realize image enhancement processing, and improve image quality.
Smart Images

Figure CN113436083B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technologies, and particularly to a video processing method and related products. Background Art
[0002] With the rapid development of electronic technologies, taking pictures has increasingly become a standard technology for electronic devices (such as mobile phones, tablet computers, etc.). The image quality greatly affects users' judgment of the product quality of electronic devices. Therefore, how to achieve image enhancement is an urgent problem to be solved. Summary of the Invention
[0003] Embodiments of this application provide a video processing method and related products, which can implement image enhancement processing and help improve the image quality.
[0004] In a first aspect, embodiments of this application provide a video processing method, and the method includes:
[0005] Obtain an image to be processed, where the image to be processed is any frame image in a target video;
[0006] Perform multi-scale transformation on the image to be processed to obtain a low-frequency sub-band image and K high-frequency sub-band images, where K is a positive integer;
[0007] Determine enhancement coefficients of S high-frequency sub-band images among the K high-frequency sub-band images to obtain S enhancement coefficients, where S is a positive integer less than or equal to K;
[0008] Perform an inverse transformation corresponding to the multi-scale transformation based on the S enhancement coefficients, the low-frequency sub-band image, and the K high-frequency sub-band images to obtain a target image.
[0009] In a second aspect, embodiments of this application provide a video processing device, and the device includes: an obtaining unit, a decomposing unit, a determining unit, and a reconstructing unit, where
[0010] The obtaining unit is configured to obtain an image to be processed, where the image to be processed is any frame image in a target video;
[0011] The decomposing unit is configured to perform multi-scale transformation on the image to be processed to obtain a low-frequency sub-band image and K high-frequency sub-band images, where K is a positive integer;
[0012] The determining unit is configured to determine enhancement coefficients of S high-frequency sub-band images among the K high-frequency sub-band images to obtain S enhancement coefficients, where S is a positive integer less than or equal to K;
[0013] The reconstruction unit is configured to perform an inverse transform corresponding to the multi-scale transform based on the S enhancement coefficients, the low-frequency subband image, and the K high-frequency subband images to obtain a target image.
[0014] In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a memory, a communication interface, and one or more programs. Wherein, the one or more programs are stored in the memory and are configured to be executed by the processor. The programs include instructions for performing the steps in any method of the first aspect of the embodiments of the present application.
[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium. Wherein, the computer-readable storage medium stores a computer program for electronic data exchange. Wherein, the computer program enables a computer to execute some or all of the steps described in any method of the first aspect of the embodiments of the present application.
[0016] In a fifth aspect, an embodiment of the present application provides a computer program product. Wherein, the computer program product includes a non-transitory computer-readable storage medium storing a computer program. The computer program is operable to enable a computer to execute some or all of the steps described in any method of the first aspect of the embodiments of the present application. The computer program product can be a software installation package.
[0017] Adopting the embodiments of the present application has the following beneficial effects:
[0018] It can be seen that in the video processing method and related products described in the embodiments of the present application, a to-be-processed image is obtained, and the to-be-processed image is any frame image in a target video; a multi-scale transform is performed on the to-be-processed image to obtain a low-frequency subband image and K high-frequency subband images, where K is a positive integer; enhancement coefficients of S high-frequency subband images among the K high-frequency subband images are determined to obtain S enhancement coefficients, where S is a positive integer less than or equal to K; an inverse transform corresponding to the multi-scale transform is performed based on the S enhancement coefficients, the low-frequency subband image, and the K high-frequency subband images to obtain a target image. Since the high-frequency image reflects the details of the image, the details of the image can be enhanced to improve the saliency of the detail information. Furthermore, image enhancement processing can be achieved, which is also helpful for improving the image quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0020] Figure 1 It is a schematic flowchart of a video processing method provided by an embodiment of the present application;
[0021] Figure 2 It is a schematic flowchart of another video processing method provided by an embodiment of the present application;
[0022] Figure 3 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application;
[0023] Figure 4 It is a block diagram of the functional units of a video processing device provided by an embodiment of the present application. Detailed implementation manners
[0024] In order to enable those skilled in the art to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0025] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products or devices.
[0026] Referring to "embodiment" in this article means that a specific feature, structure or characteristic described in combination with the embodiment may be included in at least one embodiment of the present application. The phrase appears in various positions in the specification and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.
[0027] The electronic devices involved in the embodiments of the present application may include various handheld devices with wireless communication functions (such as mobile phones, tablet computers, etc.), vehicle-mounted devices, wearable devices (such as smart glasses, smart bracelets, smart watches, etc.), computing devices, or other processing devices connected to a wireless modem, as well as various forms of user equipment (UE), mobile stations (MS), terminal devices, and so on.
[0028] Please refer to Figure 1 , Figure 1 Figure 1 is a schematic flowchart of a video processing method provided by an embodiment of the present application, which is applied to an electronic device. As shown in the figure, the video processing method includes the following operations.
[0029] 101. Obtain an image to be processed, where the image to be processed is any frame image in a target video.
[0030] Among them, the image to be processed can be any frame image in the target video, and the image to be processed can be a grayscale image or a color image. In a specific implementation, the electronic device can capture through a camera to obtain the target video.
[0031] 102. Perform a multi-scale transformation on the image to be processed to obtain a low-frequency subband image and K high-frequency subband images, where K is a positive integer.
[0032] Among them, the multi-scale transformation can be at least one of the following: wavelet transform, contourlet transform, non-subsampled contourlet transform, shearlet transform, ridgelet transform, pyramid transform, etc., which is not limited here. For example, in a specific implementation, the electronic device can perform a wavelet transform on the image to be processed to obtain a low-frequency subband image and K high-frequency subband images, where K is a positive integer.
[0033] In a specific implementation, after the image undergoes a wavelet transform, it can be divided into low-frequency signals and high-frequency signals. For any image I(i,j), its wavelet decomposition formula can be defined as:
[0034]
[0035] In the formula, C l,n represents the low-frequency subband (approximate image), that is, the LL3 subband; W k,n represents the high-frequency subbands (detail images), that is, LH1′, HL1′, and HH1′, LH2′, HL2′, and HH2′, LH3′, HL3′, and HH3′; l represents the number of wavelet decomposition layers, and n represents the number of wavelet coefficients.
[0036] 103. Determine the enhancement coefficients of S high-frequency subband images among the K high-frequency subband images to obtain S enhancement coefficients, where S is a positive integer less than or equal to K.
[0037] Among them, in specific implementation, the electronic device can determine the enhancement coefficients of S high-frequency subband images among the K high-frequency subband images to obtain S enhancement coefficients. If S = K, it means that image enhancement processing needs to be performed on each of the K high-frequency subband images. On the contrary, if S is less than K, it means that image enhancement processing is performed on some of the K high-frequency subband images.
[0038] Optionally, for the above step 103, determining the enhancement coefficients of S high-frequency subband images among the K high-frequency subband images to obtain S enhancement coefficients may include the following steps:
[0039] A31. Determine the target ratio between the resolution i of the high-frequency subband image i and the resolution of the image to be processed, where the high-frequency subband image i is any one of the K high-frequency subband images;
[0040] A32. Divide the high-frequency subband image i into multiple regions, and determine the distribution density of feature points in each of the multiple regions to obtain multiple distribution densities of feature points;
[0041] A33. Determine the target mean square error corresponding to the multiple distribution densities of feature points;
[0042] A34. According to the mapping relationship between the preset ratio and the enhancement coefficient, determine the first enhancement coefficient corresponding to the target ratio;
[0043] A35. According to the mapping relationship between the preset mean square error and the fine-tuning coefficient, determine the target fine-tuning coefficient corresponding to the target mean square error;
[0044] A36. Adjust the first enhancement coefficient according to the target fine-tuning coefficient to obtain the enhancement coefficient of the high-frequency subband image i.
[0045] Among them, in specific implementation, the electronic device may pre-store the mapping relationship between the preset ratio and the enhancement coefficient and the mapping relationship between the preset mean square error and the fine-tuning coefficient.
[0046] Specifically, taking the high-frequency sub-band image i as an example, the high-frequency sub-band image i is any one of the K high-frequency sub-band images. The electronic device can determine the target ratio between the resolution i of the high-frequency sub-band image i and the resolution of the image to be processed, and can also divide the high-frequency sub-band image i into multiple regions, where the area size of each region is the same or the region pattern of each region is the same. Furthermore, the feature point distribution density of each region in the multiple regions can be determined to obtain multiple feature point distribution densities. The feature point distribution density = the number of feature points in the region / the area of the region, and the target mean square error corresponding to the multiple feature point distribution densities can also be determined.
[0047] Furthermore, the electronic device can determine the first enhancement coefficient corresponding to the target ratio according to the mapping relationship between the preset ratio and the enhancement coefficient, and determine the target fine-tuning coefficient corresponding to the target mean square error according to the mapping relationship between the preset mean square error and the fine-tuning coefficient. The value range of the fine-tuning coefficient can be -1 to 1, for example, -0.1 to 0.1. Then, the first enhancement coefficient is adjusted according to the target fine-tuning coefficient to obtain the enhancement coefficient of the high-frequency sub-band image i. The specific formula is as follows:
[0048] The enhancement coefficient of the high-frequency sub-band image i = (1 + target fine-tuning coefficient) * first enhancement coefficient
[0049] Since the mean square error reflects the correlation between neighborhoods, that is, the consistency between different regions of the image, furthermore, the enhancement coefficient can be fine-tuned according to the mean square error, so that the enhancement effect is more in line with the characteristics of the image itself.
[0050] Optionally, step 103 above, determining the enhancement coefficients of S high-frequency sub-band images among the K high-frequency sub-band images to obtain S enhancement coefficients, may include the following steps:
[0051] B31. Determine the first energy value of the low-frequency sub-band image;
[0052] B32. Determine the second energy value of the image to be processed;
[0053] B33. Determine the target energy ratio between the first energy value and the second energy value;
[0054] B34. Determine the reference enhancement coefficient corresponding to the target energy ratio according to the mapping relationship between the preset energy ratio and the enhancement coefficient, and use the reference enhancement coefficient as the enhancement coefficient of S high-frequency sub-band images among the K high-frequency sub-band images.
[0055] In specific implementation, the mapping relationship between the preset energy ratio and the enhancement coefficient can be pre-stored in the electronic device.
[0056] Specifically, the electronic device can determine the first energy value of the low-frequency sub-band image, the second energy value of the image to be processed, and the target energy ratio between the first energy value and the second energy value. The larger the target energy ratio is, the less detailed information the high-frequency sub-band image contains. Conversely, the more detailed information the high-frequency sub-band image contains.
[0057] Further, the electronic device can determine the reference enhancement coefficient corresponding to the target energy ratio according to the mapping relationship between the preset energy ratio and the enhancement coefficient, and use the reference enhancement coefficient as the enhancement coefficient of S high-frequency sub-band images among the K high-frequency sub-band images, that is, the enhancement coefficients of the S high-frequency sub-band images can be the same.
[0058] 104. Perform an inverse transform corresponding to the multi-scale transform based on the S enhancement coefficients, the low-frequency sub-band image, and the K high-frequency sub-band images to obtain the target image.
[0059] In specific implementation, in the wavelet sub-band, since the high-frequency sub-band contains the contour information and detailed information of the image, image enhancement can also be understood as clarity enhancement, that is, clarity enhancement is to enhance these information of the image. Therefore, a gain coefficient G is introduced into the high-frequency signal k,n , so as to achieve the purpose of image enhancement. The specific calculation formula is as follows:
[0060]
[0061] Optionally, after step 101 of obtaining the image to be processed, where the image to be processed is any frame image in the target video, and before step 102 of performing a multi-scale transform on the image to be processed, the following steps may further be included:
[0062] A1. Perform an image quality evaluation on the image to be processed to obtain an image quality evaluation value;
[0063] A2. Obtain the target environmental parameters;
[0064] A3. Obtain the target shooting parameters;
[0065] A4. Determine the first reference image quality evaluation value range corresponding to the target environmental parameters according to the mapping relationship between the preset environmental parameters and the first image quality evaluation value range;
[0066] A5. Determine the second reference image quality evaluation value range corresponding to the target shooting parameters according to the mapping relationship between the preset shooting parameters and the second image quality evaluation value range;
[0067] A6. Determine the target intersection between the first reference image quality evaluation value range and the second reference image quality evaluation value range;
[0068] A7. When the image quality evaluation value is not within the target intersection, perform the step of performing multi-scale transformation on the image to be processed.
[0069] Specifically, in implementation, mapping relationships between preset environmental parameters and a first image quality evaluation value range, and between preset shooting parameters and a second image quality evaluation value range can be pre-stored in the electronic device.
[0070] In the embodiments of the present application, the environmental parameters can be at least one of the following: ambient light brightness, ambient color temperature, ambient temperature, atmospheric pressure value, ambient humidity, etc., which are not limited herein. The shooting parameters can be at least one of the following: sensitivity, exposure duration, white balance value, beauty parameter, etc., which are not limited herein.
[0071] Specifically, in implementation, the electronic device can use at least one image quality evaluation index to evaluate the image quality of the image to be processed and obtain an image quality evaluation value. The image quality evaluation index can be at least one of the following: information entropy, average gradient, sharpness, signal-to-noise ratio, etc., which are not limited herein.
[0072] Further, the electronic device can obtain the target environmental parameters corresponding to the image to be processed and the target shooting parameters corresponding to the image to be processed. Then, according to the mapping relationship between the preset environmental parameters and the first image quality evaluation value range, determine the first reference image quality evaluation value range corresponding to the target environmental parameters, and according to the mapping relationship between the preset shooting parameters and the second image quality evaluation value range, determine the second reference image quality evaluation value range corresponding to the target shooting parameters. Determine the target intersection between the first reference image quality evaluation value range and the second reference image quality evaluation value range. When the image quality evaluation value is not within the target intersection, perform step 102. Otherwise, it means the image quality is good and image enhancement processing may not be performed.
[0073] Optionally, step A1 above, evaluating the image quality of the image to be processed to obtain an image quality evaluation value, may include the following steps:
[0074] A11. Perform target extraction on the image to be processed to obtain a target area;
[0075] A12. Evaluate the image quality of the target area to obtain the image quality evaluation value.
[0076] Specifically, in implementation, the electronic device can perform target extraction on the image to be processed to obtain a target area, and can use at least one image quality evaluation index to evaluate the image quality of the target area to obtain an image quality evaluation value.
[0077] It can be seen that for the video processing method described in the embodiments of the present application, a to-be-processed image is obtained, and the to-be-processed image is any frame image in a target video; the to-be-processed image is subjected to multi-scale transformation to obtain a low-frequency sub-band image and K high-frequency sub-band images, where K is a positive integer; enhancement coefficients of S high-frequency sub-band images among the K high-frequency sub-band images are determined to obtain S enhancement coefficients, where S is a positive integer less than or equal to K; an inverse transformation corresponding to the multi-scale transformation is performed based on the S enhancement coefficients, the low-frequency sub-band image, and the K high-frequency sub-band images to obtain a target image. Since the high-frequency image reflects the image details, the image details can be enhanced to improve the saliency of the detail information. Furthermore, image enhancement processing can be achieved, which also helps to improve the image quality.
[0078] Consistent with the above Figure 1 shown embodiment, please refer to Figure 2 , Figure 2 is a flowchart of a video processing method provided by an embodiment of the present application, which is applied to an electronic device. As shown in the figure, the video processing method includes the following steps.
[0079] 201. Obtain a to-be-processed image, where the to-be-processed image is any frame image in a target video.
[0080] 202. Perform image quality evaluation on the to-be-processed image to obtain an image quality evaluation value.
[0081] 203. Obtain target environmental parameters.
[0082] 204. Obtain target shooting parameters.
[0083] 205. Determine a first reference image quality evaluation value range corresponding to the target environmental parameters according to a mapping relationship between preset environmental parameters and a first image quality evaluation value range.
[0084] 206. Determine a second reference image quality evaluation value range corresponding to the target shooting parameters according to a mapping relationship between preset shooting parameters and a second image quality evaluation value range.
[0085] 207. Determine a target intersection between the first reference image quality evaluation value range and the second reference image quality evaluation value range.
[0086] 208. When the image quality evaluation value is not within the target intersection, perform multi-scale transformation on the to-be-processed image to obtain a low-frequency sub-band image and K high-frequency sub-band images, where K is a positive integer.
[0087] 209. Determine enhancement coefficients of S high-frequency sub-band images among the K high-frequency sub-band images to obtain S enhancement coefficients, where S is a positive integer less than or equal to K.
[0088] 210. Perform an inverse transform corresponding to the multi-scale transform based on the S enhancement coefficients, the low-frequency subband image, and the K high-frequency subband images to obtain a target image.
[0089] Among them, for the specific descriptions of the above steps 201 - 210, reference can be made to the corresponding steps of the video processing method described above. Figure 1 Details are not elaborated here.
[0090] It can be seen that in the video processing method described in the embodiments of this application, a to-be-processed image is obtained, and the to-be-processed image is any frame image in a target video; the to-be-processed image is subjected to a multi-scale transform to obtain a low-frequency subband image and K high-frequency subband images, where K is a positive integer; enhancement coefficients of S high-frequency subband images among the K high-frequency subband images are determined to obtain S enhancement coefficients, where S is a positive integer less than or equal to K; an inverse transform corresponding to the multi-scale transform is performed based on the S enhancement coefficients, the low-frequency subband image, and the K high-frequency subband images to obtain a target image. Since the high-frequency image reflects the details of the image, the details of the image can be enhanced to improve the significance of the detail information. Furthermore, image enhancement processing can be achieved, which is also helpful for improving the image quality.
[0091] Consistent with the above Figure 1 、 Figure 2 shown embodiment, please refer to Figure 3 , Figure 3 FIG. 20 is a schematic structural diagram of an electronic device 300 provided by an embodiment of this application. As shown in the figure, the electronic device 300 includes a processor 310, a memory 320, a communication interface 330, and one or more programs 321. Among them, the one or more programs 321 are stored in the above memory 320 and are configured to be executed by the above processor 310. The one or more programs 321 include instructions for executing any step in the above method embodiments.
[0092] Obtain a to-be-processed image, where the to-be-processed image is any frame image in a target video;
[0093] Perform a multi-scale transform on the to-be-processed image to obtain a low-frequency subband image and K high-frequency subband images, where K is a positive integer;
[0094] Determine enhancement coefficients of S high-frequency subband images among the K high-frequency subband images to obtain S enhancement coefficients, where S is a positive integer less than or equal to K;
[0095] Perform an inverse transform corresponding to the multi-scale transform based on the S enhancement coefficients, the low-frequency subband image, and the K high-frequency subband images to obtain a target image.
[0096] It can be seen that the electronic device described in the embodiments of the present application acquires an image to be processed, where the image to be processed is any frame image in a target video; performs multi-scale transformation on the image to be processed to obtain a low-frequency sub-band image and K high-frequency sub-band images, where K is a positive integer; determines enhancement coefficients of S high-frequency sub-band images among the K high-frequency sub-band images to obtain S enhancement coefficients, where S is a positive integer less than or equal to K; performs an inverse transformation corresponding to the multi-scale transformation based on the S enhancement coefficients, the low-frequency sub-band image, and the K high-frequency sub-band images to obtain a target image. Since the high-frequency image reflects the details of the image, the details of the image can be enhanced to improve the significance of the detail information. Furthermore, image enhancement processing can be achieved, which also helps to improve the image quality.
[0097] Optionally, the determining enhancement coefficients of S high-frequency sub-band images among the K high-frequency sub-band images to obtain S enhancement coefficients includes:
[0098] Determining a target ratio between the resolution i of the high-frequency sub-band image i and the resolution of the image to be processed, where the high-frequency sub-band image i is any high-frequency sub-band image among the K high-frequency sub-band images;
[0099] Dividing the high-frequency sub-band image i into multiple regions, and determining the distribution density of feature points in each of the multiple regions to obtain multiple distribution densities of feature points;
[0100] Determining a target mean square error corresponding to the multiple distribution densities of feature points;
[0101] Determining a first enhancement coefficient corresponding to the target ratio according to a mapping relationship between a preset ratio and an enhancement coefficient;
[0102] Determining a target fine-tuning coefficient corresponding to the target mean square error according to a mapping relationship between a preset mean square error and a fine-tuning coefficient;
[0103] Adjusting the first enhancement coefficient according to the target fine-tuning coefficient to obtain the enhancement coefficient of the high-frequency sub-band image i.
[0104] Optionally, the determining enhancement coefficients of S high-frequency sub-band images among the K high-frequency sub-band images to obtain S enhancement coefficients includes:
[0105] Determining a first energy value of the low-frequency sub-band image;
[0106] Determining a second energy value of the image to be processed;
[0107] Determining a target energy ratio between the first energy value and the second energy value;
[0108] Determine the reference enhancement coefficient corresponding to the target energy ratio according to the mapping relationship between the preset energy ratio and the enhancement coefficient, and use the reference enhancement coefficient as the enhancement coefficient of S high-frequency sub-band images among the K high-frequency sub-band images.
[0109] Optionally, after obtaining the image to be processed and before performing multi-scale transformation on the image to be processed, it further includes:
[0110] Perform image quality evaluation on the image to be processed to obtain an image quality evaluation value;
[0111] Obtain target environmental parameters;
[0112] Obtain target shooting parameters;
[0113] Determine the first reference image quality evaluation value range corresponding to the target environmental parameters according to the mapping relationship between the preset environmental parameters and the first image quality evaluation value range;
[0114] Determine the second reference image quality evaluation value range corresponding to the target shooting parameters according to the mapping relationship between the preset shooting parameters and the second image quality evaluation value range;
[0115] Determine the target intersection between the first reference image quality evaluation value range and the second reference image quality evaluation value range;
[0116] When the image quality evaluation value is not within the target intersection, perform the step of performing multi-scale transformation on the image to be processed.
[0117] Optionally, the performing image quality evaluation on the image to be processed to obtain an image quality evaluation value includes:
[0118] Perform target extraction on the image to be processed to obtain a target area;
[0119] Perform image quality evaluation on the target area to obtain the image quality evaluation value.
[0120] The above mainly introduced the solution of the embodiment of the present application from the perspective of the execution process on the method side. It can be understood that in order for the electronic device to implement the above functions, it includes the corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should easily realize that, combining the units and algorithm steps of each example described in the embodiments provided in this article, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving the hardware depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0121] The embodiments of the present application can divide the functional units of the electronic device according to the above method examples. For example, each functional unit can be divided corresponding to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. It should be noted that the division of units in the embodiments of the present application is illustrative, only a logical function division, and there can be other division methods in actual implementation.
[0122] Figure 4 It is a block diagram of the functional unit composition of the video processing device 400 involved in the embodiments of the present application. The video processing device 400 is applied to an electronic device. The video processing device 400 includes an acquisition unit 401, a decomposition unit 402, a determination unit 403, and a reconstruction unit 404, where
[0123] The acquisition unit 401 is configured to acquire an image to be processed, and the image to be processed is any frame image in a target video;
[0124] The decomposition unit 402 is configured to perform a multi-scale transform on the image to be processed to obtain a low-frequency sub-band image and K high-frequency sub-band images, where K is a positive integer;
[0125] The determination unit 403 is configured to determine enhancement coefficients of S high-frequency sub-band images among the K high-frequency sub-band images to obtain S enhancement coefficients, where S is a positive integer less than or equal to K;
[0126] The reconstruction unit 404 is configured to perform an inverse transform corresponding to the multi-scale transform based on the S enhancement coefficients, the low-frequency sub-band image, and the K high-frequency sub-band images to obtain a target image.
[0127] It can be seen that the video processing device described in the embodiments of the present application acquires an image to be processed, where the image to be processed is any frame image in the target video; performs multi-scale transformation on the image to be processed to obtain a low-frequency sub-band image and K high-frequency sub-band images, where K is a positive integer; determines enhancement coefficients of S high-frequency sub-band images among the K high-frequency sub-band images to obtain S enhancement coefficients, where S is a positive integer less than or equal to K; performs an inverse transformation corresponding to the multi-scale transformation based on the S enhancement coefficients, the low-frequency sub-band image, and the K high-frequency sub-band images to obtain a target image. Since the high-frequency image reflects the details of the image, the details of the image can be enhanced to improve the saliency of the detail information. Furthermore, image enhancement processing can be achieved, which also helps to improve the image quality.
[0128] Optionally, in terms of determining enhancement coefficients of S high-frequency sub-band images among the K high-frequency sub-band images to obtain S enhancement coefficients, the determining unit 403 is specifically configured to:
[0129] Determine a target ratio between the resolution i of the high-frequency sub-band image i and the resolution of the image to be processed, where the high-frequency sub-band image i is any high-frequency sub-band image among the K high-frequency sub-band images;
[0130] Divide the high-frequency sub-band image i into multiple regions, determine the distribution density of feature points in each of the multiple regions to obtain multiple distribution densities of feature points;
[0131] Determine the target mean square error corresponding to the multiple distribution densities of feature points;
[0132] According to a preset mapping relationship between the ratio and the enhancement coefficient, determine a first enhancement coefficient corresponding to the target ratio;
[0133] According to a preset mapping relationship between the mean square error and the fine-tuning coefficient, determine a target fine-tuning coefficient corresponding to the target mean square error;
[0134] Adjust the first enhancement coefficient according to the target fine-tuning coefficient to obtain the enhancement coefficient of the high-frequency sub-band image i.
[0135] Optionally, in terms of determining enhancement coefficients of S high-frequency sub-band images among the K high-frequency sub-band images to obtain S enhancement coefficients, the determining unit 403 is specifically configured to:
[0136] Determine a first energy value of the low-frequency sub-band image;
[0137] Determine a second energy value of the image to be processed;
[0138] Determine a target energy ratio between the first energy value and the second energy value;
[0139] Determine the reference enhancement factor corresponding to the target energy ratio according to the mapping relationship between the preset energy ratio and the enhancement factor, and use the reference enhancement factor as the enhancement factor of S high-frequency sub-band images among the K high-frequency sub-band images.
[0140] Optionally, after obtaining the image to be processed and before performing multi-scale transformation on the image to be processed, the apparatus 400 is further specifically configured to:
[0141] Perform image quality evaluation on the image to be processed to obtain an image quality evaluation value;
[0142] Obtain target environmental parameters;
[0143] Obtain target shooting parameters;
[0144] Determine the first reference image quality evaluation value range corresponding to the target environmental parameters according to the mapping relationship between the preset environmental parameters and the first image quality evaluation value range;
[0145] Determine the second reference image quality evaluation value range corresponding to the target shooting parameters according to the mapping relationship between the preset shooting parameters and the second image quality evaluation value range;
[0146] Determine the target intersection between the first reference image quality evaluation value range and the second reference image quality evaluation value range;
[0147] When the image quality evaluation value is not within the target intersection, perform the step of performing multi-scale transformation on the image to be processed.
[0148] Optionally, in terms of performing image quality evaluation on the image to be processed to obtain an image quality evaluation value, the apparatus 400 is specifically configured to:
[0149] Perform target extraction on the image to be processed to obtain a target area;
[0150] Perform image quality evaluation on the target area to obtain the image quality evaluation value.
[0151] An embodiment of the present application further provides a computer storage medium, where the computer storage medium stores a computer program for electronic data exchange, and the computer program enables a computer to execute some or all of the steps of any method described in the above method embodiments, and the above computer includes an electronic device.
[0152] The embodiments of the present application also provide a computer program product. The computer program product includes a non-transitory computer-readable storage medium storing a computer program. The computer program is operable to cause a computer to execute some or all of the steps of any one of the methods described in the foregoing method embodiments. The computer program product may be a software installation package, and the computer includes an electronic device.
[0153] It should be noted that, for the foregoing method embodiments, for simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should understand that the present application is not limited by the described action sequence, because according to the present application, certain steps may be performed in other sequences or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present application.
[0154] In the above embodiments, the descriptions of the respective embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0155] In several embodiments provided by the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the above division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection may be through some interfaces. The indirect coupling or communication connection of the device or unit may be in an electrical or other form.
[0156] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0157] In addition, the functional units in each embodiment of the present application may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0158] If the above integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the above methods in various embodiments of this application. The aforementioned memory includes: various media such as USB flash drives, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), external hard drives, magnetic disks, or optical discs that can store program codes.
[0159] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing relevant hardware through a program. This program can be stored in a computer-readable memory, and the memory can include: flash drives, read-only memories (English: Read-Only Memory, abbreviated: ROM), random access memories (English: Random Access Memory, abbreviated: RAM), magnetic disks, or optical discs, etc.
[0160] The above has introduced the embodiments of this application in detail. Specific examples are used in this article to elaborate on the principle and implementation manner of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application; at the same time, for those of ordinary skill in the art, according to the idea of this application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to this application.
Claims
1. A video processing method, characterized in that, The method includes: Obtaining an image to be processed, where the image to be processed is any frame image in a target video; Performing multi-scale transformation on the image to be processed to obtain a low-frequency sub-band image and K high-frequency sub-band images, where K is a positive integer; Determining enhancement coefficients of S high-frequency sub-band images among the K high-frequency sub-band images to obtain S enhancement coefficients, where the enhancement coefficients are used to enhance the contour information and detail information of the image; the enhancement coefficients include gain coefficients of high-frequency signals; S is a positive integer less than or equal to K; Performing an inverse transformation corresponding to the multi-scale transformation based on the S enhancement coefficients, the low-frequency sub-band image, and the K high-frequency sub-band images to obtain a target image; Among them, determining the enhancement coefficients of S high-frequency sub-band images among the K high-frequency sub-band images to obtain S enhancement coefficients includes: Determining a first energy value of the low-frequency sub-band image; Determining a second energy value of the image to be processed; Determining a target energy ratio between the first energy value and the second energy value; According to a mapping relationship between a preset energy ratio and an enhancement coefficient, determining a reference enhancement coefficient corresponding to the target energy ratio, and using the reference enhancement coefficient as the enhancement coefficients of S high-frequency sub-band images among the K high-frequency sub-band images.
2. The method according to claim 1, wherein After obtaining the image to be processed and before performing multi-scale transformation on the image to be processed, the method further includes: Performing image quality evaluation on the image to be processed to obtain an image quality evaluation value; Obtaining target environmental parameters; Obtaining target shooting parameters; According to a mapping relationship between preset environmental parameters and a first image quality evaluation value range, determining a first reference image quality evaluation value range corresponding to the target environmental parameters; According to a mapping relationship between preset shooting parameters and a second image quality evaluation value range, determining a second reference image quality evaluation value range corresponding to the target shooting parameters; Determining a target intersection between the first reference image quality evaluation value range and the second reference image quality evaluation value range; When the image quality evaluation value is not within the target intersection, performing the step of performing multi-scale transformation on the image to be processed.
3. The method according to claim 2, wherein Performing image quality evaluation on the image to be processed to obtain an image quality evaluation value includes: Performing target extraction on the image to be processed to obtain a target area; Performing image quality evaluation on the target area to obtain the image quality evaluation value.
4. A video processing device, characterized in that, The device includes: an acquisition unit, a decomposition unit, a determination unit, and a reconstruction unit, where The acquisition unit is configured to obtain an image to be processed, where the image to be processed is any frame image in a target video; The decomposition unit is configured to perform multi-scale transformation on the image to be processed to obtain a low-frequency sub-band image and K high-frequency sub-band images, where K is a positive integer; The determination unit is configured to determine enhancement coefficients of S high-frequency sub-band images among the K high-frequency sub-band images to obtain S enhancement coefficients, where the enhancement coefficients are used to enhance the contour information and detail information of the image; the enhancement coefficients include gain coefficients of high-frequency signals; S is a positive integer less than or equal to K; The reconstruction unit is configured to perform an inverse transform corresponding to the multi-scale transform based on the S enhancement coefficients, the low-frequency sub-band image, and the K high-frequency sub-band images to obtain a target image; Wherein, in terms of determining the enhancement coefficients of S high-frequency sub-band images among the K high-frequency sub-band images to obtain S enhancement coefficients, the determining unit is specifically configured to: Determine a first energy value of the low-frequency sub-band image; Determine a second energy value of the image to be processed; Determine a target energy ratio between the first energy value and the second energy value; According to a preset mapping relationship between the energy ratio and the enhancement coefficient, determine a reference enhancement coefficient corresponding to the target energy ratio, and use the reference enhancement coefficient as the enhancement coefficients of S high-frequency sub-band images among the K high-frequency sub-band images.
5. The device according to claim 4, characterized in that, After obtaining the image to be processed and before performing the multi-scale transform on the image to be processed, the apparatus is further specifically configured to: Perform image quality evaluation on the image to be processed to obtain an image quality evaluation value; Obtain target environmental parameters; Obtain target shooting parameters; According to a preset mapping relationship between the environmental parameters and the first image quality evaluation value range, determine a first reference image quality evaluation value range corresponding to the target environmental parameters; According to a preset mapping relationship between the shooting parameters and the second image quality evaluation value range, determine a second reference image quality evaluation value range corresponding to the target shooting parameters; Determine a target intersection between the first reference image quality evaluation value range and the second reference image quality evaluation value range; When the image quality evaluation value is not within the target intersection, perform the step of performing the multi-scale transform on the image to be processed.
6. A computer-readable storage medium, characterized in that, It is used to store a computer program, wherein the computer program causes the computer to execute the method according to any one of claims 1-3.
Citation Information
Patent Citations
Target feature enhancement method and device based on multispectral fusion and electronic equipment
CN109584192A
Image enhancement method and related product
CN112330546A
Image processing method and related device
CN112330577A