WO2024152901A1 - 一种图像处理方法、装置、设备及介质 - Google Patents

一种图像处理方法、装置、设备及介质 Download PDF

Info

Publication number
WO2024152901A1
WO2024152901A1 PCT/CN2024/070322 CN2024070322W WO2024152901A1 WO 2024152901 A1 WO2024152901 A1 WO 2024152901A1 CN 2024070322 W CN2024070322 W CN 2024070322W WO 2024152901 A1 WO2024152901 A1 WO 2024152901A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
mask image
mask
processed
processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2024/070322
Other languages
English (en)
French (fr)
Inventor
严萌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Publication of WO2024152901A1 publication Critical patent/WO2024152901A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/18Image warping, e.g. rearranging pixels individually
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/00Two-dimensional [2D] image generation
    • G06T11/10Texturing; Colouring; Generation of textures or colours

Definitions

  • the present disclosure relates to the field of computer technology, and in particular to an image processing method, device, equipment and medium.
  • the present disclosure provides an image processing method, apparatus, device and medium to achieve diversified processing of images to meet user needs.
  • an image processing method comprising:
  • the image to be processed is processed using the first mask image and the second mask image to obtain a target image, wherein a first side of an edge of a target object in the target image presents a texture corresponding to the first mask image, and a second side of an edge of the target object presents a texture corresponding to the second mask image.
  • an image processing device comprising:
  • An acquisition unit configured to acquire a mask image corresponding to an image to be processed, wherein the image to be processed includes a target object, and the mask image is a mask image corresponding to the target object;
  • a processing unit configured to process the mask image using a first processing method to obtain a first mask image
  • the processing unit is further configured to process the first mask image using a second processing method to obtain a second mask image
  • the processing unit is used to process the image to be processed using the first mask image and the second mask image to obtain a target image, wherein the first side of the edge of the target object in the target image presents the texture corresponding to the first mask image, and the second side of the edge of the target object presents the texture corresponding to the second mask image.
  • an electronic device comprising: a processor and a memory;
  • the memory is used to store instructions or computer programs
  • the processor is used to execute the instructions or computer programs in the memory so that the electronic device executes the method described in the first aspect.
  • a computer-readable storage medium wherein instructions are stored in the computer-readable storage medium.
  • the device executes the method described in the first aspect.
  • a computer program product comprising a computer program/instructions, and when the computer program/instructions are executed by a processor, the method described in the first aspect is implemented.
  • FIG1 is a flow chart of an image processing method provided by an embodiment of the present disclosure.
  • FIG2a is a schematic diagram of obtaining a mask image provided by an embodiment of the present disclosure.
  • FIG2b is a schematic diagram of obtaining a first mask image provided by an embodiment of the present disclosure.
  • FIG2c is a schematic diagram of obtaining a second mask image provided by an embodiment of the present disclosure.
  • FIG3a is a schematic diagram of a target image provided by an embodiment of the present disclosure.
  • FIG3b is a diagram showing a distortion processing effect provided by an embodiment of the present disclosure.
  • FIG3c is a schematic diagram of another target image provided by an embodiment of the present disclosure.
  • FIG4 is a structural diagram of an image processing device provided by an embodiment of the present disclosure.
  • FIG5 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure.
  • the present disclosure provides an image processing method, specifically, obtaining a mask image corresponding to an image to be processed, the image to be processed includes a target object, and the mask image is a mask image corresponding to the target object.
  • the mask image is processed using a first processing method to obtain a first mask image
  • the first mask image is processed using a second processing method to obtain a second mask image.
  • the image to be processed is processed using the first mask image and the second mask image to obtain a target image, in which different sides of the target object in the target image present different textures.
  • the texture corresponding to the first mask image may be different from the texture corresponding to the second mask image.
  • the edge of the target object in the target image presents a torn paper stroke effect.
  • the torn paper stroke effect refers to the edge lines of objects (such as people and animals) in the processed image after the image is processed, which is similar to tearing paper, revealing uneven edges. Compared with the image before processing, it feels flat. By adding the torn paper effect design, the image can look more vivid, casual and realistic.
  • a prompt message is sent to the user to clearly remind the user that the operation requested to be performed will require obtaining and using the user's personal information.
  • the user can independently choose whether to submit a request to execute the disclosed technology according to the prompt message.
  • the personal information is provided by software or hardware such as electronic devices, applications, servers or storage media that operate technical solutions.
  • the prompt information in response to receiving an active request from the user, 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.
  • the pop-up window may also carry a selection control for the user to choose "agree” or “disagree” to provide personal information to the electronic device.
  • FIG. 1 is a flow chart of an image processing method provided by an embodiment of the present disclosure.
  • the method can be executed by an image processing client, and the image processing client can be deployed in an electronic device.
  • the electronic device may include a mobile phone, a tablet computer, a laptop computer, a desktop computer, a vehicle terminal, a wearable electronic device, an all-in-one machine, a smart home device, and other devices with communication functions, or a device simulated by a virtual machine or a simulator.
  • the method may include the following steps:
  • the image to be processed includes a target object, and the mask image is a mask image corresponding to the target object.
  • the target object may be a person, an animal or other object.
  • the image to be processed may be subjected to mask processing to obtain a mask image corresponding to the target object in the image to be processed.
  • the mask image is a binary image composed of 0 and 1. When the mask is applied, the 1-value area is processed, and the masked 0-value area is not included in the calculation.
  • the image mask is defined by a specified data value, a data range, a finite or infinite value, and a region of interest.
  • the image to be processed includes a person and a plant, and mask processing is performed on the image to be processed to obtain a mask image corresponding to the person.
  • S102 Processing the mask image using a first processing method to obtain a first mask image.
  • the first processing method may include dilation processing and/or distortion processing.
  • Dilation processing refers to expanding and enlarging the bright white area in the image by adding pixels to the perceived boundary of the object in the image.
  • image dilation processing horizontal dilation, vertical dilation, and omnidirectional dilation. In this embodiment, it mainly refers to omnidirectional dilation; distortion processing, image distortion is to move pixels from the original position to the new position according to a certain mapping.
  • the mask image when the first processing method is expansion processing, the mask image is expanded to obtain the first mask image; when the first processing method is distortion processing, the mask image is distorted to obtain the first mask image; when the first processing method includes expansion processing and distortion processing, the mask image can be expanded first to obtain a third mask image; and then the third mask image is distorted to obtain the first mask image.
  • FIG2b shows a mask schematic diagram corresponding to the first processing process.
  • the third mask image is distorted to obtain the first mask image, which can be specifically achieved in the following manner: two value noise images are obtained, and the two value noise images include a horizontal displacement image and a vertical displacement image; the third mask image is horizontally and vertically displaced by the two value noise images to obtain the first mask image.
  • the value noise several vertices are defined and each vertex contains a random value. These vertices will affect the surrounding coordinates according to their own random values. The closer to the vertex, the easier it is to be affected by the vertex. That is, in this embodiment, the first mask image is obtained by using the value noise image to affect the horizontal and vertical directions of the third mask image.
  • the second processing method may include expansion processing or distortion processing. Specifically, when the second processing method is expansion processing, the first mask image is expanded to obtain the second mask image; when the second processing method is distortion processing, the first mask image is distorted to obtain the second mask image.
  • FIG2c is a schematic diagram of the second mask image after the first mask image is expanded.
  • S104 Process the image to be processed using the first mask image and the second mask image to obtain a target image.
  • the image to be processed is processed using the first mask image and the second mask image to obtain a target image.
  • the first side of the edge of the target object in the target image presents the texture corresponding to the first mask image
  • the second side of the edge of the target object presents the texture corresponding to the second mask image.
  • the first side may be the inner side of the edge of the target object, or the outer side of the edge of the target object.
  • the second side is the outer side of the edge of the target object; when the first side is the outer side of the edge of the target object, the second side is the inner side of the edge of the target object.
  • the edge corresponding to the target presents a torn paper stroke effect.
  • the first mask image and the second mask image are used to perform mixed processing on the image to be processed to obtain the target image.
  • the first mask image and the second mask image are combined to process the image to be processed. If the first side is the inner side, the target object is filled in the first mask image, and the inner side of the edge of the target object is the texture corresponding to the edge of the first mask image, and the outer side of the edge of the target object is the texture corresponding to the edge of the first mask image.
  • an image to be processed and a mask image corresponding to the image to be processed are obtained, and the mask image is a mask image corresponding to the target object included in the image to be processed.
  • the mask image is processed using a first processing method to obtain a first mask image, and the first mask image is distorted using a second processing method to obtain a second mask image.
  • the image to be processed is processed using the first mask image and the second mask image to obtain a target image, in which the first side of the edge of the target object in the target image presents a texture corresponding to the first mask image, and the second side of the edge of the target object presents a texture corresponding to the second mask image. That is, the technical solution provided by the present disclosure can realize the processing of the edge of the target object in the image to be processed, so that different sides of the edge present different texture effects, thereby improving the diversity of image processing.
  • the first mask image and the second mask image may be processed respectively, and the processed first mask image and the processed second mask image may be used to process the image to be processed, thereby enhancing the effect of image processing.
  • the first mask image and the second mask image are distorted respectively to obtain a fourth mask image and a fifth mask image; the image to be processed is processed using the fourth mask image and the fifth mask image to obtain a target image.
  • the first side of the edge of the target object in the target image presents the texture corresponding to the fourth mask image
  • the second side of the edge of the target object presents the texture corresponding to the fifth mask image.
  • the first mask image and the second mask image may be distorted in the following manner: obtaining at least two fractal noise images, the at least two fractal noise images including a horizontal displacement image and a vertical displacement image; A displacement map; horizontally and vertically displace the first mask map using at least two fractal noise maps to obtain a fourth mask map; horizontally and vertically displace the second mask map using at least two fractal noise maps to obtain a fifth mask map.
  • fractal noise is obtained by superimposing noises of different frequencies to obtain detailed noise.
  • the fourth mask map is also an inner mask map of the edge of the target object and the fifth mask map is an outer mask map of the edge of the target object.
  • four fractal noise images can be obtained, and the four fractal noise images include two horizontal displacement images and two vertical displacement images.
  • the first mask image is horizontally and vertically displaced using one horizontal displacement image and one vertical displacement image to obtain a fourth mask image; and the second mask image is horizontally and vertically displaced using another horizontal displacement image and another vertical displacement image to obtain a fifth mask image.
  • the fourth mask image and the fifth mask image are distorted, and the processed image is processed using the processed fourth mask image and the processed fifth mask image to obtain the target image.
  • the fourth mask image and the fifth mask image are distorted respectively to obtain the sixth mask image and the seventh mask image; the image to be processed is processed using the sixth mask image and the seventh mask image to obtain the target image.
  • the first side of the edge of the target object in the target image presents the texture corresponding to the sixth mask image
  • the second side of the edge of the target object presents the texture corresponding to the seventh mask image.
  • the fourth mask image is the inner mask image of the edge of the target object and the fifth mask image is the outer mask image of the edge of the target object
  • the sixth mask image is also the inner mask image of the edge of the target object
  • the seventh mask image is the outer mask image of the edge of the target object.
  • the left picture is the effect of combining the fourth mask image and the fifth mask image
  • the right picture is the effect of combining the sixth mask image and the seventh mask image after distortion.
  • the distortion processing of the fourth mask image and the fifth mask image can be realized by the following method, specifically: obtaining at least two white noise images, the at least two white noise images including a horizontal displacement image and a vertical displacement image; performing horizontal displacement and vertical displacement on the fourth mask image by using the at least two white noise images; A sixth mask image is obtained; and at least two white noise images are used to horizontally displace and vertically shift the fifth mask image to obtain a seventh mask image.
  • the second mask image may be blurred to obtain a shadow mask image.
  • the first mask image may be blurred to obtain a shadow mask image.
  • the image to be processed is processed using the first mask image, the second mask image, and the shadow mask image to obtain a target image. There is a shadow area corresponding to the shadow mask image outside the edge of the target object.
  • the first mask image, the second mask image, and the shadow mask image are used to process the image to be processed to obtain the target image, including: using the first mask image, the second mask image, and the shadow mask image to mix the paper texture and the image to be processed to obtain the target image.
  • the target image includes the paper texture except for the area where the target object is located.
  • the edge of the person in the target image presents a torn paper stroke effect.
  • the outer mask image can be blurred to obtain a shadow mask image. Then, the image to be processed is processed using the fourth mask image, the fifth mask image, and the shadow mask image to obtain a target image.
  • the outer mask image can be blurred to obtain a shadow mask image. Then, the image to be processed is processed using the sixth mask image, the seventh mask image, and the shadow mask image to obtain a target image.
  • the embodiments of the present application provide an image processing device and an electronic device, which will be described below in conjunction with the accompanying drawings.
  • the device 400 includes: an acquisition unit 401 and a processing unit 402 .
  • An acquisition unit 401 is used to acquire a mask image corresponding to an image to be processed, wherein the image to be processed includes a target object, and the mask image is a mask image corresponding to the target object;
  • the processing unit 402 is used to process the mask image using a first processing method to obtain a first mask image
  • the processing unit 402 is further configured to process the first mask image using a second processing method to obtain a second mask image;
  • the processing unit 403 is used to process the image to be processed using the first mask image and the second mask image to obtain a target image, wherein the first side of the edge of the target object in the target image presents the texture corresponding to the first mask image, and the second side of the edge of the target object presents the texture corresponding to the second mask image.
  • the first processing method includes expansion processing and/or twisting processing.
  • the processing unit 402 is specifically configured to perform expansion processing on the mask image to obtain a third mask image; and perform distortion processing on the third mask image to obtain the first mask image.
  • the processing unit 402 is specifically configured to perform dilation processing on the first mask image to obtain a second mask image.
  • the processing unit 402 before using the first mask image and the second mask image to process the image to be processed, is further configured to perform distortion processing on the first mask image and the second mask image respectively to obtain a fourth mask image and a fifth mask image;
  • the processing unit 402 is specifically used to process the image to be processed using the fourth mask image and the fifth mask image to obtain a target image, wherein the first side of the edge of the target object in the target image presents the texture corresponding to the fourth mask image, and the second side of the edge of the target object presents the texture corresponding to the fifth mask image.
  • the processing unit 402 before using the fourth mask image and the fifth mask image to process the image to be processed, respectively distorts the fourth mask image and the fifth mask image to obtain a sixth mask image and a seventh mask image;
  • the processing unit 402 is specifically used to process the image to be processed using the sixth mask image and the seventh mask image to obtain a target image, wherein the first side of the edge of the target object in the target image presents the texture corresponding to the sixth mask image, and the second side of the edge of the target object presents the texture corresponding to the seventh mask image.
  • the processing unit 402 is further configured to perform blur processing on the second mask image to obtain a shadow mask image before processing the image to be processed using the first mask image and the second mask image;
  • the processing unit 402 is specifically configured to process the image to be processed using the first mask image, the second mask image and the shadow mask image to obtain a target image, wherein a shadow area corresponding to the shadow mask image exists on the second side of the edge of the target object.
  • the processing unit 402 is specifically configured to mix the paper texture and the image to be processed by using the first mask image, the second mask image, and the shadow mask image to obtain a target image.
  • other regions in the target image except the region where the target object is located are the paper texture.
  • the processing unit 402 is specifically configured to obtain two value noise maps, wherein the two value noise maps include a horizontal displacement map and a vertical displacement map; and use the two value noise maps to horizontally and vertically displace the third mask image to obtain the first mask image.
  • the processing unit 402 is specifically used to obtain at least two fractal noise images, wherein the at least two fractal noise images include a horizontal displacement image and a vertical displacement image; use the at least two fractal noise images to horizontally displace and vertically displace the first mask image to obtain a fourth mask image; use the at least two fractal noise images to horizontally displace and vertically displace the second mask image to obtain a fifth mask image.
  • the processing unit 402 is specifically used to obtain at least two white noise images, and the at least two white noise images include a horizontal permutation image and a vertical permutation image; use the at least two white noise images to horizontally permute and vertically permute the fourth mask image to obtain a sixth mask image; use the at least two white noise images to horizontally permute and vertically permute the fifth mask image to obtain a seventh mask image.
  • the edge of the target object presents a torn paper effect.
  • each unit in this embodiment can refer to the relevant description in the above method embodiment.
  • the division of units in the embodiment of the present disclosure is schematic and is only a logical function division. There may be other division methods in actual implementation.
  • the functional units in the embodiment of the present disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
  • the processing unit and the sending unit can be the same unit or different units.
  • the above integrated The unit can be implemented in the form of hardware or in the form of software functional units.
  • the terminal device 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), etc., and fixed terminals such as digital TVs, desktop computers, etc.
  • 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), etc., and fixed terminals such as digital TVs, desktop computers, etc.
  • PDAs personal digital assistants
  • PADs tablet computers
  • PMPs portable multimedia players
  • vehicle-mounted terminals such as vehicle-mounted navigation terminals
  • fixed terminals such as digital TVs, desktop computers, etc.
  • the electronic device shown in FIG5 is only an example and should not bring any limitation to the functions and scope of use of
  • the electronic device 500 may include a processing device (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 to a random access memory (RAM) 503.
  • a processing device 501 e.g., a central processing unit, a graphics processing unit, etc.
  • RAM random access memory
  • Various programs and data required for the operation of the electronic device 500 are also stored in the RAM 503.
  • the processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504.
  • An input/output (I/O) interface 505 is also connected to the bus 504.
  • the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 508 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 509.
  • the communication devices 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data.
  • FIG. 5 shows an electronic device 500 with various devices, it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have instead.
  • 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 contains program code for executing the method shown in the flowchart.
  • the computer program can be downloaded and installed from the network through the communication device 509, or stored from the storage device 508. or is installed from ROM 502.
  • the processing device 501 When the computer program is executed by the processing device 501, the above functions defined in the method of the embodiment of the present disclosure are executed.
  • the electronic device provided by the embodiment of the present disclosure and the method provided by the above embodiment belong to the same inventive concept.
  • the technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
  • the embodiments of the present disclosure provide a computer storage medium on which a computer program is stored. When the program is executed by a processor, the method provided by the above embodiments is implemented.
  • the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above.
  • 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.
  • a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device.
  • a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried.
  • This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above.
  • the computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit 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 of the above.
  • the client and server may communicate using any currently known or future developed network protocol such as HTTP (Hyper Text Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network).
  • HTTP Hyper Text Transfer Protocol
  • Examples of communication networks include a local area network ("LAN”), a wide area network (“WAN”), Internetworks (eg, the Internet) and peer-to-peer networks (eg, ad hoc peer-to-peer networks), as well as any currently known or later developed network.
  • LAN local area network
  • WAN wide area network
  • Internetworks eg, the Internet
  • peer-to-peer networks eg, ad hoc peer-to-peer networks
  • the computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
  • the computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device can execute the method.
  • 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 separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server.
  • 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., via the Internet using an Internet service provider).
  • LAN local area network
  • WAN wide area network
  • Internet service provider e.g., via the Internet using an Internet service provider
  • each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function.
  • the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square 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.
  • each square box in the block diagram and/or flow chart, and the combination of the square boxes in the block diagram and/or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
  • the units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit/module does not, in some cases, constitute a limitation on the unit itself.
  • exemplary types of hardware logic components 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.
  • FPGAs field programmable gate arrays
  • ASICs application specific integrated circuits
  • ASSPs application specific standard products
  • SOCs systems on chip
  • CPLDs complex programmable logic devices
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment.
  • a machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • a machine-readable medium may 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 may 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.
  • RAM random access memory
  • ROM read-only memory
  • EPROM or flash memory erasable programmable read-only memory
  • CD-ROM portable compact disk read-only memory
  • CD-ROM compact disk read-only memory
  • magnetic storage device or any suitable combination of the foregoing.
  • At least one (item) means one or more, and “plurality” means two or more.
  • “And/or” is used to describe the association relationship of associated objects, indicating that three relationships may exist.
  • a and/or B can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural.
  • the character “/” generally indicates that the previous and next associated objects are in an “or” relationship.
  • At least one of the following” or similar expressions refers to any combination of these items, including any combination of single or plural items.
  • At least one of a, b or c can mean: a, b, c, "a and b", “a and c", “b and c", or "a and b and c", where a, b, c can be single or multiple.
  • the steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two.
  • the software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

本公开公开了一种图像处理方法、装置、设备及介质,获取待处理图像以及该待处理图像对应的掩模图,该掩模图为待处理图像中所包括的目标对象所对应的掩模图。利用第一处理方式对掩模图进行处理,获得第一掩模图,以及利用第二处理方式对第一掩模图进行扭曲处理,获得第二掩模图。利用第一掩模图以及第二掩模图对待处理图像进行处理,获得目标图像,该目标图像中目标对象的边缘的第一侧呈现第一掩模图对应的纹理,目标对象的边缘的第二侧呈现第二掩模图对应的纹理。即,通过本公开提供的技术方案可以实现待处理图像中目标对象的边缘进行处理,以使得边缘的不同侧呈现不同的纹理效果,提升图像处理的多样性。

Description

一种图像处理方法、装置、设备及介质
相关申请的交叉引用
本申请要求申请号为202310086534.X,题为“一种图像处理方法、装置、设备及介质”、申请日为2023年01月18日的中国发明专利申请的优先权,通过引用的方式将该申请整本并入本文。
技术领域
本公开涉及计算机技术领域,具体涉及一种图像处理方法、装置、设备及介质。
背景技术
随着图像处理技术的不断发展,用户可以根据自身的需求对图像进行处理,以获得具有某一种特效的图像。然而,目前针对图像的处理方式较为单一,无法满足用户的多样化需求。
发明内容
有鉴于此,本公开提供一种图像处理方法、装置、设备及介质,以实现对图像进行多样化处理,满足用户需求。
为实现上述目的,本公开提供的技术方案如下:
在本公开第一方面,提供了一种图像处理方法,该方法包括:
获取待处理图像对应的掩模图,所述待处理图像包括目标对象,所述掩模图为所述目标对象对应的掩模图;
利用第一处理方式对所述掩模图进行处理,获得第一掩模图;
利用第二处理方式对所述第一掩模图进行处理,获得第二掩模图;
利用所述第一掩模图和所述第二掩模图对所述待处理图像进行处理,获得目标图像,所述目标图像中所述目标对象的边缘的第一侧呈现所述第一掩模图对应的纹理,所述目标对象的边缘的第二侧呈现所述第二掩模图对应的纹理。
在本申请第二方面,提供了一种图像处理装置,该装置包括:
获取单元,用于获取待处理图像对应的掩模图,所述待处理图像包括目标对象,所述掩模图为所述目标对象对应的掩模图;
处理单元,用于利用第一处理方式对所述掩模图进行处理,获得第一掩模图;
所述处理单元,还用于利用第二处理方式对所述第一掩模图进行处理,获得第二掩模图;
所述处理单元,用于利用所述第一掩模图和所述第二掩模图对所述待处理图像进行处理,获得目标图像,所述目标图像中所述目标对象的边缘的第一侧呈现所述第一掩模图对应的纹理,所述目标对象的边缘的第二侧呈现所述第二掩模图对应的纹理。
在本公开第三方面,提供了一种电子设备,所述设备包括:处理器和存储器;
所述存储器,用于存储指令或计算机程序;
所述处理器,用于执行所述存储器中的所述指令或计算机程序,以使得所述电子设备执行第一方面所述的方法。
在本公开第四方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述指令在设备上运行时,使得所述设备执行第一方面所述的方法。
在本公开第五方面,提供了一种计算机程序产品,所述计算机程序产品包括计算机程序/指令,所述计算机程序/指令被处理器执行时实现第一方面所述的方法。
附图说明
为了更清楚地说明本公开实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本公开中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本公开实施例提供的一种图像处理方法流程图;
图2a为本公开实施例提供的一种获取掩模图示意图;
图2b为本公开实施例提供的一种获取第一掩模图示意图;
图2c为本公开实施例提供的一种获取第二掩模图示意图;
图3a为本公开实施例提供的一种目标图像的示意图;
图3b为本公开实施例提供的一种扭曲处理效果图;
图3c为本公开实施例提供的另一种目标图像的示意图;
图4为本公开实施例提供的一种图像处理装置结构图;
图5为本公开实施例提供的一种电子设备结构示意图。
具体实施方式
为了使本技术领域的人员更好地理解本公开方案,下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本公开一部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本公开保护的范围。
为实现对图像中的目标对象的边缘增加多样化的处理效果,本公开提供了一种图像处理方法,具体地,获取待处理图像对应的掩模图,该待处理图像包括目标对象,该掩模图为目标对象对应的掩模图。利用第一处理方式对掩模图进行处理,获得第一掩模图,以及利用第二处理方式对第一掩模图进行处理,获得第二掩模图。利用第一掩模图、第二掩模图对待处理图像进行处理,获得目标图像,该目标图像中目标对象的不同侧呈现不同的纹理。其中,第一掩模图对应的纹理与第二掩模图对应的纹理可以不同。具体地,目标图像中的目标对象的边缘呈现撕纸描边效果。
其中,撕纸描边效果,是指图像经过处理后,该处理后的图像中的对象(例如人、动物)的边缘线条类似将纸张撕开,露出不平滑的边缘,相比处理前的图像,平平整整的感觉,通过添加撕纸效果设计,可以让图像看起来更加生动随意,也更真实。
可以理解的是,在使用本公开中各个实施例的技术方案之前,均应当依据相关法律法规通过恰当的方式对所涉及的个人信息的类型、使用范围、使用场景等告知用户,并获得用户的授权。
例如,在响应于接收到用户的主动请求时,向用户发送提示信息,以明确的提示用户,其请求执行的操作将需要获取和使用到用户的个人信息。从而,使得用户可以根据提示信息来自主的选择是否向执行本公开技 术方案的操作的电子设备、应用程序、服务器或存储介质等软件或硬件提供个人信息。
作为一种可选的但非限定的实现方式,响应于接收到用户的主动请求,向用户发送提示信息的方式例如可以是弹窗的方式,弹窗中可以以文字的方式呈现提示信息。此外,弹窗中还可以承载供用户选择“同意”或者“不同意”向电子设备提供个人信息的选择控件。
可以理解的是,上述通知和获取用户授权过程仅是示意性的,不对本公开的实现方式构成限定,其他满足相关法律法规的方式也可应用于本公开的实现方式中。
为便于理解本公开所提供的技术方案,下面将先对本公开中的表情迁移模型训练过程进行说明。
参见图1,该图为本公开实施例提供的一种图像处理方法流程图,该方法可以由图像处理客户端执行,该图像处理客户端可以部署在电子设备中。其中,电子设备可以包括移动电话、平板电脑、笔记本电脑、台式电脑、车载终端、可穿戴电子设备、一体机、智能家居设备等具有通信功能的设备,也可以是虚拟机或者模拟器模拟的设备。如图1所示,该方法可以包括如下步骤:
S101:获取待处理图像对应的掩模图。
其中,待处理图像包括目标对象,掩模图为目标对象对应的掩模图。其中,目标对象可以为人、动物或其他物体。具体地,可以对待处理图像进行掩模(mask)处理,获取待处理图像中目标对象对应的掩模图。其中,掩模图是由0和1组成的一个二进制图像,在应用掩模时,1值区域被处理,被屏蔽的0值区域不被包括在计算中。通过指定的数据值、数据范围、有限或无限值、感兴趣区定义图像掩模。
例如图2a所示,待处理图像中包括人以及植物,对待处理图像进行掩模处理,获得人对应的掩模图。
S102:利用第一处理方式对掩模图进行处理,获得第一掩模图。
其中,第一处理方式可以包括膨胀处理和/或扭曲处理,膨胀处理是指通过将像素添加到该图像中的对象的感知边界,扩张放大图像中的明亮白色区域。图像的膨胀处理可分三种:水平膨胀、垂直膨胀、全方向膨胀,本实施例中主要是指全方向膨胀;扭曲处理,图像的扭曲是按照一定的映射将像素点从原来的位置移动到新的位置。
在一些实施方式中,当第一处理方式为膨胀处理时,对掩模图进行膨胀处理,获得第一掩模图;当第一处理方式为扭曲处理时,对掩模图进行扭曲处理,获得第一掩模图;当第一处理方式包括膨胀处理和扭曲处理时,可以先对掩模图进行膨胀处理,获得第三掩模图;再对第三掩模图进行扭曲处理,获得第一掩模图。例如,图2b所示的第一处理过程对应的掩模示意图。
其中,对第三掩模图进行扭曲处理,获得第一掩模图,具体可以通过以下方式实现:获取两张值噪声图,该两张值噪声图包括水平置换图和垂直置换图;利用两张值噪声图对第三掩模图进行水平置换和垂直置换,获得第一掩模图。其中,值噪声中定义若干顶点且每个顶点含有一个随机值,这些顶点会根据自己的随机值对周围坐标产生影响,越靠近顶点则越容易受该顶点影响。即,本实施例中通过利用值噪声图对第三掩模图的水平方向和垂直方向进行影响,获得第一掩模图。
S103:利用第二处理方式对第一掩模图进行处理,获得第二掩模图。
其中,第二处理方式可以包括膨胀处理或扭曲处理。具体地,当第二处理方式为膨胀处理时,对第一掩模图进行膨胀处理,获得第二掩模图;当第二处理方式为扭曲处理时,对第一掩模图进行扭曲处理,获得第二掩模图。例如,图2c所示,对第一掩模图进行膨胀处理后的第二掩模图的示意图。
S104:利用第一掩模图和第二掩模图对待处理图像进行处理,获得目标图像。
在获取第一掩模图和第二掩模图后,利用第一掩模图和第二掩模图对待处理图像进行处理,获得目标图像。其中,目标图像中目标对象的边缘的第一侧呈现第一掩模图对应的纹理,目标对象的边缘的第二侧呈现第二 掩模图对应的纹理。其中,第一侧可以为目标对象的边缘的里侧,或者为目标对象的边缘的外侧。当第一侧为目标对象的边缘的里侧时,第二侧为目标对象的边缘的外侧;当第一侧为目标对象的边缘的外侧时,第二侧为目标对象的边缘的里侧。具体地,目标对应的边缘呈现撕纸描边效果。
具体地,利用第一掩模图和第二掩模图对待处理图像进行混合处理,获得目标图像。例如,图3a所示的示意图,将第一掩模图和第二掩模图合在一起对待处理图像进行处理,若第一侧为里侧,则第一掩模图中填充目标对象,该目标对象的边缘的里侧为第一掩模图的边缘对应的纹理,目标对象的边缘的外侧为第一掩模图的边缘对应的纹理。
可见,获取待处理图像以及该待处理图像对应的掩模图,该掩模图为待处理图像中所包括的目标对象所对应的掩模图。利用第一处理方式对掩模图进行处理,获得第一掩模图,以及利用第二处理方式对第一掩模图进行扭曲处理,获得第二掩模图。利用第一掩模图以及第二掩模图对待处理图像进行处理,获得目标图像,该目标图像中目标对象的边缘的第一侧呈现第一掩模图对应的纹理,目标对象的边缘的第二侧呈现第二掩模图对应的纹理。即,通过本公开提供的技术方案可以实现待处理图像中目标对象的边缘进行处理,以使得边缘的不同侧呈现不同的纹理效果,提升图像处理的多样性。
在一些实施方式中,在利用第一掩模图和第二掩模图对待处理图像进行处理之前,还可以分别对第一掩模图和第二掩模图进行处理,在利用处理后的第一掩模图和处理后的第二掩模图对待处理图像进行处理,从而增强图像处理的效果。具体地,对第一掩模图、第二掩模图进行分别扭曲处理,获得第四掩模图和第五掩模图;利用第四掩模图和第五掩模图对待处理图像进行处理,获得目标图像。其中,目标图像中目标对象的边缘的第一侧呈现第四掩模图对应的纹理,目标对象的边缘的第二侧呈现第五掩模图对应的纹理。
具体地,可以通过以下方式对第一掩模图、第二掩模图进行扭曲处理:获取至少两张分形噪声图,该至少两张分形噪声图包括水平置换图和垂直 置换图;利用至少两张分形噪声图对所述第一掩模图进行水平置换和垂直置换,获得第四掩模图;利用至少两张分形噪声图对第二掩模图进行水平置换和垂直置换,获得第五掩模图。其中,分形噪声是通过将不同频率的噪声叠加,得到富有细节的噪声。当第一掩模图为目标对象的边缘的里侧掩模图、第二掩模图为目标对象的边缘的外侧掩模图时,第四掩模图也为目标对象的边缘的里侧掩模图、第五掩模图为目标对象的边缘的外侧掩模图。
在具体实现时,为提高处理结果的多样性,可以获取四张分形噪声图,该四张分形噪声图包括两张水平置换图和两张垂直置换图。利用一张水平置换图和一张垂直置换图对第一掩模图进行水平置换和垂直置换,获得第四掩模图;再利用另一张水平置换图和另一张垂直置换图对第二掩模图进行水平置换和垂直置换,获得第五掩模图。
在一些实施方式中,为使得边缘所呈现的撕纸效果更佳逼真,在利用第四掩模图、第五掩模图对待处理图像进行处理前,对该第四掩模图和第五掩模图进行扭曲处理,利用处理后的第四掩模图和处理后的第五掩模图对待处理图像进行处理,获得目标图像。具体地,对第四掩模图、第五掩模图分别进行扭曲处理,获得第六掩模图和第七掩模图;利用第六掩模图、第七掩模图对待处理图像进行处理,获得目标图像。其中,目标图像中目标对象的边缘的第一侧呈现第六掩模图对应的纹理,目标对象的边缘的第二侧呈现第七掩模图对应的纹理。当四第掩模图为目标对象的边缘的里侧掩模图、第五掩模图为目标对象的边缘的外侧掩模图时,第六掩模图也为目标对象的边缘的里侧掩模图、第七掩模图为目标对象的边缘的外侧掩模图。
例如,图3b所示,左图为第四掩模图和第五掩模图合在一起的效果图,右图为扭曲处理后的第六掩模图和第七掩模图合在一起后的效果图。其中,第六掩模图和第七掩模图的边缘会有一点毛毛的噪点,会更像撕纸产生的细小纤维。
其中,可以通过以下方式实现对第四掩模图、第五掩模图进行扭曲处理,具体为:获取至少两张白噪声图,该至少两张白噪声图包括水平置换图和垂直置换图;利用至少两张白噪声图对第四掩模图进行水平置换和垂直置换, 获得第六掩模图;利用至少两张白噪声图对所述第五模图进行水平置换和垂直指端,获得第七掩模图。
在一些实施方式中,若第二侧为目标对象的边缘的外侧,在利用第一掩模图和第二掩模图对待处理图像进行处理之前,还可以对第二掩模图进行模糊处理,获得阴影掩模图。同理,若第一侧为目标对象的外侧,则可以对对第一掩模图进行模糊处理,获得阴影掩模图。然后,利用第一掩模图、第二掩模图以及阴影掩模图对待处理退昂进行处理,获得目标图像。其中,目标对象的边缘的外侧存在该阴影掩模图对应的阴影区域。
在一些实施方式中,利用第一里掩模图、第二掩模图以及阴影掩模图对待处理图像进行处理,获得目标图像,包括:利用第一里掩模图、第二掩模图以及阴影掩模图对纸质纹理和待处理图像进行混合,获得目标图像。其中,目标图像中除目标对象所在的区域外的其他区域为纸质纹理。
例如,图3c的左图所示的目标图像示意图,目标图像中的人物的边缘呈现撕纸描边效果。
具体地,若存在第四掩模图和第五掩模图,则可以对其中外侧掩模图进行模糊处理,获得阴影掩模图。然后,利用第四掩模图、第五掩模图以及阴影掩模图对待处理图像进行处理,获得目标图像。或者,若存在第六掩模图和第七掩模图,则可以对其中外侧掩模图进行模糊处理,获得阴影掩模图。然后,利用第六掩模图、第七掩模图以及阴影掩模图对待处理图像进行处理,获得目标图像。
基于上述方法实施例,本申请实施例提供了一种图像处理装置和电子设备,下面将结合附图进行说明。
参见图4,该图为本申请实施例提供的一种图像处理装置结构图,如图4所示,该装置400包括:获取单元401和处理单元402。
获取单元401,用于获取待处理图像对应的掩模图,所述待处理图像包括目标对象,所述掩模图为所述目标对象对应的掩模图;
处理单元402,用于利用第一处理方式对所述掩模图进行处理,获得第一掩模图;
所述处理单元402,还用于利用第二处理方式对所述第一掩模图进行处理,获得第二掩模图;
所述处理单元403,用于利用所述第一掩模图和所述第二掩模图对所述待处理图像进行处理,获得目标图像,所述目标图像中所述目标对象的边缘的第一侧呈现所述第一掩模图对应的纹理,所述目标对象的边缘的第二侧呈现所述第二掩模图对应的纹理。
在一些实施方式中,所述第一处理方式包括膨胀处理和/或扭曲处理。
在一些实施方式中,所述处理单元402,具体用于对所述掩模图进行膨胀处理,获得第三掩模图;对所述第三掩模图进行扭曲处理,获得第一掩模图。
在一些实施方式中,所述处理单元402,具体用于对所述第一掩模图进行膨胀处理,获得第二掩模图。
在一些实施方式中,所述处理单元402,在利用所述第一掩模图和所述第二掩模图对所述待处理图像进行处理之前,还用于对所述第一掩模图、所述第二掩模图进行分别扭曲处理,获得第四掩模图和第五掩模图;
所述处理单元402,具体用于利用所述第四掩模图和所述第五掩模图对所述待处理图像进行处理,获得目标图像,所述目标图像中所述目标对象的边缘的第一侧呈现所述第四掩模图对应的纹理,所述目标对象的边缘的第二侧呈现所述第五掩模图对应的纹理。
在一些实施方式中,所述处理单元402,在利用所述第四掩模图和所述第五掩模图对所述待处理图像进行处理之前,对所述第四掩模图、所述第五掩模图分别进行扭曲处理,获得第六掩模图和第七掩模图;
所述处理单元402,具体用于所述利用所述第六掩模图、所述第七掩模图对所述待处理图像进行处理,获得目标图像,所述目标图像中所述目标对象的边缘的第一侧呈现所述第六掩模图对应的纹理,所述目标对象的边缘的第二侧呈现所述第七掩模图对应的纹理。
在一些实施方式中,若所述第二侧为所述目标对象的边缘的外侧,所述处理单元402,在利用所述第一掩模图和所述第二掩模图对所述待处理图像进行处理之前,还用于对所述第二掩模图进行模糊处理,获得阴影掩模图;
所述处理单元402,具体用于利用所述第一掩模图、所述第二掩模图以及所述阴影掩模图对所述待处理图像进行处理,获得目标图像,所述目标对象的边缘的第二侧存在所述阴影掩模图对应的阴影区域。
在一些实施方式中,所述处理单元402,具体用于利用所述第一掩模图、所述第二掩模图以及所述阴影掩模图对纸质纹理和所述待处理图像进行混合,获得目标图像。
在一些实施方式中,所述目标图像中除所述目标对象所在的区域外的其他区域为所述纸质纹理。
在一些实施方式中,所述处理单元402,具体用于获取两张值噪声图,所述两张值噪声图包括水平置换图和垂直置换图;利用所述两张值噪声图对所述第三掩模图进行水平置换和垂直置换,获得第一掩模图。
在一些实施方式中,所述处理单元402,具体用于获取至少两张分形噪声图,所述至少两张分形噪声图包括水平置换图和垂直置换图;利用所述至少两张分形噪声图对所述第一掩模图进行水平置换和垂直置换,获得第四掩模图;利用所述至少两张分形噪声图对所述第二掩模图进行水平置换和垂直置换,获得第五掩模图。
在一些实施方式中,所述处理单元402,具体用于获取至少两张白噪声图,所述至少两张白噪声图包括水平置换图和垂直置换图;利用所述至少两张白噪声图对所述第四掩模图进行水平置换和垂直置换,获得第六掩模图;利用所述至少两张白噪声图对所述第五模图进行水平置换和垂直指端,获得第七掩模图。
在一些实施方式中,所述目标对象的边缘呈现撕纸效果。
需要说明的是,本实施例中各个单元的具体实现可以参见上述方法实施例中的相关描述。本公开实施例中对单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。本公开实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。例如,上述实施例中,处理单元和发送单元可以是同一个单元,也可以是不同的单元。上述集成 的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
参见图5,其示出了适于用来实现本公开实施例的电子设备500的结构示意图。本公开实施例中的终端设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图5示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图5所示,电子设备500可以包括处理装置(例如中央处理器、图形处理器等)501,其可以根据存储在只读存储器(ROM)502中的程序或者从存储装置508加载到随机访问存储器(RAM)503中的程序而执行各种适当的动作和处理。在RAM503中,还存储有电子设备500操作所需的各种程序和数据。处理装置501、ROM 502以及RAM 503通过总线504彼此相连。输入/输出(I/O)接口505也连接至总线504。
通常,以下装置可以连接至I/O接口505:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置506;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置507;包括例如磁带、硬盘等的存储装置508;以及通信装置509。通信装置509可以允许电子设备500与其他设备进行无线或有线通信以交换数据。虽然图5示出了具有各种装置的电子设备500,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置509从网络上被下载和安装,或者从存储装置508被 安装,或者从ROM502被安装。在该计算机程序被处理装置501执行时,执行本公开实施例的方法中限定的上述功能。
本公开实施例提供的电子设备与上述实施例提供的方法属于同一发明构思,未在本实施例中详尽描述的技术细节可参见上述实施例,并且本实施例与上述实施例具有相同的有益效果。
本公开实施例提供了一种计算机存储介质,其上存储有计算机程序,该程序被处理器执行时实现上述实施例所提供的方法。
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。
在一些实施方式中,客户端、服务器可以利用诸如HTTP(Hyper Text Transfer Protocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”), 网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备可以执行上述方法。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元/模块的名称在某种情况下并不构成对该单元本身的限定。
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。
需要说明的是,本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的系统或装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。
应当理解,在本公开中,“至少一个(项)”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,用于描述关联对象的关联关系,表示可以存在三种关系,例如,“A和/或B”可以表示:只存在A,只存在B以及同时存在A和B三种情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项(个)”或其类似表达,是指这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b或c中的至少一项(个),可以表示:a,b,c,“a和b”,“a和c”,“b和c”,或“a和b和c”,其中a,b,c可以是单个,也可以是多个。
还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。
对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本公开。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本公开的精神或范围的情况下,在其它实施例中实现。因此,本公开将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。

Claims (22)

  1. 一种图像处理方法,其特征在于,所述方法包括:
    获取待处理图像对应的掩模图,所述待处理图像包括目标对象,所述掩模图为所述目标对象对应的掩模图;
    利用第一处理方式对所述掩模图进行处理,获得第一掩模图;
    利用第二处理方式对所述第一掩模图进行处理,获得第二掩模图;
    利用所述第一掩模图和所述第二掩模图对所述待处理图像进行处理,获得目标图像,所述目标图像中所述目标对象的边缘的第一侧呈现所述第一掩模图对应的纹理,所述目标对象的边缘的第二侧呈现所述第二掩模图对应的纹理。
  2. 根据权利要求1所述的方法,其特征在于,所述第一处理方式包括膨胀处理和/或扭曲处理。
  3. 根据权利要求2所述的方法,其特征在于,所述利用第一处理方式对所述掩模图进行处理,获得第一掩模图,包括:
    对所述掩模图进行膨胀处理,获得第三掩模图;
    对所述第三掩模图进行扭曲处理,获得第一掩模图。
  4. 根据权利要求1所述的方法,其特征在于,所述利用第二处理方式对所述第一掩模图进行处理,获得第二掩模图,包括:
    对所述第一掩模图进行膨胀处理,获得第二掩模图。
  5. 根据权利要求1所述的方法,其特征在于,在利用所述第一掩模图和所述第二掩模图对所述待处理图像进行处理之前,所述方法还包括:
    对所述第一掩模图、所述第二掩模图进行分别扭曲处理,获得第四掩模图和第五掩模图;
    所述利用所述第一掩模图和所述第二掩模图对所述待处理图像进行处理,获得目标图像,包括:
    利用所述第四掩模图和所述第五掩模图对所述待处理图像进行处理,获得目标图像,所述目标图像中所述目标对象的边缘的第一侧呈现所述第四掩模图对应的纹理,所述目标对象的边缘的第二侧呈现所述第五掩模图对应的纹理。
  6. 根据权利要求5所述的方法,其特征在于,在利用所述第四掩模图和所述第五掩模图对所述待处理图像进行处理之前,所述方法还包括:
    对所述第四掩模图、所述第五掩模图分别进行扭曲处理,获得第六掩模图和第七掩模图;
    所述利用所述第四模图和所述第五掩模图对所述待处理图像进行处理,获得目标图像,包括:
    所述利用所述第六掩模图、所述第七掩模图对所述待处理图像进行处理,获得目标图像,所述目标图像中所述目标对象的边缘的第一侧呈现所述第六掩模图对应的纹理,所述目标对象的边缘的第二侧呈现所述第七掩模图对应的纹理。
  7. 根据权利要求1所述的方法,其特征在于,若所述第二侧为所述目标对象的边缘的外侧,在利用所述第一掩模图和所述第二掩模图对所述待处理图像进行处理之前,所述方法还包括:
    对所述第二掩模图进行模糊处理,获得阴影掩模图;
    所述利用所述第一掩模图和所述第二掩模图对所述待处理图像进行处理,获得目标图像,包括:
    利用所述第一掩模图、所述第二掩模图以及所述阴影掩模图对所述待处理图像进行处理,获得目标图像,所述目标对象的边缘的第二侧存在所述阴影掩模图对应的阴影区域。
  8. 根据权利要求7所述的方法,其特征在于,所述利用所述第一掩模图、所述第二掩模图以及所述阴影掩模图对所述待处理图像进行处理,获得目标图像,包括:
    利用所述第一掩模图、所述第二掩模图以及所述阴影掩模图对纸质纹理和所述待处理图像进行混合,获得目标图像。
  9. 根据权利要求8所述的方法,其特征在于,所述目标图像中除所述目标对象所在的区域外的其他区域为所述纸质纹理。
  10. 根据权利要求1所述的方法,其特征在于,所述目标对象的边缘呈现撕纸描边效果。
  11. 一种图像处理装置,其特征在于,所述装置包括:
    获取单元,用于获取待处理图像对应的掩模图,所述待处理图像包括目标对象,所述掩模图为所述目标对象对应的掩模图;
    处理单元,用于利用第一处理方式对所述掩模图进行处理,获得第一掩模图;
    所述处理单元,还用于利用第二处理方式对所述第一掩模图进行处理,获得第二掩模图;
    所述处理单元,用于利用所述第一掩模图和所述第二掩模图对所述待处理图像进行处理,获得目标图像,所述目标图像中所述目标对象的边缘的第一侧呈现所述第一掩模图对应的纹理,所述目标对象的边缘的第二侧呈现所述第二掩模图对应的纹理。
  12. 一种电子设备,其特征在于,所述设备包括:处理器和存储器;
    所述存储器,用于存储指令或计算机程序;
    所述处理器,用于执行所述存储器中的所述指令或计算机程序,以使得所述电子设备执行动作,所述动作包括:
    获取待处理图像对应的掩模图,所述待处理图像包括目标对象,所述掩模图为所述目标对象对应的掩模图;
    利用第一处理方式对所述掩模图进行处理,获得第一掩模图;
    利用第二处理方式对所述第一掩模图进行处理,获得第二掩模图;
    利用所述第一掩模图和所述第二掩模图对所述待处理图像进行处理,获得目标图像,所述目标图像中所述目标对象的边缘的第一侧呈现所述第一掩模图对应的纹理,所述目标对象的边缘的第二侧呈现所述第二掩模图对应的纹理。
  13. 根据权利要求12所述的设备,其特征在于,所述第一处理方式包括膨胀处理和/或扭曲处理。
  14. 根据权利要求13所述的设备,其特征在于,所述利用第一处理方式对所述掩模图进行处理,获得第一掩模图,包括:
    对所述掩模图进行膨胀处理,获得第三掩模图;
    对所述第三掩模图进行扭曲处理,获得第一掩模图。
  15. 根据权利要求12所述的设备,其特征在于,所述利用第二处理方式对所述第一掩模图进行处理,获得第二掩模图,包括:
    对所述第一掩模图进行膨胀处理,获得第二掩模图。
  16. 根据权利要求12所述的设备,其特征在于,在利用所述第一掩模图和所述第二掩模图对所述待处理图像进行处理之前,所述动作还包括:
    对所述第一掩模图、所述第二掩模图进行分别扭曲处理,获得第四掩模图和第五掩模图;
    所述利用所述第一掩模图和所述第二掩模图对所述待处理图像进行处理,获得目标图像,包括:
    利用所述第四掩模图和所述第五掩模图对所述待处理图像进行处理,获得目标图像,所述目标图像中所述目标对象的边缘的第一侧呈现所述第四掩模图对应的纹理,所述目标对象的边缘的第二侧呈现所述第五掩模图对应的纹理。
  17. 根据权利要求16所述的设备,其特征在于,在利用所述第四掩模图和所述第五掩模图对所述待处理图像进行处理之前,所述动作还包括:
    对所述第四掩模图、所述第五掩模图分别进行扭曲处理,获得第六掩模图和第七掩模图;
    所述利用所述第四模图和所述第五掩模图对所述待处理图像进行处理,获得目标图像,包括:
    所述利用所述第六掩模图、所述第七掩模图对所述待处理图像进行处理,获得目标图像,所述目标图像中所述目标对象的边缘的第一侧呈现所述第六掩模图对应的纹理,所述目标对象的边缘的第二侧呈现所述第七掩模图对应的纹理。
  18. 根据权利要求12所述的设备,其特征在于,若所述第二侧为所述目标对象的边缘的外侧,在利用所述第一掩模图和所述第二掩模图对所述待处理图像进行处理之前,所述动作还包括:
    对所述第二掩模图进行模糊处理,获得阴影掩模图;
    所述利用所述第一掩模图和所述第二掩模图对所述待处理图像进行处理,获得目标图像,包括:
    利用所述第一掩模图、所述第二掩模图以及所述阴影掩模图对所述待处理图像进行处理,获得目标图像,所述目标对象的边缘的第二侧存在所述阴影掩模图对应的阴影区域。
  19. 根据权利要求18所述的设备,其特征在于,所述利用所述第一掩模图、所述第二掩模图以及所述阴影掩模图对所述待处理图像进行处理,获得目标图像,包括:
    利用所述第一掩模图、所述第二掩模图以及所述阴影掩模图对纸质纹理和所述待处理图像进行混合,获得目标图像。
  20. 根据权利要求19所述的设备,其特征在于,所述目标图像中除所述目标对象所在的区域外的其他区域为所述纸质纹理。
  21. 根据权利要求12所述的设备,其特征在于,所述目标对象的边缘呈现撕纸描边效果。
  22. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有指令,当所述指令在设备上运行时,使得所述设备执行权利要求1-10任一项所述的方法。
PCT/CN2024/070322 2023-01-18 2024-01-03 一种图像处理方法、装置、设备及介质 Ceased WO2024152901A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202310086534.X 2023-01-18
CN202310086534.XA CN116051365A (zh) 2023-01-18 2023-01-18 一种图像处理方法、装置、设备及介质

Publications (1)

Publication Number Publication Date
WO2024152901A1 true WO2024152901A1 (zh) 2024-07-25

Family

ID=86117995

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2024/070322 Ceased WO2024152901A1 (zh) 2023-01-18 2024-01-03 一种图像处理方法、装置、设备及介质

Country Status (2)

Country Link
CN (1) CN116051365A (zh)
WO (1) WO2024152901A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116051365A (zh) * 2023-01-18 2023-05-02 北京字跳网络技术有限公司 一种图像处理方法、装置、设备及介质

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170109900A1 (en) * 2015-05-28 2017-04-20 Adobe Systems Incorporated Example-based Edge-aware Directional Texture Painting
CN111464834A (zh) * 2020-04-07 2020-07-28 腾讯科技(深圳)有限公司 一种视频帧处理方法、装置、计算设备及存储介质
CN112116624A (zh) * 2019-06-21 2020-12-22 华为技术有限公司 一种图像处理方法和电子设备
CN113674303A (zh) * 2021-08-31 2021-11-19 Oppo广东移动通信有限公司 图像处理方法、装置、电子设备及存储介质
CN114943788A (zh) * 2022-07-01 2022-08-26 北京字跳网络技术有限公司 特效生成方法、装置、设备及存储介质
CN114979506A (zh) * 2021-02-26 2022-08-30 精工爱普生株式会社 显示方法和记录介质
CN116051365A (zh) * 2023-01-18 2023-05-02 北京字跳网络技术有限公司 一种图像处理方法、装置、设备及介质

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170109900A1 (en) * 2015-05-28 2017-04-20 Adobe Systems Incorporated Example-based Edge-aware Directional Texture Painting
CN112116624A (zh) * 2019-06-21 2020-12-22 华为技术有限公司 一种图像处理方法和电子设备
CN111464834A (zh) * 2020-04-07 2020-07-28 腾讯科技(深圳)有限公司 一种视频帧处理方法、装置、计算设备及存储介质
CN114979506A (zh) * 2021-02-26 2022-08-30 精工爱普生株式会社 显示方法和记录介质
CN113674303A (zh) * 2021-08-31 2021-11-19 Oppo广东移动通信有限公司 图像处理方法、装置、电子设备及存储介质
CN114943788A (zh) * 2022-07-01 2022-08-26 北京字跳网络技术有限公司 特效生成方法、装置、设备及存储介质
CN116051365A (zh) * 2023-01-18 2023-05-02 北京字跳网络技术有限公司 一种图像处理方法、装置、设备及介质

Also Published As

Publication number Publication date
CN116051365A (zh) 2023-05-02

Similar Documents

Publication Publication Date Title
JP7553582B2 (ja) 画像特殊効果の処理方法及び装置
CN109460233B (zh) 页面的原生界面显示更新方法、装置、终端设备及介质
EP4258165B1 (en) Two-dimensional code displaying method and apparatus, device, and medium
CN114332323B (zh) 一种粒子效果渲染方法、装置、设备及介质
CN116596748A (zh) 图像风格化处理方法、装置、设备、存储介质和程序产品
CN114742934B (zh) 图像渲染方法、装置、可读介质及电子设备
WO2024016923A1 (zh) 特效图的生成方法、装置、设备及存储介质
CN111459364B (zh) 图标更新方法、装置和电子设备
CN114723600B (zh) 美妆特效的生成方法、装置、设备、存储介质和程序产品
CN109635821A (zh) 图像区域的特征提取方法、装置、设备及可读介质
CN114419298A (zh) 虚拟物体的生成方法、装置、设备及存储介质
CN113808238A (zh) 动画的渲染方法、装置、可读介质和电子设备
WO2024152901A1 (zh) 一种图像处理方法、装置、设备及介质
CN115600629B (zh) 车辆信息二维码生成方法、电子设备和计算机可读介质
CN112764629B (zh) 增强现实界面展示方法、装置、设备和计算机可读介质
CN110427584A (zh) 页面生成方法、装置、电子设备及计算机可读存储介质
CN111338827B (zh) 表格数据的粘贴方法、装置以及电子设备
CN111258582B (zh) 一种窗口渲染方法、装置、计算机设备及存储介质
CN111290812B (zh) 应用控件的显示方法、装置、终端及存储介质
WO2025108247A1 (zh) 图像处理方法、装置、电子设备以及存储介质
CN112148417A (zh) 页面调整方法、装置、电子设备和计算机可读介质
EP4672157A1 (en) IMAGE PROCESS AND APPARATUS, DEVICE AND SUPPORT
US20250336167A1 (en) Method, apparatus, device and storage medium for image processing
WO2024051541A1 (zh) 特效图像生成方法、装置、电子设备及存储介质
CN111199519B (zh) 特效包的生成方法和装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 24744077

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 24744077

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 24744077

Country of ref document: EP

Kind code of ref document: A1