Image processing method and apparatus, electronic device and storage medium
By cutting, depicting and decoloring the target image and synthesizing the image, the problem of limited types of special effects in the existing technology is solved, and simple and exquisite artistic effects and rich visual experience are achieved.
Patent Information
- Application Number
- PCT/CN2024/137947
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-01-23
- Filing Date
- 2024-12-09
- Publication Date
- 2025-07-31
AI Technical Summary
In the prior art, the types of special effects provided by image processing software are limited, and it is difficult to meet the diverse needs of users.
By obtaining the target image, the first layer, the second layer and the third layer are separated, and the cutout, depict and color removal are performed respectively, and the processed image is synthesized to simulate the art style of a monochrome poster.
It realizes the simplicity of the image without losing the exquisite visual effect, meets users' diverse needs for special effects, and provides a richer visual experience.
Smart Images

Figure CN2024137947_31072025_PF_FP_ABST
Abstract
Description
Image processing method, device, electronic device and storage medium
[0001] This application claims priority to the Chinese invention patent application entitled “Image processing method, device, electronic device and storage medium” and application number 202410094879.4 filed on January 23, 2024. The entire contents of that application are incorporated by reference into this application. Technical Field
[0002] The present disclosure relates to the field of image processing technology, and in particular to an image processing method, device, electronic device, and storage medium. Background Art
[0003] With the rapid development of digital imaging technology, people are placing higher demands on the visual quality of images. Adding special effects to images has become an important technical tool to enhance their visual appeal and artistic quality. Special effects can enrich the visual quality of images, making them more attractive and valuable.
[0004] However, although some software or applications on the market currently provide the function of adding special effects, the types of special effects they provide are limited and it is difficult to meet the diverse needs of users. Summary of the Invention
[0005] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides an image processing method, apparatus, electronic device and storage medium.
[0006] In a first aspect, an embodiment of the present disclosure provides an image processing method, including: acquiring a target image; obtaining a first layer, a second layer, and a third layer based on the target image; the first layer is a cutout result obtained by performing a cutout process on a target object in the target image; the second layer is a depiction result obtained by depicting a part of the target image; the third layer is a decolorization result obtained by decolorizing the target image; and the first layer, the second layer, and the third layer are synthesized to obtain a processed image.
[0007] In a second aspect, an embodiment of the present disclosure further provides an image processing device, comprising: an acquisition module for acquiring a target image; a processing module for obtaining a first layer, a second layer, and a third layer based on the target image; the first layer is a cutout result obtained by performing a cutout process on a target object in the target image; the second layer is a depiction result obtained by depicting a part of the target image; the third layer is a decolorization result obtained by performing a decolorization process on the target image; and a synthesis module for synthesizing the first layer, the second layer, and the third layer to obtain a processed image.
[0008] In a third aspect, an embodiment of the present disclosure further provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs; and when the one or more programs are executed by the one or more processors, the one or more processors implement the image processing method as described above.
[0009] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, which implements the image processing method described above when executed by a processor.
[0010] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product, comprising computer program instructions, which implement the image processing method described above when the computer program instructions are executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0012] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0013] FIG1 is a flow chart of an image processing method provided by an embodiment of the present disclosure;
[0014] Figures 2 to 4 are principle images of an image processing method provided by an embodiment of the present disclosure;
[0015] FIG5 is a flowchart of a method for obtaining a second layer based on a target image provided by an embodiment of the present disclosure;
[0016] FIG6 is a schematic structural diagram of an image processing device according to an embodiment of the present disclosure;
[0017] FIG7 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0018] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features therein can be combined with each other in the absence of conflict.
[0019] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0020] Figure 1 is a flow chart of an image processing method provided by an embodiment of the present disclosure. This embodiment is applicable to situations where image processing is performed in a client. The method can be performed by an image processing device, which can be implemented in software and / or hardware. The device can be configured in an electronic device, such as a terminal, specifically including but not limited to a smartphone, a PDA, a tablet computer, a wearable device with a display screen, a desktop computer, a laptop computer, an all-in-one computer, a smart home device, etc. Alternatively, this embodiment is applicable to situations where image processing is performed in a server. The method can be performed by an image processing device, which can be implemented in software and / or hardware, and the device can be configured in an electronic device, such as a server.
[0021] As shown in FIG1 , the method may specifically include:
[0022] S110: Acquire a target image.
[0023] The target image may be, for example, an image to which special effects are to be added. The target image may be specified by the user. The target image may specifically be an image captured by the user or an image downloaded from the Internet.
[0024] Optionally, the target image may be, for example, a static image, a dynamic image, or an image frame in a video.
[0025] In addition, the target image can be an image that has been edited before, or an image that has not been edited. Here, the "edited image" can be, for example, an image that has been added with other special effects.
[0026] S120. Based on the target image, a first layer, a second layer, and a third layer are obtained; the first layer is a cutout result obtained by performing a cutout process on the target object in the target image; the second layer is a depiction result obtained by depicting a part of the target image; the third layer is a decolorization result obtained by performing a decolorization process on the target image.
[0027] The object can be something in the target image, which can specifically be a person, animal, plant, building or object.
[0028] The target object may be, for example, an object in the target image that requires special attention or that is desired to be highlighted. This application does not limit the specific object to which the target object refers. In some scenarios, the target object may be the main body of the target image. For example, the target object may be a person, an animal, a plant, a building, or an object. Furthermore, this application does not limit the number of target objects. For example, the number of target objects may be one, two, or three.
[0029] Since the first layer is the result of the cutout of the target object in the target image, the first image only includes the target object. If the target image is a color image, the target object in the first layer is also in color.
[0030] The second layer is the result of depicting a portion of the target image. Exemplarily, the second layer includes lines used to depict the edges of objects in the target image. And / or, the second layer includes color blocks used to fill portions of the target image. Optionally, the number of colors in the second layer is less than the number of colors in the target image. Typically, the second layer is monochrome. Furthermore, the colors in the second layer are colors other than black, white, and gray. Exemplarily, the colors in the second layer are red, yellow, orange, green, etc.
[0031] The decolorization process can be, for example, an image processing method of converting a color image into a grayscale image or a black and white image. Since the third layer is the result of the decolorization process on the target image, the third layer is a grayscale image or a black and white image.
[0032] S130: Synthesize the first layer, the second layer, and the third layer to obtain a processed image.
[0033] There are various methods for implementing this step, which are not limited in this application. For example, the method for implementing this step may include: synthesizing the first layer, the second layer, and the third layer according to a preset layer stacking order to obtain a processed image. The preset layer stacking order includes: from top to bottom, the second layer, the first layer, and the third layer.
[0034] For example, assume the target image shown in Figure 2 is a color image depicting a person walking on a road flanked by a row of trees. There is a sun in the upper right corner of the target image. Referring to Figure 3 , with the person as the target object, the target image is subjected to a cutout process to obtain a first layer. This first layer contains only the person, without any background, i.e., without objects such as the road, trees, or sun. This first layer is also color. Referring to Figure 3 or Figure 4 , the edges of the person, trees, and sun in the target image are delineated, and the road is filled with color to obtain a second layer. In the second layer, the lines used to depict the edges of the person, trees, and sun are yellow, and the blocks used to fill the road are also yellow. The target image is converted to a grayscale image, and the resulting grayscale image is used as the third layer. The three layers are superimposed, in order from top to bottom: the second layer, the first layer, and the third layer, to obtain the processed image.
[0035] The processed image creates a monochromatic poster effect. This effect, achieved by highlighting and / or filling specific areas of the image with color in the second layer, results in the image being primarily black and white with a single, distinct color. This reduces the color interference of redundant elements within the image, making the information more prominent and effectively conveying the message.
[0036] The above technical solution sets up a target image to obtain first, second, and third layers. The first layer is the result of cropping the target object in the target image; the second layer is the result of partially desaturating the target image; and the third layer is the result of desaturating the target image. The first, second, and third layers are then combined to produce the processed image. Essentially, this method provides an automated method for adding a new special effect to a target image. This effect simulates the artistic style of a monochrome poster, giving the target image a simple yet sophisticated visual effect. This method can meet users' diverse needs for special effects and provide a richer visual experience.
[0037] Based on the above technical solution, there are many specific implementation methods for "obtaining the second layer based on the target image", which are not limited by this application. For example, referring to Figure 5, "obtaining the second layer based on the target image" may specifically include:
[0038] S210: Determine a target pixel in a target image.
[0039] The target pixel is a pixel in the target image, which is a pixel that needs to be color-adjusted. This application does not limit what the target pixel is specifically constituting.
[0040] In practice, this application does not limit the specific method for determining the target pixel point.
[0041] In one embodiment, the implementation method of this step includes: identifying the edge of the object in the target image to obtain an edge image; and determining the target pixel in the edge image based on the brightness value of the pixel in the edge image.
[0042] Optionally, identifying the edge of the object in the target image may be performed by using a gradient-based edge detection algorithm.
[0043] Determining target pixels in the edge image based on brightness values of pixels in the edge image may, for example, include taking pixels in the edge image having brightness values greater than a first preset brightness value as target pixels.
[0044] By setting the edges of the objects in the target image to be recognized, an edge image is obtained; based on the brightness values of the pixels in the edge image, the target pixels are determined in the edge image, so that the second layer can present the effect of depicting the relatively important edge lines of the objects in the target image.
[0045] Optionally, determining the target pixel in the edge image based on the brightness values of the pixels in the edge image may further include: adjusting the brightness values of the pixels in the edge image having brightness values greater than a first preset brightness value to a second preset brightness value; and determining the target pixel based on the pixels in the edge image having brightness values equal to the second preset brightness value. Because the visibility of the pixels in the edge image obtained through edge recognition varies, adjusting the brightness values of the pixels in the edge image having brightness values greater than the first preset brightness value to the second preset brightness value can make the visibility of the pixels uniform, thereby reducing the fragmentation caused by blurred edges.
[0046] In another embodiment, the implementation method of this step includes: performing tone separation on the target image to obtain a second image; and determining the target pixel in the second image based on the brightness value of the pixel in the second image.
[0047] For example, tone separation may involve adjusting the brightness values of all pixels in the target image whose brightness values fall within a preset brightness interval to a third preset brightness value corresponding to the preset brightness interval. For example, n brightness intervals are pre-set, each with a corresponding third preset brightness value. For any pixel whose brightness value falls within the mth brightness interval, the brightness value of the pixel is adjusted to the third preset brightness value corresponding to the mth brightness interval. Both m and n are positive integers, and m≤n.
[0048] In the target image, the brightness values of adjacent pixels exhibit a gradient effect. After the target image is toned, the brightness values of adjacent pixels exhibit a stepped effect. Before toning, the target image includes more brightness values than after toning. For example, before toning, the target image includes 256 brightness value types, while after toning, the target image includes 8 brightness value types.
[0049] Determining target pixels in the second image based on brightness values of pixels in the second image may, for example, include taking pixels in the second image whose brightness values are within a target brightness range as target pixels.
[0050] By performing tonal separation on the target image, a second image is generated. Based on the brightness of the pixels in the second image, target pixels are identified within the second image. Essentially, this selection of pixels determines the areas that require color fill. This maintains the structured light and shadow effects of the target image, avoiding the undesirable distortion of the processed image caused by color fills that disrupt the structured light and shadow effects of the target image.
[0051] Optionally, this step may also include blurring the target image; and determining the target pixel in the blurred target image. There are various methods for blurring the target image, such as Gaussian blurring or intelligent blurring. Blurring the target image before determining the target pixel can reduce noise interference with the determination of the target pixel, reduce errors caused by uneven lighting, shadows, or other non-uniformities, highlight the primary information in the image, and weaken the secondary information, simplifying calculations and improving the efficiency of determining the target pixel.
[0052] S220: Extract target pixels to obtain a first image.
[0053] The first image is an image composed of target pixels.
[0054] Optionally, a rough edge effect is added to the first image, which can reduce the jaggedness of the first image and increase the hand-painted texture.
[0055] S230: Adjust the color value of the target pixel in the first image to the target color value to obtain a second layer.
[0056] Optionally, the specific implementation method of this step may also include: adjusting the color value of the target pixel point to the target color value to obtain the fourth layer, copying the fourth layer to obtain the fifth layer; blurring the fifth layer to obtain the sixth layer; and fusing the fourth layer and the sixth layer to obtain the second layer.
[0057] The target color value is a pre-specified color value. In some scenarios, the target color value can be user-specified.
[0058] The purpose of blurring the fifth layer is to reduce the jagged edges of the image in the second layer and reduce the sharpness.
[0059] The above technical solution is set up to determine the target pixel point in the target image; extract the target pixel point to obtain the first image; adjust the color value of the target pixel point in the first image to the target color value to obtain the second layer, and provides a specific method for obtaining the second layer. The method is relatively simple to implement, does not require new algorithm development, and has low requirements on device performance.
[0060] On the basis of the above technical solution, optionally, after S130, the method further includes: adding filters and / or noise to the processed image. The purpose of such setting is to further enhance the artistic effect of the processed image and enrich the expressiveness of the processed image.
[0061] The following describes this with reference to specific examples.
[0062] If the user wishes to add a graffiti effect that depicts the edges of the target image to the target image. After acquiring the target image, duplicate the target image to obtain three target images. Next, cut out the target object in the first target image to obtain the first layer. Perform Gaussian filtering on the second target image, and perform object edge recognition on the Gaussian filtered target image to obtain an edge image. Adjust the brightness values of the pixels in the edge image whose brightness values are greater than the preset brightness value to the preset brightness value; extract the pixels whose brightness values are the preset brightness value to obtain the first image. Add a burr effect to the first image. Adjust the color values of the pixels in the first image after adding the burr effect to obtain the second layer. Adjust the third target image to a grayscale image to obtain the third layer. Synthesize the first, second, and third layers to obtain a synthesized image; add filters and noise to the entire synthesized image. In this way, a graffiti effect with hand-drawn strokes can be achieved in the target image.
[0063] If the user wants to add a graffiti effect to the target image that fills the local area of the target image with color. After obtaining the target image, copy the target image to obtain three target images. Then, cut out the target object in the first target image to obtain the first layer. Perform intelligent filtering on the second target image, perform tone separation on the target image after intelligent filtering to obtain the second image, which includes a preset number of brightnesses; extract all pixels with brightness values in the preset brightness range to obtain the first image. Adjust the color values of the pixels in the first image to obtain the second layer. Adjust the third target image to a grayscale image to obtain the third layer. Synthesize the first, second and third layers to obtain a synthesized image; add a filter to the entire synthesized image. In this way, a graffiti effect of filling the local area of the target image with color can be achieved.
[0064] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0065] For example, in response to a user's active request, a prompt message is sent to the user to clearly inform the user that the operation requested will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the electronic device, application, server, storage medium, or other software or hardware that performs the operations of the disclosed technical solution based on the prompt message.
[0066] As an optional but non-limiting implementation, in response to receiving a user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. Furthermore, the pop-up window may also contain a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.
[0067] It is understandable that the above notification and user authorization process are merely illustrative and do not limit the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0068] It should be noted that for the aforementioned method embodiments, for simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present disclosure is not limited by the order of the actions described, because according to the present disclosure, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for disclosure.
[0069] FIG6 is a schematic structural diagram of an image processing device in an embodiment of the present disclosure. The image processing device provided by the embodiment of the present disclosure can be configured in a client, or can be configured in a server. Referring to FIG6 , the image processing device specifically includes: an acquisition module 310 for acquiring a target image; a processing module 320 for obtaining a first layer, a second layer, and a third layer based on the target image; the first layer is a cutout result obtained by performing a cutout process on a target object in the target image; the second layer is a depiction result obtained by depicting a part of the target image; the third layer is a decolorization result obtained by decolorizing the target image; and a synthesis module 330 for synthesizing the first layer, the second layer, and the third layer to obtain a processed image.
[0070] Furthermore, the processing module 320 is used to: determine a target pixel point in the target image; extract the target pixel point to obtain a first image; and adjust the color value of the target pixel point in the first image to a target color value to obtain a second layer.
[0071] Furthermore, the processing module 320 is configured to: identify edges of objects in the target image to obtain an edge image; and determine target pixels in the edge image based on brightness values of pixels in the edge image.
[0072] Furthermore, the processing module 320 is configured to: perform tone separation on the target image to obtain a second image; and determine target pixels in the second image based on brightness values of pixels in the second image.
[0073] Furthermore, the processing module 320 is configured to: after extracting the target pixel point to obtain the first image, add a burr effect to the first image.
[0074] Furthermore, the processing module 320 is configured to: perform blur processing on the target image; and determine target pixels in the target image after blur processing.
[0075] Furthermore, the processing module 320 is used to: adjust the color value of the target pixel point to the target color value to obtain a fourth layer, copy the fourth layer to obtain a fifth layer; blur the fifth layer to obtain a sixth layer; and merge the fourth layer and the sixth layer to obtain a second layer.
[0076] Furthermore, the synthesis module 330 is used to: synthesize the first layer, the second layer and the third layer according to a preset layer stacking order to obtain a processed image; the preset layer stacking order includes: from the top layer to the bottom layer, in order, the second layer, the first layer and the third layer.
[0077] The image processing device provided in the embodiment of the present disclosure can execute the steps executed by the client or server in the image processing method provided in the embodiment of the method of the present disclosure, and has the execution steps and beneficial effects, which will not be repeated here.
[0078] FIG7 is a schematic diagram of the structure of an electronic device in an embodiment of the present disclosure. Specific reference will be made below to FIG7 , which shows a schematic diagram of the structure of an electronic device 1000 suitable for implementing an embodiment of the present disclosure. The electronic device 1000 in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), wearable electronic devices, and the like, as well as fixed terminals such as digital TVs, desktop computers, smart home devices, and the like. The electronic device shown in FIG7 is merely an example and should not impose any limitations on the functions and scope of use of the embodiments of the present disclosure.
[0079] As shown in FIG7 , the electronic device 1000 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1001, which can perform various appropriate actions and processes to implement the image processing method of the embodiment described in the present disclosure according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1008 into a random access memory (RAM) 1003. Various programs and information required for the operation of the electronic device 1000 are also stored in the RAM 1003. The processing device 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0080] Typically, the following devices may be connected to the I / O interface 1005: an input device 1006 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 1007 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1008 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 may allow the electronic device 1000 to communicate with other devices wirelessly or by wire to exchange information. Although FIG. 7 shows the electronic device 1000 with various devices, it should be understood that not all of the devices shown are required to be implemented or present. More or fewer devices may be implemented or present instead.
[0081] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart, thereby implementing the image processing method described above. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 1009, or installed from the storage device 1008, or installed from the ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0082] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include an information signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated information signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0083] In some embodiments, the client and server can communicate using any known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital information communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any known or future developed network.
[0084] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0085] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device is enabled to: obtain a target image; obtain a first layer, a second layer and a third layer based on the target image; the first layer is a cutout result obtained by cutting out the target object in the target image; the second layer is a depiction result obtained by depicting a part of the target image; the third layer is a decolorization result obtained by decolorizing the target image; and synthesize the first layer, the second layer and the third layer to obtain a processed image.
[0086] Optionally, when the above one or more programs are executed by the electronic device, the electronic device may also execute other steps described in the above embodiments.
[0087] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0088] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0089] The units involved in the embodiments described in this disclosure may be implemented in software or hardware, wherein the name of a unit does not necessarily limit the unit itself.
[0090] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0091] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0092] According to one or more embodiments of the present disclosure, the present disclosure provides an electronic device, including:
[0093] one or more processors;
[0094] a memory for storing one or more programs;
[0095] When the one or more programs are executed by the one or more processors, the one or more processors implement any image processing method provided in the present disclosure.
[0096] According to one or more embodiments of the present disclosure, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any image processing method provided by the present disclosure.
[0097] An embodiment of the present disclosure further provides a computer program product, which includes a computer program or instructions, and when the computer program or instructions are executed by a processor, the image processing method described above is implemented.
[0098] 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 entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0099] The foregoing description is intended only to provide specific embodiments of the present disclosure, intended to enable those skilled in the art to understand and implement the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the embodiments described herein, but rather to be construed in the broadest manner consistent with the principles and novel features disclosed herein.
Claims
1. An image processing method, comprising: Acquire the target image; Based on the target image, a first layer, a second layer, and a third layer are obtained; the first layer is a cutout result obtained by performing a cutout process on a target object in the target image; the second layer is a depiction result obtained by depicting a part of the target image; and the third layer is a decolorization result obtained by performing a decolorization process on the target image. as well as The first layer, the second layer, and the third layer are synthesized to obtain a processed image.
2. The method according to claim 1, wherein obtaining the second layer based on the target image comprises: In the target image, determining a target pixel point; Extracting the target pixel points to obtain a first image; as well as The color value of the target pixel in the first image is adjusted to a target color value to obtain a second layer.
3. The method according to claim 2, wherein determining the target pixel in the target image comprises: Identifying edges of objects in the target image to obtain an edge image; as well as Based on the brightness values of the pixels in the edge image, a target pixel is determined in the edge image.
4. The method according to claim 2, wherein determining the target pixel in the target image comprises: performing tone separation on the target image to obtain a second image; as well as Based on the brightness values of the pixels in the second image, a target pixel is determined in the second image.
5. The method according to claim 2, wherein after extracting the target pixel points to obtain the first image, the method further comprises: A rough edge effect is added to the first image.
6. The method according to claim 2, wherein determining the target pixel in the target image comprises: Performing blur processing on the target image; as well as In the target image after blurring, target pixels are determined.
7. The method according to claim 2, wherein adjusting the color value of the target pixel to a target color value to obtain the second layer comprises: Adjust the color value of the target pixel to the target color value to obtain the fourth layer, Duplicate the fourth layer to obtain a fifth layer; performing blur processing on the fifth layer to obtain a sixth layer; as well as The fourth layer and the sixth layer are merged to obtain a second layer.
8. The method according to claim 1, wherein synthesizing the first layer, the second layer, and the third layer to obtain a processed image comprises: The first layer, the second layer, and the third layer are synthesized according to a preset layer stacking order to obtain a processed image, wherein the preset layer stacking order includes: from the top layer to the bottom layer, the second layer, the first layer, and the third layer in sequence.
9. An image processing device comprising: An acquisition module, used to acquire a target image; A processing module, configured to obtain a first layer, a second layer, and a third layer based on the target image; the first layer is a matte result obtained by performing matte processing on a target object in the target image; the second layer is a rendering result obtained by rendering a part of the target image; the third layer is a desaturation result obtained by performing desaturation processing on the target image. And A composition module, configured to compose the first layer, the second layer, and the third layer to obtain a processed image.
10. An electronic device, comprising: One or more processors; And A storage device, configured to store one or more programs; Wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1-8.
11. A computer-readable storage medium, having stored thereon a computer program, which when executed by a processor, implements the method according to any one of claims 1-8.
12. A computer program product, comprising computer-executable instructions, wherein when the computer-executable instructions are executed by a processor, the method according to any one of claims 1-8 is implemented.
Citation Information
Patent Citations
Image processing method and device, electronic equipment and computer readable storage medium
CN110209861A
Method and system of determining object positions for image processing using wireless network angle of transmission
US20180276841A1