Halo effect generation method and device and storage medium
By performing multiple blurring and overlay processes, the problem of high computational cost in generating high-intensity halo effects in existing technologies has been solved, thereby reducing computational costs and equipment performance requirements.
Patent Information
- Application Number
- CN202410917909.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-09
- Publication Date
- 2026-01-09
AI Technical Summary
Existing methods for generating halo effects have high computational costs when adjusting high-intensity halo effects, resulting in excessively high equipment performance requirements.
By performing multiple blurring and overlay processes, the intensity of the target halo effect is gradually approached, reducing the computational cost of each blurring process.
It reduces the computational cost of generating halo effects and decreases the performance requirements of equipment, making it suitable for scenarios with large target halo effect intensity.
Smart Images

Figure CN121304833A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer and network communication technology, and in particular to a method, device and storage medium for generating a halo effect. Background Technology
[0002] In image processing, there are often scenes in images that require the addition of a halo effect. A halo is an image rendering effect that makes the bright parts of an image appear to glow.
[0003] In existing methods for generating halo effects, different halo effects can be presented by adjusting the intensity of the halo effect. However, higher halo effect intensity usually requires higher computational costs, places higher demands on equipment performance, and is prone to performance problems. Summary of the Invention
[0004] This disclosure provides a method, apparatus, and storage medium for generating a halo effect, thereby reducing the computational cost of the halo effect generation process and reducing the equipment requirements.
[0005] In a first aspect, embodiments of this disclosure provide a method for generating a halo effect, comprising:
[0006] Obtain the target halo effect intensity of the original image;
[0007] Based on the target halo effect intensity and the preset mapping relationship, the target parameters for blurring are determined. The blurring parameters include the first target parameters for the first blurring and the second target parameters for the second blurring.
[0008] The original image is subjected to a first blurring process using the first target parameter, and the image after the first blurring process is superimposed on the original image to obtain a first superimposed image;
[0009] The first superimposed image is subjected to a second blurring process using the second target parameter, and the image after the second blurring process is superimposed on the original image to obtain a second superimposed image. Based on the second superimposed image, a target image that satisfies the target halo effect intensity is obtained.
[0010] Secondly, embodiments of this disclosure provide a device for generating a halo effect, comprising:
[0011] The input unit is used to obtain the intensity of the target halo effect in the original image;
[0012] The parameter determination unit is used to determine the target parameters for blurring based on the intensity of the target halo effect and the preset mapping relationship. The parameters for blurring include the first target parameters for the first blurring and the second target parameters for the second blurring.
[0013] The processing unit is configured to perform a first blurring process on the original image using the first target parameter, and superimpose the image after the first blurring process on the original image to obtain a first superimposed image; perform a second blurring process on the first superimposed image using the second target parameter, and superimpose the image after the second blurring process on the original image to obtain a second superimposed image; and obtain a target image that satisfies the target halo effect intensity based on the second superimposed image.
[0014] Thirdly, embodiments of this disclosure provide an electronic device, including: at least one processor and a memory;
[0015] The memory stores computer-executed instructions;
[0016] The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the halo effect generation method as described in the first aspect and various possible designs of the first aspect.
[0017] Fourthly, embodiments of this disclosure provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the halo effect generation method described in the first aspect and various possible designs of the first aspect.
[0018] Fifthly, embodiments of this disclosure provide a computer program product, including computer execution instructions, which, when executed by a processor, implement the halo effect generation method described in the first aspect and various possible designs of the first aspect.
[0019] The halo effect generation method, device, and storage medium provided in this disclosure involve: acquiring the target halo effect intensity of an original image; determining target parameters for blurring based on the target halo effect intensity and a preset mapping relationship, wherein the blurring parameters include a first target parameter for a first blurring process and a second target parameter for a second blurring process; performing a first blurring process on the original image using the first target parameter, and superimposing the image after the first blurring process onto the original image to obtain a first superimposed image; performing a second blurring process on the first superimposed image using the second target parameter, and superimposing the image after the second blurring process onto the original image to obtain a second superimposed image; and obtaining a target image that satisfies the target halo effect intensity based on the second superimposed image. This disclosure achieves the target halo effect intensity through multiple blurring and superimposing processes, reducing the computational cost of each blurring process, thereby reducing the computational cost of the halo effect generation process and reducing the equipment requirements, making it applicable to scenarios with a large target halo effect intensity. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of this disclosure 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 some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is an example image illustrating the generation of a halo effect in existing technology.
[0022] Figure 2 This is a schematic flowchart of a method for generating a halo effect according to an embodiment of the present disclosure;
[0023] Figure 3 A schematic flowchart illustrating a method for generating a halo effect according to another embodiment of this disclosure;
[0024] Figure 4 A structural block diagram of a device for generating a halo effect according to an embodiment of this disclosure;
[0025] Figure 5 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0027] Existing methods for generating halo effects typically involve blurring the original image once, then overlaying the blurred image onto the original image to obtain the target image with the desired halo effect. Different halo effects can be achieved by adjusting the intensity of the halo effect; however, higher halo intensity usually requires higher computational costs, places higher demands on device performance, and is prone to performance issues.
[0028] To address the aforementioned technical problems, this disclosure provides a method for generating a halo effect. Considering that existing technologies only perform one blurring and overlay processing, and if the target halo effect intensity is high, performing only one blurring process consumes a lot of computing resources, resulting in high computational costs and high equipment performance requirements. In this disclosure, multiple blurring and overlay processing are performed to gradually approximate the halo effect that has only undergone one blurring process. The computational cost of each blurring process is low, thereby reducing the computational cost of the halo effect generation process and reducing the equipment requirements.
[0029] Specifically, in this embodiment, the target halo effect intensity of the original image can be obtained; based on the target halo effect intensity and a preset mapping relationship, target parameters for blurring are determined, including a first target parameter for a first blurring and a second target parameter for a second blurring; the original image is subjected to a first blurring using the first target parameter, and the image after the first blurring is superimposed on the original image to obtain a first superimposed image; the first superimposed image is subjected to a second blurring using the second target parameter, and the image after the second blurring is superimposed on the original image to obtain a second superimposed image; a target image satisfying the target halo effect intensity is obtained based on the second superimposed image. This embodiment achieves the target halo effect intensity through multiple blurring and superimposing processes, reducing the computational cost of each blurring process, thereby reducing the computational cost of the halo effect generation process and reducing the equipment requirements, making it suitable for scenarios with a large target halo effect intensity.
[0030] The application scenarios of the halo effect generation method provided in this disclosure are as follows: Figure 1As shown, the method for generating the halo effect can be applied to electronic devices such as terminal devices or servers. First, the original image is acquired. After receiving the setting instruction for the target halo effect intensity of the original image, the target parameters for each blurring process are determined according to the target halo effect intensity and the preset number of blurring processes. Then, based on the original image, iterative processing is performed according to the target parameters for each blurring process to finally obtain a target image that meets the target halo effect intensity. In any iteration process, the image after the previous iteration is blurred using the target parameters for the current blurring process, and the blurred image is superimposed on the original image.
[0031] The method for generating the halo effect of this disclosure will be described in detail below with reference to specific embodiments.
[0032] refer to Figure 2 , Figure 2 This is a schematic flowchart illustrating a method for generating a halo effect according to an embodiment of the present disclosure. The method of this embodiment can be applied to electronic devices such as terminal devices or servers. The method for generating the halo effect includes:
[0033] S201. Obtain the intensity of the target halo effect in the original image.
[0034] In this embodiment, the original image can be obtained in any way, and the original image can be any image, such as a photo, video frame, etc.
[0035] When a user needs to generate a halo effect on the entire original image, they can set the target halo effect intensity. The terminal device or server can obtain the target halo effect intensity according to the setting command. Of course, the target halo effect intensity of the original image can also be obtained through other means.
[0036] S202. Based on the intensity of the target halo effect and the preset mapping relationship, determine the target parameters for blurring. The parameters for blurring include the first target parameters for the first blurring and the second target parameters for the second blurring.
[0037] In this embodiment, considering that the existing methods for generating halo effects typically involve blurring the original image once and then superimposing the blurred image onto the original image, if the target halo effect intensity is large, performing only one blurring operation would consume a lot of computing resources, resulting in high computational costs and high requirements for device performance. Therefore, in this embodiment, multiple blurring and superimposition operations can be performed to gradually approximate the halo effect that has only undergone one blurring operation, thereby reducing the computational cost of each blurring operation and reducing the requirements for the device.
[0038] In this embodiment, the target halo effect intensity is achieved by accumulating the halo effect intensity through multiple blurring and overlay processes. The halo effect intensity accumulated in each blurring and overlay process is mainly determined by the blurring process itself. Therefore, the target parameters required for each blurring process are determined. The target parameters for any blurring process determine the degree of blurring of the image in that blurring process. The target parameters for each blurring process depend on the target halo effect intensity and the number of blurring processes. When the number of blurring processes remains constant, if the target halo effect intensity is increased, the target parameters for each blurring process will increase accordingly. When the target halo effect intensity remains constant, if the number of blurring processes is increased, the target parameters for each blurring process will decrease accordingly. The number of blurring processes can be a preset number of blurring processes, which is the default number of blurring processes. Alternatively, it can be set by the user or modified based on the preset number of blurring processes (for example, receiving a first modification instruction for the preset number of blurring processes and modifying the preset number of blurring processes according to the first modification instruction).
[0039] Optionally, when determining the target parameters for blurring based on the target halo effect intensity and the preset mapping relationship, the specific steps include:
[0040] The default proportional relationship between the target parameters of each fuzzing process is determined based on the preset number of fuzzing processes and the first preset mapping relationship; the first preset mapping relationship is the mapping relationship between different preset number of fuzzing processes and different default proportional relationships.
[0041] The target parameters for each blurring process are determined based on the default proportional relationship between the target halo effect intensity and the target parameters of each blurring process.
[0042] In this embodiment, since the halo effect intensity accumulated through multiple blurring and overlay processes reaches the target halo effect intensity, the target halo effect intensity can be allocated to each blurring and overlay process. Since the halo effect intensity accumulated in each blurring and overlay process is mainly determined by the blurring process itself, the proportional relationship between the target parameters of each blurring process can be obtained. Specifically, a first preset mapping relationship can be pre-configured. This first preset mapping relationship is a mapping relationship between different preset blurring processes and different default proportional relationships. For example, it includes the default proportional relationship between the target parameters of the first and second blurring processes when the preset blurring process count is two, the default proportional relationship between the target parameters of the first, second, and third blurring processes when the preset blurring process count is three, and so on. Furthermore, based on the current preset blurring process count, the default proportional relationship between the target parameters of each blurring process can be queried from the first preset mapping relationship. Then, based on the default proportional relationship between the target parameters of each blurring process, the target halo effect intensity is allocated to each blurring process, thus determining the target parameters of each blurring process.
[0043] For example, if the preset number of blurring operations is two, and the default ratio between the target parameters for each blurring operation is 1:2, then the target parameters for each blurring operation will be adjusted according to the default ratio to ensure that the final halo effect intensity reaches the target halo effect intensity. As another example, if the preset number of blurring operations is three, and the default ratio between the target parameters for each blurring operation is 1:2:3, then the target parameters for each blurring operation will be adjusted according to the default ratio to ensure that the final halo effect intensity reaches the target halo effect intensity.
[0044] Optionally, the magnification factor can be determined based on the target halo effect intensity and a second preset mapping relationship. The second preset mapping relationship is the mapping relationship between different halo effect intensities and different magnification factors under different preset blurring processes. Then, the default proportional relationship between the target parameters of each blurring process is amplified according to the magnification factor to determine the target parameters of each blurring process. For example, in the example above, the current preset blurring process is two times, and the target halo effect intensity is A. The target halo effect intensity can be determined based on the mapping relationship between different halo effect intensities and different magnification factors under the case of two preset blurring processes. The magnification factor corresponding to the degree is 4. The default ratio of 1:2 between the target parameters of the two blurring processes is magnified by 4 times, resulting in target parameters of 4 and 8 for the two blurring processes. For example, if the current preset number of blurring processes is three and the target halo effect intensity is A, the magnification factor corresponding to the target halo effect intensity can be determined to be 2.5 based on the mapping relationship between different halo effect intensities and different magnification factors in the case of three preset blurring processes. The default ratio of 1:2:3 between the target parameters of the three blurring processes is magnified by 2.5 times, resulting in target parameters of 2.5, 5, and 7.5 for the three blurring processes.
[0045] Optionally, after the preset number of fuzzing operations is modified, the default proportional relationship between the target parameters for each fuzzing operation can be re-determined based on the modified preset number of fuzzing operations.
[0046] Of course, in this embodiment, other methods can also be used to determine the target parameters for each blurring process based on the intensity of the target halo effect and the preset number of blurring processes. For example, any possible model (such as a deep learning model, which can be trained to predict the target parameters for each blurring process), any possible algorithm, etc., are not limited in this embodiment.
[0047] S203. The original image is subjected to a first blurring process using the first target parameter, and the image after the first blurring process is superimposed on the original image to obtain a first superimposed image.
[0048] In this embodiment, after determining the target parameters for blurring, blurring and overlay processing can be performed based on the target parameters for each blurring process. That is, iterative processing is performed based on the original image. Blurring and overlay processing are repeated continuously during the iterative processing. In any iteration, the image after the previous iteration is blurred using the target parameters for the current blurring process, and the blurred image is overlaid with the original image.
[0049] In specific implementation, during the first iteration, the first target parameter of the first blurring process is used to perform the first blurring process on the original image, and the image after the first blurring process is superimposed on the original image to obtain the first superimposed image.
[0050] It should be noted that the blurring process in this embodiment can employ any known method, and no restriction is imposed in this embodiment. Similarly, the superposition process in this embodiment can also employ any known method, and no restriction is imposed in this embodiment.
[0051] S204. The first superimposed image is subjected to a second blurring process using the second target parameter, and the image after the second blurring process is superimposed on the original image to obtain a second superimposed image. A target image that satisfies the target halo effect intensity is obtained based on the second superimposed image.
[0052] In this embodiment, after the first iteration is completed, a second iteration is performed. The second target parameter of the second blurring process is used to perform a second blurring on the first superimposed image, and the blurred image is superimposed on the original image to obtain a second superimposed image. If the preset number of blurring operations is only two, the second superimposed image can be directly used as the target image that satisfies the target halo effect intensity, and the iteration process ends. If the preset number of blurring operations is two or more, subsequent iterations are performed based on the second superimposed image to finally obtain the target image that satisfies the target halo effect intensity. For example, if the preset number of blurring operations is three, after the second iteration is completed, a third iteration is performed. The third target parameter is used to perform a third blurring on the second superimposed image, and the blurred image is superimposed on the original image to obtain a third superimposed image. The target image that satisfies the target halo effect intensity is obtained from the third superimposed image; that is, the third superimposed image is directly used as the target image that satisfies the target halo effect intensity, and the iteration process ends. If the preset number of blurring operations is more than three, subsequent iterations are performed based on the third superimposed image to finally obtain the target image that satisfies the target halo effect intensity, and so on. Figure 3 As shown.
[0053] Based on any of the above embodiments, the target parameter for any blurring process is the target radius or target neighborhood size used in that blurring process. When blurring any image using any target parameter, the average or weighted average of pixel values within the target radius or target neighborhood size range around any pixel in any image to be blurred can be obtained as the pixel value of that pixel. By performing the above-mentioned averaging or weighted averaging process on all pixels in the image, blurring can be achieved.
[0054] The halo effect generation method provided in this embodiment obtains the target halo effect intensity of the original image; determines the target parameters for blurring based on the target halo effect intensity and a preset mapping relationship, the blurring parameters including a first target parameter for a first blurring process and a second target parameter for a second blurring process; performs a first blurring process on the original image using the first target parameter, and superimposes the image after the first blurring process on the original image to obtain a first superimposed image; performs a second blurring process on the first superimposed image using the second target parameter, and superimposes the image after the second blurring process on the original image to obtain a second superimposed image; and obtains a target image that satisfies the target halo effect intensity based on the second superimposed image. This embodiment achieves the target halo effect intensity through multiple blurring and superimposing processes, reducing the computational cost of each blurring process, thereby reducing the computational cost of the halo effect generation process and reducing the equipment requirements, making it applicable to scenarios with a large target halo effect intensity.
[0055] In any of the above embodiments, the preset number of fuzzing operations can be modified by the user, and the target parameter of any fuzzing operation can also be modified by the user. Specifically, a second modification instruction for the target parameter of any fuzzing operation can be received, the target parameter of the current fuzzing operation can be modified according to the second modification instruction, and the modified target parameter can be determined as the final target parameter of the current fuzzing operation, thereby improving the flexibility of parameter setting.
[0056] Corresponding to the halo effect generation method in the above embodiments, Figure 4 This is a structural block diagram of a device for generating halo effects according to an embodiment of the present disclosure. For ease of explanation, only the parts relevant to the embodiments of the present disclosure are shown. (Refer to...) Figure 4 The halo effect generating device 400 includes: an input unit 401, a parameter determination unit 402, and a processing unit 403.
[0057] The input unit 401 is used to obtain the intensity of the target halo effect in the original image;
[0058] The parameter determination unit 402 is used to determine the target parameters for blurring based on the target halo effect intensity and the preset mapping relationship. The parameters for blurring include the first target parameters for the first blurring and the second target parameters for the second blurring.
[0059] Processing unit 403 is configured to perform a first blurring process on the original image using the first target parameter, and then superimpose the image after the first blurring process on the original image to obtain a first superimposed image; perform a second blurring process on the first superimposed image using the second target parameter, and then superimpose the image after the second blurring process on the original image to obtain a second superimposed image; and obtain a target image that satisfies the target halo effect intensity based on the second superimposed image.
[0060] In one or more embodiments of this disclosure, the parameters of the fuzzing process further include a third target parameter of the third fuzzing process;
[0061] Accordingly, when the processing unit 403 obtains a target image that satisfies the target halo effect intensity based on the second superimposed image, it is used to:
[0062] The second superimposed image is subjected to a third blurring process using the third target parameter, and the image after the third blurring process is superimposed on the original image to obtain a third superimposed image. Based on the third superimposed image, a target image that satisfies the target halo effect intensity is obtained.
[0063] In one or more embodiments of this disclosure, when the parameter determination unit 402 determines the target parameters for blurring based on the target halo effect intensity and a preset mapping relationship, it is used to:
[0064] The default proportional relationship between the target parameters of each fuzzing process is determined based on the preset number of fuzzing processes and the first preset mapping relationship; the first preset mapping relationship is the mapping relationship between different preset number of fuzzing processes and different default proportional relationships.
[0065] The target parameters for each blurring process are determined based on the default proportional relationship between the target halo effect intensity and the target parameters of each blurring process.
[0066] In one or more embodiments of this disclosure, when the parameter determination unit 402 determines the target parameters for each blurring process based on the default proportional relationship between the target halo effect intensity and the target parameters for each blurring process, it is used to:
[0067] The magnification factor is determined based on the target halo effect intensity and the second preset mapping relationship. The default ratio between the target parameters of each blurring process is amplified based on the magnification factor to determine the target parameters of each blurring process. The second preset mapping relationship is the mapping relationship between different halo effect intensities and different magnification factors under different preset blurring processes.
[0068] In one or more embodiments of this disclosure, the parameter determination unit 402 is further configured to:
[0069] The system receives a first modification instruction for the preset number of fuzzing processes, modifies the preset number of fuzzing processes according to the first modification instruction, and redetermines the target parameters for each fuzzing process based on the modified preset number of fuzzing processes.
[0070] In one or more embodiments of this disclosure, the parameter determination unit 402, when determining the target parameters for fuzzy processing, is further configured to:
[0071] Receive a second modification instruction for the target parameter of any fuzzing process, modify the target parameter of the fuzzing process according to the second modification instruction, and determine the modified target parameter as the final target parameter of the fuzzing process.
[0072] In one or more embodiments of this disclosure, the target parameter for any fuzzing process is the target radius or target neighborhood size used in the fuzzing process;
[0073] Accordingly, when blurring any image using any target parameter, the processing unit 403 is used to:
[0074] For any pixel in any image, obtain the average or weighted average of the pixel values within the target radius or target neighborhood size range around the pixel, and use it as the pixel value of the pixel.
[0075] The device provided in this embodiment can be used to execute the technical solutions of the above method embodiments. Its implementation principle and technical effect are similar, and will not be described again here.
[0076] refer to Figure 5 The diagram illustrates a structural schematic of an electronic device 500 suitable for implementing embodiments of the present disclosure. The electronic device 500 can be a terminal device or a server. The terminal device can include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, personal digital assistants (PDAs), portable Android devices (PADs), portable media players (PMPs), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0077] like Figure 5As shown, the electronic device 500 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the electronic device 500. The processing unit 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0078] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 509. Communication device 509 allows electronic device 500 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 An electronic device 500 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0079] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, it performs the functions defined in the methods of embodiments of this disclosure.
[0080] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0081] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0082] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.
[0083] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0084] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0085] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".
[0086] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0087] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0088] In a first aspect, according to one or more embodiments of this disclosure, a method for generating a halo effect is provided, comprising:
[0089] Obtain the target halo effect intensity of the original image;
[0090] Based on the target halo effect intensity and the preset mapping relationship, the target parameters for blurring are determined. The blurring parameters include the first target parameters for the first blurring and the second target parameters for the second blurring.
[0091] The original image is subjected to a first blurring process using the first target parameter, and the image after the first blurring process is superimposed on the original image to obtain a first superimposed image;
[0092] The first superimposed image is subjected to a second blurring process using the second target parameter, and the image after the second blurring process is superimposed on the original image to obtain a second superimposed image. Based on the second superimposed image, a target image that satisfies the target halo effect intensity is obtained.
[0093] According to one or more embodiments of this disclosure, the parameters of the fuzzing process further include a third target parameter of the third fuzzing process;
[0094] Accordingly, obtaining a target image that satisfies the target halo effect intensity based on the second superimposed image includes:
[0095] The second superimposed image is subjected to a third blurring process using the third target parameter, and the image after the third blurring process is superimposed on the original image to obtain a third superimposed image. Based on the third superimposed image, a target image that satisfies the target halo effect intensity is obtained.
[0096] According to one or more embodiments of this disclosure, determining the target parameters for blurring based on the target halo effect intensity and a preset mapping relationship includes:
[0097] The default proportional relationship between the target parameters of each fuzzing process is determined based on the preset number of fuzzing processes and the first preset mapping relationship; the first preset mapping relationship is the mapping relationship between different preset number of fuzzing processes and different default proportional relationships.
[0098] The target parameters for each blurring process are determined based on the default proportional relationship between the target halo effect intensity and the target parameters of each blurring process.
[0099] According to one or more embodiments of this disclosure, determining the target parameters for each blurring process based on the default proportional relationship between the target halo effect intensity and the target parameters of each blurring process includes:
[0100] The magnification factor is determined based on the target halo effect intensity and the second preset mapping relationship. The default ratio between the target parameters of each blurring process is amplified based on the magnification factor to determine the target parameters of each blurring process. The second preset mapping relationship is the mapping relationship between different halo effect intensities and different magnification factors under different preset blurring processes.
[0101] According to one or more embodiments of this disclosure, the method further includes:
[0102] The system receives a first modification instruction for the preset number of fuzzing processes, modifies the preset number of fuzzing processes according to the first modification instruction, and redetermines the target parameters for each fuzzing process based on the modified preset number of fuzzing processes.
[0103] According to one or more embodiments of this disclosure, determining the target parameters for fuzzing further includes:
[0104] Receive a second modification instruction for the target parameter of any fuzzing process, modify the target parameter of the fuzzing process according to the second modification instruction, and determine the modified target parameter as the final target parameter of the fuzzing process.
[0105] According to one or more embodiments of this disclosure, the target parameter of any fuzzing process is the target radius or target neighborhood size used in the fuzzing process;
[0106] Accordingly, when blurring any image using any target parameter, the process includes:
[0107] For any pixel in any image, obtain the average or weighted average of the pixel values within the target radius or target neighborhood size range around the pixel, and use it as the pixel value of the pixel.
[0108] Secondly, according to one or more embodiments of this disclosure, a device for generating a halo effect is provided, comprising:
[0109] The input unit is used to obtain the intensity of the target halo effect in the original image;
[0110] The parameter determination unit is used to determine the target parameters for blurring based on the intensity of the target halo effect and the preset mapping relationship. The parameters for blurring include the first target parameters for the first blurring and the second target parameters for the second blurring.
[0111] The processing unit is configured to perform a first blurring process on the original image using the first target parameter, and superimpose the image after the first blurring process on the original image to obtain a first superimposed image; perform a second blurring process on the first superimposed image using the second target parameter, and superimpose the image after the second blurring process on the original image to obtain a second superimposed image; and obtain a target image that satisfies the target halo effect intensity based on the second superimposed image.
[0112] According to one or more embodiments of this disclosure, the parameters of the fuzzing process further include a third target parameter of the third fuzzing process;
[0113] Accordingly, when the processing unit obtains a target image that satisfies the target halo effect intensity based on the second superimposed image, it is used to:
[0114] The second superimposed image is subjected to a third blurring process using the third target parameter, and the image after the third blurring process is superimposed on the original image to obtain a third superimposed image. Based on the third superimposed image, a target image that satisfies the target halo effect intensity is obtained.
[0115] According to one or more embodiments of this disclosure, when the parameter determining unit determines the target parameters for blurring based on the target halo effect intensity and a preset mapping relationship, it is used to:
[0116] The default proportional relationship between the target parameters of each fuzzing process is determined based on the preset number of fuzzing processes and the first preset mapping relationship; the first preset mapping relationship is the mapping relationship between different preset number of fuzzing processes and different default proportional relationships.
[0117] The target parameters for each blurring process are determined based on the default proportional relationship between the target halo effect intensity and the target parameters of each blurring process.
[0118] According to one or more embodiments of this disclosure, when the parameter determination unit determines the target parameters for each blurring process based on the default proportional relationship between the target halo effect intensity and the target parameters of each blurring process, it is configured to:
[0119] The magnification factor is determined based on the target halo effect intensity and the second preset mapping relationship. The default ratio between the target parameters of each blurring process is amplified based on the magnification factor to determine the target parameters of each blurring process. The second preset mapping relationship is the mapping relationship between different halo effect intensities and different magnification factors under different preset blurring processes.
[0120] According to one or more embodiments of this disclosure, the parameter determining unit is further configured to:
[0121] The system receives a first modification instruction for the preset number of fuzzing processes, modifies the preset number of fuzzing processes according to the first modification instruction, and redetermines the target parameters for each fuzzing process based on the modified preset number of fuzzing processes.
[0122] According to one or more embodiments of this disclosure, the parameter determination unit, when determining the target parameters for fuzzy processing, is further configured to:
[0123] Receive a second modification instruction for the target parameter of any fuzzing process, modify the target parameter of the fuzzing process according to the second modification instruction, and determine the modified target parameter as the final target parameter of the fuzzing process.
[0124] According to one or more embodiments of this disclosure, the target parameter of any fuzzing process is the target radius or target neighborhood size used in the fuzzing process;
[0125] Accordingly, when the processing unit performs blurring processing on any image using any target parameter, it is used to:
[0126] For any pixel in any image, obtain the average or weighted average of the pixel values within the target radius or target neighborhood size range around the pixel, and use it as the pixel value of the pixel.
[0127] Thirdly, according to one or more embodiments of the present disclosure, an electronic device is provided, comprising: at least one processor and a memory;
[0128] The memory stores computer-executed instructions;
[0129] The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the halo effect generation method as described in the first aspect and various possible designs of the first aspect.
[0130] Fourthly, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, wherein computer-executable instructions are stored therein, and when a processor executes the computer-executable instructions, the method for generating the halo effect as described in the first aspect and various possible designs of the first aspect is implemented.
[0131] Fifthly, according to one or more embodiments of the present disclosure, a computer program product is provided, including computer execution instructions, which, when executed by a processor, implement the halo effect generation method described in the first aspect and various possible designs of the first aspect.
[0132] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0133] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0134] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A method for generating a halo effect, characterized in that, include: Obtain the target halo effect intensity of the original image; Based on the target halo effect intensity and the preset mapping relationship, the target parameters for blurring are determined. The blurring parameters include the first target parameters for the first blurring and the second target parameters for the second blurring. The original image is subjected to a first blurring process using the first target parameter, and the image after the first blurring process is superimposed on the original image to obtain a first superimposed image; The first superimposed image is subjected to a second blurring process using the second target parameter, and the image after the second blurring process is superimposed on the original image to obtain a second superimposed image. Based on the second superimposed image, a target image that satisfies the target halo effect intensity is obtained.
2. The method according to claim 1, characterized in that, The parameters for the fuzzing process also include the third target parameter of the third fuzzing process; Accordingly, obtaining a target image that satisfies the target halo effect intensity based on the second superimposed image includes: The second superimposed image is subjected to a third blurring process using the third target parameter, and the image after the third blurring process is superimposed on the original image to obtain a third superimposed image. Based on the third superimposed image, a target image that satisfies the target halo effect intensity is obtained.
3. The method according to claim 1 or 2, characterized in that, The step of determining the target parameters for blurring based on the target halo effect intensity and a preset mapping relationship includes: The default proportional relationship between the target parameters of each fuzzing process is determined based on the preset number of fuzzing processes and the first preset mapping relationship; the first preset mapping relationship is the mapping relationship between different preset number of fuzzing processes and different default proportional relationships. The target parameters for each blurring process are determined based on the default proportional relationship between the target halo effect intensity and the target parameters of each blurring process.
4. The method according to claim 3, characterized in that, The step of determining the target parameters for each blurring process based on the default proportional relationship between the target halo effect intensity and the target parameters of each blurring process includes: The magnification factor is determined based on the target halo effect intensity and the second preset mapping relationship. The default ratio between the target parameters of each blurring process is amplified based on the magnification factor to determine the target parameters of each blurring process. The second preset mapping relationship is the mapping relationship between different halo effect intensities and different magnification factors in different preset blurring processes.
5. The method according to claim 3, characterized in that, The method further includes: The system receives a first modification instruction for the preset number of fuzzing processes, modifies the preset number of fuzzing processes according to the first modification instruction, and redetermines the target parameters for each fuzzing process based on the modified preset number of fuzzing processes.
6. The method according to claim 1 or 2, characterized in that, The determination of the target parameters for fuzzy processing further includes: Receive a second modification instruction for the target parameter of any fuzzing process, modify the target parameter of the fuzzing process according to the second modification instruction, and determine the modified target parameter as the final target parameter of the fuzzing process.
7. The method according to claim 1 or 2, characterized in that, The target parameter for any fuzzing process is the target radius or target neighborhood size used in the fuzzing process. Accordingly, when blurring any image using any target parameter, the process includes: For any pixel in any image, obtain the average or weighted average of the pixel values within the target radius or target neighborhood size range around the pixel, and use it as the pixel value of the pixel.
8. A device for generating a halo effect, characterized in that, include: The input unit is used to obtain the intensity of the target halo effect in the original image; The parameter determination unit is used to determine the target parameters for blurring based on the intensity of the target halo effect and the preset mapping relationship. The parameters for blurring include the first target parameters for the first blurring and the second target parameters for the second blurring. The processing unit is configured to perform a first blurring process on the original image using the first target parameter, and then superimpose the image after the first blurring process onto the original image to obtain a first superimposed image; The first superimposed image is subjected to a second blurring process using the second target parameter, and the image after the second blurring process is superimposed on the original image to obtain a second superimposed image. Based on the second superimposed image, a target image that satisfies the target halo effect intensity is obtained.
9. An electronic device, characterized in that, include: At least one processor and memory; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the method as described in any one of claims 1-7.
11. A computer program product, characterized in that, Includes computer execution instructions, which, when executed by a processor, implement the method as described in any one of claims 1-7.