Image processing method, apparatus and electronic device

CN115546376BActive Publication Date: 2026-10-30GUANGZHOU HUYA INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211239261.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-11
Publication Date
2026-10-30
Estimated Expiration
2042-10-11

AI Technical Summary

Technical Problem

但是,人工进行图像处理成本高,且生成效率低,难以满足海量多样化的风格化贴图生成需求

Benefits of technology

[0041]本申请实施例提供的一种图像处理方法、装置及电子设备,通过对待处理图像进行滤波、灰度转换及明度调整处理,然后根据前序处理后各像素的灰度值确定相应的噪声添加参数并进行噪声叠加处理,从而可以实现自动地根据所述待处理图像内容为所述待处理图像添加烟雾效果,提高了图像风格化处理的效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115546376B_ABST
    Figure CN115546376B_ABST
Patent Text Reader

Abstract

The application provides an image processing method, device and electronic equipment, which can automatically add smoke effect to a to-be-processed image according to the content of the to-be-processed image, and improve the efficiency of image stylization processing, by filtering, gray scale conversion and brightness adjustment processing on the to-be-processed image, then determining corresponding noise adding parameters according to the gray scale values of each pixel after the previous processing and performing noise superposition processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing, and more specifically, to an image processing method, apparatus, and electronic device. Background Technology

[0002] In some virtual avatar customization processes, users may need to customize virtual clothing textures in a specific style according to their needs. Currently, image processing for certain styles typically relies on manual image adjustments or compositing, such as applying smoke effects to images. However, manual image processing is costly and inefficient, making it difficult to meet the demand for generating massive amounts of diverse stylized textures. Summary of the Invention

[0003] To overcome the aforementioned shortcomings in the prior art, the purpose of this application is to provide an image processing method, the method comprising:

[0004] Obtain the image to be processed;

[0005] The image to be processed is filtered to obtain a first intermediate image;

[0006] The first intermediate image is converted to grayscale to obtain the second intermediate image;

[0007] The brightness of the second intermediate image is adjusted by reducing the brightness of the high-brightness parts and increasing the brightness of the low-brightness parts to obtain a third intermediate image.

[0008] Based on the grayscale value of each pixel in the third intermediate image, determine the noise addition parameters corresponding to each pixel;

[0009] The noise is superimposed on each pixel in the third intermediate image according to the noise addition parameters to obtain the result image.

[0010] In one possible implementation, the noise addition parameters include the probability, variance, mean, and / or the clipping value of the noise; the step of determining the noise addition parameters corresponding to each pixel based on the grayscale value of each pixel in the third intermediate image includes:

[0011] Calculate the absolute value of the difference between the grayscale value of each pixel in the third intermediate image and the preset grayscale reference value;

[0012] The probability, variance, mean, and / or clipping value of the noise are determined based on the absolute value, wherein the larger the absolute value, the smaller the probability, variance, mean, and / or clipping value of the noise.

[0013] In one possible implementation, the step of filtering the image to be processed to obtain a first intermediate image includes:

[0014] Image content recognition is performed on the image to be processed to determine whether the image to be processed contains a preset target.

[0015] If the image to be processed is an image containing a preset target, then the target region where the preset target is located and the non-target region other than the target region in the image to be processed are determined.

[0016] The image of the target region is extracted and sharpened using a high-pass filter to obtain the first segmented image;

[0017] The image of the non-target region is extracted and subjected to low-pass filtering to obtain a second segmented image;

[0018] The first segmented image and the second segmented image are fused to obtain the first intermediate image.

[0019] In one possible implementation, the step of fusing the first segmented image and the second segmented image includes:

[0020] The edge contours of the first segmented image and the second segmented image are smoothed, and the processed first segmented image and the second segmented image are then merged.

[0021] In one possible implementation, image content recognition is performed on the image to be processed;

[0022] If the image to be processed is a landscape image, then the edge information of the image to be processed is determined by an edge detection algorithm;

[0023] Based on the edge information, the image to be processed is subjected to edge detail removal and edge softening processing to obtain an edge-softened image;

[0024] The edge-softened image is subjected to low-pass filtering to obtain the first intermediate image;

[0025] Before the step of performing noise superposition processing on each pixel in the third intermediate image according to the noise addition parameters to obtain the result image, the method includes:

[0026] The edge-softened image and the second intermediate image are then subjected to transparency fusion processing to obtain the second intermediate image after blending.

[0027] In one possible implementation, the step of adjusting the brightness of the second intermediate image includes:

[0028] The brightness of the second intermediate image is adjusted according to a preset brightness reference curve, so that the adjusted brightness curve of the second intermediate image tends to the brightness reference curve. The brightness improvement rate corresponding to the low brightness area in the brightness reference curve is greater than 1, and the brightness improvement rate corresponding to the high brightness area is less than 1.

[0029] In one possible implementation, the method further includes:

[0030] The resulting image is rendered onto a preset 3D clothing model to obtain a 3D clothing texture.

[0031] Another object of this application is to provide an image processing apparatus, the apparatus comprising:

[0032] The image acquisition module is used to acquire the image to be processed.

[0033] The filtering module is used to filter the image to be processed to obtain a first intermediate image;

[0034] A grayscale conversion module is used to convert the first intermediate image to grayscale to obtain a second intermediate image;

[0035] The brightness adjustment module is used to adjust the brightness of the second intermediate image, reduce the brightness of the high-brightness parts of the second intermediate image, and increase the brightness of the low-brightness parts of the second intermediate image to obtain a third intermediate image.

[0036] The noise determination module is used to determine the noise addition parameters corresponding to each pixel based on the grayscale value of each pixel in the third intermediate image.

[0037] The noise addition module is used to perform noise superposition processing on each pixel in the third intermediate image according to the noise addition parameters to obtain the result image.

[0038] Another object of this application is to provide an electronic device, including a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions, which, when executed by the processor, implement the image processing method provided in this application.

[0039] Another objective of this application is to provide a machine-readable storage medium storing machine-executable instructions that, when executed by one or more processors, implement the image processing method provided in this application.

[0040] Compared with the prior art, this application has the following beneficial effects:

[0041] This application provides an image processing method, apparatus, and electronic device that performs filtering, grayscale conversion, and brightness adjustment on the image to be processed. Then, based on the grayscale values ​​of each pixel after the previous processing, it determines the corresponding noise addition parameters and performs noise superposition processing. This enables the automatic addition of a smoke effect to the image to be processed according to its content, thereby improving the efficiency of image stylization processing. Attached Figure Description

[0042] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0043] Figure 1 This is a flowchart illustrating the steps of the image processing method provided in the embodiments of this application;

[0044] Figure 2 A schematic diagram of the image to be processed provided in an embodiment of this application;

[0045] Figure 3 A schematic diagram of the resulting images provided in the embodiments of this application;

[0046] Figure 4 This is one of the flowcharts illustrating the sub-steps of step S120;

[0047] Figure 5 This is the second flowchart illustrating the sub-steps of step S120;

[0048] Figure 6 A schematic diagram of a brightness reference curve provided for an embodiment of this application;

[0049] Figure 7 A schematic diagram of an electronic device provided in an embodiment of this application;

[0050] Figure 8 This is a schematic diagram of the functional modules of the image processing apparatus provided in the embodiments of this application. Detailed Implementation

[0051] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0052] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0053] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0054] In the description of this application, it should be noted that the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0055] In the description of this application, it should also be noted that, unless otherwise expressly specified and limited, the terms "set up," "install," "connect," and "link" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.

[0056] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating the steps of an image processing method provided in this embodiment. The method will be described in detail below.

[0057] Step S110: Obtain the image to be processed.

[0058] In this embodiment, the image to be processed can be an image that needs to be smoked, such as a landscape image, a portrait image, or an animal image.

[0059] Step S120: Filter the image to be processed to obtain a first intermediate image.

[0060] In this embodiment, different image processing effects can be obtained by using specific filtering methods. For example, using high-pass filtering for degradation processing can improve image contrast and increase image expressiveness; using low-pass filtering can reduce image details and noise, thereby reducing image contrast.

[0061] Step S130: Convert the first intermediate image to grayscale to obtain the second intermediate image.

[0062] In this embodiment, subsequent image smoking requires adding noise based on the brightness information of the grayscale image. Therefore, in this step, the first intermediate image can be converted into a grayscale second intermediate image.

[0063] Step S140: Adjust the brightness of the second intermediate image by reducing the brightness of the high-brightness portion of the second intermediate image and increasing the brightness of the low-brightness portion of the second intermediate image to obtain a third intermediate image.

[0064] In this embodiment, image areas with pixel brightness higher than a preset brightness (corresponding to high-brightness regions) can be adjusted by reducing their brightness, while image areas with pixel brightness lower than the preset brightness (corresponding to low-brightness regions) can be adjusted by increasing their brightness. By reducing the brightness of high-brightness regions and increasing the brightness of low-brightness regions, the overall brightness difference of the image can be reduced, thereby improving the hazy effect of the smoky image processing.

[0065] Step S150: Determine the noise addition parameters corresponding to each pixel based on the grayscale value of each pixel in the third intermediate image.

[0066] In this embodiment, the noise addition parameters include the noise probability, variance, mean, and / or the noise clipping value. Since applying the same level of noise addition parameters to both white and black image portions will have a more noticeable effect, in step S150, the absolute value of the difference between the grayscale value of each pixel in the third intermediate image and a preset grayscale reference value can be calculated. Then, the noise probability, variance, mean, and / or clipping value are determined based on the absolute value, wherein a larger absolute value corresponds to a smaller noise probability, variance, mean, and / or noise clipping value.

[0067] For example, the grayscale value of a pixel is typically in the range of 0 to 255. In this embodiment, the absolute value of the difference between the grayscale value of each pixel in the third intermediate image and 128 can be calculated. The larger the absolute value, the smaller the noise addition parameter.

[0068] Optionally, in order to avoid the noise addition parameters being too large and affecting the final image processing effect, in this embodiment, after determining the noise addition parameters of each pixel, all noise addition parameters greater than the set threshold are set to the set threshold.

[0069] Step S160: Perform noise superposition processing on each pixel in the third intermediate image according to the noise addition parameters to obtain the result image.

[0070] In this embodiment, a preset noise generation algorithm can be used to perform noise superposition processing on the third intermediate image according to the noise addition parameters, ultimately forming a result image with a smoke effect. For example, please refer to... Figure 2 and Figure 3 The method provided in this embodiment can be used for, for example Figure 2 The image to be processed, as shown, undergoes a smoke effect processing, transforming it into something like... Figure 3 The resulting image is shown.

[0071] Through the above steps, the image to be processed can be automatically smoky based on its content, improving the efficiency of image processing and generating a large number of user-customized smoky style images.

[0072] In this embodiment, different filtering processes can be performed on different image contents.

[0073] For example, please refer to Figure 4 In one possible implementation, step S120 may include the following sub-steps S201-S205.

[0074] Step S201: Perform image content recognition on the image to be processed to determine whether the image to be processed contains a preset target. The preset target may include predefined people, animals, or specific objects (such as vehicles or buildings).

[0075] Step S202: If the image to be processed is an image containing a preset target, then determine the target region where the preset target is located and the non-target region other than the target region in the image to be processed.

[0076] For example, image recognition can be performed using a pre-trained image recognition model or image semantic segmentation model, simultaneously determining the target region and non-target regions. The target region can be a foreground image region that includes the preset target, and the non-target region can be a background image region that does not include the preset target.

[0077] Step S203: Extract the image of the target region and perform high-pass filtering and sharpening processing to obtain the first segmented image.

[0078] Step S204: Extract the image of the non-target region and perform low-pass filtering to obtain the second segmented image.

[0079] In this embodiment, by applying high-pass filtering to the image of the target area, the contrast of the preset target image can be improved, thereby increasing its contrast performance. Applying low-pass filtering to the image of the non-target area can reduce the texture details and noise in the background, thereby reducing the background contrast and preventing the background from being too cluttered and disturbing the subject.

[0080] Step S205: Fuse the first segmented image and the second segmented image to obtain the first intermediate image.

[0081] Furthermore, to avoid differences in boundary contours after the foreground and background images are synthesized, multiple low-pass filtering processes can be applied to the boundary between the target region and the non-target region during image fusion, based on the mask image used when extracting the target region or the non-target region, thereby softening the boundary between the target region and the non-target region.

[0082] In another possible implementation, please see Figure 5 Step S120 may include the following sub-steps S301-S304.

[0083] Step S301: Perform image content recognition on the image to be processed to determine whether the image to be processed is a landscape image.

[0084] In this embodiment, a preset image content recognition model can be used to perform image content recognition on the image to be processed, thereby determining whether the image to be processed is a landscape image.

[0085] Step S302: If the image to be processed is a landscape image, then the edge information of the image to be processed is determined by an edge detection algorithm.

[0086] Step S303: Based on the edge information, perform edge detail removal and edge softening processing on the image to be processed to obtain an edge-softened image.

[0087] Step S304: Perform low-pass filtering on the edge-softened image to obtain the first intermediate image.

[0088] Specifically, since landscape images have many texture details and the main image is not very prominent, in this embodiment, the image edge information of the landscape content can first be determined using an edge detection algorithm (e.g., the Deepedge algorithm). Then, based on the image edge information, the details of the edge parts are reduced, and unimportant edges are removed using image shrinkage. Next, multiple low-pass filters can be applied to the edge image to obtain an edge-softened image. The edge-softened image is then subjected to low-pass filtering again to reduce high-frequency noise, finally obtaining the first intermediate image.

[0089] Then, in step S150, noise superposition processing is performed on each pixel in the third intermediate image according to the noise addition parameters. Before obtaining the result image, the edge-softened image and the second intermediate image can be subjected to alpha blending processing to obtain the second intermediate image after blending.

[0090] In one possible implementation, in step S140, the brightness of the second intermediate image can be adjusted according to a preset brightness reference curve, so that the adjusted brightness curve of the second intermediate image tends to the brightness reference curve, wherein the brightness enhancement rate corresponding to the low brightness area in the brightness reference curve is greater than 1, and the brightness enhancement rate corresponding to the high brightness area is less than 1.

[0091] For example, please refer to Figure 6 , Figure 6 This is a schematic diagram of a possible brightness reference curve. In this embodiment, the brightness curve of the second intermediate image can be adjusted based on the brightness reference curve so that the brightness curve of the second intermediate image tends to the brightness reference curve.

[0092] Specifically, in this embodiment, a reference image can be determined first, and then the following can be obtained based on the reference image: Figure 3 The brightness reference curve shown has four points by default (p1, p2, p3, p4 from left to right). When adjusting the brightness curve of the second intermediate image, curve fitting can be performed based on these four points to make the brightness curve of the second intermediate image tend towards the brightness reference curve. Furthermore, considering the different brightness levels of different images, when the number of pixels with a gray value less than 128 in the second intermediate image is n, and the number of pixels with a gray value less than 128 in the reference image is ns, the x-coordinate of p2 can be scaled down to the corresponding scaling ratio (1 + ns / n) / 2.

[0093] In some possible implementations, after step S150, the resulting image can also be rendered onto a preset 3D clothing model to obtain a 3D clothing texture.

[0094] Specifically, the image of the target region can be extracted first based on the previous image recognition results. Then, the color information of the image of the target region can be quantized by the Modified Median Cut Quantization (MMCQ) algorithm. Based on the quantization results, a color scheme (such as a color palette) corresponding to the target region can be determined. The color scheme includes multiple selectable colors.

[0095] Next, a preset 3D clothing model can be determined, such as stripes, polo shirts, jackets, etc., and multiple optional colors can be selected from the color scheme to color the preset 3D clothing model.

[0096] Then, the resulting image can be rendered onto the preset clothing 3D model according to the outline rendering rules corresponding to the preset clothing 3D model.

[0097] In this way, the image to be processed can be automatically smoked and the resulting image after smoked processing can be rendered onto the preset clothing 3D model, which greatly improves the generation efficiency of 3D clothing textures and can handle the generation of massive amounts of user-personalized 3D clothing textures.

[0098] Optionally, in this embodiment, the corresponding text to be displayed can be determined based on the content recognition result of the image to be processed. Then, the text display range, text size, etc., can be determined based on the preset clothing 3D model, the text color can be determined based on the color scheme, and a corresponding text image can be generated. When the result image is rendered onto the preset clothing 3D model, the text image can be rendered onto the preset clothing 3D model simultaneously.

[0099] In some possible implementations, the method can run on a server, where in step S110 the server can obtain an image uploaded by the user from the user terminal as the image to be processed, or use an image selected by the user through the terminal as the image to be processed.

[0100] For example, when a user needs to personalize their virtual avatar with clothing, they can upload an image or select one from a preset image set to be displayed on the virtual clothing via their user terminal. The server can then use the uploaded or selected image as the image to be processed and... Figure 1 The steps shown perform image processing on the image to be processed to add a smoke effect to the image.

[0101] Based on the same inventive concept, this embodiment also provides an electronic device, which can be a device with certain image processing capabilities, such as a personal computer, a server, a server cluster, etc. Please refer to... Figure 7 , Figure 7 This is a block diagram of the electronic device 100 provided in this embodiment. The electronic device 100 includes an image processing device 110, a machine-readable storage medium 120, and a processor 130.

[0102] The machine-readable storage medium 120, processor 130, and communication unit 140 are electrically connected directly or indirectly to each other to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines. The image processing device 110 includes at least one software function module that can be stored in the machine-readable storage medium 120 in the form of software or firmware or embedded in the operating system (OS) of the electronic device 100. The processor 130 is used to execute the executable modules stored in the machine-readable storage medium 120, such as the software function modules and computer programs included in the image processing device 110.

[0103] The machine-readable storage medium 120 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc. The machine-readable storage medium 120 is used to store a program, which the processor 130 executes upon receiving an execution instruction.

[0104] The processor 130 may be an integrated circuit chip with signal processing capabilities. The aforementioned processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application-Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor.

[0105] Please refer to Figure 8This embodiment also provides an image processing device 110, which includes at least one functional module that can be stored in a machine-readable storage medium 120 in software form. Functionally, the image processing device 110 may include an image acquisition module 111, a filtering module 112, a grayscale conversion module 113, a brightness adjustment module 114, a noise determination module 115, and a noise addition module 116.

[0106] The image acquisition module 111 is used to acquire the image to be processed.

[0107] In this embodiment, the image acquisition module 111 can be used to perform... Figure 1 For a detailed description of the image acquisition module 111 shown in step S110, please refer to the description of step S110.

[0108] The filtering module 112 is used to filter the image to be processed to obtain a first intermediate image.

[0109] In this embodiment, the filtering module 112 can be used to perform... Figure 1 For a detailed description of the filtering module 112, see the description of step S120 shown.

[0110] The grayscale conversion module 113 is used to convert the first intermediate image to grayscale to obtain a second intermediate image.

[0111] In this embodiment, the grayscale conversion module 113 can be used to perform... Figure 1 For a detailed description of the grayscale conversion module 113 shown in step S130, please refer to the description of step S130.

[0112] The brightness adjustment module 114 is used to adjust the brightness of the second intermediate image, reduce the brightness of the high-brightness part of the second intermediate image, and increase the brightness of the low-brightness part of the second intermediate image to obtain a third intermediate image.

[0113] In this embodiment, the brightness adjustment module 114 can be used to perform... Figure 1 For a detailed description of the brightness adjustment module 114 shown in step S140, please refer to the description of step S140.

[0114] The noise determination module 115 is used to determine the noise addition parameters corresponding to each pixel based on the grayscale value of each pixel in the third intermediate image.

[0115] In this embodiment, the noise determination module 115 can be used to perform... Figure 1For a detailed description of the noise determination module 115 shown in step S150, please refer to the description of step S150.

[0116] The noise addition module 116 is used to perform noise superposition processing on each pixel in the third intermediate image according to the noise addition parameters to obtain the result image.

[0117] In this embodiment, the noise addition module 116 can be used to perform... Figure 1 For a detailed description of the noise addition module 116 shown in step S160, please refer to the description of step S160.

[0118] In summary, the image processing method, apparatus, and electronic device provided in this application can automatically add a smoke effect to the image to be processed according to the content of the image, thereby improving the efficiency of image stylization processing by filtering, grayscale conversion, and brightness adjustment of the image to be processed, and then determining the corresponding noise addition parameters based on the grayscale values ​​of each pixel after the previous processing and performing noise superposition processing.

[0119] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. 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 marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive 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 a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0120] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0121] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0122] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, 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 limitations, 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.

[0123] The above descriptions are merely various embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. An image processing method, characterized in that, The method includes: Obtain the image to be processed that needs to be smoked; Image content recognition is performed on the image to be processed to determine whether the image to be processed contains a preset target. If the image to be processed is an image containing a preset target, then the target region where the preset target is located and the non-target region other than the target region in the image to be processed are determined. The image of the target region is extracted and sharpened using a high-pass filter to obtain the first segmented image; The image of the non-target region is extracted and subjected to low-pass filtering to obtain a second segmented image; The first segmented image and the second segmented image are fused to obtain a first intermediate image; The first intermediate image is converted to grayscale to obtain the second intermediate image; The brightness of the second intermediate image is adjusted by reducing the brightness of the high-brightness parts and increasing the brightness of the low-brightness parts to obtain a third intermediate image. Calculate the absolute value of the difference between the gray value of each pixel in the third intermediate image and the preset gray value, and determine the probability, variance, mean and / or clipping value of the noise as the corresponding noise addition parameters based on the absolute value. The larger the absolute value, the smaller the probability, variance, mean and / or clipping value of the noise. Based on the noise addition parameters, noise superposition processing is performed on each pixel in the third intermediate image to obtain a result image with a smoke effect.

2. The method according to claim 1, characterized in that, The step of fusing the first segmented image and the second segmented image includes: The edge contours of the first segmented image and the second segmented image are smoothed, and the processed first segmented image and the second segmented image are then merged.

3. The method according to claim 1, characterized in that, The step of filtering the image to be processed to obtain a first intermediate image includes: Perform image content recognition on the image to be processed to determine whether the image to be processed is a landscape image; If the image to be processed is a landscape image, then the edge information of the image to be processed is determined by an edge detection algorithm; Based on the edge information, the image to be processed is subjected to edge detail removal and edge softening processing to obtain an edge-softened image; The edge-softened image is subjected to low-pass filtering to obtain the first intermediate image; Before the step of performing noise superposition processing on each pixel in the third intermediate image according to the noise addition parameters to obtain the result image, the method includes: The edge-softened image and the second intermediate image are then subjected to transparency fusion processing to obtain the second intermediate image after blending.

4. The method according to claim 1, characterized in that, The step of adjusting the brightness of the second intermediate image includes: The brightness of the second intermediate image is adjusted according to a preset brightness reference curve, so that the adjusted brightness curve of the second intermediate image tends to the brightness reference curve. The brightness improvement rate corresponding to the low brightness area in the brightness reference curve is greater than 1, and the brightness improvement rate corresponding to the high brightness area is less than 1.

5. The method according to claim 1, characterized in that, The method further includes: The resulting image is rendered onto a preset 3D clothing model to obtain a 3D clothing texture.

6. An image processing apparatus, characterized in that, The device includes: The image acquisition module is used to acquire the image to be processed by the smoke treatment; A filtering module is used to perform image content recognition on the image to be processed to determine whether the image to be processed contains a preset target; if the image to be processed contains a preset target, then the target region where the preset target is located and the non-target region other than the target region in the image to be processed are determined; the image of the target region is extracted and subjected to high-pass filtering and sharpening to obtain a first segmented image; the image of the non-target region is extracted and subjected to low-pass filtering to obtain a second segmented image; the first segmented image and the second segmented image are fused to obtain a first intermediate image; A grayscale conversion module is used to convert the first intermediate image to grayscale to obtain a second intermediate image; The brightness adjustment module is used to adjust the brightness of the second intermediate image, reduce the brightness of the high-brightness parts of the second intermediate image, and increase the brightness of the low-brightness parts of the second intermediate image to obtain a third intermediate image. The noise determination module is used to calculate the absolute value of the difference between the gray value of each pixel in the third intermediate image and the preset gray value, and to determine the probability, variance, mean and / or clipping value of the noise as corresponding noise addition parameters based on the absolute value. The larger the absolute value, the smaller the probability, variance, mean and / or clipping value of the noise. The noise addition module is used to perform noise superposition processing on each pixel in the third intermediate image according to the noise addition parameters to obtain a result image with a smoke effect.

7. An electronic device, characterized in that, The method includes a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions, which, when executed by the processor, implement the method according to any one of claims 1-5.

8. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores machine-executable instructions that, when executed by one or more processors, implement the method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Picture noise adding method

    CN102156960A