Image enhancement method and device, storage medium and electronic equipment

By detecting the support status of the SSE instruction set of the device, selecting the appropriate video processing filter operation mode, and performing multi-scale exponential blur calculation and pixel-level subtraction operations in parallel, the problem of high computing resource consumption in real-time applications is solved, and efficient image enhancement effect is achieved.

CN120235772APending Publication Date: 2025-07-01HUNAN HAPPLY SUNSHINE INTERACTIVE ENTERTAINMENT MEDIA CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510360737.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-25
Publication Date
2025-07-01

AI Technical Summary

Technical Problem

The existing image enhancement algorithm has high demand for computing resources in real-time applications, resulting in reduced processing timeliness. The traditional method has limited effect, while the deep learning method has good effect but high computing resources are consumed.

Method used

By calling the CPU capability detection interface of the cross-platform video framework, the SSE instruction set of detection device supports status, selecting the appropriate video processing filter operation mode, performing multi-scale exponential fuzzy calculations, and performing pixel-level subtraction operations and multi-threaded weighted fusion in parallel through thread pools to generate image enhancement results.

Benefits of technology

It improves the overall execution efficiency of image enhancement processing, meets real-time application needs, and improves image quality and processing speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120235772A_ABST
    Figure CN120235772A_ABST
Patent Text Reader

Abstract

The invention provides an image enhancement method and device, a storage medium and electronic equipment, which are applied to the technical field of image processing, and are characterized in that an SSE instruction set support state of current equipment is checked through a CPU capability detection interface of a cross-platform video framework, and a proper video processing filter operation mode is selected according to the SSE instruction set support state. According to a blur radius parameter set by a user, multi-scale index blur calculation is performed on an input image to generate a plurality of intermediate blur images. And processing the pixel-level subtraction operation of the input image and each intermediate blurred image in parallel by using the thread pool to obtain each detail difference image. And performing multi-thread weighted fusion on each detail difference image to obtain an enhanced image. According to the method, by dynamically adapting the SSE instruction set, parallelizing the calculation task and optimizing thread resource allocation, calculation resources for image enhancement can be reasonably scheduled, so that the overall execution efficiency of image enhancement processing is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular, to an image enhancement method, apparatus, storage medium, and electronic device. Background Art

[0002] Image enhancement technology is a key technology in the field of image processing, aiming to improve the quality and visualization effect of the original image through processing, and then provide support for subsequent image analysis and processing. The core goal of image enhancement is to improve the visibility and contrast of the image, enhance the detail performance, and at the same time eliminate the noise existing in the image.

[0003] However, traditional enhancement algorithms (such as mean filtering and Gaussian filtering), although easy to use, have limited effects. In recent years, deep learning methods (such as autoencoders and generative adversarial networks) have significantly improved the image enhancement effect and can improve the image quality by learning a large amount of data, but usually require high computing resources, which limits the real-time application of image enhancement technology.

[0004] Therefore, how to accelerate the timeliness of image enhancement algorithm processing has become a technical problem that needs to be solved urgently by those skilled in the art. Summary of the Invention

[0005] In view of the above problems, the present invention provides an image enhancement method, apparatus, storage medium, and electronic device that overcome the above problems or at least partially solve the above problems. The technical solutions are as follows:

[0006] An image enhancement method, comprising:

[0007] Invoking the CPU capability detection interface of the cross-platform video framework to detect the support status of the SSE instruction set of the current device and obtaining a detection result;

[0008] Based on the detection result, selecting an operating mode of a video processing filter;

[0009] Based on the selected operating mode of the video processing filter, performing multi-scale exponential blurring calculation on the input image according to the blur radius parameter set by the user to generate intermediate blurred images of each scale;

[0010] Parallelly executing pixel-level subtraction operations between the input image and the intermediate blurred images of each scale through a thread pool to respectively obtain corresponding detail difference images;

[0011] Performing multi-threaded weighted fusion on each of the detail difference images to obtain an image enhancement result of the input image.

[0012] Optionally, for the running mode of the selected video processing filter, multi-scale exponential blurring calculation is performed on the input image according to the blur radius parameter set by the user to generate intermediate blurred images at each scale, including:

[0013] When the running mode of the video processing filter is the resident thread concurrency mode, exponential blurring calculation is performed on the input image within a single thread at a single scale according to the blur radius parameter set by the user to generate intermediate blurred images at each scale.

[0014] Optionally, the exponential blurring calculation performed on the input image within a single thread at a single scale according to the blur radius parameter set by the user to generate intermediate blurred images at each scale includes:

[0015] Within a single thread at a single scale: According to the blur radius parameter set by the user, first calculate the pixel value of each pixel of the input image in the vertical direction, and then calculate the pixel value of each pixel of the input image in the horizontal direction to generate the intermediate blurred image at this scale. Among them, when calculating in the vertical direction, first calculate the blur result from top to bottom, and then calculate the blur result in reverse from bottom to top; when calculating in the horizontal direction, first calculate the blur result from left to right, and then calculate the blur result in reverse from right to left.

[0016] Optionally, for the selected filter running mode, multi-scale exponential blurring calculation is performed on the input image according to the blur radius parameter set by the user to generate intermediate blurred images at each scale, including:

[0017] When the running mode of the video processing filter is the SSE acceleration mode, SSE acceleration is started within a single thread at a single scale. According to the blur radius parameter set by the user, calculate the pixel value of each pixel of the input image in the vertical direction to obtain the first blurred image;

[0018] Transpose the first blurred image to obtain the second blurred image;

[0019] According to the blur radius parameter, calculate the pixel value of each pixel of the second blurred image in the vertical direction to obtain the third blurred image;

[0020] Transpose the third blurred image to generate the intermediate blurred image at this scale.

[0021] Optionally, when calculating in the vertical direction, first calculate the blur result from top to bottom, and then calculate the blur result in reverse from bottom to top.

[0022] Optionally, the SSE acceleration process includes:

[0023] Shift the first row of pixels of the input image to the left by the preset zero-bit precision parameter to initialize the accumulated value, and pre-load the SIMD constants of the all-zero vector and the blur precision parameter;

[0024] Process the pixels of all rows of the input image in two passes along the vertical direction: first scan row by row from top to bottom, and then scan in reverse from bottom to top. Among them, 8 columns of pixels are processed in each iteration during each scan. Use the SSE instruction set to parallel load the pixels and their accumulated values, update the accumulated value based on the blur precision parameter, the preset zero-bit precision parameter and the preset approximation precision parameter, and after shifting the updated accumulated value to the right by the preset zero-bit precision parameter, use the SSE instruction set to pack it into 8-bit pixels and write them to the target row. Among them, for the remaining columns that are not multiples of 8 in the input image, perform column-by-column exponential blur calculation.

[0025] Optionally, in the selected filter operation mode, before performing multi-scale exponential blur calculation on the input image according to the blur radius parameter set by the user to generate intermediate blur images of each scale, the method further includes:

[0026] Allocate intermediate blur image cache spaces for each scale respectively, where the intermediate blur image cache spaces are used to store the blur images generated during the multi-scale exponential blur calculation.

[0027] An image enhancement device includes: a detection result obtaining unit, an operation mode selection unit, an intermediate blur image generation unit, a detail difference image obtaining unit, and an image enhancement result obtaining unit.

[0028] The detection result obtaining unit is used to call the CPU capability detection interface of the cross-platform video framework to detect the SSE instruction set support status of the current device and obtain the detection result;

[0029] The operation mode selection unit is used to select the operation mode of the video processing filter based on the detection result;

[0030] The intermediate blur image generation unit is used to perform multi-scale exponential blur calculation on the input image according to the blur radius parameter set by the user based on the selected operation mode of the video processing filter to generate intermediate blur images of each scale;

[0031] The detail difference image obtaining unit is used to perform pixel-level subtraction operations between the input image and the intermediate blur images of each scale in parallel through a thread pool to obtain corresponding detail difference images respectively;

[0032] The image enhancement result obtaining unit is used to perform multi-thread weighted fusion on each of the detail difference images to obtain the image enhancement result of the input image.

[0033] A computer-readable storage medium, on which a program is stored, and when the program is executed by a processor, the image enhancement method described above is implemented.

[0034] An electronic device, the electronic device includes at least one processor, at least one memory connected to the processor, and a bus; wherein, the processor and the memory complete communication with each other through the bus; the processor is used to call program instructions in the memory to execute the image enhancement method described above.

[0035] By means of the above technical solution, an image enhancement method, device, storage medium and electronic device provided by the present invention, the method includes: calling the CPU capability detection interface of the cross-platform video framework, detecting the support status of the SSE instruction set of the current device, and obtaining the detection result; based on the detection result, select the running mode of the video processing filter; based on the selected running mode of the video processing filter, perform multi-scale exponential blur calculation on the input image according to the blur radius parameter set by the user to generate intermediate blur images of each scale; perform pixel-level subtraction operations on the input image and the intermediate blur images of each scale in parallel through a thread pool to obtain corresponding detail difference images respectively; perform multi-thread weighted fusion on each of the detail difference images to obtain the image enhancement result of the input image. The present invention can reasonably schedule the computing resources for image enhancement by dynamically adapting the SSE instruction set, parallelizing computing tasks and optimizing thread resource allocation, thereby improving the overall execution efficiency of image enhancement processing.

[0036] The above description is only an overview of the technical solution of the present invention. In order to be able to understand the technical means of the present invention more clearly, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features and advantages of the present invention more obvious and understandable, the following specifically describes the embodiments of the present invention. Description of the Drawings

[0037] By reading the detailed description of the preferred embodiments below, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only for the purpose of showing the preferred embodiments and are not considered to be a limitation of the present invention. And throughout the drawings, the same reference numerals are used to represent the same components. In the drawings:

[0038] Figure 1 Shows a flowchart of an implementation manner of the image enhancement method provided by an embodiment of the present invention;

[0039] Figure 2 Shows a schematic structural diagram of the image enhancement device provided by an embodiment of the present invention;

[0040] Figure 3 Shows a schematic structural diagram of the electronic device provided by an embodiment of the present invention. Detailed implementation manners

[0041] Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present invention can be more thoroughly understood and the scope of the present invention can be fully conveyed to those skilled in the art.

[0042] In the fields of computer vision and image processing, image enhancement technology has developed rapidly and become a key component for important tasks such as improving image quality, noise reduction, enhancing contrast and clarity. The purpose of image enhancement is to effectively highlight the useful information in the image by improving the visualization effect of the image, while weakening or removing unnecessary information, which is crucial for subsequent image analysis and processing. Image enhancement not only plays an important role in object detection and recognition, but also has wide applications in the production of image and video for high-resolution display devices.

[0043] Image enhancement algorithms can be roughly divided into two categories: traditional methods and deep learning-based methods. Traditional image enhancement algorithms include statistics-based methods such as mean filtering, median filtering, and Gaussian filtering, template-based methods such as image edge detection and segmentation, and wavelet analysis-based methods such as wavelet transform. Although these traditional algorithms perform well in some applications and are easy to implement, their effects are limited when dealing with complex images.

[0044] In recent years, with the rapid development of deep learning technology, deep learning-based image enhancement algorithms have gradually become a research hotspot. Methods such as autoencoders and generative adversarial networks can greatly improve the quality and contrast of images by learning image features in large-scale datasets. These methods perform excellently in image enhancement tasks, but usually require a large amount of training data and computing resources, which may become a bottleneck in some real-time application scenarios, resulting in a reduction in the timeliness of image enhancement algorithm processing.

[0045] Based on this, the embodiments of the present invention perform engineering acceleration by using a simple and efficient exponential blur algorithm and perform a subtraction operation with the original image to extract detail information at different scales. In addition, to meet the real-time application requirements, the image enhancement algorithm can be embedded as a video processing filter in a cross-platform video framework including the FFmpeg framework, making full use of the powerful multimedia processing capabilities of the cross-platform video framework.

[0046] The implementation of the image enhancement algorithm provided by the embodiments of the present invention is divided into three main steps: First, perform blurring processing on the original image at multiple different scales to generate multiple blurred images; Second, perform subtraction operations on these blurred images and the original image to obtain detail images at multiple scales; Finally, stack and fuse these detail images according to a set ratio to finally generate the enhanced image. Since the first step is the most time-consuming calculation part, refined performance optimization is required for this step, while the subsequent subtraction and fusion operations can be accelerated through multi-threading and the SSE instruction set.

[0047] As Figure 1 shown, a flowchart of an implementation manner of the image enhancement method provided by the embodiments of the present invention, the method may include:

[0048] S100. Call the CPU capability detection interface of the cross-platform video framework to detect the support status of the SSE instruction set of the current device and obtain the detection result.

[0049] Among them, the cross-platform video framework refers to a development tool and library that can run on multiple operating systems and hardware platforms, aiming to provide audio and video processing functions. The cross-platform video framework provided by the embodiments of the present invention may specifically be the FFmpeg framework. As an open-source cross-platform video processing framework, the FFmpeg framework provides audio and video encoding, decoding, conversion, stream processing, and playback functions.

[0050] Among them, the CPU capability detection interface is a program interface for querying the hardware characteristics and supported instruction sets of the current computer. By calling the CPU capability detection interface, it can be detected whether the current device supports the SSE instruction set, and based on this, it can be decided whether to use a specific optimization algorithm.

[0051] Among them, the SSE (Streaming SIMD Extensions) instruction set is a set of instruction sets used to accelerate floating-point operations and integer operations. The SSE instruction set can execute multiple data points within a single CPU cycle, thereby improving the calculation efficiency.

[0052] Among them, the detection result may be information about the device support status obtained through the CPU capability detection interface, which may be presented in the form of a boolean value (supported or not supported) or instruction set version information. The detection result may include the support status indicating whether the current CPU supports a specific SSE instruction set and the specific supported instruction set version.

[0053] S110. Based on the detection result, select the running mode of the video processing filter.

[0054] Among them, the video processing filter is an algorithm used to enhance image content in a cross-platform video framework. Through engineering acceleration, the embodiments of the present invention can effectively integrate the image enhancement algorithm into the FFmpeg framework as a video processing filter. With the powerful audio and video processing capabilities of FFmpeg, various image and video formats can be quickly processed by calling its command-line interface.

[0055] Among them, the running mode refers to the way of selecting different execution strategies or algorithms according to specific conditions or system capabilities when processing images. When the CPU of the current device supports the SSE instruction set and its version number, if the filter parameter of the video processing filter sets the SSE running mode, the running mode of the video processing filter is selected as the SSE acceleration mode. If the CPU of the current device does not support the SSE instruction set and its version number, or the filter parameter of the video processing filter does not set the SSE running mode, the running mode of the video processing filter is selected as the resident thread concurrency mode.

[0056] Among them, the SSE acceleration mode is an image processing execution strategy that uses the SSE instruction set of the CPU to process multiple data points in parallel. In the SSE acceleration mode, the video processing filter can utilize the parallel computing power of the SSE instructions to accelerate the operation process of the image filter, which is particularly suitable for image processing tasks that require processing a large amount of data or complex calculations. The SSE acceleration mode depends on the hardware support of the processor. When the CPU supports the corresponding SSE version and the filter parameter is set to the SSE running mode, the SSE acceleration mode can be enabled.

[0057] Among them, the resident thread concurrency mode is an image processing execution strategy that uses resident threads to process multiple concurrent tasks. In the resident thread concurrency mode, the video processing filter manages multiple concurrent tasks through resident threads to ensure the effective utilization of system resources when processing images. The resident thread concurrency mode is applicable when there is no support for the SSE instruction set or the SSE running mode is not enabled, and traditional multi-threading techniques are used to process image data in parallel. Through the mechanism of resident threads, multiple threads can be executed simultaneously at different stages of the processing process, thereby improving the efficiency and response speed of image processing. The resident thread concurrency mode ensures stable operation under various device conditions and has strong adaptability.

[0058] S120. Based on the selected running mode of the video processing filter, perform multi-scale exponential blur calculation on the input image according to the blur radius parameter set by the user to generate intermediate blur images of each scale.

[0059] Among them, the blur radius parameter is a parameter used to control the intensity or range of the blur effect, which defines the size of the neighborhood range affecting each pixel during the image blurring process. The larger the value of the blur radius, the more obvious the blur effect, and the more blurred the image becomes; the smaller the value of the blur radius, the weaker the blur effect, and the more details the image retains. Users can customize the blur radius according to their needs to achieve specific visual effects.

[0060] Among them, multi-scale exponential blur calculation is an image processing technique used to blur images at multiple scales. It can process the same image at different blur radii (scales) to obtain different degrees of blur results.

[0061] Among them, the intermediate blurred image refers to the blurred result images at each scale generated during the multi-scale blur calculation. The intermediate blurred image at each scale represents the result of the input image at a specific blur radius, showing the performance of the image at different blur intensities.

[0062] S130. Through the thread pool, perform pixel-level subtraction operations on the input image and the intermediate blurred images at each scale in parallel to obtain the corresponding detailed difference images respectively.

[0063] Among them, pixel-level subtraction operation is an image processing technique that obtains a new image effect by performing subtraction operations on the values of corresponding pixels in the image. In pixel-level subtraction operation, the value of each pixel (usually a color value, such as RGB or grayscale value) is subtracted one by one from the pixel value at the corresponding position in another image to highlight the changing parts of the image and help analyze and process the image content.

[0064] Among them, the detailed difference image is an image obtained through pixel-level subtraction operation, mainly used to display the detailed changes compared with the original input image. The detailed difference image shows the parts of the image where details are lost or changed due to the blur processing. By comparing with the original input image, it can be seen which detailed information is highlighted or disappeared.

[0065] S140. Perform multi-threaded weighted fusion on each detailed difference image to obtain the image enhancement result of the input image.

[0066] Among them, multi-threaded weighted fusion is used to process multiple detailed difference images in parallel using multiple threads, and then combine the weights assigned in advance for the detailed difference images at different scales to perform weighted fusion on each detailed difference image to generate a comprehensive image that retains important details (i.e., image enhancement).

[0067] Among them, the image enhancement result refers to the optimized output image obtained by processing different detailed difference versions of the input image through the multi-threaded weighted fusion technique.

[0068] An image enhancement method provided by the present invention includes: calling the CPU capability detection interface of a cross-platform video framework to detect the support status of the SSE instruction set of the current device and obtain a detection result; based on the detection result, selecting an operating mode of a video processing filter; based on the selected operating mode of the video processing filter, performing multi-scale exponential blur calculation on an input image according to a blur radius parameter set by a user to generate intermediate blur images at each scale; performing pixel-level subtraction operations on the input image and the intermediate blur images at each scale in parallel through a thread pool to respectively obtain corresponding detail difference images; performing multi-thread weighted fusion on the detail difference images to obtain an image enhancement result of the input image. By dynamically adapting to the SSE instruction set, parallelizing calculation tasks, and optimizing thread resource allocation, the present invention can reasonably schedule the computing resources for image enhancement, thereby improving the overall execution efficiency of image enhancement processing.

[0069] Optionally, based on one or more corresponding embodiments above, in another optional embodiment provided by an embodiment of the present invention, performing multi-scale exponential blur calculation on an input image according to a blur radius parameter set by a user based on the selected operating mode of the video processing filter to generate intermediate blur images at each scale may specifically include: Figure 1 When the operating mode of the video processing filter is a resident thread concurrent mode, performing exponential blur calculation on the input image according to the blur radius parameter set by the user within a single thread at a single scale to generate intermediate blur images at each scale.

[0070]

[0071] ​Specifically, exponential blur calculation involves three input parameters. One is the first-order blur precision parameter (alpha) generated from the blur radius parameter, and the other two are fixed parameters for controlling precision. Usually, the preset approximate precision parameter (aprec) is set to 16, and the preset zero precision parameter (zprec) is set to 7. Among them, except for the first-order alpha parameter calculation that requires floating-point operations, other parts mainly use integer multiplication and shift operations. The calculation method of each pixel value is consistent in each calculation direction and is divided into three steps: First, initialize the accumulated value sum = LinePS[0] << zprec, where "LinePS[0]" is the first pixel value in the processing direction, and "<<" represents the left shift operation. Then, calculate each pixel value in this direction twice one by one. First, update the accumulated value "sum+=(alpha*((LinePS[x] << zprec)-sum)) >> aprec", where "LinePS[x]" is the (X + 1)-th pixel value in the processing direction, and ">>" represents the right shift operation. Finally, determine the target pixel value as "LinePD[x]=sum >> zprec".

[0072] In the case where the running mode of the video processing filter in the embodiment of the present invention is the resident thread concurrent mode, by performing exponential blur calculation according to the blur radius parameter set by the user within a single scale and a single thread, the efficiency and response speed of image processing can be effectively improved. This mode not only reduces the competition between threads and the consumption of computing resources, but also ensures the fast processing and precise detail extraction of the input image in real-time video processing scenarios. At the same time, the generated intermediate blurred images at each scale provide rich detail information for subsequent image enhancement operations, strengthening the quality of the final output image, meeting the multiple requirements of efficient and precise processing, and greatly enhancing the user experience.

[0073] Optionally, in the embodiment of the present invention, within a single scale and a single thread: according to the blur radius parameter set by the user, first calculate the pixel value of each pixel of the input image in the vertical direction, and then calculate the pixel value of each pixel of the input image in the horizontal direction to generate the intermediate blurred image of the scale. Among them, when calculating in the vertical direction, first calculate the blur result from top to bottom, and then calculate the blur result in reverse from bottom to top; when calculating in the horizontal direction, first calculate the blur result from left to right, and then calculate the blur result in reverse from right to left.

[0074] The exponential blur algorithm adopts a row-column separation method, so the focus of optimization will be concentrated on the calculations in the horizontal and vertical directions. In specific implementation, it can be selected to calculate the pixel values of each pixel in the input image one by one in the vertical direction within a single scale and single thread according to the blur radius parameter set by the user. This process includes first calculating the blur result from top to bottom, and then performing reverse calculation from bottom to top to ensure the accuracy of each pixel value. Then, similar processing is carried out in the horizontal direction, first calculating the blur result from left to right, and then performing reverse calculation from right to left. This order ensures that the data processed in the previous step can be fully utilized during the calculation, thereby improving the coherence and accuracy of the blur effect.

[0075] Optionally, in an embodiment of the present invention, within a single scale and single thread: according to the blur radius parameter set by the user, first calculate the pixel values of each pixel in the input image in the horizontal direction, and then calculate the pixel values of each pixel in the input image in the vertical direction to generate an intermediate blurred image of the scale. Among them, when performing the calculation in the vertical direction, first calculate the blur result from top to bottom, and then perform reverse calculation from bottom to top; when performing the calculation in the horizontal direction, first calculate the blur result from left to right, and then perform reverse calculation from right to left.

[0076] Specifically, in an embodiment of the present invention, within a single scale and single thread, a different calculation order can also be followed: first calculate the value of each pixel in the horizontal direction, and then perform the calculation in the vertical direction. No matter which order is selected, the calculation in the vertical direction still needs to follow the reverse calculation from top to bottom and from bottom to top, while the horizontal direction needs to be processed from left to right and from right to left. This flexible selection provides diverse paths for achieving an efficient blur effect, ensuring the adaptability and optimized performance of the exponential blur algorithm in the resident thread concurrent mode.

[0077] Optionally, based on one or more corresponding embodiments described above, in another optional embodiment provided by the embodiments of the present invention, based on the selected filter operation mode, multi-scale exponential blur calculation is performed on the input image according to the blur radius parameter set by the user to generate intermediate blurred images of each scale, which may specifically include: Figure 1 Based on the selected filter operation mode, multi-scale exponential blur calculation is performed on the input image according to the blur radius parameter set by the user to generate intermediate blurred images of each scale, which may specifically include:

[0078] When the operation mode of the video processing filter is the SSE acceleration mode, SSE acceleration is started within a single scale and single thread. According to the blur radius parameter set by the user, calculate the pixel values of each pixel in the input image in the vertical direction to obtain a first blurred image. Transpose the first blurred image to obtain a second blurred image. According to the blur radius parameter, calculate the pixel values of each pixel in the second blurred image in the vertical direction to obtain a third blurred image. Transpose the third blurred image to generate an intermediate blurred image of the scale.

[0079] When performing exponential blur calculations in SSE acceleration mode, special attention needs to be paid to data dependencies during the calculation process. Since each step of the calculation is based on previously processed data, the calculations in both directions must be carried out serially. Additionally, in the horizontal direction, there is a certain correlation between the calculations of each pixel value, which makes it complex to directly apply SSE acceleration optimization.

[0080] Therefore, the embodiments of the present invention can perform transposition processing on the image, which can convert the calculations in the horizontal direction into those in the vertical direction. The transposed image data allows for accelerated optimization calculations in the vertical direction using the SSE instruction set. After completing the SSE acceleration calculations in the vertical direction, the image is transposed back. By this method, the entire exponential blur calculation is actually carried out twice in the vertical direction. This means that only the calculations in the vertical direction need to be optimized using the SSE instruction set, thereby effectively improving the calculation efficiency and avoiding performance bottlenecks caused by data correlations. Such a processing strategy not only improves the implementation efficiency of the blur effect but also fully utilizes the advantages of SSE acceleration.

[0081] Optionally, when the operating mode of the video processing filter is the SSE acceleration mode, when performing calculations in the vertical direction, first calculate the blur result from top to bottom, and then calculate the blur result in reverse from bottom to top.

[0082] Optionally, to facilitate the blur calculations in the vertical direction, the embodiments of the present invention can pre-apply for a buffer size for storing accumulated values for one row of elements. For example: for a 1080p (i.e., 1920*1080 resolution size) video, when the blur algorithm performs calculations in the vertical direction, it is necessary to perform cumulative evaluation on 1080 pixel points in the vertical direction, that is, the column direction. For convenient calculation, it is necessary to apply for buffer space to store 1920 temporary accumulated values, that is, the buffer space for one row of elements.

[0083] Optionally, in the multi-scale exponential blur calculation, pixel-level subtraction operation, and multi-thread weighted fusion, the embodiments of the present invention can utilize resident threads for concurrent acceleration optimization to improve the efficiency and response speed of image processing, thereby achieving a faster presentation of image effects. The embodiments of the present invention integrate the above optimized algorithms according to the filter interface specifications of the FFmpeg framework, making it embedded into the FFmpeg framework as a video processing filter, so that efficient and convenient image enhancement processing of different picture and video format sources can be achieved by calling the FFmpeg command line. Such integration not only improves the usability of the algorithm but also facilitates users to quickly apply image enhancement effects in various scenarios.

[0084] Optionally, the SSE acceleration process provided by the embodiments of the present invention may include: shifting the first row of pixels of the input image to the left by a preset zero-bit precision parameter to initialize the accumulated value, and preloading the SIMD constants of the all-zero vector and the blur precision parameter. Process the pixels of all rows of the input image in two passes along the vertical direction: first scan row by row from top to bottom, and then scan in reverse from bottom to top. Among them, 8 columns of pixels are processed iteratively each time during each scan. Use the SSE instruction set to parallel load the pixels and their accumulated values, update the accumulated value based on the blur precision parameter, the preset zero-bit precision parameter, and the preset approximation precision parameter. After shifting the updated accumulated value to the right by the preset zero-bit precision parameter, use the SSE instruction set to pack it into 8-bit pixels and write them to the target row. Among them, for the remaining columns that are not multiples of 8 in the input image, column-by-column exponential blur calculation is adopted.

[0085] Specifically, in the initialization stage of the SSE acceleration process, a row buffer array Sum is created. The value of each pixel in the first row of the image is shifted left by zprec bits as the initial value (Sum[x] = pixels[x] << zprec, where "pixels[x]" is the value of the (x + 1)-th pixel in the first row, and "<<" is the left shift operation). Two fixed parameters are pre-loaded into the SIMD registers: a vector of all zeros (__m128i Zero = _mm_setzero_si128()) for subsequent data compression, and a vector of the repeated alpha parameter (__m128i Alpha128 = _mm_set1_epi32(alpha)) for weight calculation. Next, in the data preparation stage, 8 pixels are continuously read from the current row and split into two groups of 4-byte data. Each group of 4 8-bit pixels is extended to the 32-bit integer format and loaded into the SIMD register (__m128i Src1 = _mm_cvtepu8_epi32(_mm_cvtsi32_si128((*(int*)(LinePS + x + 0)))), __m128i Src2 = _mm_cvtepu8_epi32(_mm_cvtsi32_si128((*(int*)(LinePS + x + 4))))). The corresponding row buffer data is synchronously loaded into the SIMD register (__m128i Sum1 = _mm_loadu_si128((__m128i*)(Sum + x + 0)), __m128i Sum2 = _mm_loadu_si128((__m128i*)(Sum + x + 4))). In the data calculation stage, the original pixels are left-shifted by zprec bits for amplification. The difference between the amplified pixel value and the cached value is calculated, and the difference is weighted and adjusted with the alpha parameter. The adjusted difference is accumulated onto the original cached value (Sum1 = _mm_add_epi32(_mm_srai_epi32(_mm_mullo_epi32(_mm_sub_epi32(_mm_slli_epi32(Src1, zprec), Sum1), Alpha128), aprec), Sum1), Sum2 = _mm_add_epi32(_mm_srai_epi32(_mm_mullo_epi32(_mm_sub_epi32(_mm_slli_epi32(Src2, zprec), Sum2), Alpha128), aprec), Sum2)).In the data write-back phase, the updated accumulated value is written back to the row cache, and the accumulated result is right-shifted by zprec bits to restore the actual value (_mm_storeu_si128((__m128i*)(Sum+x+0),Sum1),_mm_storeu_si128((__m128i*)(Sum+x+4),Sum2)). In the result output phase, the 32-bit intermediate result is compressed to 16 bits, and then further saturated and compressed to 8-bit pixel values, and the final pixel value is written to the target image row (_mm_storel_epi64((__m128i*)(LinePD+x),_mm_packus_epi16(_mm_packs_epi32(_mm_srai_epi32(Sum1,zprec),_mm_srai_epi32(Sum2,zprec)),Zero))).

[0086] It should be noted that vertical processing requires bidirectional calculation from top to bottom and from bottom to top to ensure vertical symmetry. The above description is only a calculation from top to bottom, and it is necessary to recalculate in the opposite direction from bottom to top. The calculation method is the same, but the direction is different.

[0087] The reason why the embodiment of the present invention uses the same algorithm but uses a conventional loop to process the last 1-7 columns of data is that the SSE acceleration process implements parallel computing through SIMD instructions, uses fixed-point operations to maintain accuracy, the zprec bit controls the accuracy level, and the alpha parameter controls the pixel blending weight. The design of batch processing of 8 columns is to maximize the processing power of the 128-bit register.

[0088] Optional, in the above Figure 1 On the basis of one or more corresponding embodiments, in another optional embodiment provided by the embodiment of the present invention, before performing multi-scale exponential blur calculation on the input image according to the blur radius parameter set by the user based on the selected filter operation mode and generating intermediate blurred images of each scale, the method further includes:

[0089] An intermediate blurred image buffer space is allocated to each scale respectively, wherein the intermediate blurred image buffer space is used to store blurred images generated in the multi-scale exponential blur calculation process.

[0090] In the embodiments of the present invention, by allocating intermediate blurred image cache spaces for each scale, the blurred images generated during the multi-scale exponential blurring calculation can be effectively stored. This not only improves the calculation efficiency, avoids the waste of resources caused by repeated calculations, but also can speed up the response speed of subsequent image processing. The use of the intermediate cache enables the blurred images of different scales to be quickly accessed and operated, thereby enhancing the fluency and effect performance of the overall image processing process, and ensuring that the finally output image has higher quality and is clearer.

[0091] In practical applications, in the embodiments of the present invention, by embedding the optimized multi-scale image detail enhancement algorithm as a video filter into the FFmpeg transcoding tool, video image processing for high-resolution display devices and video data prepared for machine learning can be achieved. An example of the FFmpeg command line used is as follows: ". / ffmpeg -i / home / jszhou / video_test / 1080p_test.mp4 -vf multiscalesharp=run_mode=2:radius=2 -pix_fmt yuv420p -c:v libx264 -preset slow -x264opts force-cfr:fps=25:crf=16 -y / home / jszhou / video_test / 1080p_test_sharp.ts". This command can perform image detail enhancement processing on three scales for the source video " / home / jszhou / video_test / 1080p_test.mp4", set the frame rate of the output video to 25, control the CRF value of the bitrate to 16, use the slow x264 format for encoding, and finally save the processed video as " / home / jszhou / video_test / 1080p_test_sharp.ts". The newly added multi-scale image detail enhancement algorithm filter is named "multiscalesharp" and supports the setting of the running mode. Among them, "run_mode=2" indicates the acceleration method that combines resident threads with the SSE instruction set, and "radius=2" is used to calculate and generate three different scale blurring radii, including radius, 2*radius, and 4*radius, and these values can be used as empirical references. After acceleration optimization, the algorithm can achieve a processing speed increase of approximately four times while maintaining the same effect.

[0092] The image enhancement method provided by the embodiments of the present invention aims to engineer and accelerate a traditional multi-scale image detail enhancement algorithm and embed it into the FFmpeg framework as a video processing filter, so as to achieve fast processing of different image and video formats through the FFmpeg command line. The present invention has at least three main advantages: 1. Optimization of multi-thread parallelism of resident threads: Compared with ordinary threads, resident threads remain active after the task ends, can quickly respond to new tasks, and reduce the resource overhead caused by frequent creation and destruction of threads, especially significantly improving speed and saving resources during frame-by-frame video processing. 2. Self-adaptive accelerated operation mode: The video processing filter can automatically detect whether the CPU supports the SSE instruction set. If supported, an optimization method combining resident threads and SSE instructions is adopted, which can achieve a speed increase of about 4 times; if not supported, a speed increase of about 2 times can still be achieved through resident threads, thereby improving processing efficiency. 3. Engineering implementation based on the FFmpeg framework: Embed the optimized image enhancement algorithm into the FFmpeg framework, which is convenient for quickly processing various image and video formats through the command line. At the same time, using the powerful audio and video processing capabilities of FFmpeg, other processing functions can be added before and after image enhancement to achieve more complex image and video effects.

[0093] Although the operations are depicted in a particular order, this should not be construed as requiring that the operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous.

[0094] It should be understood that the various steps recited in the method embodiments of the present invention may be executed in a different order and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this regard.

[0095] Corresponding to the above method embodiments, the embodiments of the present invention also provide an image enhancement device, the structure of which is as Figure 2 shown, and may include: a detection result obtaining unit 10, an operation mode selection unit 20, an intermediate blurred image generation unit 30, a detail difference image obtaining unit 40, and an image enhancement result obtaining unit 50.

[0096] The detection result obtaining unit 10 is configured to call the CPU capability detection interface of the cross-platform video framework to detect the SSE instruction set support status of the current device and obtain the detection result.

[0097] The operation mode selection unit 20 is configured to select the operation mode of the video processing filter based on the detection result.

[0098] An intermediate blurred image generation unit 30 is configured to perform multi-scale exponential blurring calculations on an input image according to a blurred radius parameter set by a user based on an operating mode of a selected video processing filter, and generate intermediate blurred images at various scales.

[0099] A detail difference image obtaining unit 40 is configured to perform pixel-level subtraction operations on the input image and the intermediate blurred images at various scales in parallel through a thread pool, and respectively obtain corresponding detail difference images.

[0100] An image enhancement result obtaining unit 50 is configured to perform multi-thread weighted fusion on the detail difference images to obtain an image enhancement result of the input image.

[0101] Optionally, the intermediate blurred image generation unit 30 may include: a resident thread concurrency subunit.

[0102] The resident thread concurrency subunit is configured to perform exponential blurring calculations on the input image according to the blurred radius parameter set by the user within a single thread at a single scale when the operating mode of the video processing filter is the resident thread concurrency mode, and generate intermediate blurred images at various scales.

[0103] Optionally, the resident thread concurrency subunit may specifically be configured to, within a single thread at a single scale: according to the blurred radius parameter set by the user, first calculate the pixel value of each pixel of the input image in the vertical direction, and then calculate the pixel value of each pixel of the input image in the horizontal direction to generate an intermediate blurred image at the scale, wherein when performing the calculation in the vertical direction, first calculate the blurred result from top to bottom and then calculate the blurred result in reverse from bottom to top; when performing the calculation in the horizontal direction, first calculate the blurred result from left to right and then calculate the blurred result in reverse from right to left.

[0104] Optionally, the intermediate blurred image generation unit 30 may include: an SSE acceleration subunit.

[0105] The SSE acceleration subunit is configured to start SSE acceleration within a single thread at a single scale when the operating mode of the video processing filter is the SSE acceleration mode, calculate the pixel value of each pixel of the input image in the vertical direction according to the blurred radius parameter set by the user to obtain a first blurred image; transpose the first blurred image to obtain a second blurred image; calculate the pixel value of each pixel of the second blurred image in the vertical direction according to the blurred radius parameter to obtain a third blurred image; and transpose the third blurred image to generate an intermediate blurred image at the scale.

[0106] Optionally, when the SSE acceleration subunit performs the calculation in the vertical direction, it first calculates the blurred result from top to bottom and then calculates the blurred result in reverse from bottom to top.

[0107] Optionally, the SSE acceleration sub-unit can be specifically used to shift the pixels of the first row of the input image to the left by a preset zero-bit precision parameter to initialize the accumulated value, and pre-load the all-zero vector and the SIMD constant of the blur precision parameter; process the pixels of all rows of the input image in two passes vertically: first scan row by row from top to bottom, and then scan in reverse from bottom to top. Among them, 8 columns of pixels are processed iteratively each time during each scan. The SSE instruction set is used to parallelly load the pixels and their accumulated values, and the accumulated value is updated based on the blur precision parameter, the preset zero-bit precision parameter, and the preset approximation precision parameter. After shifting the updated accumulated value to the right by the preset zero-bit precision parameter, it is packed into 8-bit pixels using the SSE instruction set and written to the target row. Among them, for the remaining columns that are not multiples of 8 in the input image, column-by-column exponential blurring calculation is performed.

[0108] Optionally, the image enhancement device may further include: a blurred image cache space allocation unit.

[0109] The blurred image cache space allocation unit is used to, before the intermediate blurred image generation unit 30 performs multi-scale exponential blurring calculation on the input image according to the selected filter operation mode and the blurred radius parameter set by the user to generate intermediate blurred images of each scale, allocate intermediate blurred image cache spaces for each scale respectively. The intermediate blurred image cache space is used to store the blurred images generated during the multi-scale exponential blurring calculation. An image enhancement device provided by the present invention is used to: call the CPU capability detection interface of the cross-platform video framework to detect the SSE instruction set support status of the current device and obtain the detection result; based on the detection result, select the operation mode of the video processing filter; based on the selected operation mode of the video processing filter, perform multi-scale exponential blurring calculation on the input image according to the blurred radius parameter set by the user to generate intermediate blurred images of each scale; perform pixel-level subtraction operations between the input image and the intermediate blurred images of each scale in parallel through a thread pool to obtain the corresponding detailed difference images respectively; perform multi-thread weighted fusion on the detailed difference images to obtain the image enhancement result of the input image. The present invention can reasonably schedule the computing resources for image enhancement by dynamically adapting the SSE instruction set, parallelizing the computing tasks, and optimizing the thread resource allocation, thereby improving the overall execution efficiency of the image enhancement process.

[0110] Regarding the device in the above embodiments, the specific manners in which each unit performs operations have been described in detail in the embodiments related to the method, and will not be elaborated here.

[0111] The image enhancement device includes a processor and a memory. The above-mentioned detection result acquisition unit 10, operation mode selection unit 20, intermediate blurred image generation unit 30, detail difference image acquisition unit 40, image enhancement result acquisition unit 50, etc. are all stored in the memory as program units, and the processor executes the above program units stored in the memory to implement corresponding functions.

[0112] The processor contains a kernel, and the kernel retrieves the corresponding program units from the memory. One or more kernels can be set. By adjusting the kernel parameters, the SSE instruction set support status of the current device is checked through the CPU capability detection interface of the cross-platform video framework, and a suitable video processing filter operation mode is selected accordingly. According to the blurred radius parameter set by the user, multi-scale exponential blur calculation is performed on the input image to generate multiple intermediate blurred images. The pixel-level subtraction operation of the input image and each intermediate blurred image is processed in parallel using a thread pool to obtain each detail difference image. Multi-thread weighted fusion is performed on each detail difference image to obtain an enhanced image, so as to improve the overall execution efficiency of the image enhancement process.

[0113] An embodiment of the present invention provides a computer-readable storage medium, on which a program is stored, and when the program is executed by a processor, the image enhancement method is implemented.

[0114] An embodiment of the present invention provides a processor, and the processor is used to run a program, wherein when the program runs, the image enhancement method is executed.

[0115] As Figure 3 As shown, an embodiment of the present invention provides an electronic device 1000, which includes at least one processor 1001, at least one memory 1002 connected to the processor 1001, and a bus 1003; wherein, the processor 1001 and the memory 1002 complete mutual communication through the bus 1003; the processor 1001 is used to call the program instructions in the memory 1002 to execute the above image enhancement method. The electronic device herein can be a server, a PC, a PAD, a mobile phone, etc.

[0116] The present invention also provides a computer program product, which is suitable for executing a program initialized with the steps of the image enhancement method when executed on an electronic device.

[0117] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses, electronic devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, and the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable devices to generate a machine, such that the instructions executed by the processors of the computer or other programmable devices produce means for implementing the functions specified in one process Figure 1 one process or a plurality of processes and / or blocks Figure 1 or a plurality of blocks.

[0118] In a typical configuration, an electronic device includes one or more processors (CPUs), a memory, and a bus. The electronic device may also include an input / output interface, a network interface, etc.

[0119] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM), and / or non-volatile memory such as read-only memory (ROM) or flash memory (flash RAM), and the memory includes at least one storage chip. The memory is an example of computer-readable media.

[0120] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can store information by any method or technology. The 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 technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD), or other optical storage, magnetic cassette tapes, magnetic tape disk storage, or other magnetic storage devices, or any other non-transitory media that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media such as modulated data signals and carrier waves.

[0121] In the description of the present invention, it should be understood that if terms such as "upper", "lower", "front", "rear", "left" and "right" are used to indicate the orientation or positional relationship, they are based on the orientation or positional relationship shown in the drawings. This is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the indicated position or element must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation of the present invention.

[0122] It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. It should also be noted that the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, commodity or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, commodity or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the existence of additional identical elements in the process, method, commodity or device comprising the element.

[0123] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system or a computer program product. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0124] The above are only embodiments of the present invention and are not used to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included within the scope of the present invention.

Claims

1. An image enhancement method, characterized in that: include: Call the CPU capability detection interface of the cross-platform video framework to detect the SSE instruction set support status of the current device and obtain the detection result; Based on the detection result, selecting an operation mode of the video processing filter; Based on the selected video processing filter operation mode, a multi-scale exponential blur calculation is performed on the input image according to the blur radius parameter set by the user to generate intermediate blurred images of each scale; Execute pixel-level subtraction operations of the input image and the intermediate blurred images of each scale in parallel through a thread pool to obtain corresponding detail difference images respectively; Multi-thread weighted fusion is performed on each of the detail difference images to obtain an image enhancement result of the input image.

2. The method according to claim 1, characterized in that: The operation mode of the selected video processing filter is based on performing multi-scale exponential blur calculation on the input image according to the blur radius parameter set by the user to generate intermediate blurred images of each scale, including: When the operation mode of the video processing filter is the resident thread concurrent mode, an exponential blur calculation is performed on the input image according to a blur radius parameter set by a user in a single thread of a single scale to generate an intermediate blurred image of each scale.

3. The method according to claim 2, characterized in that The step of performing exponential blur calculation on the input image according to the blur radius parameter set by the user in a single thread at a single scale to generate intermediate blurred images at each scale includes: In a single thread of a single scale: according to the blur radius parameter set by the user, the pixel value of each pixel of the input image is first calculated in the vertical direction, and then the pixel value of each pixel of the input image is calculated in the horizontal direction, to generate an intermediate blurred image of the scale, wherein, when calculating in the vertical direction, the blur result is first calculated from top to bottom, and then the blur result is calculated reversely from bottom to top; when calculating in the horizontal direction, the blur result is first calculated from left to right, and then the blur result is calculated reversely from right to left.

4. The method according to claim 1, characterized in that The method of performing multi-scale exponential blur calculation on the input image based on the selected filter operation mode according to the blur radius parameter set by the user to generate intermediate blurred images of each scale includes: When the operation mode of the video processing filter is the SSE acceleration mode, SSE acceleration is started in a single thread of a single scale, and a pixel value of each pixel of the input image is calculated in a vertical direction according to a blur radius parameter set by a user to obtain a first blurred image; Transposing the first blurred image to obtain a second blurred image; Calculating the pixel value of each pixel of the second blurred image in the vertical direction according to the blur radius parameter to obtain a third blurred image; The third blurred image is transposed to generate an intermediate blurred image of the scale.

5. The method according to claim 4, characterized in that When performing calculations in the vertical direction, the fuzzy result is first calculated from top to bottom, and then the fuzzy result is calculated in reverse from bottom to top.

6. The method according to claim 4, characterized in that The SSE acceleration process includes: Shift the first row of pixels of the input image left according to a preset zero-bit precision parameter to initialize the accumulated value, and preload the SIMD constants of the all-zero vector and the blur precision parameter; The pixels of all rows of the input image are processed twice along the vertical direction: first, scan row by row from top to bottom, and then scan in reverse from bottom to top, wherein 8 columns of pixels are processed in each iteration during each scan, and the pixels and their accumulated values ​​are loaded in parallel using the SSE instruction set, and the accumulated values ​​are updated based on the blur precision parameter, the preset zero-bit precision parameter, and the preset approximate precision parameter, and the updated accumulated values ​​are right-shifted according to the preset zero-bit precision parameter, and then the SSE instruction set is used to pack the updated accumulated values ​​into 8-bit pixels and write them into the target row, wherein column-by-column exponential blur calculation is adopted for the remaining columns in the input image that are not multiples of 8.

7. The method according to claim 1, characterized in that Before performing multi-scale exponential blur calculation on the input image based on the selected filter operation mode according to the blur radius parameter set by the user to generate intermediate blurred images of each scale, the method further includes: An intermediate blurred image buffer space is allocated to each scale respectively, wherein the intermediate blurred image buffer space is used to store blurred images generated in the multi-scale exponential blur calculation process.

8. An image enhancement device, characterized in that: include: a detection result obtaining unit, an operation mode selecting unit, an intermediate blurred image generating unit, a detail difference image obtaining unit and an image enhancement result obtaining unit, The detection result obtaining unit is used to call the CPU capability detection interface of the cross-platform video framework, detect the SSE instruction set support status of the current device, and obtain the detection result; The operation mode selection unit is used to select the operation mode of the video processing filter based on the detection result; The intermediate blurred image generating unit is used to perform multi-scale exponential blur calculation on the input image according to the blur radius parameter set by the user based on the operation mode of the selected video processing filter, and generate intermediate blurred images of each scale; The detail difference image obtaining unit is used to perform pixel-level subtraction operations between the input image and the intermediate blurred images of each scale in parallel through a thread pool to obtain corresponding detail difference images respectively; The image enhancement result obtaining unit is used to perform multi-thread weighted fusion on each of the detail difference images to obtain the image enhancement result of the input image.

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

10. An electronic device, characterized in that: The electronic device includes at least one processor, and at least one memory and a bus connected to the processor; wherein the processor and the memory communicate with each other via the bus; and the processor is used to call program instructions in the memory to execute the image enhancement method as described in any one of claims 1 to 7.