A method, device and equipment for generating a halo effect based on a mobile terminal

By performing highlight extraction, inverse tone mapping, multi-resolution downsampling, blurring, and tone mapping on mobile devices, a high-quality halo effect is generated, solving the problem of generating halo effects on mobile devices with limited computing power and achieving an efficient and natural halo effect.

CN122336034APending Publication Date: 2026-07-03XIAMEN MEITUZHIJIA TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
XIAMEN MEITUZHIJIA TECH
Filing Date
2026-03-23
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

When generating halo effects, mobile devices struggle to achieve high-intensity, wide-area diffusion, smooth transition, and no overexposure artifacts with limited computing power. Existing technologies often result in excessive computation or insufficient halo performance, affecting visual perception.

Method used

By employing steps such as highlight extraction, inverse tone mapping, multi-resolution downsampling, blurring, upsampling overlay, and tone mapping, the highlight areas are precisely extracted to generate multi-scale halo effects. Conditional overlay is then applied to ensure that the halo only affects non-highlight areas, thus avoiding overexposure.

Benefits of technology

While ensuring real-time processing performance, it significantly improves the visual performance of the halo, achieving a comprehensive effect of sufficient halo brightness, controllable diffusion range, and smooth and natural transition, and optimizing the halo generation quality and computing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122336034A_ABST
    Figure CN122336034A_ABST
Patent Text Reader

Abstract

This invention discloses a method, apparatus, and device for generating halo effects on a mobile device, comprising: acquiring an original image and extracting highlight regions from the original image to obtain highlight image attachments; performing inverse tone mapping on the highlight image attachments to obtain high dynamic range (HDR) brightened image attachments; performing multiple downsampling on the brightened image attachments to generate multiple downsampled image attachments with different resolutions; performing blurring processing on the brightened image attachments and each downsampled image attachment to obtain corresponding multiple blurred image attachments; upsampling and superimposing each blurred image attachment to generate a HDR halo composite attachment; performing tone mapping processing on the halo composite attachment to obtain a standard dynamic range (SDR) standard halo attachment; and superimposing the standard halo attachment with the original image based on the highlight image attachment to obtain the halo result image. This method can balance the visual realism of the halo effect with real-time processing performance under limited computing power.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method, apparatus, and device for generating halo effects based on a mobile device. Background Technology

[0002] In the field of mobile image processing, halo effects are widely used in photography, video, and real-time special effects scenarios as an important visual enhancement technique. They are used to simulate the diffusion of light in bright areas, thereby improving the realism and expressiveness of the image. However, the computing power limitations of mobile devices pose a severe challenge to the effectiveness and performance of real-time halo algorithms.

[0003] In existing technologies, halo effect review algorithms often face the challenge of balancing effect and performance. On the one hand, increasing the blur kernel size to pursue a larger halo effect leads to a sharp increase in computation, making real-time processing on mobile devices difficult. On the other hand, simple Gaussian blur overlay can easily cause problems such as the halo brightness being too close to the luminous object, insufficient or excessive halo diffusion, resulting in blurred images, weak halo performance, and even overexposure of the luminous object's center or incorrect illumination of surrounding areas, making the overall visual effect appear unnatural. In addition, some solutions attempt to improve performance by reducing resolution, but this introduces new image quality problems such as jagged edges and fuzzy textures at the halo edges, seriously affecting the visual appeal of the final image. Although halo algorithms with ideal effects exist on PCs, their computational models usually cannot be directly transferred to mobile devices for real-time operation. Therefore, the industry urgently needs a high-quality halo effect that can achieve high intensity, large-area diffusion, smooth transition, and no overexposure artifacts under the limited computing power constraints of mobile devices, which has become a pressing problem to be solved in this field. Summary of the Invention

[0004] In view of this, the purpose of this invention is to propose a method, apparatus and device for generating halo effects based on mobile devices, which aims to solve the problem that existing mobile halo generation algorithms are unable to balance the visual realism of halo effects and real-time processing performance under limited computing power.

[0005] To achieve the above objectives, the present invention provides a method for generating halo effects on mobile devices, the method comprising: Acquire the original image and extract the highlight regions from the original image to obtain the highlight image attachment; The highlight image attachment is subjected to inverse tone mapping to obtain a brightened image attachment with high dynamic range; The brightened image attachments are downsampled multiple times to generate multiple downsampled image attachments with different resolutions; The brightened image attachment and each of the downsampled image attachments are blurred to obtain multiple corresponding blurred image attachments; The blurred image attachments are upsampled and superimposed to generate a high dynamic range halo composite attachment; The halo composite attachment is subjected to tone mapping processing to obtain a standard halo attachment with standard dynamic range; Based on the aforementioned highlight image attachment, the standard halo attachment is superimposed on the original image to obtain the halo result image.

[0006] Preferably, the step of extracting the highlight region from the original image to obtain the highlight image attachment includes: Calculate the brightness-weighted average value of each pixel in the original image, and determine the pixel region where the brightness-weighted average value is greater than a preset threshold as the highlight region; An image containing only the highlight areas is generated as the highlight image attachment, and the pixel intensity of the non-highlight areas in the highlight image attachment is set to 0.

[0007] Preferably, the step of performing inverse tone mapping on the highlight image attachment to obtain a brightened image attachment with high dynamic range includes: Using formula The pixel value A(x,y) at each pixel position (x,y) in the highlight image attachment is calculated to obtain the brightened image attachment A. hdr The pixel value A at the corresponding position in the middle hdr (x,y), where A(x,y) represents the pixel value located at coordinates (x,y) in the highlight image attachment, and a, b, c, d, and e represent preset inverse tone mapping coefficients, respectively.

[0008] Preferably, the step of downsampling the brightened image attachment multiple times to generate multiple downsampled image attachments of different resolutions includes: The brightened image attachment is downsampled for the first time to generate a first downsampled image attachment, wherein the width and height magnification of the downsampled image is 2; The first downsampled image attachment is downsampled a second time to generate a second downsampled image attachment, wherein the width and height magnification of the downsampled image is 2; The second downsampled image attachment is downsampled a third time to generate a third downsampled image attachment, wherein the width and height magnification of the downsampled image is 2.

[0009] Preferably, the step of upsampling and superimposing each of the blurred image attachments to generate a high dynamic range halo composite attachment includes: Upsample the blurred image attachment, which has a lower resolution than the brightened image attachment, so that the resolution of the blurred image attachment is the same as that of the brightened image attachment; All the blurred image attachments with the same resolution are superimposed to generate the halo composite attachment.

[0010] Preferably, the step of performing tone mapping processing on the halo composite attachment to obtain a standard halo attachment with a standard dynamic range includes: Using formula For the pixel value B at each pixel position (x, y) in the halo synthesis attachment HDR Calculations were performed using (x, y) to obtain the standard halo attachment B. SDR The pixel value B at the corresponding position in the middle SDR (x,y), where B HDR (x,y) represents the pixel value located at coordinates (x,y) in the halo synthesis attachment, and a, b, c, d, and e represent preset tone mapping coefficients, respectively.

[0011] Preferably, the step of overlaying the standard halo attachment with the original image based on the highlight image attachment to obtain the halo result image includes: If the pixel value A(x,y) of the highlight image attachment at coordinates (x,y) is 0, then the pixel value of the standard halo attachment at the corresponding coordinates (x,y) is superimposed with the pixel value of the original image at the corresponding coordinates (x,y) to obtain the pixel value of the halo result image at coordinates (x,y). If the pixel value A(x,y) of the highlight image attachment at coordinates (x,y) > 0, then the pixel value of the original image at the corresponding coordinates (x,y) is used as the pixel value of the halo result image at coordinates (x,y).

[0012] To achieve the above objectives, the present invention provides a halo effect generation device based on a mobile terminal, the device comprising: A highlight extraction unit is used to acquire the original image and extract the highlight regions from the original image to obtain a highlight image attachment; The first processing unit is used to perform inverse tone mapping processing on the highlight image attachment to obtain a brightened image attachment with high dynamic range; The downsampling unit is used to downsample the brightened image attachment multiple times to generate multiple downsampled image attachments with different resolutions; The blurring unit is used to blur the brightened image attachment and each of the downsampled image attachments respectively to obtain multiple corresponding blurred image attachments; An upsampling unit is used to upsample and superimpose each of the blurred image attachments to generate a high dynamic range halo composite attachment; The second processing unit is used to perform tone mapping processing on the halo synthesis attachment to obtain a standard halo attachment with standard dynamic range. The halo effect generation unit is used to overlay the standard halo attachment with the original image based on the highlight image attachment to obtain a halo result image.

[0013] To achieve the above objectives, the present invention also proposes a halo effect generation device based on a mobile terminal, comprising a processor, a memory, and a computer program stored in the memory, wherein the computer program is executed by the processor to implement the steps of a halo effect generation method based on a mobile terminal as described in the above embodiments.

[0014] To achieve the above objectives, the present invention also proposes a computer-readable storage medium storing a computer program that is executed by a processor to implement the steps of a mobile terminal-based halo effect generation method as described in the above embodiments.

[0015] To achieve the above objectives, the present invention also proposes a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of a halo effect generation method based on a mobile terminal as described in the above embodiments.

[0016] Beneficial effects: The above scheme achieves an optimal balance between performance and visual appeal on mobile devices through a series of coordinated steps including highlight extraction, inverse tone mapping, multi-resolution downsampling, blurring, upsampling overlay, tone mapping, and conditional overlay. Specifically, this method purifies highlight energy through inverse tone mapping, laying the foundation for generating a bright, wide-ranging halo. It employs a multi-level downsampling and blurring strategy, using small-kernel blurring on low-resolution images to simulate large-kernel blurring at high resolution, thus significantly reducing the computational complexity of convolution operations and ensuring real-time performance on mobile devices. Conditional overlay logic ensures that the halo only affects non-high-brightness areas, fundamentally preventing overexposure of the luminous subject due to the overlaid halo. This scheme significantly improves the visual expressiveness of the halo while maintaining real-time processing performance, achieving a comprehensive effect of sufficient halo brightness, controllable diffusion range, smooth and natural transition, and no overexposure. It systematically optimizes the generation quality and computational efficiency of the halo, thus solving the problem of balancing performance and visual appeal in traditional methods.

[0017] By employing brightness-weighted averaging and threshold filtering, highlight areas are precisely extracted as halo seeds, while non-highlight areas are set to zero, providing a clean input foundation for subsequent processing and ensuring accurate light source positioning. Building upon this, inverse tone mapping is introduced to effectively increase the upper limit of the extracted highlight areas' brightness, extending their dynamic range into the high dynamic range space. This ensures the halo has sufficient energy reserves during subsequent blurring and diffusion, significantly enhancing the brightness of halo areas far from the light-emitting center. This avoids problems such as dim halo and rapid dissipation due to insufficient energy, laying a crucial foundation for generating high-intensity, large-area halo effects and significantly enhancing the halo's layering and expressiveness.

[0018] By downsampling the brightened image attachments three times with a width-to-height ratio of 2, three downsampled image attachments of different resolutions were generated, constructing a multi-scale representation of the halo. The blurring results at each resolution were then uniformly upsampled to the original resolution and superimposed, achieving a technological breakthrough in simulating the blurring effect of large-size convolutional kernels with minimal computational cost. This collectively achieves significant performance optimization and a natural visual transition: in terms of performance, applying small convolutional kernels to the downsampled small-size image requires far less computation than directly using large convolutional kernels at the original image resolution, thus significantly improving processing speed; in terms of effect, superimposing halos generated at different scales (i.e., different blur radii) simulates a smoother and more realistic brightness decay, resulting in a softer and more natural transition from the center to the edge of the halo, avoiding the harsh boundaries or brightness discontinuities within the halo that might occur with single-scale blurring.

[0019] By performing tone mapping on the high dynamic range halo synthesis attachments, compressing them back to the standard dynamic range, and mapping them to the sRGB color space, the high brightness information enhanced and diffused in the previous steps can be reasonably mapped to the brightness range that the display device can display. This effectively prevents the problem of halo brightness confusion with the brightness of the luminous object caused by brightness truncation, ensuring the natural presentation of halo colors and improving the accuracy and visibility of the final halo brightness. Furthermore, using the highlight image attachments as a binary judgment criterion, halos are superimposed on non-highlight areas while the original image is retained in highlight areas, achieving precise protection of the luminous object itself and fundamentally preventing overexposure. This conditional superposition mechanism, combined with the aforementioned multi-scale halo synthesis, makes the halo closely fit the outline of the luminous object, maintaining the clarity of the luminous object while giving it a natural outward diffusion visual effect, thereby maintaining the purity and realism of the image and ultimately generating a halo result image with distinct layers and strong realism. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a flowchart illustrating a method for generating halo effects on a mobile device, as provided in an embodiment of the present invention.

[0022] Figure 2 This is a schematic diagram of a halo effect generation device based on a mobile terminal, provided in an embodiment of the present invention.

[0023] The realization of the invention's objective, its functional characteristics, and advantages will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to represent selected embodiments of the invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0025] The present invention will be described in detail below with reference to the embodiments.

[0026] Reference Figure 1 The diagram shown is a flowchart of a method for generating halo effects on a mobile device according to an embodiment of the present invention.

[0027] In this embodiment, the method includes: S11, acquire the original image and extract the highlight areas from the original image to obtain a highlight image attachment.

[0028] Furthermore, in step S11, extracting the highlight region from the original image to obtain a highlight image attachment includes: S11-1, Calculate the brightness-weighted average value of each pixel in the original image, and determine the pixel region where the brightness-weighted average value is greater than a preset threshold as the highlight region; S11-2, Generate an image containing only the highlight area as the highlight image attachment, and set the pixel intensity of the non-highlight area in the highlight image attachment to 0.

[0029] In this embodiment, an original image O is acquired. For each pixel in the original image, its brightness value is calculated using a weighted average method, for example, by obtaining a normalized weighted average brightness value using a common RGB-to-brightness conversion formula. This weighted average brightness value is compared with a preset threshold (e.g., 0.85). If the weighted average brightness value of a pixel is greater than 0.85, the pixel is determined to belong to a highlight region, and its original pixel value (or brightness value) is retained and written to the corresponding position in highlight image attachment A. If the weighted average brightness value of a pixel is less than or equal to 0.85, it is determined to be a non-highlight region, and the pixel intensity at the corresponding position in highlight image attachment A is set to 0. Thus, the generated highlight image attachment A is an image that only contains the original pixel values ​​of the highlight regions, while all non-highlight regions are set to zero, thereby accurately extracting the luminous regions and providing a clean input basis for subsequent halo processing.

[0030] S12, perform inverse tone mapping processing on the highlight image attachment to obtain a brightened image attachment with high dynamic range.

[0031] Furthermore, in step S12, the inversion tone mapping process performed on the highlight image attachment to obtain a brightened image attachment with high dynamic range includes: Using formula The pixel value A(x,y) at each pixel position (x,y) in the highlight image attachment is calculated to obtain the brightened image attachment A. hdr The pixel value A at the corresponding position in the middle hdr (x,y), where A(x,y) represents the pixel value located at coordinates (x,y) in the highlight image attachment, and a, b, c, d, and e represent preset inverse tone mapping coefficients, respectively.

[0032] In this embodiment, to increase the brightness limit of the highlight area and provide sufficient energy reserves for subsequent halo diffusion, the Anti-Academy Color Encoding System ToneMapping (A-ACES inverse tone mapping algorithm) is used to process the highlight image attachment A. Specifically, for each pixel value A(x,y) located at coordinates (x,y) in the highlight image attachment A, the brightened image attachment A is calculated using the following formula. hdr The pixel value A at the corresponding position (x, y) in the middle hdr(x,y): Where a, b, c, d, and e are preset inverse tone mapping coefficients, which in this embodiment are set to: a=2.51, b=0.03, c=2.43, d=0.59, and e=0.14. This formula, through a specific mathematical transformation, maps the input highlight region pixel values ​​from the standard dynamic range to the high dynamic range space, significantly increasing the brightness upper limit of the highlight region. After this processing step, the resulting high dynamic range brightened image (Attachment A) is obtained. hdr It not only fully preserves the location information of the original highlight area, but also has a numerical space that far exceeds the conventional brightness range, laying a key foundation for the highlight area to produce a wider range and brighter halo diffusion effect in subsequent blurring processing.

[0033] S13, the brightened image attachment is downsampled multiple times to generate multiple downsampled image attachments with different resolutions.

[0034] Furthermore, in step S13, the process of downsampling the brightened image attachment multiple times to generate multiple downsampled image attachments of different resolutions includes: S13-1, Perform a first downsampling on the brightened image attachment to generate a first downsampled image attachment, wherein the width and height magnification of the downsampled image is 2; S13-2, perform a second downsampling on the first downsampled image attachment to generate a second downsampled image attachment, wherein the width and height magnification of the downsampled image is 2; S13-3, perform a third downsampling on the second downsampled image attachment to generate a third downsampled image attachment, wherein the width and height magnification of the downsampled image is 2.

[0035] In this embodiment, in order to simulate the halo diffusion effect of large-size convolution kernels with low computational cost in subsequent blurring processing, the image attachment A is brightened. hdr Multiple image compression operations are performed to construct a multi-scale image pyramid. Specifically, the first downsampling process is executed, brightening image attachment A by a ratio of 2x in both width and height. hdr Perform downsampling (image compression) to generate the first downsampled image attachment A2, whose resolution is reduced to that of the brightened image attachment A. hdr Half of the first downsampled image A2 is then processed by a second downsampling, again with a width and height magnification of 2, to generate the second downsampled image A4, whose resolution is reduced to that of the brightened image A2. hdr 1 / 4; Finally, the second downsampled image attachment A4 is downsampled a third time, still at a ratio of 2x in both width and height, to generate the third downsampled image attachment A8, whose resolution is reduced to that of the brightened image attachment A.hdr 1 / 8. After the above three downsampling operations, the final result includes the brightened image attachment A. hdr The image itself, along with four image attachments of different resolutions, together form a pyramid structure for subsequent multi-scale halo processing, laying the foundation for simulating large-scale halo diffusion effects using small convolution kernels in later steps.

[0036] S14, blur the brightened image attachment and each of the downsampled image attachments respectively to obtain a plurality of corresponding blurred image attachments.

[0037] The fuzzing process is a Gaussian fuzzing process that separates horizontal and vertical data.

[0038] In this embodiment, in order to simulate the halo diffusion effect at different scales, the image attachment A was brightened. hdr The generated downsampled image attachments A2, A4, and A8 are then blurred. Specifically, a Gaussian blur algorithm with horizontal and vertical separation is used for processing; that is, for the brightened image attachment A... hdr The blurred image attachment A is obtained by Gaussian blurring through horizontal and vertical separation. blur For the first downsampled image attachment A2, the blurred image attachment A is obtained in the same way. blur2 For the second downsampled image attachment A4, the blurred image attachment A is obtained. blur4 For the third downsampled image attachment A8, the blurred image attachment A is obtained. blur8 In this embodiment, the convolution kernel size for Gaussian blur can be set to 3×3, that is, a kernel with a width of 3 pixels is used for horizontal and vertical separation convolution. Since the resolutions of the downsampled image attachments A2, A4, and A8 are 1 / 2, 1 / 4, and 1 / 8 of the resolutions of the brightened image attachments, respectively, using a convolution kernel of size 3 on them for blurring is equivalent to using convolution kernels of sizes 5, 11, and 21 on the brightened image attachments at the original resolution, respectively. This simulates the halo effect with different diffusion radii with a small computational cost, effectively improving computational efficiency. Thus, four blurred image attachments are obtained, each corresponding to the halo diffusion results at different resolutions.

[0039] S15, upsample and superimpose each of the blurred image attachments to generate a high dynamic range halo composite attachment.

[0040] Furthermore, in step S15, the upsampling and superposition of each of the blurred image attachments to generate a high dynamic range halo composite attachment includes: S15-1, Upsample the blurred image attachment whose resolution is lower than that of the brightened image attachment, so that the resolution of the blurred image attachment is the same as that of the brightened image attachment; S15-2, superimpose all the blurred image attachments with the same resolution to generate the halo composite attachment.

[0041] In this embodiment, in order to fuse the blurring results of different scales into a complete high dynamic range halo composite attachment, it is necessary to upsample the low-resolution blurred image attachment so that its resolution is similar to that of blurred image attachment A. blur Consistent. Specifically, for A blur2 A blur4 A blur8 The following formula is used for upsampling when both width and height are magnified by 2: Where ⊙ represents the convolution operation, A 低分辩图像 (x,y) represents the pixel value at coordinates (x,y) in a low-resolution image, where the low-resolution image is A. blur A blur2 A blur4 A blur8 The term "upsampling" refers to the process of calculating the pixel value at the corresponding position in the upsampled image by weighted averaging of the pixel values ​​of each pixel in the low-resolution image and its surrounding 3×3 neighborhood. The weight distribution in this convolution kernel reflects the contribution of neighboring pixels, with the center pixel having the highest weight and the surrounding pixels having decreasing weights, thus achieving a smooth upsampling effect. After upsampling, all blurred image attachments have the same resolution as the brightened image attachments. Subsequently, these blurred image attachments with the same resolution are superimposed: A... blur Compared with the upsampled A blur2 A blur4 A blur8 Add pixels one by one (or use other pixel-level blending methods), and write the superposition result into color attachment B. HDR In this process, a high dynamic range halo composite attachment is generated. This process fuses multi-scale information so that the final halo effect includes both the fine diffusion at the original scale and the large-scale halo simulated by downsampling blur. This achieves a halo effect that is smooth from the luminous center to the periphery, with a wide range and sufficient energy, while avoiding the problems of abrupt halo or insufficient diffusion that may be caused by single-scale blur.

[0042] S16, perform tone mapping processing on the halo synthesis attachment to obtain a standard halo attachment with standard dynamic range.

[0043] Further, in step S16, the step of performing tone mapping processing on the halo composite attachment to obtain a standard halo attachment with a standard dynamic range includes: Using formula For the pixel value B at each pixel position (x, y) in the halo synthesis attachment HDRCalculations were performed using (x, y) to obtain the standard halo attachment B. SDR The pixel value B at the corresponding position in the middle SDR (x,y), where B HDR (x,y) represents the pixel value located at coordinates (x,y) in the halo synthesis attachment, and a, b, c, d, and e represent preset tone mapping coefficients, respectively.

[0044] In this embodiment, in order to B HDR The pixel values ​​in the image are compressed from the high dynamic range space back to the standard dynamic range and correctly mapped to the sRGB color space for display and subsequent compositing. The Academy Color Encoding System Tone Mapping (ACES tone mapping algorithm) is used for B... HDR Processing is required. Specifically, for halo synthesis attachment B... HDR The value B of each pixel located at coordinates (x, y) HDR (x,y), the standard halo attachment B is calculated using the following formula. SDR The pixel value B at the corresponding position (x,y) in the middle SDR (x,y): Where a, b, c, d, and e are preset tone mapping coefficients, which in this embodiment use the same parameter values ​​as the inverse tone mapping step, i.e., a=2.51, b=0.03, c=2.43, d=0.59, and e=0.14. This formula, through specific mathematical transformations, compresses the high dynamic range halo pixel values ​​to the standard dynamic range and maps them to the sRGB color space, thereby ensuring that the final generated halo attachment retains sufficient luminance energy without causing display distortion or luminance cutoff due to excessive dynamic range. After this step, a standard halo attachment B with a standard dynamic range is obtained. SDR Its brightness range is compatible with conventional display devices, preparing it for subsequent synthesis with the original image.

[0045] S17, Based on the highlight image attachment, the standard halo attachment is superimposed on the original image to obtain the halo result image.

[0046] Furthermore, in step S17, the step of superimposing the standard halo attachment with the original image based on the highlight image attachment to obtain a halo result image includes: S17-1, If ​​the pixel value A(x,y) of the highlight image attachment at coordinates (x,y) is 0, then the pixel value of the standard halo attachment at the corresponding coordinates (x,y) is superimposed with the pixel value of the original image at the corresponding coordinates (x,y) to obtain the pixel value of the halo result image at coordinates (x,y). S17-2, if the pixel value A(x,y) of the highlight image attachment at coordinates (x,y)>0, then the pixel value of the original image at the corresponding coordinates (x,y) is used as the pixel value of the halo result image at coordinates (x,y).

[0047] In this embodiment, the highlight image attachment A is a binary image, where the pixel value corresponding to the highlight area is 1, and the pixel value corresponding to the non-highlight area is 0. Based on the binary characteristics of this highlight image attachment, the following formula is used to perform conditional judgment and superposition calculation on each pixel position (x,y) to obtain the halo result image O. 最终结果 (x,y): .

[0048] Specifically, if the pixel value A(x,y)=0 of the highlight image attachment at coordinates (x,y), it indicates that the pixel belongs to a non-highlight region. Therefore, the pixel value B of the standard halo attachment at the corresponding coordinates (x,y) is... SDR The pixel value (x,y) of the original image at the corresponding coordinates (x,y) is added to the pixel value O(x,y) of the halo image, and the result is used as the pixel value O(x,y) of the halo image at the corresponding coordinates (x,y). 最终结果 (x,y); If the pixel value A(x,y) of the highlight image at coordinates (x,y) > 0 (i.e., equal to 1), it indicates that the pixel belongs to the highlight area of ​​the luminous object itself. To avoid overexposure, the pixel value O(x,y) of the original image at coordinates (x,y) is directly used as the pixel value O of the halo result image at coordinates (x,y). 最终结果 (x, y), without any added halo components. By performing the above conditional judgment and calculation on all pixel positions, the complete halo result image is finally obtained. This processing method achieves precise protection of the luminous object through a binary mask on the highlight image, ensuring that the halo only acts on the non-highlight area. This preserves the clarity and original brightness of the luminous object while creating a naturally diffused halo effect around it, fundamentally eliminating the overexposure phenomenon caused by the superimposed halo in the luminous area.

[0049] Reference Figure 2 The diagram shown is a structural schematic of a halo effect generation device based on a mobile terminal provided in an embodiment of the present invention.

[0050] In this embodiment, the device 20 includes: The highlight extraction unit 21 is used to acquire the original image and extract the highlight areas in the original image to obtain a highlight image attachment; The first processing unit 22 is used to perform inverse tone mapping processing on the highlight image attachment to obtain a brightened image attachment with high dynamic range; The downsampling unit 23 is used to downsample the brightened image attachment multiple times to generate multiple downsampled image attachments with different resolutions; The blurring unit 24 is used to perform blurring processing on the brightened image attachment and each of the downsampled image attachments respectively to obtain a plurality of corresponding blurred image attachments; Upsampling unit 25 is used to upsample and superimpose each of the blurred image attachments to generate a high dynamic range halo composite attachment; The second processing unit 26 is used to perform tone mapping processing on the halo synthesis attachment to obtain a standard halo attachment with standard dynamic range. The halo effect generation unit 27 is used to superimpose the standard halo attachment with the original image based on the highlight image attachment to obtain a halo result image.

[0051] Each unit module of the device 20 can execute the corresponding steps in the above method embodiment, so the details of each unit module will not be elaborated here. Please refer to the description of the corresponding steps above for details.

[0052] This invention also provides a mobile-based halo effect generation device, which includes the mobile-based halo effect generation apparatus described above. The mobile-based halo effect generation apparatus can employ... Figure 2 The structure of the embodiment, correspondingly, can be executed Figure 1 The technical solutions of the method embodiments shown are similar in implementation principle and technical effect. For details, please refer to the relevant records in the above embodiments, which will not be repeated here.

[0053] The device includes: a mobile phone, digital camera, or tablet computer, or other device with a camera function; or a device with an image processing function; or a device with an image display function. The device may include components such as a memory, processor, input unit, display unit, and power supply.

[0054] The memory can be used to store software programs and modules. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory can mainly include a program storage area and a data storage area. The program storage area can store the operating system, application programs required for at least one function (such as image playback function), etc.; the data storage area can store data created according to the use of the device. In addition, the memory can include high-speed random access memory, and can also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory can also include a memory controller to provide access to the memory for the processor and input units.

[0055] The input unit can be used to receive input numerical, character, or image information, and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control. Specifically, in addition to a camera, the input unit of this embodiment may also include a touch-sensitive surface (e.g., a touch screen) and other input devices.

[0056] The display unit can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the device. These graphical user interfaces can be composed of graphics, text, icons, video, and any combination thereof. The display unit may include a display panel, optionally configured as an LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), or other similar display panel. Furthermore, a touch-sensitive surface may cover the display panel. When the touch-sensitive surface detects a touch operation on or near it, it transmits the information to the processor to determine the type of touch event. Subsequently, the processor provides corresponding visual output on the display panel based on the type of touch event.

[0057] This invention also provides a computer-readable storage medium, which may be a computer-readable storage medium included in the memory described in the above embodiments; or it may be a standalone computer-readable storage medium not assembled into a device. The computer-readable storage medium stores at least one instruction, which is loaded and executed by a processor to implement... Figure 1 The method for generating halo effects based on a mobile device is shown. The computer-readable storage medium can be a read-only memory, a disk, or an optical disk, etc.

[0058] This invention also provides a computer program product, including a computer program / instructions, which are loaded and executed by a processor to achieve [the desired result]. Figure 1 This illustrates a method for generating halo effects on mobile devices.

[0059] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the device embodiments, equipment embodiments, and storage medium embodiments, since they are basically similar to the method embodiments, the descriptions are relatively simple, and relevant parts can be referred to the descriptions in the method embodiments.

[0060] Furthermore, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0061] The foregoing description illustrates and describes preferred embodiments of the present invention. It should be understood that the present invention is not limited to the forms disclosed herein and should not be construed as excluding other embodiments. It can be used in various other combinations, modifications, and environments, and can be altered within the scope of the inventive concept by means of the foregoing teachings or techniques or knowledge in related fields. Any modifications and variations made by those skilled in the art that do not depart from the spirit and scope of the present invention should be within the protection scope of the appended claims.

Claims

1. A method for generating halo effects on mobile devices, characterized in that, The method includes: Acquire the original image and extract the highlight regions from the original image to obtain the highlight image attachment; The highlight image attachment is subjected to inverse tone mapping to obtain a brightened image attachment with high dynamic range; The brightened image attachments are downsampled multiple times to generate multiple downsampled image attachments with different resolutions; The brightened image attachment and each of the downsampled image attachments are blurred to obtain multiple corresponding blurred image attachments; The blurred image attachments are upsampled and superimposed to generate a high dynamic range halo composite attachment; The halo composite attachment is subjected to tone mapping processing to obtain a standard halo attachment with standard dynamic range; Based on the aforementioned highlight image attachment, the standard halo attachment is superimposed on the original image to obtain the halo result image.

2. The method for generating a halo effect based on a mobile terminal according to claim 1, characterized in that, The step of extracting the highlight regions from the original image to obtain highlight image attachments includes: Calculate the brightness-weighted average value of each pixel in the original image, and determine the pixel region where the brightness-weighted average value is greater than a preset threshold as the highlight region; An image containing only the highlight areas is generated as the highlight image attachment, and the pixel intensity of the non-highlight areas in the highlight image attachment is set to 0.

3. The method for generating halo effects based on a mobile terminal according to claim 1, characterized in that, The step of performing inverse tone mapping on the highlight image attachment to obtain a brightened image attachment with high dynamic range includes: Using formula The pixel value A(x,y) at each pixel position (x,y) in the highlight image attachment is calculated to obtain the brightened image attachment A. hdr The pixel value A at the corresponding position in the middle hdr (x,y), where A(x,y) represents the pixel value located at coordinates (x,y) in the highlight image attachment, and a, b, c, d, and e represent preset inverse tone mapping coefficients, respectively.

4. The method for generating a halo effect based on a mobile terminal according to claim 1, characterized in that, The step of downsampling the brightened image attachment multiple times to generate multiple downsampled image attachments of different resolutions includes: The brightened image attachment is downsampled for the first time to generate a first downsampled image attachment, wherein the width and height magnification of the downsampled image is 2; The first downsampled image attachment is downsampled a second time to generate a second downsampled image attachment, wherein the width and height magnification of the downsampled image is 2; The second downsampled image attachment is downsampled a third time to generate a third downsampled image attachment, wherein the width and height magnification of the downsampled image is 2.

5. The method for generating a halo effect based on a mobile terminal according to claim 1, characterized in that, The step of upsampling and superimposing each of the blurred image attachments to generate a high dynamic range halo composite attachment includes: Upsample the blurred image attachment, which has a lower resolution than the brightened image attachment, so that the resolution of the blurred image attachment is the same as that of the brightened image attachment; All the blurred image attachments with the same resolution are superimposed to generate the halo composite attachment.

6. The method for generating a halo effect based on a mobile terminal according to claim 1, characterized in that, The step of performing tone mapping processing on the halo composite attachment to obtain a standard halo attachment with a standard dynamic range includes: Using formula For the pixel value B at each pixel position (x, y) in the halo synthesis attachment HDR Calculations were performed using (x, y) to obtain the standard halo attachment B. SDR The pixel value B at the corresponding position in the middle SDR (x,y), where B HDR (x,y) represents the pixel value located at coordinates (x,y) in the halo synthesis attachment, and a, b, c, d, and e represent preset tone mapping coefficients, respectively.

7. The method for generating a halo effect based on a mobile terminal according to claim 1, characterized in that, The step of overlaying the standard halo attachment with the original image based on the highlight image attachment to obtain a halo result image includes: If the pixel value A(x,y) of the highlight image attachment at coordinates (x,y) is 0, then the pixel value of the standard halo attachment at the corresponding coordinates (x,y) is superimposed with the pixel value of the original image at the corresponding coordinates (x,y) to obtain the pixel value of the halo result image at coordinates (x,y). If the pixel value A(x,y) of the highlight image attachment at coordinates (x,y) > 0, then the pixel value of the original image at the corresponding coordinates (x,y) is used as the pixel value of the halo result image at coordinates (x,y).

8. A halo effect generation device based on a mobile terminal, characterized in that, The device includes: A highlight extraction unit is used to acquire the original image and extract the highlight regions from the original image to obtain a highlight image attachment; The first processing unit is used to perform inverse tone mapping processing on the highlight image attachment to obtain a brightened image attachment with high dynamic range; The downsampling unit is used to downsample the brightened image attachment multiple times to generate multiple downsampled image attachments with different resolutions; The blurring unit is used to blur the brightened image attachment and each of the downsampled image attachments respectively to obtain multiple corresponding blurred image attachments; An upsampling unit is used to upsample and superimpose each of the blurred image attachments to generate a high dynamic range halo composite attachment; The second processing unit is used to perform tone mapping processing on the halo synthesis attachment to obtain a standard halo attachment with standard dynamic range. The halo effect generation unit is used to overlay the standard halo attachment with the original image based on the highlight image attachment to obtain a halo result image.

9. A halo effect generation device based on a mobile terminal, characterized in that, The device includes a processor, a memory, and a computer program stored in the memory, the computer program being executed by the processor to implement the steps of a mobile terminal-based halo effect generation method as described in any one of claims 1 to 7.

10. A computer program product, characterized in that, Includes a computer program / instructions, which are executed by a processor to implement the steps of a mobile terminal-based halo effect generation method as described in any one of claims 1 to 7.