WO2023221941A1 - 图像处理方法、装置、设备及存储介质 - Google Patents

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

Info

Publication number
WO2023221941A1
WO2023221941A1 PCT/CN2023/094297 CN2023094297W WO2023221941A1 WO 2023221941 A1 WO2023221941 A1 WO 2023221941A1 CN 2023094297 W CN2023094297 W CN 2023094297W WO 2023221941 A1 WO2023221941 A1 WO 2023221941A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
special effect
server
display
current screen
Prior art date
Application number
PCT/CN2023/094297
Other languages
English (en)
French (fr)
Inventor
马佳欣
刘纯
刘伟莹
何孟芸
Original Assignee
北京字跳网络技术有限公司
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 北京字跳网络技术有限公司 filed Critical 北京字跳网络技术有限公司
Publication of WO2023221941A1 publication Critical patent/WO2023221941A1/zh

Links

Classifications

    • G06T3/04
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation

Definitions

  • the embodiments of the present disclosure relate to the field of image processing technology, such as an image processing method, device, equipment and storage medium.
  • mobile terminals have become one of the indispensable tools for users to carry out entertainment activities. Users can use mobile terminals to perform a variety of image processing. In related technologies, during image processing, most can only run local algorithms on the client. Due to the limitations of the hardware configuration of the mobile terminal, the efficiency of image processing is low, and the accuracy of the processed image is poor, which affects Image processing effects.
  • Embodiments of the present disclosure provide an image processing method, device, equipment, and storage medium.
  • the initial image is sent to the server for special effects processing, which can not only reduce the data processing pressure on the client, but also improve the effect of image special effects processing.
  • an embodiment of the present disclosure provides an image processing method, including:
  • embodiments of the present disclosure also provide an image processing device, including:
  • the initial image acquisition module is configured to capture a frame of the current picture in response to detecting the setting operation triggered by the user, and obtain the initial image;
  • the initial image sending module is configured to send the initial image to the server so that the server The initial image is subjected to first special effects processing; and the set material is rendered to the current picture for display;
  • the first special effects image display module is configured to receive the first special effects image sent by the server, and render the first special effects image to the current screen for display; wherein the first special effects image is the initial image performed by the server. The image after the first special effects processing.
  • embodiments of the present disclosure also provide an electronic device, where the electronic device includes:
  • processors one or more processors
  • a storage device for storing one or more programs
  • the one or more processors When the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the image processing method as described in any one of claims 1-9.
  • embodiments of the present disclosure also provide a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the image processing method as described in the embodiments of the present disclosure.
  • Figure 1 is a schematic flowchart of an image processing method provided by an embodiment of the present disclosure
  • Figure 2a is an example diagram of a setting material provided by an embodiment of the present disclosure
  • Figure 2b is an example diagram of a setting material provided by an embodiment of the present disclosure
  • Figure 3 is a schematic structural diagram of an image processing device provided by an embodiment of the present disclosure.
  • FIG. 4 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.
  • the term “include” and its variations are open-ended, ie, “including but not limited to.”
  • the term “based on” means “based at least in part on.”
  • the term “one embodiment” means “at least one embodiment”; the term “another embodiment” means “at least one additional embodiment”; and the term “some embodiments” means “at least some embodiments”. Relevant definitions of other terms will be given in the description below.
  • a prompt message is sent to the user to clearly remind the user that the operation requested will require the acquisition and use of the user's personal information. Therefore, users can autonomously choose whether to provide personal information to software or hardware such as electronic devices, applications, servers or storage media that perform the operations of the technical solution of the present disclosure based on the prompt information.
  • the method of sending prompt information to the user may be, for example, a pop-up window, and the prompt information may be presented in the form of text in the pop-up window.
  • the pop-up window can also contain a selection control for the user to choose "agree” or "disagree” to provide personal information to the electronic device.
  • FIG. 1 is a schematic flowchart of an image processing method provided by an embodiment of the present disclosure.
  • the embodiment of the present disclosure is suitable for processing images.
  • the method can be executed by an image processing device, and the device can be implemented through software and/or It is implemented in the form of hardware, optionally, through electronic equipment.
  • the electronic equipment can be a mobile terminal, PC or server, etc.
  • the method includes:
  • the setting operation can be clicking the screen, double-clicking the screen, detecting the user making a setting gesture or posture, collecting a voice signal containing the setting keyword, etc.
  • Frame capture can also be called screen capture. By calling the frame capture function, the content displayed on the current screen is captured to obtain the initial image.
  • the terminal device when the terminal device opens an image processing prop, the terminal device displays the image currently collected by the camera on the current screen in real time, or obtains a video file from a local database or a network database and plays it on the current interface.
  • the terminal device detects a setting operation triggered by the user, it performs a frame capture process on the content displayed on the current screen to obtain an initial image.
  • the current picture before capturing the current picture, it also includes: running a set beautification program package to beautify the collected images; and rendering the beautified image to the current picture.
  • the setting and beautification package may be a program package that performs setting and beautifying processing on the image, the input of which is the image, and the output is the beautified image.
  • the beautification setting package may be a beautification program package.
  • the beautification setting package may be a program package for adjusting hue and/or saturation.
  • the set beautification program package may be a program package with beautification functions that has been packaged in advance, and the user can select and set it according to needs after opening the image processing tool package.
  • the image collected by the camera is beautified, and the beautified image is rendered to the current picture.
  • capturing a frame of the current picture includes: capturing a frame of the beautified image in the current picture.
  • the image is first beautified so that the beautified image can be obtained through frame capture, which can improve the display effect of the image.
  • S120 Send the initial image to the server, so that the server performs first special effects processing on the initial image; and renders the set material to the current screen for display.
  • the client sends the initial image to the server
  • the server calls the special effects algorithm configured on the server to perform first special effects processing on the initial image to obtain the first special effects image, and then the server returns the first special effects image to the client. end.
  • the method of sending the initial image to the server so that the server performs the first special effect processing on the initial image may be: sending the initial image carrying the algorithm identifier to the server, so that the server calls the target special effect according to the algorithm identifier.
  • the algorithm identification may consist of information such as algorithm name, algorithm storage address, etc.
  • the target special effects algorithm can be a constructed neural network model, such as a generative adversarial network model (Generative Adversarial Nets, GAN), etc.
  • different special effects functions correspond to different special effects processing algorithms.
  • An image processing prop can set one or more special effects processing algorithms on the server side, and the user selects the required special effects processing algorithms.
  • the special effects function can be to perform special effects on a set area in the image. Processing, such as: changing the hairstyle of the portrait in the original image (including replacing hair length, hair color, and hair style in at least one way), stylizing the original image (for example: converting to sketch style, simple drawing style Or opera facial makeup style, etc.).
  • the first special effects processing can be accurately performed on the initial image.
  • the time for the server to return the special effects processed image is uncertain.
  • the set materials can be rendered to the current screen for display.
  • the set material can be a video file, which is composed of a sequence of material pictures, that is, it is composed of multiple material pictures.
  • the material picture can be an image preset by the developer, or a sequence of material pictures used for timing.
  • it can be a sequence of material images in the form of a progress bar, a sequence of material images in the form of a countdown, or a sequence of material images combined with a countdown and a progress bar.
  • Figures 2a and 2b are example diagrams of setting materials.
  • the setting materials are displayed in the form of a progress bar. From left to right, as time advances, the progress of the progress bar also moves forward. Advance.
  • the set material is displayed in the form of a countdown. From left to right, as time progresses, the numbers in the material picture gradually decrease.
  • the process of rendering the set material to the current screen for display may be: sequentially rendering the sequence of material images to the current screen for display.
  • the sequence of material pictures is arranged in a certain order, the material pictures are read in sequence according to the sorting, and the read material pictures are rendered to the current screen for slow display.
  • the set material is rendered to the current screen for display, which can avoid the problem that the current screen display content is relatively single, thereby improving the interest of image processing.
  • S130 Receive the first special effect image sent by the server, and render the first special effect image to the current screen for display.
  • the first special effect image is an image after the server performs first special effect processing on the initial image.
  • the server After the server completes the first special effect processing on the initial image, it obtains the first special effect image, and then returns the first special effect image to the client, so that the client displays the first special effect image.
  • receiving the first special effects image sent by the server and rendering the first special effects image to the current screen for display may include: in response to receiving the first special effects image sent by the server and the display of the set material is not completed, continuing Render the set material to the current screen; in response to completion of display of the set material, render the first special effects image to the current screen for display.
  • the set material is composed of a sequence of material pictures, it takes a certain amount of time to display all the sequence of material pictures, for example, it can be any value between 2 and 5 seconds. If the current network status is good, the server can return the first special effect image to the client in a short period of time.
  • the material set here may Not shown yet completed. At this time, continue to render the remaining material images to the current screen in order for display until the set material display is completed, and then render the first special effect image to the current screen for display.
  • the set material is displayed completely to ensure the continuity of the screen display content, and can avoid the first special effect image from being displayed abruptly on the current screen, thereby improving the user's viewing experience.
  • the server can return the first special effect image to the client in a short period of time, and the set material here may not be displayed yet. At this time, stop rendering the remaining material images, and directly render the first special effects image to the current screen for display.
  • the solution of this embodiment can promptly display the first special effect image on the current screen, reducing the user's waiting time.
  • receiving the first special effect image sent by the server and rendering the first special effect image to the current screen for display may include: in response to not receiving the first special effect image sent by the server when the set material display is completed, Stop the current picture at the set material for a set duration, or reacquire the set material, and display the set material for the set duration on the current screen; in response to receiving the first special effects image sent by the server within the set duration , rendering the first special effect image to the current screen for display.
  • the set duration can be shorter than the complete display duration of the set material. For example, any value between 2-3 seconds can be set. Resting the current picture on the set material for a set duration can be understood as freezing the current picture on the last material picture of the set material for a set duration. Reacquiring the set material and displaying the set material with a set duration on the current screen can be understood as: reading from the first material image of the set material, reading the material image with a set duration, or starting from the set material image. Randomly read material images of a set duration from the material, and render the read material images to the current screen for display. Within the set time period, in response to the client receiving the first special effect image sent by the server, the first special effect image is rendered to the current screen for display.
  • the client may still not receive the first special effect image returned by the server when the set material display is completed. At this time, it will wait for the set time. If it is within the set time, When the client receives the first special effect image sent by the server, it renders the first special effect image to the current screen for display. When the set material display is completed and the first special effect image sent by the server has not been received, continue to wait for the set time to ensure that the image processed by the server is displayed on the current screen as much as possible.
  • stopping the current picture for the set material for a set duration, or reacquiring the set material, and displaying the set material for the set duration after the current picture also includes: responding to a response that the message is not received within the set duration.
  • the first special effect image sent to the server is rendered to the current screen for display, or the setting information is displayed on the current screen.
  • the setting information may be information indicating that the first special effect image returned by the server has not been received, For example: "Processing failed" etc.
  • the initial image is rendered to the current screen for display, or the setting information is displayed on the current screen to clarify the content displayed on the current screen.
  • the initial image after obtaining the initial image, it also includes: performing a second special effect processing on the initial image to obtain a second special effect image; in response to not receiving the first special effect image sent by the server within a set time period, processing the second special effect image.
  • the image is rendered to the current screen for display.
  • the client performs second special effects processing on the initial image by calling a local special effects processing algorithm.
  • the local special effects processing algorithm is less accurate and takes up less system resources than the server-side special effects processing algorithm.
  • performing the second special effect processing on the initial image to obtain the second special effect image may include: segmenting the set area in the initial image to obtain sub-regions; performing the second special effect processing on the sub-regions to obtain the second special effect image. Two special effects images.
  • the second special effect processing may be a processing method corresponding to the first special effect processing. For example: if the first special effect treatment is the special effect treatment of "changing hair style", the second special effect treatment may be dyeing the hair.
  • the process of segmenting the set area in the initial image and obtaining the sub-regions may be: first, perform semantic recognition on the set area, obtain a mask of the set area, and use the mask to divide the set area into Segment from the initial image to obtain the sub-region corresponding to the set area.
  • After obtaining the sub-region perform a second special effect processing on the sub-region, and then fuse the sub-region processed by the second special effect with the initial image to obtain a second special effect image.
  • the process of performing the second special effect processing on the initial image may be: first, perform hair recognition on the initial image, obtain the hair mask, and use the hair mask to remove the hair area from the initial image.
  • Segment then obtain the set color, mix the set color and the original color of the hair to obtain the target color, determine the target color as the final color of each pixel in the hair area, and finally fuse the dyed hair area with the initial image.
  • a second special effect image is obtained, thereby achieving hair dyeing.
  • the second special effect image processed by the client is displayed on the current screen to achieve full coverage of image processing and avoid affecting the user's use. experience.
  • the current screen after rendering the first special effect image to the current screen for display, it also includes: in response to detecting that the user clicks the restore button, the current screen resumes displaying the image collected by the camera in real time, and can continue to detect the setting operation triggered by the user. .
  • this embodiment can be used in an application scenario of performing special effect processing of "changing hairstyle” on the portraits in the image.
  • the specific process is as follows: After the user starts the image processing tool through the mobile terminal, he runs the beautification program package. The mobile terminal beautifies the collected images and displays them on the current screen in real time. When the user triggers the setting operation, the mobile terminal captures the content displayed on the current screen to obtain the initial image. The client sends the initial image to the server, causing the server to perform special effects processing of "changing hair styles" on the portraits in the initial image, and at the same time, the client performs special effects processing of "dying hair” on the portraits in the initial image.
  • the client After the client captures the frame of the current screen, it displays the set material on the current screen for display. When the display of the set material is completed and the client receives the first special effects image returned by the server, it will render the first special effects image to the current screen for display. If the client does not receive the first special effects image returned by the server, then Continue to wait for the set time period, and if the first special effects image returned by the server is received within the set time period, the first special effects image will be rendered to the current screen for display. If the first special effect image returned by the server is not received after the set time period, the second special effect image obtained after processing by the client is rendered to the current screen for display.
  • the embodiment of the present disclosure captures the current picture to obtain an initial image; sends the initial image to the server, causing the server to perform first special effects processing on the initial image; and sets the Render the material to the current screen for display; receive the first special effect image sent by the server, and render the first special effect image to the current screen for display; wherein the first special effect image is the image after the server performs the first special effect processing on the initial image .
  • the image processing method provided by the embodiment of the present disclosure sends the initial image obtained by frame capture to the server for special effects processing, which can not only reduce the data processing pressure on the client, but also improve the effect of image special effects processing.
  • FIG. 3 is a schematic structural diagram of an image processing device provided by an embodiment of the present disclosure. As shown in Figure 3, the device includes:
  • the initial image acquisition module 310 is configured to capture a frame of the current picture in response to detecting the setting operation triggered by the user, and obtain the initial image;
  • the initial image sending module 320 is configured to send the initial image to the server, so that the server performs first special effects processing on the initial image; and renders the set material to the current screen for display;
  • the first special effect image display module 330 is configured to receive the first special effect image sent by the server, and render the first special effect image to the current screen for display; wherein, the first special effect image is the first special effect image processed by the server on the initial image. Image.
  • the initial image sending module 320 is configured to send the initial image to the server in the following manner, so that the server performs the first special effect processing on the initial image:
  • the initial image carrying the algorithm identifier is sent to the server, so that the server calls the target special effects algorithm according to the algorithm identifier to perform first special effects processing on the initial image using the target special effects algorithm.
  • the set material is composed of a sequence of material pictures
  • the device also includes: a set material rendering module, which is set to
  • the first special effect image display module 330 is configured to receive the first special effect image sent by the server in the following manner, and render the first special effect image to the current screen for display:
  • the setting material In response to receiving the first special effects image sent by the server, the setting material is not displayed completely, and continues to render the setting material to the current screen;
  • the first special effect image is rendered to the current screen for display.
  • the first special effect image display module 330 is configured to receive the first special effect image sent by the server in the following manner, and render the first special effect image to the current screen for display:
  • the rendering of the set material is stopped and the first special effect image is rendered to the current screen for display.
  • the first special effect image display module 330 is configured to receive the first special effect image sent by the server in the following manner, and render the first special effect image to the current screen for display:
  • the current picture is still at the set material for a set duration, or the set material is reacquired, and the set material for the set duration is displayed. on the current screen;
  • the first special effect image is rendered to the current screen for display.
  • the first special effect image display module 330 is configured to receive the first special effect image sent by the server in the following manner, and render the first special effect image to the current screen for display:
  • the initial image is rendered to the current screen for display, or the setting information is displayed on the current screen.
  • the device also includes: a second special effects image display module, set to:
  • the second special effect image is rendered to the current screen for display.
  • the second special effect image display module is configured to perform second special effect processing on the initial image in the following manner to obtain the second special effect image:
  • the device also includes: beautification module, set to:
  • the initial image acquisition module 310 is configured to capture the current picture in the following manner:
  • the image processing device provided by the embodiments of the present disclosure can execute the image processing method provided by any embodiment of the present disclosure, and has functional modules and beneficial effects corresponding to the execution method.
  • FIG. 4 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.
  • Terminal devices in the embodiments of the present disclosure may include mobile phones, notebook computers, digital broadcast receivers, personal digital assistants (Personal Digital Assistant, PDA), tablet computers (Portable Android Device, PAD), portable multimedia players (Portable Media Player , PMP), mobile terminals such as vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and fixed terminals such as digital televisions (television, TV), desktop computers, etc.
  • PDA Personal Digital Assistant
  • PMP portable multimedia players
  • mobile terminals such as vehicle-mounted terminals (such as vehicle-mounted navigation terminals)
  • fixed terminals such as digital televisions (television, TV), desktop computers, etc.
  • the electronic device shown in Figure 4 is only an example.
  • the electronic device 500 may include a processing device (such as a central processing unit, a graphics processor, etc.) 501, which may process data according to a program stored in a read-only memory (Read-Only Memory, ROM) 502 or from a storage device. 508 loads the program in the random access memory (Random Access Memory, RAM) 503 to perform various appropriate actions and processes. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored.
  • the processing device 501, ROM 502 and RAM 503 are connected to each other via a bus 504.
  • An editing/output (I/O) interface 505 is also connected to bus 504.
  • input devices 506 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a Liquid Crystal Display (LCD) , an output device 507 such as a speaker, a vibrator, etc.; a storage device 508 including a magnetic tape, a hard disk, etc.; and a communication device 509.
  • Communication device 509 may allow electronic device 500 to communicate wirelessly or wiredly with other devices to exchange data.
  • FIG. 4 illustrates electronic device 500 with various means, it should be understood that implementation or availability of all illustrated means is not required. More or fewer means may alternatively be implemented or provided.
  • embodiments of the present disclosure include a computer program product including a computer program embodied on a non-transitory computer-readable medium, the computer program including instructions for executing a process.
  • the computer program may be downloaded and installed from the network via communication device 509, or from storage device 508, or from ROM 502.
  • the processing device 501 When the computer program is executed by the processing device 501, the above-mentioned functions in the method of the embodiment of the present disclosure are performed.
  • the electronic device provided by the embodiments of the present disclosure and the image processing method provided by the above embodiments belong to the same inventive concept.
  • Technical details that are not described in detail in this embodiment can be referred to the above embodiments, and this embodiment has the same features as the above embodiments. beneficial effects.
  • Embodiments of the present disclosure provide a computer storage medium on which a computer program is stored.
  • the program is executed by a processor, the image processing method provided by the above embodiments is implemented.
  • 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 above two.
  • the computer-readable storage medium may be, for example, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof.
  • Computer-readable storage media may include: an electrical connection having one or more wires, a portable computer disk, a hard drive, RAM, ROM, Erasable Programmable Read-Only Memory (EPROM or Flash memory), fiber optics , portable compact disk read-only memory (Compact Disc Read-Only Memory, CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code therein. Such propagated data signals may take many forms, including 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 send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device .
  • Program code embodied on a computer-readable medium can be transmitted using any appropriate medium, including: wire, optical cable, radio frequency (Radio Frequency, RF), etc., or any suitable combination of the above.
  • the client and server can communicate using any currently known or future developed network protocol such as HyperText Transfer Protocol (HTTP), and can communicate with digital data in any form or medium. (e.g., communications network) interconnection.
  • HTTP HyperText Transfer Protocol
  • Examples of communication networks include local area networks (LAN), wide area networks (WAN), the Internet (eg, the Internet), and end-to-end networks (eg, ad hoc end-to-end networks), as well as any current network for knowledge or future research and development.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device; it may also exist independently without being assembled into the electronic device.
  • the above-mentioned computer-readable medium carries one or more programs.
  • the electronic device executes the above-mentioned one or more programs.
  • the above-mentioned computer-readable medium carries one or more programs.
  • the electronic device in response to detecting the setting operation triggered by the user, captures the current picture, Obtain the initial image; send the initial image to the server, so that the server performs first special effects processing on the initial image; render the set material to the current screen for display; receive the first special effects image sent by the server, The first special effect image is rendered to the current screen for display; wherein the first special effect image is an image obtained by the server performing first special effect processing on the initial image.
  • Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional Procedural programming language—such as "C" or a similar programming language.
  • the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server.
  • the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as an Internet service provider through Internet connection).
  • LAN local area network
  • WAN wide area network
  • Internet service provider such as an Internet service provider through Internet connection
  • each block in the flowchart or block diagram may represent a module, segment, or portion of code that contains one or more logic functions that implement the specified executable instructions.
  • the functions noted in the block may occur out of the order noted in the figures. For example, two blocks represented one after another may actually execute substantially in parallel. OK, they can sometimes be executed in reverse order, depending on the functionality involved.
  • each block of the block diagram and/or flowchart illustration, and combinations of blocks in the block diagram and/or flowchart illustration can be implemented by special purpose hardware-based systems that perform the specified functions or operations. , or can be implemented using a combination of specialized hardware and computer instructions.
  • the units involved in the embodiments of the present disclosure can be implemented in software or hardware.
  • the name of the unit can be set according to the actual situation in some cases.
  • the first acquisition unit can also be described as "the unit that acquires at least two Internet Protocol addresses.”
  • FPGA Field Programmable Gate Array
  • ASIC Application Specific Integrated Circuit
  • ASSP Application Specific Standard Parts
  • SOC System on Chip
  • CPLD Complex Programming logic device
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in connection with an instruction execution system, apparatus, or device.
  • the machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • Machine-readable media may include electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or devices, or any suitable combination of the foregoing.
  • Machine-readable storage media may include electrical connections based on one or more wires, portable computer disks, hard drives, RAM, ROM, erasable programmable read-only memory (EPROM or flash memory), fiber optics, CD-ROM, optical storage device, magnetic storage device, or any suitable combination of the foregoing.
  • an image processing method including:
  • sending the initial image to the server so that the server performs a first special effect processing on the initial image includes:
  • the initial image carrying the algorithm identification is sent to the server, so that the server calls the target special effects algorithm according to the algorithm identification, so as to use the target special effects algorithm to perform the first step on the initial image. Special effects processing.
  • the setting material is composed of a sequence of material pictures
  • Rendering the set material to the current screen for display includes:
  • the sequence of material images is sequentially rendered to the current screen for display.
  • the step of receiving the first special effect image sent by the server and rendering the first special effect image to the current screen for display includes:
  • the setting material In response to receiving the first special effect image sent by the server, the setting material is not displayed completely, and continues to render the setting material to the current screen;
  • the rendering of the setting material is stopped, and the first special effect image is rendered to the current screen for display.
  • the step of receiving the first special effect image sent by the server and rendering the first special effect image to the current screen for display includes:
  • the current picture is still at the set material for the set duration, or the set material is reacquired, and the set material is The set material of the set duration is displayed on the current screen;
  • the first special effect image is rendered to the current screen for display.
  • the method further includes:
  • the initial image is rendered to the current screen for display, or the setting information is displayed on the current screen.
  • the method further includes:
  • the second special effect image is rendered to the current screen for display.
  • performing second special effect processing on the initial image to obtain a second special effect image includes:
  • the method before capturing the current picture, the method further includes:
  • the frame capturing of the current picture includes:

Abstract

本公开实施例提供了一种图像处理方法、装置、设备及存储介质。响应于检测到用户触发的设定操作,对当前画面进行抓帧,获得初始图像;将所述初始图像发送至服务端,使得服务端对所述初始图像进行第一特效处理;并将设定素材渲染至当前画面进行显示;接收服务端发送的第一特效图像,将所述第一特效图像渲染至当前画面进行显示;其中,所述第一特效图像为服务端对所述初始图像进行第一特效处理后的图像。

Description

图像处理方法、装置、设备及存储介质
本公开要求在2022年05月18日提交中国专利局、申请号为202210551443.4的中国专利申请的优先权,该申请的全部内容通过引用结合在本公开中。
技术领域
本公开实施例涉及图像处理技术领域,例如涉及一种图像处理方法、装置、设备及存储介质。
背景技术
目前,移动终端已经成为用户进行娱乐活动的不可或缺的工具之一。用户可以采用移动终端进行多种多样的图像处理。相关技术中,在对图像处理过程中,大多数只能运行客户端本地的算法,由于移动终端的硬件配置的限制,使得对图像处理时效率较低,且处理后的图像精度较差,影响图像处理效果。
发明内容
本公开实施例提供一种图像处理方法、装置、设备及存储介质,将初始图像发送至服务端进行特效处理,不仅可以减轻客户端的数据处理压力,也可以提高图像特效处理的效果。
第一方面,本公开实施例提供了一种图像处理方法,包括:
响应于检测到用户触发的设定操作,对当前画面进行抓帧,获得初始图像;
将所述初始图像发送至服务端,使得服务端对所述初始图像进行第一特效处理;并将设定素材渲染至当前画面进行显示;
接收服务端发送的第一特效图像,将所述第一特效图像渲染至当前画面进行显示;其中,所述第一特效图像为服务端对所述初始图像进行第一特效处理后的图像。
第二方面,本公开实施例还提供了一种图像处理装置,包括:
初始图像获取模块,设置为响应于检测到用户触发的设定操作,对当前画面进行抓帧,获得初始图像;
初始图像发送模块,设置为将所述初始图像发送至服务端,使得服务端对 所述初始图像进行第一特效处理;并将设定素材渲染至当前画面进行显示;
第一特效图像显示模块,设置为接收服务端发送的第一特效图像,将所述第一特效图像渲染至当前画面进行显示;其中,所述第一特效图像为服务端对所述初始图像进行第一特效处理后的图像。
第三方面,本公开实施例还提供了一种电子设备,所述电子设备包括:
一个或多个处理器;
存储装置,用于存储一个或多个程序,
当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-9中任一所述的图像处理方法。
第四方面,本公开实施例还提供了一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行如本公开实施例所述的图像处理方法。
附图说明
贯穿附图中,相同或相似的附图标记表示相同或相似的元素。应当理解附图是示意性的,原件和元素不一定按照比例绘制。
图1是本公开实施例所提供的一种图像处理方法的流程示意图;
图2a是本公开实施例所提供的一种设定素材的示例图;
图2b是本公开实施例所提供的一种设定素材的示例图;
图3是本公开实施例所提供的一种图像处理装置的结构示意图;
图4是本公开实施例所提供的一种电子设备的结构示意图。
具体实施方式
下面将参照附图更详细地描述本公开的实施例。虽然附图中显示了本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用。
应当理解,本公开的方法实施方式中记载的各个步骤可以按照不同的顺序执行,和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。
本文使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。术语“基于”是“至少部分地基于”。术语“一个实施例”表示“至少一个实施例”;术语“另一实施例”表示“至少一个另外的实施例”;术语“一些实施例”表示“至少一些实施例”。其他术语的相关定义将在下文描述中给出。
需要注意,本公开中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分。
需要注意,本公开中提及的“一个”、“多个”的修饰是示意性,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。
本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的。
可以理解的是,在使用本公开各实施例公开的技术方案之前,均应当依据相关法律法规通过恰当的方式对本公开所涉及个人信息的类型、使用范围、使用场景等告知用户并获得用户的授权。
例如,在响应于接收到用户的主动请求时,向用户发送提示信息,以明确地提示用户,其请求执行的操作将需要获取和使用到用户的个人信息。从而,使得用户可以根据提示信息来自主地选择是否向执行本公开技术方案的操作的电子设备、应用程序、服务器或存储介质等软件或硬件提供个人信息。
作为一种可选的实现方式,响应于接收到用户的主动请求,向用户发送提示信息的方式例如可以是弹窗的方式,弹窗中可以以文字的方式呈现提示信息。此外,弹窗中还可以承载供用户选择“同意”或者“不同意”向电子设备提供个人信息的选择控件。
可以理解的是,上述通知和获取用户授权过程仅是示意性的,其它满足相关法律法规的方式也可应用于本公开的实现方式中。
可以理解的是,本技术方案所涉及的数据(包括数据本身、数据的获取或使用)应当遵循相应法律法规及相关规定的要求。
图1为本公开实施例所提供的一种图像处理方法的流程示意图,本公开实施例适用于对图像进行处理的情形,该方法可以由图像处理装置来执行,该装置可以通过软件和/或硬件的形式实现,可选的,通过电子设备来实现,该电子设备可以是移动终端、PC端或服务器等。
如图1所示,所述方法包括:
S110,响应于检测到用户触发的设定操作,对当前画面进行抓帧,获得初 始图像。
其中,设定操作可以是单击屏幕、双击屏幕、检测到用户摆出设定手势或者姿态、采集到包含有设定关键词的语音信号等。抓帧还可以称之为截屏,通过调用抓帧函数,对当前画面显示的内容进行抓帧,从而获得初始图像。
本实施例中,当终端设备打开某个图像处理道具时,终端设备将摄像头当前采集的图像实时的显示在当前画面,或者从本地数据库或者网络数据库中获取视频文件在当前界面进行播放。当终端设备检测到用户触发的设定操作时,对当前画面显示的内容进行抓帧处理,获得初始图像。
可选的,在对当前画面进行抓帧之前,还包括:运行设定美化程序包,以对采集的图像进行美化处理;将美化处理后的图像渲染至当前画面。
其中,设定美化程序包可以是对图像进行设定美化处理的程序包,其输入为图像,输出为美化处理后的图像。若图像为面部图像,则设定美化程序包可以是美妆美颜的程序包,若图像为风景图,则设定美化程序包可以是调整色相和/或饱和度的程序包。此处,设定美化程序包可以是先封装好的具有美化功能的程序包,由用户在打开图像处理工具包后根据需要进行选择设置。
本实施例中,运行设定美化程序包之后,对摄像头采集的图像进行美化处理,并将美化处理的后图像渲染至当前画面。相应的,对当前画面进行抓帧,包括:对当前画面中美化处理的图像进行抓帧。本实施例中,对图像先进行美化处理,使得抓帧获取到美化的图像,可以提高图像的显示效果。
S120,将初始图像发送至服务端,使得服务端对初始图像进行第一特效处理;并将设定素材渲染至当前画面进行显示。
本实施例中,客户端将初始图像发送至服务端,服务端调用配置于服务端的特效算法对初始图像进行第一特效处理,获得第一特效图像,然后服务端将第一特效图像返回至客户端。
可选的,将初始图像发送至服务端,使得服务端对初始图像进行第一特效处理的方式可以是:将携带有算法标识的初始图像发送至服务端,使得服务端根据算法标识调用目标特效算法,以采用目标特效算法对初始图像进行第一特效处理。
其中,算法标识可以由算法名称、算法存储地址等信息组成。目标特效算法可以是构建的神经网络模型,例如:生成对抗网络模型(Generative Adversarial Nets,GAN))等。本实施例中,不同特效功能对应不同的特效处理算法,一种图像处理道具可以在服务端设置一个或者多个特效处理算法,由用户选择所需的特效处理算法。示例性的:特效功能可以是对图像中的设定区域进行特效处 理,如:对原始图像中的人像进行换发型处理(包括头发长度、头发颜色、头发造型至少一种方式的替换),对原始图像进行风格化处理(例如:转化为素描风格、简笔画风格或者戏曲脸谱风格等)。本实施例中,通过算法标识调用目标特效算法,可以准确的对初始图像进行第一特效处理。
本实施例中,客户端将初始图像发送至服务端后,由于网络状况的影响且目标特效算法运行需要时间,服务端返回特效处理的图像的时间不确定,在发送初始图像与接收到第一特效图像间的时间段内,可以将设定素材渲染至当前画面进行显示。
其中,设定素材可以是一段视频文件,由素材图序列构成,即有多个素材图构成。素材图可以是开发人员预先设置的图像,可以是用于计时的素材图序列。例如:可以是进度条形式的素材图序列,或者倒计时形式的素材图序列,或者倒计时与进度条相结合的素材图序列。示例性的,图2a-图2b为设定素材的示例图,如图2a所示,设定素材以进度条形式展示,从左到右,随着时间的推进,进度条的进度也向前推进。如图2b所示,设定素材以倒计时的形式展示,从左到右,随着时间的推进,素材图中的数字逐渐减小。
本实施例中,将设定素材渲染至当前画面进行显示的过程可以是:将素材图序列依次渲染至当前画面进行显示。
其中,素材图序列按照一定顺序排列,按照排序依次读取素材图,将读取到的素材图渲染至当前画面缓慢进行显示。本实施例中,在将初始图像发送至服务端之后,将设定素材渲染至当前画面进行显示,可以避免当前画面显示内容相对单一的问题,从而可以提高图像处理的趣味性。
S130,接收服务端发送的第一特效图像,将第一特效图像渲染至当前画面进行显示。
其中,第一特效图像为服务端对初始图像进行第一特效处理后的图像。本实施例中,服务端对初始图像进行第一特效处理完成后,获得第一特效图像,然后将第一特效图像返回至客户端,使得客户端显示第一特效图像。
可选的,接收服务端发送的第一特效图像,将第一特效图像渲染至当前画面进行显示,可以包括:响应于接收到服务端发送的第一特效图像时设定素材未显示完成,继续渲染设定素材至当前画面;响应于设定素材显示完成,将第一特效图像渲染至当前画面进行显示。
本实施例中,由于设定素材由素材图序列构成,将素材图序列均显示完成需要经过一定的时长,例如:可以是2-5秒之间的任意值。若当前网络状态较佳,服务端可以在较短的时间内将第一特效图像返回至客户端,此处设定素材可能 还未显示完成。此时,继续将剩余的素材图按照顺序依次渲染至当前画面进行显示,直到设定素材显示完成,将第一特效图像渲染至当前画面进行显示。本实施例中,将设定素材完整的进行显示,保证画面显示内容的连续性,可以避免第一特效图像突兀的显示于当前画面,从而提高用户观看体验。
可选的,响应于接收到服务端发送的第一特效图像时设定素材未显示完成,停止渲染设定素材,将第一特效图像渲染至当前画面进行显示。
若当前网络状态较佳,服务端可以在较短的时间内将第一特效图像返回至客户端,此处设定素材可能还未显示完成。此时,停止渲染剩余的素材图,直接将第一特效图像渲染至当前画面进行显示。本实施例的方案,可以及时的将第一特效图显示于当前画面,减少用户的等待时间。
可选的,接收服务端发送的第一特效图像,将第一特效图像渲染至当前画面进行显示,可以包括:响应于在设定素材显示完成时未接收到服务端发送的第一特效图像,将当前画面静止于设定素材设定时长,或者重新获取设定素材,并将设定时长的设定素材显示于当前画面;响应于在设定时长内接收到服务端发送的第一特效图像,将第一特效图像渲染至当前画面进行显示。
其中,设定时长可以小于设定素材的完整显示时长,例如:可以设置2-3秒之间的任意值。将当前画面静止于设定素材设定时长可以理解为将当前画面静止于设定素材的最后一张素材图设定时长。重新获取设定素材,并将设定时长的设定素材显示于当前画面可以理解为:从设定素材的第一张素材图开始读取,读取设定时长的素材图,或者从设定素材中随机读取设定时长的素材图,将读取的到素材图渲染至当前画面进行显示。在设定时长内,响应于客户端接收到服务端发送的第一特效图像,将第一特效图像渲染至当前画面进行显示。
本实施例中,若当前网络状态较差,客户端可能在设定素材显示完成时,仍然未接收到服务端返回的第一特效图像,此时再等待设定时长,若在设定时长内客户端接收到服务端发送的第一特效图像,则将第一特效图像渲染至当前画面进行显示。在设定素材显示完成时,仍未接收到服务端发送的第一特效图像的情况下,继续等待设定时长,以尽可能的保证服务端处理后图像显示于当前画面。
可选的,将当前画面静止于设定素材设定时长,或者重新获取设定素材,并将设定时长的设定素材显示于当前画面之后,还包括:响应于在设定时长内未接收到服务端发送的第一特效图像,将初始图像渲染至当前画面进行显示,或者,将设定信息显示于当前画面。
其中,设定信息可以是表征未接收到服务端返回的第一特效图像的信息, 例如:“处理失败”等。本实施例中,当未接收到第一特效图像时,将初始图像渲染至当前画面进行显示,或者,将设定信息显示于当前画面,以对当前画面显示的内容进行兜底。
可选的,获得初始图像之后,还包括:对初始图像进行第二特效处理,获得第二特效图像;响应于在设定时长内未接收到服务端发送的第一特效图像,将第二特效图像渲染至当前画面进行显示。
本实施例中,客户端通过调用本地的特效处理算法对初始图像进行第二特效处理。其中,本地的特效处理算法与服务端的特效处理算法相比,精度较低且占用系统资源较少。
在一实施例中,对初始图像进行第二特效处理,获得第二特效图像,可以包括:对初始图像中的设定区域进行分割,获得子区域;对子区域进行第二特效处理,获得第二特效图像。
其中,第二特效处理可以是与第一特效处理相对应的处理方式。例如:若第一特效处理为“换发型”的特效处理,则第二特效处理可以是对头发进行染色处理。
其中,对初始图像中的设定区域进行分割,获得子区域的过程可以是:首先对设定区域进行语义识别,获得设定区域的掩膜图(mask),利用掩膜图将设定区域从初始图像中分割,获得设定区域对应的子区域。在获得子区域之后,对子区域进行第二特效处理,再将第二特效处理的子区域与初始图像进行融合,获得第二特效图像。示例性的,假设第二特效处理为对头发染色,则对初始图像进行第二特效处理的过程可以是:首先对初始图像进行头发识别,获得头发mask,利用头发mask将头发区域从初始图像中分割,然后获取设定颜色,将设定颜色和头发的原始颜色进行混合,获得目标颜色,将目标颜色确定为头发区域各像素点的最终颜色,最后将染色后的头发区域与初始图像融合,获得第二特效图像,从而实现了对头发的染色处理。本实施例中,若在设定时长内未接收到服务端发送的第一特效图像,将客户端处理后的第二特效图像显示于当前画面,实现对图像处理的兜底,避免影响用户的使用体验。
可选的,在将第一特效图像渲染至当前画面进行显示之后,还包括:响应于检测到用户点击恢复按钮,当前画面恢复显示摄像头实时采集的图像,并可以继续检测用户触发的设定操作。
示例性的,本实施例中可以用于对图像中的人像进行“换发型”的特效处理的应用场景。具体过程如下:用户通过移动终端启动图像处理工具后,运行美化程序包,移动终端将采集的图像进行美化处理后实时的显示在当前画面, 当用户触发设定操作时,移动终端对当前画面中显示的内容进行抓帧,获得初始图像。客户端将初始图像发送至服务端,使得服务端对初始图像中的人像进行“换发型”的特效处理,同时客户端对初始图像中的人像进行“染发”的特效处理。客户端在对当前画面抓帧之后,将设定素材显示于当前画面进行显示。当设定素材显示完成时,客户端接收到服务端返回的第一特效图像,则将第一特效图像渲染至当前画面进行显示,若客户端未接收到服务端返回的第一特效图像,则继续等待设定时长,若在设定时长内接收到服务端返回的第一特效图像,则将第一特效图像渲染至当前画面进行显示。若在设定时长之后,仍未接收到服务端返回的第一特效图像,则将客户端处理后获得的第二特效图像渲染至当前画面进行显示。
本公开实施例响应于检测到用户触发的设定操作,对当前画面进行抓帧,获得初始图像;将初始图像发送至服务端,使得服务端对初始图像进行第一特效处理;并将设定素材渲染至当前画面进行显示;接收服务端发送的第一特效图像,将第一特效图像渲染至当前画面进行显示;其中,第一特效图像为服务端对初始图像进行第一特效处理后的图像。本公开实施例提供的图像处理方法,将抓帧获取的初始图像发送至服务端进行特效处理,不仅可以减轻客户端的数据处理压力,也可以提高图像特效处理的效果。
图3是本公开实施例提供的一种图像处理装置的结构示意图。如图3所示,该装置包括:
初始图像获取模块310,设置为响应于检测到用户触发的设定操作,对当前画面进行抓帧,获得初始图像;
初始图像发送模块320,设置为将初始图像发送至服务端,使得服务端对初始图像进行第一特效处理;并将设定素材渲染至当前画面进行显示;
第一特效图像显示模块330,设置为接收服务端发送的第一特效图像,将第一特效图像渲染至当前画面进行显示;其中,第一特效图像为服务端对初始图像进行第一特效处理后的图像。
可选的,初始图像发送模块320,设置为通过如下方式将初始图像发送至服务端,使得服务端对初始图像进行第一特效处理:
将携带有算法标识的初始图像发送至服务端,使得服务端根据算法标识调用目标特效算法,以采用目标特效算法对初始图像进行第一特效处理。
可选的,设定素材由素材图序列构成,该装置还包括:设定素材渲染模块,设置为
将素材图序列依次渲染至当前画面进行显示。
可选的,第一特效图像显示模块330,设置为通过如下方式接收服务端发送的第一特效图像,将第一特效图像渲染至当前画面进行显示:
响应于接收到服务端发送的第一特效图像时设定素材未显示完成,继续渲染设定素材至当前画面;
响应于设定素材显示完成,将第一特效图像渲染至当前画面进行显示。
可选的,第一特效图像显示模块330,设置为通过如下方式接收服务端发送的第一特效图像,将第一特效图像渲染至当前画面进行显示:
响应于接收到服务端发送的第一特效图像时设定素材未显示完成,停止渲染设定素材,将第一特效图像渲染至当前画面进行显示。
可选的,第一特效图像显示模块330,设置为通过如下方式接收服务端发送的第一特效图像,将第一特效图像渲染至当前画面进行显示:
响应于在设定素材显示完成时未接收到服务端发送的第一特效图像,将当前画面静止于设定素材设定时长,或者重新获取设定素材,并将设定时长的设定素材显示于当前画面;
响应于在设定时长内接收到服务端发送的第一特效图像,将第一特效图像渲染至当前画面进行显示。
可选的,第一特效图像显示模块330,设置为通过如下方式接收服务端发送的第一特效图像,将第一特效图像渲染至当前画面进行显示:
响应于在设定时长内未接收到服务端发送的第一特效图像,将初始图像渲染至当前画面进行显示,或者,将设定信息显示于当前画面。
可选的,该装置还包括:第二特效图像显示模块,设置为:
对初始图像进行第二特效处理,获得第二特效图像;
响应于在设定时长内未接收到服务端发送的第一特效图像,将第二特效图像渲染至当前画面进行显示。
可选的,第二特效图像显示模块,设置为通过如下方式对初始图像进行第二特效处理,获得第二特效图像:
对初始图像中的设定区域进行分割,获得子区域;
对子区域进行第二特效处理,获得第二特效图像。
可选的,该装置还包括:美化模块,设置为:
运行设定美化程序包,以对采集的图像进行美化处理;
将美化处理后的图像渲染至当前画面;
可选的,初始图像获取模块310,设置为通过如下方式对当前画面进行抓帧:
对当前画面中美化处理的图像进行抓帧。
本公开实施例所提供的图像处理装置可执行本公开任意实施例所提供的图像处理方法,具备执行方法相应的功能模块和有益效果。
值得注意的是,上述装置所包括的各个单元和模块只是按照功能逻辑进行划分的,实际划分只要能够实现相应的功能即可;另外,各功能单元的具体名称也只是为了便于相互区分。
图4为本公开实施例所提供的一种电子设备的结构示意图。下面参考图4,其示出了适于用来实现本公开实施例的电子设备(例如图4中的终端设备或服务器)500的结构示意图。本公开实施例中的终端设备可以包括移动电话、笔记本电脑、数字广播接收器、个人数字助理(Personal Digital Assistant,PDA)、平板电脑(Portable Android Device,PAD)、便携式多媒体播放器(Portable Media Player,PMP)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字电视(television,TV)、台式计算机等等的固定终端。图4示出的电子设备仅仅是一个示例。
如图4所示,电子设备500可以包括处理装置(例如中央处理器、图形处理器等)501,其可以根据存储在只读存储器(Read-Only Memory,ROM)502中的程序或者从存储装置508加载到随机访问存储器(Random Access Memory,RAM)503中的程序而执行各种适当的动作和处理。在RAM 503中,还存储有电子设备500操作所需的各种程序和数据。处理装置501、ROM 502以及RAM 503通过总线504彼此相连。编辑/输出(Input/Output,I/O)接口505也连接至总线504。
通常,以下装置可以连接至I/O接口505:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置506;包括例如液晶显示器(Liquid Crystal Display,LCD)、扬声器、振动器等的输出装置507;包括例如磁带、硬盘等的存储装置508;以及通信装置509。通信装置509可以允许电子设备500与其他设备进行无线或有线通信以交换数据。虽然图4示出了具有各种装置的电子设备500,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行流程 图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置509从网络上被下载和安装,或者从存储装置508被安装,或者从ROM 502被安装。在该计算机程序被处理装置501执行时,执行本公开实施例的方法中的上述功能。
本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的。
本公开实施例提供的电子设备与上述实施例提供的图像处理方法属于同一发明构思,未在本实施例中详尽描述的技术细节可参见上述实施例,并且本实施例与上述实施例具有相同的有益效果。
本公开实施例提供了一种计算机存储介质,其上存储有计算机程序,该程序被处理器执行时实现上述实施例所提供的图像处理方法。
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质可以包括:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、RAM、ROM、可擦式可编程只读存储器(Erasable Programmable Read-Only Memory,EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(Compact Disc Read-Only Memory,CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括:电线、光缆、射频(Radio Frequency,RF)等等,或者上述的任意合适的组合。
在一些实施方式中,客户端、服务器可以利用超文本传输协议(HyperText Transfer Protocol,HTTP)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(Local Area Network,LAN),广域网(Wide Area Network,WAN),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:
当响应于检测到用户触发的设定操作时,对当前画面进行抓帧,获得初始图像;
将所述初始图像发送至服务端,使得服务端对所述初始图像进行第一特效处理;并将设定素材渲染至当前画面进行显示;
接收服务端发送的第一特效图像,将所述第一特效图像渲染至当前画面进行显示;其中,所述第一特效图像为服务端对所述初始图像进行第一特效处理后的图像。
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:响应于检测到用户触发的设定操作,对当前画面进行抓帧,获得初始图像;将所述初始图像发送至服务端,使得服务端对所述初始图像进行第一特效处理;并将设定素材渲染至当前画面进行显示;接收服务端发送的第一特效图像,将所述第一特效图像渲染至当前画面进行显示;其中,所述第一特效图像为服务端对所述初始图像进行第一特效处理后的图像。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执 行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元的名称在某种情况下可以根据实际情况进行设置,例如,第一获取单元还可以被描述为“获取至少两个网际协议地址的单元”。
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(Field Programmable Gate Array,FPGA)、专用集成电路(Application Specific Integrated Circuit,ASIC)、专用标准产品(Application Specific Standard Parts,ASSP)、片上系统(System on Chip,SOC)、复杂可编程逻辑设备(Complex Programming logic device,CPLD)等等。
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质可以包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、RAM、ROM、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、CD-ROM、光学储存设备、磁储存设备、或上述内容的任何合适组合。
根据本公开的一个或多个实施例,提供了一种图像处理方法,包括:
响应于检测到用户触发的设定操作,对当前画面进行抓帧,获得初始图像;
将所述初始图像发送至服务端,使得服务端对所述初始图像进行第一特效处理;并将设定素材渲染至当前画面进行显示;
接收服务端发送的第一特效图像,将所述第一特效图像渲染至当前画面进行显示;其中,所述第一特效图像为服务端对所述初始图像进行第一特效处理后的图像。
在一实施例中,所述将所述初始图像发送至服务端,使得服务端对所述初始图像进行第一特效处理,包括:
将携带有算法标识的所述初始图像发送至服务端,使得服务端根据所述算法标识调用目标特效算法,以采用所述目标特效算法对所述初始图像进行第一 特效处理。
在一实施例中,所述设定素材由素材图序列构成,
所述将设定素材渲染至当前画面进行显示,包括:
将所述素材图序列依次渲染至当前画面进行显示。
在一实施例中,所述接收服务端发送的第一特效图像,将所述第一特效图像渲染至当前画面进行显示,包括:
响应于接收到服务端发送的第一特效图像时所述设定素材未显示完成,继续渲染所述设定素材至当前画面;
响应于所述设定素材显示完成,将所述第一特效图像渲染至当前画面进行显示;
响应于接收到服务端发送的第一特效图像时所述设定素材未显示完成,停止渲染所述设定素材,将所述第一特效图像渲染至当前画面进行显示。
在一实施例中,所述接收服务端发送的第一特效图像,将所述第一特效图像渲染至当前画面进行显示,包括:
响应于在所述设定素材显示完成时,未接收到服务端发送的第一特效图像,将当前画面静止于所述设定素材设定时长,或者重新获取所述设定素材,并将所述设定时长的所述设定素材显示于当前画面;
响应于在所述设定时长内接收到服务端发送的第一特效图像,将所述第一特效图像渲染至当前画面进行显示。
在一实施例中,所述方法还包括:
响应于在所述设定时长内未接收到服务端发送的第一特效图像,将所述初始图像渲染至当前画面进行显示,或者,将设定信息显示于当前画面。
在一实施例中,获得初始图像之后,所述方法还包括:
对所述初始图像进行第二特效处理,获得第二特效图像;
响应于在所述设定时长内未接收到服务端发送的第一特效图像,将所述第二特效图像渲染至当前画面进行显示。
在一实施例中,所述对所述初始图像进行第二特效处理,获得第二特效图像,包括:
对所述初始图像中的设定区域进行分割,获得子区域;
对所述子区域进行第二特效处理,获得第二特效图像。
在一实施例中,在对当前画面进行抓帧之前,所述方法还包括:
运行设定美化程序包,以对采集的图像进行美化处理;
将美化处理后的图像渲染至当前画面;
所述对当前画面进行抓帧,包括:
对当前画面中美化处理的图像进行抓帧。
虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。在单独的实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地,在单个实施例的上下文中描述的各种特征也可以单独地或以任何合适的子组合的方式实现在多个实施例中。

Claims (13)

  1. 一种图像处理方法,包括:
    响应于检测到用户触发的设定操作,对当前画面进行抓帧,获得初始图像;
    将所述初始图像发送至服务端,使得服务端对所述初始图像进行第一特效处理;并将设定素材渲染至当前画面进行显示;
    接收服务端发送的第一特效图像,将所述第一特效图像渲染至当前画面进行显示;其中,所述第一特效图像为服务端对所述初始图像进行第一特效处理后的图像。
  2. 根据权利要求1所述的方法,其中,所述将所述初始图像发送至服务端,使得服务端对所述初始图像进行第一特效处理,包括:
    将携带有算法标识的所述初始图像发送至服务端,使得服务端根据所述算法标识调用目标特效算法,以采用所述目标特效算法对所述初始图像进行第一特效处理。
  3. 根据权利要求1所述的方法,其中,所述设定素材由素材图序列构成,所述将设定素材渲染至当前画面进行显示,包括:
    将所述素材图序列依次渲染至当前画面进行显示。
  4. 根据权利要求1或3所述的方法,其中,所述接收服务端发送的第一特效图像,将所述第一特效图像渲染至当前画面进行显示,包括:
    响应于接收到服务端发送的第一特效图像时所述设定素材未显示完成,继续渲染所述设定素材至当前画面;
    响应于所述设定素材显示完成,将所述第一特效图像渲染至当前画面进行显示。
  5. 根据权利要求1或3所述的方法,其中,所述接收服务端发送的第一特效图像,将所述第一特效图像渲染至当前画面进行显示,包括:
    响应于接收到服务端发送的第一特效图像时所述设定素材未显示完成,停止渲染所述设定素材,将所述第一特效图像渲染至当前画面进行显示。
  6. 根据权利要求1或3所述的方法,其中,所述接收服务端发送的第一特效图像,将所述第一特效图像渲染至当前画面进行显示,包括:
    响应于在所述设定素材显示完成时未接收到服务端发送的第一特效图像,将当前画面静止于所述设定素材设定时长,或者重新获取所述设定素材,并将所述设定时长的所述设定素材显示于当前画面;
    响应于在所述设定时长内接收到服务端发送的第一特效图像,将所述第一 特效图像渲染至当前画面进行显示。
  7. 根据权利要求6所述的方法,还包括:
    响应于在所述设定时长内未接收到服务端发送的第一特效图像,将所述初始图像渲染至当前画面进行显示,或者,将设定信息显示于当前画面。
  8. 根据权利要求6所述的方法,获得初始图像之后,所述方法还包括:
    对所述初始图像进行第二特效处理,获得第二特效图像;
    响应于在所述设定时长内未接收到服务端发送的第一特效图像,将所述第二特效图像渲染至当前画面进行显示。
  9. 根据权利要求8所述的方法,其中,所述对所述初始图像进行第二特效处理,获得第二特效图像,包括:
    对所述初始图像中的设定区域进行分割,获得子区域;
    对所述子区域进行第二特效处理,获得第二特效图像。
  10. 根据权利要求1所述的方法,在对当前画面进行抓帧之前,所述方法还包括:
    运行设定美化程序包,以对采集的图像进行美化处理;
    将美化处理后的图像渲染至当前画面;
    所述对当前画面进行抓帧,包括:
    对当前画面中美化处理的图像进行抓帧。
  11. 一种图像处理装置,包括:
    初始图像获取模块,设置为响应于检测到用户触发的设定操作,对当前画面进行抓帧,获得初始图像;
    初始图像发送模块,设置为将所述初始图像发送至服务端,使得服务端对所述初始图像进行第一特效处理;并将设定素材渲染至当前画面进行显示;
    第一特效图像显示模块,设置为接收服务端发送的第一特效图像,将所述第一特效图像渲染至当前画面进行显示;其中,所述第一特效图像为服务端对所述初始图像进行第一特效处理后的图像。
  12. 一种电子设备,所述电子设备包括:
    一个或多个处理器;
    存储装置,用于存储一个或多个程序,
    当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多 个处理器实现如权利要求1-10中任一所述的图像处理方法。
  13. 一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行如权利要求1-10中任一所述的图像处理方法。
PCT/CN2023/094297 2022-05-18 2023-05-15 图像处理方法、装置、设备及存储介质 WO2023221941A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210551443.4A CN114841854A (zh) 2022-05-18 2022-05-18 图像处理方法、装置、设备及存储介质
CN202210551443.4 2022-05-18

Publications (1)

Publication Number Publication Date
WO2023221941A1 true WO2023221941A1 (zh) 2023-11-23

Family

ID=82568893

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/094297 WO2023221941A1 (zh) 2022-05-18 2023-05-15 图像处理方法、装置、设备及存储介质

Country Status (2)

Country Link
CN (1) CN114841854A (zh)
WO (1) WO2023221941A1 (zh)

Families Citing this family (1)

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

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103942227A (zh) * 2013-01-23 2014-07-23 腾讯科技(深圳)有限公司 一种对信息推送过程进行渲染呈现的方法、装置和系统
CN110442450A (zh) * 2019-07-10 2019-11-12 北京云派网络科技有限公司 图像处理设备、方法、装置以及素材计算与渲染的系统
CN113836455A (zh) * 2021-09-18 2021-12-24 北京百度网讯科技有限公司 特效渲染方法、装置、设备、存储介质及计算机程序产品
CN114841854A (zh) * 2022-05-18 2022-08-02 北京字跳网络技术有限公司 图像处理方法、装置、设备及存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103942227A (zh) * 2013-01-23 2014-07-23 腾讯科技(深圳)有限公司 一种对信息推送过程进行渲染呈现的方法、装置和系统
CN110442450A (zh) * 2019-07-10 2019-11-12 北京云派网络科技有限公司 图像处理设备、方法、装置以及素材计算与渲染的系统
CN113836455A (zh) * 2021-09-18 2021-12-24 北京百度网讯科技有限公司 特效渲染方法、装置、设备、存储介质及计算机程序产品
CN114841854A (zh) * 2022-05-18 2022-08-02 北京字跳网络技术有限公司 图像处理方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN114841854A (zh) 2022-08-02

Similar Documents

Publication Publication Date Title
WO2021082760A1 (zh) 虚拟形象的生成方法、装置、终端及存储介质
US11800043B2 (en) Video processing method and apparatus, and computer-readable medium and electronic device
EP4262214A1 (en) Screen projection method and apparatus, and electronic device and storage medium
WO2023051185A1 (zh) 图像处理方法、装置、电子设备及存储介质
CN110070496B (zh) 图像特效的生成方法、装置和硬件装置
CN114598815B (zh) 一种拍摄方法、装置、电子设备和存储介质
WO2021218318A1 (zh) 视频传输方法、电子设备和计算机可读介质
KR20220122807A (ko) 인터랙션 방법 및 장치, 전자 디바이스 및 컴퓨터 판독 가능 저장 매체
CN113225483B (zh) 图像融合方法、装置、电子设备和存储介质
US11818491B2 (en) Image special effect configuration method, image recognition method, apparatus and electronic device
WO2022171024A1 (zh) 图像显示方法、装置、设备及介质
EP4344236A1 (en) Video processing method and apparatus, electronic device and storage medium
WO2023221941A1 (zh) 图像处理方法、装置、设备及存储介质
WO2023040749A1 (zh) 图像处理方法、装置、电子设备及存储介质
WO2023241427A1 (zh) 图像处理方法、装置、设备及存储介质
WO2024027819A1 (zh) 图像处理方法、装置、设备及存储介质
WO2023231918A1 (zh) 图像处理方法、装置、电子设备及存储介质
WO2024001802A1 (zh) 图像处理方法、装置、电子设备及存储介质
WO2023143240A1 (zh) 图像处理方法、装置、设备、存储介质和程序产品
US20230082530A1 (en) Method, apparatus, and device for configuring video special effect, and storage medium
US20220391082A1 (en) Special effect processing method and apparatus
US20240089560A1 (en) Video generation method, apparatus, electronic device and storage medium
WO2023185392A1 (zh) 特效图标的生成方法、装置、设备及存储介质
WO2023088461A1 (zh) 图像处理方法、装置、电子设备及存储介质
US20240147050A1 (en) Prop processing method and apparatus, and device and medium

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: 23806893

Country of ref document: EP

Kind code of ref document: A1