WO2023185671A1 - 风格图像生成方法、装置、设备及介质 - Google Patents

风格图像生成方法、装置、设备及介质 Download PDF

Info

Publication number
WO2023185671A1
WO2023185671A1 PCT/CN2023/083653 CN2023083653W WO2023185671A1 WO 2023185671 A1 WO2023185671 A1 WO 2023185671A1 CN 2023083653 W CN2023083653 W CN 2023083653W WO 2023185671 A1 WO2023185671 A1 WO 2023185671A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
target
face
processed
area
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/CN2023/083653
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
Priority to US18/853,342 priority Critical patent/US20250252629A1/en
Publication of WO2023185671A1 publication Critical patent/WO2023185671A1/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
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/00Two-dimensional [2D] image generation
    • G06T11/60Creating or editing images; Combining images with text
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/00Two-dimensional [2D] image generation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present disclosure relates to the technical field of image processing, and in particular, to a style image generation method, device, equipment and medium.
  • a style image generation method including:
  • the target face stylization algorithm from the preset face stylization algorithm, and perform stylization processing on the face image area based on the target face stylization algorithm to obtain a face stylized image;
  • the image to be processed is switched and displayed to the target image according to preset rendering parameters.
  • a style image generating device is also provided, and the device includes:
  • the image acquisition module is used to acquire the image to be processed including the face image area;
  • the acquisition algorithm module is used to obtain the target face stylization algorithm from the preset face stylization algorithm
  • a stylization processing module configured to stylize the face image area based on the target face stylization algorithm to obtain a stylized face image
  • a processing module configured to perform processing based on the stylized face image and the image to be processed to obtain a target image
  • Switching display module used to switch and display the image to be processed to the target according to the preset rendering parameters. image.
  • an electronic device includes: a processor; a memory for storing instructions executable by the processor; and the processor is configured to retrieve instructions from the memory.
  • the executable instructions are read and executed to implement the style image generation method provided by any embodiment of the present disclosure.
  • a computer-readable storage medium stores a computer program.
  • the style image generation method provided by any embodiment of the present disclosure is implemented. .
  • a computer program including: instructions, which when executed by a processor implement the style image generation method provided by any embodiment of the present disclosure.
  • Figure 1 is a schematic flowchart of a style image generation method provided by some embodiments of the present disclosure
  • Figure 2 is a schematic flowchart of another style image generation method provided by some embodiments of the present disclosure.
  • Figure 3a is a schematic diagram of an image display provided by some embodiments of the present disclosure.
  • Figure 3b is a schematic diagram of an image to be processed provided by some embodiments of the present disclosure.
  • Figure 4a is a schematic diagram of a style image provided by some embodiments of the present disclosure.
  • Figure 4b is a schematic diagram of another style image provided by some embodiments of the present disclosure.
  • Figure 5a is a schematic diagram of an image switching display provided by some embodiments of the present disclosure.
  • Figure 5b is a schematic diagram of another image switching display provided by some embodiments of the present disclosure.
  • Figure 6 is a schematic structural diagram of a style image generation device provided by some embodiments of the present disclosure.
  • Figure 7 is a schematic structural diagram of an electronic device provided by some embodiments 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.
  • the present disclosure proposes a stylized image generation method, device, equipment and medium.
  • Figure 1 is a schematic flowchart of a style image generation method provided by some embodiments of the present disclosure.
  • the method can be executed by a style image generation device, where the device can be implemented using software and/or hardware, and can generally be integrated in an electronic device.
  • the method includes: steps 101 to 104.
  • step 101 an image to be processed including a human face image area is obtained.
  • the image to be processed can be any image including a human face area.
  • the face image area refers to the image area including the human face.
  • the number of face image regions may be one or more.
  • the display interface is opened, the input original image is received in the display interface, the resolution of the original image is adjusted and displayed, and the displayed image is screenshot-processed to obtain the image to be processed.
  • the target camera is opened, based on the confirmation instruction, the captured image is obtained through the target camera and displayed, and the displayed image is screenshot-processed to obtain the image to be processed.
  • the above two methods are only used to obtain the treatment area including the face image area.
  • the embodiment of the present disclosure does not limit the specific manner of obtaining the image to be processed including the face image area.
  • the user's trigger operation on the display interface can be detected.
  • the original image can be distinguished.
  • Adjust the display rate take a screenshot of the displayed image, and obtain the image to be processed.
  • the target camera is opened.
  • the user touches the screen, presses the volume key, etc. the captured image can be obtained and displayed through the target camera, and the displayed image can be screenshot-processed to obtain the image to be processed.
  • it supports interactive methods such as touch screen freezing and uploading images to obtain images to be processed, further improving the diversity of style image generation.
  • a target face stylization algorithm is obtained from a preset face stylization algorithm, and the face image area is stylized based on the target face stylization algorithm to obtain a face stylized image.
  • Face stylization algorithm refers to an algorithm used to transform facial image areas into different styles, such as big eyes, grins, small noses, etc.
  • the preset face stylization algorithm can understand that multiple face stylization algorithms are pre-stored in the terminal settings, and the settings can be selected according to the needs of the application scenario. For example, in the process of generating style images based on history, the stored style images are analyzed to obtain the style preference characteristics of the terminal, thereby updating the preset face stylization algorithm to further meet personalized needs.
  • the target face stylization algorithm after acquiring the image to be processed, there are many ways to obtain the target face stylization algorithm from the preset face stylization algorithm.
  • the target face stylization algorithm is obtained from the preset face stylization algorithm.
  • Preset rules include random selection rules, selection rules based on facial stylization algorithm sorting, or selection rules based on terminal usage time, etc. That is, the target face stylization algorithm is uncertain and has a certain degree of randomness, so that it can randomly display the face stylization effect and support multiple faces, further improving the interest of the styled image.
  • the face image area is stylized based on the target face stylization algorithm.
  • the face image area determines the target feature area, obtains the style material corresponding to the target feature area, and processes the target feature area based on the style material to obtain a stylized face image.
  • the face image region is input into a pre-trained style image generation model to obtain a face stylized image.
  • the above two methods are only examples of stylizing the face image area based on the target face stylization algorithm to obtain a face stylized image.
  • the embodiments of the present disclosure do not perform stylization on the face image area based on the target face stylization algorithm. Stylization processing, the specific way to obtain the stylized image of the face is limited.
  • the target face stylization algorithm after receiving the image to be processed including the face image area, can be randomly obtained from the preset face stylization algorithm to stylize the face image area, and the result is Stylized image of human face.
  • the number of face image regions can be one or more, and the number of face stylized images can also be one or more.
  • the target face stylization algorithm can be multiple, so that the stylized face images generated by different face image areas have different style effects, thereby further diversifying the display of style images. sex and fun.
  • step 103 the target image is obtained by processing based on the face stylized image and the image to be processed.
  • the target image can be obtained by processing based on the stylized face image and the image to be processed.
  • the target area image in the image to be processed is determined, and the target area image is replaced with the stylized face image to obtain the target image.
  • there can be multiple face stylized images so there can be multiple target area images.
  • the mouth, eyes and nose can be stylized at the same time to obtain three people. Stylize the face image to determine the three target area images in the image to be processed and replace them to obtain the target image.
  • step 104 the image to be processed is switched and displayed into a target image according to preset rendering parameters.
  • the rendering parameters can be selected and set according to the application needs.
  • the target image is grayscaled based on the rendering parameters to obtain a grayscale image
  • the image exposure area of the grayscale image and the exposure speed of the image exposure area are determined
  • the image to be processed is processed according to the exposure of the image exposure area.
  • Speed switching is displayed to the target image.
  • the rendering image is determined based on the rendering parameters, and the image to be processed is switched to display the rendering image and then displayed as the target image. The above two methods are only examples of switching and displaying the image to be processed into the target image according to the preset rendering parameters.
  • the embodiments of the present disclosure do not limit the specific method of switching and displaying the image to be processed into the target image according to the preset rendering parameters. As a result, different rendering effects can be incorporated into the display process to improve the flexibility of switching between the image to be processed and the stylized target image, further improving the user experience.
  • the style image generation scheme obtains the image to be processed including the face image area, obtains the target face stylization algorithm from the preset face stylization algorithm, and performs the human face stylization algorithm on the basis of the target face stylization algorithm.
  • the face image area is stylized to obtain a stylized face image
  • the target image is obtained based on the processing of the stylized face image and the image to be processed, and the image to be processed is switched and displayed into the target image according to the preset rendering parameters.
  • obtaining the image to be processed including the face image area includes: responding to the stylization processing request, opening a display interface, receiving the input original image on the display interface, and performing resolution adjustment and display on the original image. Display, take a screenshot of the displayed image to obtain the image to be processed.
  • a stylized processing request There are many ways to obtain a stylized processing request. For example, when you click or hover on the image processing software icon to obtain a stylized processing request, after obtaining the stylized processing request, open the display interface and receive it by operating the controls in the display interface. The original image is further adjusted and displayed in resolution, and the displayed image is screenshot-processed to obtain the image to be processed.
  • the size of the received original image may not be suitable for the screen.
  • the resolution of the original image is adjusted and then displayed. Further meet user needs and improve user experience.
  • the embodiment of the present disclosure processes screenshots of displayed images.
  • the image to be processed that is to say, only one image is stylized during the entire style image generation process, so the screen image is captured again as the image to be processed, thereby avoiding different branches to perform different operations.
  • Stylized algorithm processing prevents waste of performance and further improves the efficiency of styled image generation.
  • obtaining the image to be processed including the face image area includes: responding to the stylization processing request, opening the target camera, based on the confirmation instruction, obtaining the captured image through the target camera and displaying it, and performing screenshot processing on the displayed image, Get the image to be processed.
  • a stylized processing request There are many ways to obtain a stylized processing request. For example, when you click or hover on the image processing software icon to obtain a stylized processing request, after obtaining the stylized processing request, open the target camera (which can be the front camera of the device or rear camera), after receiving the confirmation command, obtain the captured image through the target camera and display it, and screenshot the displayed image to obtain the image to be processed.
  • the target camera which can be the front camera of the device or rear camera
  • confirmation instructions There are many ways to obtain confirmation instructions. You can choose settings according to the application scenario. For example, touching the screen, pressing the volume key and/or the home key and other operations will trigger the confirmation instruction, further improving the flexibility of interaction and satisfying the diversity and interest of image stylization processing. sex.
  • the image to be processed is still obtained by taking a screenshot of the displayed image. That is to say, only one image is stylized during the entire stylized image generation process, so the screen is captured again. As the image to be processed, this avoids using different branches to perform different stylization algorithm processing, prevents waste of performance, and further improves the efficiency of style image generation.
  • obtaining the target face stylization algorithm from the preset face stylization algorithm includes: obtaining the target face stylization algorithm from the preset face stylization algorithm based on the preset selection rule.
  • rules for selecting face stylization algorithms can be set in advance, such as random rules, specific uncertainty selection rules such as ordering according to face stylization algorithms and terminal usage time rules, so that different selection rules can be randomly generated. Stylized face effect, and at the same time, in the case of multiple faces, it can also achieve randomness in the effects of different faces in the picture.
  • stylizing the face image area based on the target face stylization algorithm to obtain the face stylized image includes: determining the target feature area based on the face image area, and obtaining style materials corresponding to the target feature area. , process the target feature area based on the style material to obtain a stylized face image.
  • the target feature area can be one or more, such as the mouth, eyes, nose and other areas as the target feature area.
  • obtain the style material corresponding to the target feature area such as the mouth
  • obtain the style material corresponding to the mouth For example, grinning, pouting, etc., that is, different target feature areas correspond to different style materials, which further improves the diversity of image stylization.
  • the target feature area is subjected to rigid transformation and other processing to obtain the face style. image.
  • processing the stylized face image and the image to be processed to obtain the target image includes: obtaining the position information and mask corresponding to the stylized face image, and determining the position information in the image to be processed based on the position information and the mask. For the target area image, replace the target area image with the stylized image of the face to obtain the target image.
  • Position information refers to the position coordinates of the stylized face image in the image to be processed. Based on the position information, the position of the stylized face image in the image to be processed can be determined; the mask refers to the area corresponding to the stylized face image. , it can also be said that the mask corresponding to the stylized face image can accurately determine the target area image in the image to be processed based on the position information and mask, thereby replacing the target area image with the stylized face image to obtain the target image.
  • the stylized face image and the image to be processed can be accurately fused to obtain the target image, ensuring the accurate display of the styled image and satisfying the user's visual experience.
  • switching the image to be processed into a target image according to preset rendering parameters includes: performing grayscale processing on the target image based on the rendering parameters to obtain a grayscale image, and determining the image exposure area of the grayscale image; and the exposure speed of the image exposure area, and the image to be processed is switched and displayed into the target image according to the exposure speed of the image exposure area.
  • the target image is grayscaled based on the rendering parameters to obtain a grayscale image, and each image exposure area of the grayscale image is determined based on the threshold in the rendering parameters, and the exposure speed corresponding to each image exposure area is determined. degree, thereby switching the image to be processed and displaying it into the target image according to the exposure speed of the image exposure area.
  • the exposure content is integrated into the display switching process, and the content to be exposed is displayed during the display switching process.
  • the rendering special effects are integrated into the display process, improving the flexibility of screen switching.
  • switching the image to be processed to display the target image according to preset rendering parameters includes: determining the rendering image based on the rendering parameters, switching the image to be processed to display the rendered image and then displaying it as the target image.
  • the rendering image can be selected according to the needs of the scene, and the image to be processed is switched to display the rendering image and then displayed as the target image.
  • the rendering image can be displayed during the display switching process, and the rendering special effects can be incorporated into the display process to improve the flexibility of screen switching.
  • Figure 2 is a schematic flowchart of another style image generation method provided by an embodiment of the present disclosure. Based on the above embodiment, this embodiment further optimizes the above style image generation method. As shown in Figure 2, the method includes: steps 201 to 207.
  • step 201 in response to the stylization processing request, the display interface and/or the target camera are opened.
  • step 201 After step 201, step 202 or step 203 may be performed.
  • step 202 the input original image is received on the display interface, and the resolution of the original image is adjusted and displayed.
  • step 203 based on the confirmation instruction, the captured picture is obtained through the target camera and displayed.
  • step 204 screenshot processing is performed on the displayed image to obtain the image to be processed.
  • FIG. 3a is a schematic diagram of an image display provided by an embodiment of the present disclosure.
  • the figure shows a schematic diagram of a display interface.
  • the display interface includes a captured image and a preset control 11.
  • the control 11 is in the shape of a circle. If the user triggers the control 11, the terminal can receive the original image upload operation, obtain the original image and display it. As shown in Figure 3b, the uploaded original image is displayed in the display interface.
  • the image shown in Figure 3a or Figure 3b is screenshot-processed to obtain the image to be processed.
  • the user when the user does not upload the original image, he or she needs to first capture the entire screen and save the image at the freeze moment as the image to be processed, and then use the image to be processed as input for possible subsequent rendering effects and stylization algorithm processing to ensure After rendering, the stylized picture will appear.
  • the user uploads the original image after the user selects the original image from the album, adaptive display is performed according to the resolution of the original image to prevent visual discomfort caused by stretching.
  • the displayed image is captured as the image to be processed, and then The images to be processed are used as inputs for possible subsequent rendering effects and stylization algorithm processing to ensure that a stylized picture will appear after rendering.
  • face stylization algorithms are mostly based on some pre-trained deep learning models, and the calculation of the model The amounts are relatively large. If calculated every frame, it will cause lag in the experience process. Therefore, the embodiment of the present disclosure performs single-frame isolation for the operation of the face stylization algorithm, ensuring that the face stylization algorithm only calculates one frame of image, that is, the image to be processed and saves it, and then only displays the saved style image during display. Improve style image processing efficiency.
  • step 205 the target face stylization algorithm is randomly obtained from the preset face stylization algorithm, the target feature area is determined from the face image area based on the target face stylization algorithm, and the style material corresponding to the target feature area is obtained. , process the target feature area based on the style material to obtain a stylized face image.
  • Figure 4a is a schematic diagram of a style image provided by an embodiment of the present disclosure.
  • Figure 4a shows a schematic diagram of a style image.
  • Figure 3a includes a face image area.
  • the face image area is stylized, and the stylized face image is obtained as shown in Figure 4a.
  • the mouth in the face image area is stylized.
  • Figure 4b is a schematic diagram of another style image provided by an embodiment of the present disclosure.
  • Figure 4b shows a schematic diagram of a style image.
  • Two face image areas are subjected to different stylization processes to obtain the human face image.
  • the face stylized image is shown in Figure 4b.
  • the mouth in one face image area is stylized, and the hair in the other face image area is stylized.
  • step 206 the position information and mask corresponding to the stylized face image are obtained, the target area image in the image to be processed is determined based on the position information and mask, and the target area image is replaced with the stylized face image to obtain the target image.
  • step 207 perform grayscale processing on the target image based on the rendering parameters to obtain a grayscale image, determine the image exposure area of the grayscale image, and the exposure speed of the image exposure area, and convert the image to be processed according to the exposure of the image exposure area. Speed switching is displayed to the target image.
  • full-screen coverage rendering special effects are added between displaying the freeze screen or uploading the original image to the stylized face image.
  • Special effect styles such as floodlight, flash white, etc.
  • the transition time of the rendering transition is just enough to make the style
  • the optimization algorithm is used to complete the processing, which can visually increase the smoothness of the transition.
  • the interactive process increases the interest of facial stylization special effects, and optimization methods are used to solve performance problems when multiple facial styles coexist. That is to say, it has built-in multiple stylized face effects, and the switching effect is triggered to transition to a random stylized face through interactive operations. It only calculates one frame and caches the result, and then cooperates with the rendering special effects to freeze the display, thus achieving a random Generates different facial stylization effects, and supports touch screen freezing and uploading images
  • Interactive methods such as images, etc., and incorporating rendering special effects into the display process can effectively improve the smoothness of switching between the original image and the stylized picture, and the method of grabbing a frame as the image to be processed effectively solves the problem of multiple face style special effects at the same time. There will be performance issues when running.
  • the stylized image generation scheme of the embodiments of the present disclosure opens the display interface and/or the target camera in response to the stylization processing request, receives the input original image on the display interface, and adjusts the resolution of the original image for display. , or based on the confirmation command, obtain the captured image through the target camera and display it, screenshot the displayed image to obtain the image to be processed; randomly obtain the target face stylization algorithm from the preset face stylization algorithm, and based on the target person
  • the face stylization algorithm determines the target feature area from the face image area, obtains the style material corresponding to the target feature area, processes the target feature area based on the style material, and obtains the face stylized image; obtains the face stylized image correspondence Position information and mask, determine the target area image in the image to be processed based on the position information and mask, replace the target area image with the stylized face image, and obtain the target image; perform grayscale processing on the target image based on the rendering parameters, Obtain a grayscale image, determine the image exposure area of the grayscale image and the
  • the stylized effect of faces can be displayed randomly, and multiple faces can be supported to randomly assign preset stylized effects to each face, ensuring the randomness of the effects of different faces in the picture.
  • a full-screen overlay rendering effect is added between the original image and the stylized face image, which visually increases the smoothness of the transition and improves user retention.
  • Figure 6 is a schematic structural diagram of a style image generation device provided by an embodiment of the present disclosure.
  • the device can be implemented by software and/or hardware, and can generally be integrated in electronic equipment.
  • the device includes: an image acquisition module 301, an algorithm acquisition module 302, a stylization processing module 303, a processing module 304, and a switching display module 305.
  • the image acquisition module 301 is used to acquire the image to be processed including the face image area.
  • the acquisition algorithm module 302 is used to acquire the target face stylization algorithm from the preset face stylization algorithm.
  • the stylization processing module 303 is configured to stylize the face image area based on the target face stylization algorithm to obtain a stylized face image.
  • the processing module 304 is configured to perform processing based on the stylized face image and the image to be processed to obtain a target image.
  • the switching display module 305 is used to switch and display the image to be processed into the target image according to preset rendering parameters.
  • the switching display module 305 is specifically used to:
  • the image to be processed is switched and displayed to the target image according to the exposure speed of the image exposure area.
  • the switching display module 305 is specifically used to:
  • the image to be processed is switched to display the rendered picture and then displayed as the target image.
  • the acquisition algorithm module 302 is specifically used to:
  • the target face stylization algorithm is obtained from the preset face stylization algorithm based on a preset selection rule.
  • the image acquisition module 301 is specifically used to:
  • the image acquisition module 301 is specifically used to:
  • the stylization processing module 303 is specifically used to:
  • the target feature area is processed based on the style material to obtain a stylized face image.
  • the processing module 304 is specifically used to:
  • the target area image is obtained by replacing the target area image with the stylized face image.
  • the style image generation device provided by the embodiments of the disclosure can execute the style image generation method provided by any embodiment of the disclosure, and has functional modules and beneficial effects corresponding to the execution method.
  • Embodiments of the present disclosure also provide a computer program product, which includes a computer program/instruction.
  • a computer program product which includes a computer program/instruction.
  • the style image generation method provided by any embodiment of the present disclosure is implemented.
  • FIG. 7 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.
  • a schematic structural diagram of an electronic device 400 suitable for implementing an embodiment of the present disclosure is shown.
  • the electronic device 400 may include, but is not limited to, mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMP (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals) Mobile terminals such as digital TVs, desktop computers, etc., as well as fixed terminals.
  • the electronic device shown in FIG. 7 is only an example and should not impose any limitations on the functions and scope of use of the embodiments of the present disclosure.
  • the electronic device 400 may include a processing device (eg, central processing unit, graphics processor, etc.) 401 , which may be loaded into a random access device according to a program stored in a read-only memory (ROM) 402 or from a storage device 408 .
  • the program in the memory (RAM) 403 executes various appropriate actions and processes.
  • various programs and data required for the operation of the electronic device 400 are also stored.
  • the processing device 401, ROM 402 and RAM 403 are connected to each other via a bus 404.
  • An input/output (I/O) interface 405 is also connected to bus 404.
  • the following devices may be connected to the I/O interface 405: input devices 406 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a liquid crystal display (LCD), speakers, vibration An output device 407 such as a computer; a storage device 408 including a magnetic tape, a hard disk, etc.; and a communication device 409.
  • the communication device 409 may allow the electronic device 400 to communicate wirelessly or wiredly with other devices to exchange data.
  • FIG. 7 illustrates electronic device 400 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 carried on a non-transitory computer-readable medium, the computer program containing program code for performing the method illustrated in the flowchart.
  • the computer program may be downloaded and installed from the network via communication device 409, or from storage device 408, or from ROM 402.
  • the processing device 401 When the computer program is executed by the processing device 401, the above-mentioned functions defined in the style image generation method of the embodiment of the present disclosure are performed.
  • 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, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any combination thereof. More specific examples of computer readable storage media may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard drive, random access memory (RAM), read only memory (ROM), removable Programmd read-only memory (EPROM or flash memory), fiber optics, portable compact disk 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 that may Used by or in conjunction with an instruction execution system, device, 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 but not limited to electromagnetic signals, optical signals, or any suitable combination of the above.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can 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 may be transmitted using any suitable medium, including but not limited to: wire, optical cable, RF (radio frequency), 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 HTTP (HyperText Transfer Protocol), and can communicate with digital data in any form or medium.
  • Communications e.g., communications network
  • communications networks include local area networks (“LAN”), wide area networks (“WAN”), the Internet (e.g., the Internet), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or developed in the future network of.
  • 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 computer-readable medium carries one or more programs.
  • the electronic device receives the user's information display triggering operation during the playback of the video; obtains the At least two target information associated with the video; display the first target information among the at least two target information in the information display area of the play page of the video, wherein the size of the information display area is smaller than the size of the play page. Size: Receive the user's first switching triggering operation, and switch the first target information displayed in the information display area to the second target information among the at least two target information.
  • Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, including but not limited to object-oriented programming languages—such as Java, Smalltalk, C++, and Includes conventional procedural programming languages—such as "C” or similar programming languages.
  • 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 shown one after another may actually execute substantially in parallel, or they may sometimes execute in the 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. Among them, the name of a unit does not constitute a limitation on the unit itself under certain circumstances.
  • FPGAs Field Programmable Gate Arrays
  • ASICs Application Specific Integrated Circuits
  • ASSPs Application Specific Standard Products
  • SOCs Systems on Chips
  • CPLD Complex Programmable Logical 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, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any suitable combination of the foregoing.
  • machine-readable storage media would include one or more wire-based electrical connections, laptop disks, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • 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
  • magnetic storage device or any suitable combination of the above.
  • the present disclosure provides a style image generation method, including:
  • the image to be processed is switched and displayed to the target image according to preset rendering parameters.
  • the to-be-processed Switching and displaying the processed image into the target image according to the preset rendering parameters includes:
  • the image to be processed is switched and displayed to the target image according to the exposure speed of the image exposure area.
  • switching and displaying the image to be processed into the target image according to preset rendering parameters includes:
  • the image to be processed is switched to display the rendered picture and then displayed as the target image.
  • obtaining the target face stylization algorithm from the preset face stylization algorithm includes:
  • the target face stylization algorithm is obtained from the preset face stylization algorithm based on a preset selection rule.
  • the obtaining the image to be processed including the face image area includes:
  • the obtaining the image to be processed including the face image area includes:
  • stylizing the face image area based on the target face stylization algorithm to obtain the face stylized image includes:
  • the target feature area is processed based on the style material to obtain a stylized face image.
  • processing the stylized face image and the image to be processed to obtain a target image includes:
  • the target area image is obtained by replacing the target area image with the stylized face image.
  • the present disclosure provides a style image generation device, including:
  • the image acquisition module is used to acquire the image to be processed including the face image area;
  • the acquisition algorithm module is used to randomly obtain the target face stylization algorithm from the preset face stylization algorithm
  • a stylization processing module configured to stylize the face image area based on the target face stylization algorithm to obtain a stylized face image
  • a processing module configured to perform processing based on the stylized face image and the image to be processed to obtain a target image
  • a display switching module is configured to switch and display the image to be processed into the target image according to preset rendering parameters.
  • the switching display module is specifically used for:
  • the image to be processed is switched and displayed to the target image according to the exposure speed of the image exposure area.
  • the switching display module is specifically used for:
  • the image to be processed is switched to display the rendered picture and then displayed as the target image.
  • the acquisition algorithm module is specifically used to:
  • the target face stylization algorithm is obtained from the preset face stylization algorithm based on a preset selection rule.
  • the image acquisition module is specifically used to:
  • the acquired image model Blocks are specifically used for:
  • the stylization processing module is specifically used to:
  • the target feature area is processed based on the style material to obtain a stylized face image.
  • the processing module is specifically used to:
  • the target area image is obtained by replacing the target area image with the stylized face image.
  • the present disclosure provides an electronic device, including:
  • memory for storing instructions executable by the processor
  • the processor is configured to read the executable instructions from the memory and execute the instructions to implement any of the style image generation methods provided by this disclosure.
  • the present disclosure provides a computer-readable storage medium, the storage medium stores a computer program, and when the computer program is executed by a processor, the style image of any one provided by the present disclosure is Generate method.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Processing (AREA)
  • Processing Or Creating Images (AREA)

Abstract

本公开实施例涉及一种风格图像生成方法、装置、设备及介质,其中该方法包括:获取包括人脸图像区域的待处理图像,从预设的人脸风格化算法中获取目标人脸风格化算法,并基于目标人脸风格化算法对人脸图像区域进行风格化处理,得到人脸风格化图像,基于人脸风格化图像与待处理图像进行处理,得到目标图像,将待处理图像根据预设的渲染参数切换显示成目标图像。

Description

风格图像生成方法、装置、设备及介质
相关申请的交叉引用
本申请是以CN申请号为202210347666.9,申请日为2022年4月1日的申请为基础,并主张其优先权,该CN申请的公开内容在此作为整体引入本申请中。
技术领域
本公开涉及本公开涉及图像处理技术领域,尤其涉及一种风格图像生成方法、装置、设备及介质。
背景技术
随着互联网技术和智能终端的快速发展,通过对图像进行美颜、风格化等处理来满足用户的个性化需求和使用体验。
相关技术中,通过深度学习网络等方式直接对人脸进行风格化处理并显示。
发明内容
根据本公开的一些实施例,提供了一种风格图像生成方法,所述方法包括:
获取包括人脸图像区域的待处理图像;
从预设的人脸风格化算法中获取目标人脸风格化算法,并基于所述目标人脸风格化算法对所述人脸图像区域进行风格化处理,得到人脸风格化图像;
基于所述人脸风格化图像与所述待处理图像进行处理,得到目标图像;
将所述待处理图像根据预设的渲染参数切换显示成所述目标图像。
根据本公开一些实施例,还提供了一种风格图像生成装置,所述装置包括:
获取图像模块,用于获取包括人脸图像区域的待处理图像;
获取算法模块,用于从预设的人脸风格化算法中获取目标人脸风格化算法;
风格化处理模块,用于基于所述目标人脸风格化算法对所述人脸图像区域进行风格化处理,得到人脸风格化图像;
处理模块,用于基于所述人脸风格化图像与所述待处理图像进行处理,得到目标图像;
切换显示模块,用于将所述待处理图像根据预设的渲染参数切换显示成所述目标 图像。
根据本公开的一些实施例,还提供了一种电子设备,所述电子设备包括:处理器;用于存储所述处理器可执行指令的存储器;所述处理器,用于从所述存储器中读取所述可执行指令,并执行所述指令以实现如本公开任意实施例提供的风格图像生成方法。
根据本公开的一些实施例还提供了一种计算机可读存储介质,所述存储介质存储有计算机程序,所述计算机程序被处理器执行时,实现如本公开任意实施例提供的风格图像生成方法。
根据本公开的一些实施例还提供了一种计算机程序,包括:指令,所述指令被处理器执行时实现如本公开任意实施例提供的风格图像生成方法。
附图说明
结合附图并参考以下具体实施方式,本公开各实施例的上述和其他特征、优点及方面将变得更加明显。贯穿附图中,相同或相似的附图标记表示相同或相似的元素。应当理解附图是示意性的,原件和元素不一定按照比例绘制。
图1为本公开一些实施例提供的一种风格图像生成方法的流程示意图;
图2为本公开一些实施例提供的另一种风格图像生成方法的流程示意图;
图3a为本公开一些实施例提供的一种图像展示的示意图;
图3b为本公开一些实施例提供的一种待处理图像的示意图;
图4a为本公开一些实施例提供的一种风格图像的示意图;
图4b为本公开一些实施例提供的另一种风格图像的示意图;
图5a为本公开一些实施例提供的一种图像切换显示的示意图;
图5b为本公开一些实施例提供的另一种图像切换显示的示意图;
图6为本公开一些实施例提供的一种风格图像生成装置的结构示意图;
图7为本公开一些实施例提供的一种电子设备的结构示意图。
具体实施方式
下面将参照附图更详细地描述本公开的实施例。虽然附图中显示了本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保 护范围。
应当理解,本公开的方法实施方式中记载的各个步骤可以按照不同的顺序执行,和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。本公开的范围在此方面不受限制。
本文使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。术语“基于”是“至少部分地基于”。术语“一个实施例”表示“至少一个实施例”;术语“另一实施例”表示“至少一个另外的实施例”;术语“一些实施例”表示“至少一些实施例”。其他术语的相关定义将在下文描述中给出。
需要注意,本公开中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分,并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。
需要注意,本公开中提及的“一个”、“多个”的修饰是示意性而非限制性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。
本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。
发明人发现:相关技术中风格化图像的展示过程比较单一,为解决该技术问题,本公开提出一种一种风格图像生成方法、装置、设备及介质。
图1为本公开一些实施例提供的一种风格图像生成方法的流程示意图,该方法可以由风格图像生成装置执行,其中该装置可以采用软件和/或硬件实现,一般可集成在电子设备中。如图1所示,该方法包括:步骤101~104。
在步骤101中,获取包括人脸图像区域的待处理图像。
待处理图像可以为任意一个包括人脸区域的图像。人脸图像区域是指包括人脸的图像区域。其中,人脸图像区域的数量可以为一个或多个。
本公开实施例中,获取包括人脸图像区域的待处理图像的方式有很多种,可以根据应用场景需要选择设置。在一些实施例方式中,响应于风格化处理请求,打开显示界面,在显示界面接收输入的原图像,并对原图像进行分辨率调整显示,对显示的图像进行截图处理,得到待处理图像。在另一些实施方式中,响应于风格化处理请求,打开目标摄像头,基于确认指令,通过目标摄像头获取拍摄图片并显示,对显示的图像进行截图处理,得到待处理图像。以上两种方式仅为获取包括人脸图像区域的待处 理图像的示例,本公开实施例不对获取包括人脸图像区域的待处理图像的具体方式进行限定。
具体的,在响应于风格化处理请求,打开显示界面后,可以检测用户在显示界面上的触发操作,当检测到用户对相关控件的点击等操作输入原图像时,则可以对原图像进行分辨率调整显示,对显示的图像进行截图处理,得到待处理图像。在响应于风格化处理请求,打开目标摄像头,当检测到用户触屏、按压音量键等操作时,则可以通过目标摄像头获取拍摄图片并显示,对显示的图像进行截图处理,得到待处理图像。由此,通过支持了触屏定格和上传图像等交互方式获取待处理图像,进一步提高风格图像生成的多样性。
在步骤102中,从预设的人脸风格化算法中获取目标人脸风格化算法,并基于目标人脸风格化算法对人脸图像区域进行风格化处理,得到人脸风格化图像。
人脸风格化算法是指用于将人脸图像区域进行风格转化的算法,比如变成大眼睛、咧嘴笑和小鼻子等不同风格。预设的人脸风格化算法可以理解在终端设置预先存储多种人脸风格化算法,可以根据应用场景需要选择设置。比如基于历史生成风格图像过程中,基于存储的风格图像进行分析,获取终端的风格偏好特征,从而更新预设的人脸风格化算法,进一步满足个性化需求。
在本公开实施例中,在获取待处理图像后,从预设的人脸风格化算法中获取目标人脸风格化算法的方式有很多种,在一些实施方式中,基于预设选择规则从预设的人脸风格化算法中获取目标人脸风格化算法。预设规则比如随机选择的规则、按照人脸风格化算法排序进行选择的规则或者按照终端使用时间进行选择的规则等。即目标人脸风格化算法是不确定的,具有一定的随机性,从而可以随机展示人脸风格化效果且支持多人脸,进一步提高风格图像的趣味性。
在本公开实施例中,基于目标人脸风格化算法对人脸图像区域进行风格化处理,得到人脸风格化图像的方式有很多种,可以根据应用需要选择设置,在一个实施方式中,基于人脸图像区域确定目标特征区域,获取与目标特征区域对应的风格素材,基于风格素材对目标特征区域进行处理,得到人脸风格化图像。在另一个实施方式中,将人脸图像区域输入预先训练的风格图像生成模型,得到人脸风格化图像。以上两种方式仅为基于目标人脸风格化算法对人脸图像区域进行风格化处理,得到人脸风格化图像的示例,本公开实施例不对基于目标人脸风格化算法对人脸图像区域进行风格化处理,得到人脸风格化图像的具体方式进行限定。
本公开实施例中,当接收到包括人脸图像区域的待处理图像之后,可以从预设的人脸风格化算法中随机获取目标人脸风格化算法对人脸图像区域进行风格化处理,得到人脸风格化图像。人脸图像区域的数量可以为一个或多个,人脸风格化图像也可以为一个或多个。其中,人脸图像区域的数量为多个时,目标人脸风格化算法可以为多个,从而不同的人脸图像区域生成的人脸风格化图像的风格效果不同,从而进一步风格图像显示的多样性和趣味性。
在步骤103中,基于人脸风格化图像与待处理图像进行处理,得到目标图像。
具体的,获取人脸风格化图像之后,可以基于人脸风格化图像与待处理图像进行处理,得到目标图像。在一些实施方式中,确定待处理图像中的目标区域图像,将人脸风格化图像替换目标区域图像,得到目标图像。其中,在人脸图像区域仅仅为一个的情况下,人脸风格化图像可以为多个,从而目标区域图像可以为多个,比如可以同时对嘴巴、眼睛和鼻子同时进行风格处理,得到三个人脸风格化图像,从而确定待处理图像中的三个目标区域图像进行替换,得到目标图像。
在步骤104中,将待处理图像根据预设的渲染参数切换显示成目标图像。
其中,渲染参数可以根据应用需要选择设置。在一些实施方式中,基于渲染参数对目标图像进行灰度化处理,得到灰度图像,并确定灰度图像的图像曝光区域以及图像曝光区域的曝光速度,将待处理图像按照图像曝光区域的曝光速度切换显示成目标图像。在另一些实施方式中,基于渲染参数确定渲染图片,将待处理图像切换显示渲染图片后显示成目标图像。以上两种方式仅为将待处理图像根据预设的渲染参数切换显示成目标图像的示例,本公开实施例不对将待处理图像根据预设的渲染参数切换显示成目标图像的具体方式进行限定。由此,可以通过展示过程中融入了不同渲染特效,提高待处理图像和风格化后的目标图像切换灵活性,进一步提升用户体验。
本公开实施例提供的风格图像生成方案,获取包括人脸图像区域的待处理图像,从预设的人脸风格化算法中获取目标人脸风格化算法,并基于目标人脸风格化算法对人脸图像区域进行风格化处理,得到人脸风格化图像,基于人脸风格化图像与待处理图像进行处理,得到目标图像,将待处理图像根据预设的渲染参数切换显示成目标图像。采用上述技术方案,能够在生成人脸风格化效果的展示过程中融入了渲染特效,在视觉上增加过渡的平滑性,提升图像风格化场景下的图像展示效果。
在一些实施例中,获取包括人脸图像区域的待处理图像包括:响应于风格化处理请求,打开显示界面,在显示界面接收输入的原图像,并对原图像进行分辨率调整显 示,对显示的图像进行截图处理,得到待处理图像。
获取风格化处理请求的方式有很多种,比如点击或者悬停在图像处理软件图标时获取风格化处理请求,在获取风格化处理请求后,打开显示界面,通过对显示界面中控件的操作可以接收原图像,进一步对原图像进行分辨率调整显示,并对显示的图像进行截图处理,得到待处理图像。
具体地,本公开实施例中,接收的原图像可以尺寸等与屏幕可能不适应,为了防止图像拉伸产生视觉上的不适感,在获取原图像后,对原图像进行分辨率调整后显示,进一步满足用户使用需求,提升用户使用体验。
具体地,为了避免存在上传多张照片或者是其他方式同时获取图像的情况导致不同的分支去进行不同的风格化算法处理,造成性能上的浪费,本公开实施例通过对显示的图像进行截图处理,得到待处理图像,也就是说,在整个风格图像生成的过程中只对一张图像进行风格化处理,因此统一对屏幕画面进行再次抓帧作为待处理图像,从而避免不同的分支去进行不同的风格化算法处理,防止性能上的浪费,进一步提高风格图像生成的效率。
在一些实施例中,获取包括人脸图像区域的待处理图像包括:响应于风格化处理请求,打开目标摄像头,基于确认指令,通过目标摄像头获取拍摄图片并显示,对显示的图像进行截图处理,得到待处理图像。
获取风格化处理请求的方式有很多种,比如点击或者悬停在图像处理软件图标时获取风格化处理请求,在获取风格化处理请求后,打开目标摄像头(可以是设备的前置摄像头也可以是后置摄像头),在接收到确认指令,通过目标摄像头获取拍摄图片并显示,并对显示的图像进行截图处理,得到待处理图像。
确认指令的获取方式有很多种,可以根据应用场景选择设置,比如触屏、按压音量键和/或主键等操作触发确认指令,进一步提高交互的灵活性,满足图像风格化处理的多样性和趣味性。
本公开实施例还是通过对显示的图像进行截图处理,得到待处理图像,也就是说,在整个风格图像生成的过程中只对一张图像进行风格化处理,因此统一对屏幕画面进行再次抓帧作为待处理图像,从而避免不同的分支去进行不同的风格化算法处理,防止性能上的浪费,进一步提高风格图像生成的效率。
在一些实施例中,从预设的人脸风格化算法中获取目标人脸风格化算法包括:基于预设选择规则从预设的人脸风格化算法中获取目标人脸风格化算法。
在本公开实施例中,可以预先设置好选择人脸风格化算法的规则,比如随机规则、按照人脸风格化算法排序和终端使用时间规则等具体不确定性选择的规则,从而能够随机生成不同的人脸风格化效果,同时在多人脸情况下,也可以实现画面中不同人脸效果上的随机性。
在一些实施例中,基于目标人脸风格化算法对人脸图像区域进行风格化处理,得到人脸风格化图像包括:基于人脸图像区域确定目标特征区域,获取与目标特征区域对应的风格素材,基于风格素材对目标特征区域进行处理,得到人脸风格化图像。
目标特征区域可以是一个或者多个,比如嘴巴、眼睛、鼻子等区域作为目标特征区域,在确定目标特征区域后,获取与目标特征区域对应的风格素材,比如嘴巴,获取和嘴巴对应的风格素材比如咧嘴笑、嘟嘟嘴等,也就是不同目标特征区域对应不同的风格素材,进一步提高图像风格化的多样性,进一步地,基于风格素材对目标特征区域进行刚性变换等处理,得到人脸风格化图像。
上述方案中,可以针对人脸区域中提取不同的目标特征区域进行风格化处理,进一步提高风格图像的多样性,满足用户需求,提升用户使用体验,进一笔提高用户留存率。
在一些实施例中,将人脸风格化图像与待处理图像进行处理,得到目标图像包括:获取人脸风格化图像对应的位置信息和掩膜,基于位置信息和掩膜确定待处理图像中的目标区域图像,将人脸风格化图像替换目标区域图像,得到目标图像。
位置信息指的是人脸风格化图像在待处理图像中的位置坐标,基于位置信息能够确定人脸风格化图像在待处理图像中的位置;掩膜指的是人脸风格化图像对应的区域,也可以说是,人脸风格化图像对应的遮罩,基于位置信息和掩膜能够精确确定待处理图像中的目标区域图像,从而将人脸风格化图像替换目标区域图像,得到目标图像。
由此,能够精确将人脸风格化图像和待处理图像融合处理,得到目标图像,保证风格图像的精确显示,满足用户视觉体验。
在一些实施例中,将待处理图像根据预设的渲染参数切换显示成目标图像包括:基于渲染参数对目标图像进行灰度化处理,得到灰度图像,并确定灰度图像的图像曝光区域、以及图像曝光区域的曝光速度,将待处理图像按照图像曝光区域的曝光速度切换显示成目标图像。
基于渲染参数确定对目标图像进行灰度化处理,得到灰度图像,并基于渲染参数中的阈值确定灰度图像的各个图像曝光区域,并确定每个图像曝光区域对应的曝光速 度,从而将待处理图像按照图像曝光区域的曝光速度切换显示成目标图像。
由此,将曝光内容融入到切换显示过程中,并在切换显示过程展示待曝光内容,实现展示过程中融入了渲染特效,提高画面切换的灵活性。
在一些实施例中,将待处理图像根据预设的渲染参数切换显示成目标图像包括:基于渲染参数确定渲染图片,将待处理图像切换显示渲染图片后显示成目标图像。
其中,渲染图片可以根据应该场景需要选择,将待处理图像切换显示渲染图片后显示成目标图像。
由此,实现在切换显示过程中,展示渲染图片,实现展示过程中融入了渲染特效,提高画面切换的灵活性。
图2为本公开实施例提供的另一种风格图像生成方法的流程示意图,本实施例在上述实施例的基础上,进一步优化了上述风格图像生成方法。如图2所示,该方法包括:步骤201~207。
在步骤201中,响应于风格化处理请求,打开显示界面和/或目标摄像头。
在步骤201之后,可以执行步骤202或步骤203。
在步骤202中,在显示界面接收输入的原图像,并对原图像进行分辨率调整显示。
在步骤203中,基于确认指令,通过目标摄像头获取拍摄图片并显示。
在步骤204中,对显示的图像进行截图处理,得到待处理图像。
示例性的,图3a为本公开实施例提供的一种图像展示的示意图,图中展示了一个显示界面的示意图,显示界面中包括拍摄到画面以及预设的控件11,该控件11以圆形的形式设置,用户触发该控件11,则终端可以接收到原图像上传操作,进行获取原图像并显示,如图3b所示,显示界面中显示的是上传的原图像。
图3a中显示界面中,用过触发屏幕或者按压相关案件,可以对拍摄图像进行定格处理。由此,对图3a或者图3b显示的图像进行截图处理,得到待处理图像。
具体地,当用户不上传原图像时需要先对整个屏幕进行抓帧保存定格时刻的图像作为待处理图像,然后将待处理图像分别作为后续可能应用的渲染特效和风格化算法处理的输入,保证渲染后会出现风格化处理后的画面。当用户上传原图像时,在用户从相册中选中原图像后,根据原图像分辨率做自适应显示,防止被拉伸产生视觉上的不适感,对显示的图像进行抓帧作为待处理图像,然后将待处理图像分别作为后续可能应用的渲染特效和风格化算法处理的输入,保证渲染后会出现风格化处理后的画面。
具体地,人脸风格化算法大多基于一些前置训练好的深度学习模型,模型的计算 量都相对较大,如果每帧去计算的话会造成体验过程的卡顿。因此,本公开实施例针对人脸风格化算法的运行进行单帧隔离,保证人脸风格化算法只计算一帧图像,即待处理图像并保存,然后展示的时候只是对保存下来风格图像进行展示,提高风格图像处理效率。
在步骤205中,从预设的人脸风格化算法中随机获取目标人脸风格化算法,基于目标人脸风格化算法从人脸图像区域确定目标特征区域,获取与目标特征区域对应的风格素材,基于风格素材对目标特征区域进行处理,得到人脸风格化图像。
示例性的,继续以图3a为例,图4a为本公开实施例提供的一种风格图像的示意图,图4a中展示了一个风格图像的示意图,对图3a包括一个人脸图像区域,对人脸图像区域进行风格化处理,得到人脸风格化图像如图4a所示,人脸图像区域的嘴巴进行了风格化处理。继续以图3b为例,图4b为本公开实施例提供的另一种风格图像的示意图,图4b中展示了一个风格图像的示意图,分别对两个人脸图像区域进行不同风格化处理,得到人脸风格化图像如图4b所示,一个人脸图像区域的嘴巴进行了风格化处理,另一个人脸图像区域的头发进行风格化处理。
在步骤206中,获取人脸风格化图像对应的位置信息和掩膜,基于位置信息和掩膜确定待处理图像中的目标区域图像,将人脸风格化图像替换目标区域图像,得到目标图像。
在步骤207中,基于渲染参数对目标图像进行灰度化处理,得到灰度图像,并确定灰度图像的图像曝光区域、以及图像曝光区域的曝光速度,将待处理图像按照图像曝光区域的曝光速度切换显示成目标图像。
具体地,在显示定格屏幕或上传原图像到人脸风格化图像之间增加了全屏覆盖式的渲染特效,特效样式比如泛光,闪白类等,渲染转场的过渡的时间刚好可以使风格化算法完成处理,可以在视觉上增加过渡的平滑性。
示例性的,继续以图3a-图4a为例,在将图3a所示待处理图像根据预设的渲染参数切换显示成图4a所示目标图像的过程中,如图5a所示先曝光一部分内容,接着如图5b所示再曝光一部分内容,最终显示的图像如图4a所示。
由此,通过交互流程增加人脸风格化特效的趣味性,通过优化手段解决多人脸风格并存时的性能问题。也就是说,内置多种风格化人脸效果,通过交互操作来触发切换效果过渡到随机一种风格化人脸,只计算一帧并缓存下结果,之后配合渲染特效定格展示,从而实现了随机生成了不同的人脸风格化效果,并支持了触屏定格和上传图 像等交互方式,并在展示过程中融入了渲染特效能够有效提高原图像和风格化后的画面切换的流畅性,并且抓取一帧作为待处理图像的方式有效解决了多人脸风格特效同时运行会存在的性能问题。
综上所述,本公开实施例的风格图像生成方案,通过响应于风格化处理请求,打开显示界面和/或目标摄像头,在显示界面接收输入的原图像,并对原图像进行分辨率调整显示,或者基于确认指令,通过目标摄像头获取拍摄图片并显示,对显示的图像进行截图处理,得到待处理图像;从预设的人脸风格化算法中随机获取目标人脸风格化算法,基于目标人脸风格化算法从人脸图像区域确定目标特征区域,获取与目标特征区域对应的风格素材,基于风格素材对所述目标特征区域进行处理,得到人脸风格化图像;获取人脸风格化图像对应的位置信息和掩膜,基于位置信息和掩膜确定待处理图像中的目标区域图像,将人脸风格化图像替换目标区域图像,得到目标图像;基于渲染参数对目标图像进行灰度化处理,得到灰度图像,并确定灰度图像的图像曝光区域以及图像曝光区域的曝光速度,将待处理图像按照图像曝光区域的曝光速度切换显示成目标图像。由此,可以随机展示人脸风格化效果,且支持多人脸,实现为每个人脸随机分配预置的风格化效果,保证画面中不同人脸效果上的随机性。另外,原图像到人脸风格化图像之间增加了全屏覆盖式的渲染特效,在视觉上增加过渡的平滑性,提高用户留存率。
图6为本公开实施例提供的一种风格图像生成装置的结构示意图,该装置可由软件和/或硬件实现,一般可集成在电子设备中。如图6所示,该装置包括:获取图像模块301,获取算法模块302,风格化处理模块303,处理模块304,切换显示模块305。
获取图像模块301,用于获取包括人脸图像区域的待处理图像。
获取算法模块302,用于从预设的人脸风格化算法中获取目标人脸风格化算法。
风格化处理模块303,用于基于所述目标人脸风格化算法对所述人脸图像区域进行风格化处理,得到人脸风格化图像。
处理模块304,用于基于所述人脸风格化图像与所述待处理图像进行处理,得到目标图像。
切换显示模块305,用于将所述待处理图像根据预设的渲染参数切换显示成所述目标图像。
在一些实施例中,所述切换显示模块305具体用于:
基于所述渲染参数对所述目标图像进行灰度化处理,得到灰度图像,并确定所述 灰度图像的图像曝光区域、以及所述图像曝光区域的曝光速度。
将所述待处理图像按照所述图像曝光区域的曝光速度切换显示成所述目标图像。
在一些实施例中,所述切换显示模块305具体用于:
基于所述渲染参数确定渲染图片;
将所述待处理图像切换显示所述渲染图片后显示成所述目标图像。
在一些实施例中,所述获取算法模块302具体用于:
基于预设选择规则从所述预设的人脸风格化算法中获取所述目标人脸风格化算法。
在一些实施例中,所述获取图像模块301具体用于:
响应于风格化处理请求,打开显示界面;
在所述显示界面接收输入的原图像,并对所述原图像进行分辨率调整显示;
对显示的图像进行截图处理,得到所述待处理图像。
在一些实施例中,所述获取图像模块301具体用于:
响应于风格化处理请求,打开目标摄像头;
基于确认指令,通过所述目标摄像头获取拍摄图片并显示;
对显示的图像进行截图处理,得到所述待处理图像。
在一些实施例中,所述风格化处理模块303具体用于:
基于所述人脸图像区域确定目标特征区域;
获取与所述目标特征区域对应的风格素材;
基于所述风格素材对所述目标特征区域进行处理,得到人脸风格化图像。
在一些实施例中,所述处理模块304具体用于:
获取所述人脸风格化图像对应的位置信息和掩膜;
基于所述位置信息和所述掩膜确定所述待处理图像中的目标区域图像;
将所述人脸风格化图像替换所述目标区域图像,得到所述目标图像。
本公开实施例所提供的风格图像生成装置可执行本公开任意实施例所提供的风格图像生成方法,具备执行方法相应的功能模块和有益效果。
本公开实施例还提供了一种计算机程序产品,包括计算机程序/指令,该计算机程序/指令被处理器执行时实现本公开任意实施例所提供的风格图像生成方法。
图7为本公开实施例提供的一种电子设备的结构示意图。下面具体参考图7,其示出了适于用来实现本公开实施例中的电子设备400的结构示意图。本公开实施例中 的电子设备400可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图7示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图7所示,电子设备400可以包括处理装置(例如中央处理器、图形处理器等)401,其可以根据存储在只读存储器(ROM)402中的程序或者从存储装置408加载到随机访问存储器(RAM)403中的程序而执行各种适当的动作和处理。在RAM 403中,还存储有电子设备400操作所需的各种程序和数据。处理装置401、ROM 402以及RAM 403通过总线404彼此相连。输入/输出(I/O)接口405也连接至总线404。
通常,以下装置可以连接至I/O接口405:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置406;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置407;包括例如磁带、硬盘等的存储装置408;以及通信装置409。通信装置409可以允许电子设备400与其他设备进行无线或有线通信以交换数据。虽然图7示出了具有各种装置的电子设备400,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置409从网络上被下载和安装,或者从存储装置408被安装,或者从ROM 402被安装。在该计算机程序被处理装置401执行时,执行本公开实施例的风格图像生成方法中限定的上述功能。
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以 被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。
在一些实施方式中,客户端、服务器可以利用诸如HTTP(HyperText Transfer Protocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:在视频的播放过程中,接收用户的信息展示触发操作;获取所述视频关联的至少两个目标信息;在所述视频的播放页面的信息展示区域中展示所述至少两个目标信息中的第一目标信息其中,所述信息展示区域的尺寸小于所述播放页面的尺寸;接收用户的第一切换触发操作,将所述信息展示区域中展示的所述第一目标信息切换为所述至少两个目标信息中的第二目标信息。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程 序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元的名称在某种情况下并不构成对该单元本身的限定。
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。
根据本公开的一些实施例,本公开提供了一种风格图像生成方法,包括:
获取包括人脸图像区域的待处理图像;
从预设的人脸风格化算法中随机获取目标人脸风格化算法,并基于所述目标人脸风格化算法对所述人脸图像区域进行风格化处理,得到人脸风格化图像;
基于所述人脸风格化图像与所述待处理图像进行处理,得到目标图像;
将所述待处理图像根据预设的渲染参数切换显示成所述目标图像。
根据本公开的一些实施例,本公开提供的风格图像生成方法中,所述将所述待处 理图像根据预设的渲染参数切换显示成所述目标图像包括:
基于所述渲染参数对所述目标图像进行灰度化处理,得到灰度图像,并确定所述灰度图像的图像曝光区域以及所述图像曝光区域的曝光速度;
将所述待处理图像按照所述图像曝光区域的曝光速度切换显示成所述目标图像。
根据本公开的一些实施例,本公开提供的风格图像生成方法中,所述将所述待处理图像根据预设的渲染参数切换显示成所述目标图像包括:
基于所述渲染参数确定渲染图片;
将所述待处理图像切换显示所述渲染图片后显示成所述目标图像。
根据本公开的一些实施例,本公开提供的风格图像生成方法中,所述从预设的人脸风格化算法中获取目标人脸风格化算法包括:
基于预设选择规则从所述预设的人脸风格化算法中获取所述目标人脸风格化算法。
根据本公开的一些实施例,本公开提供的风格图像生成方法中,所述获取包括人脸图像区域的待处理图像包括:
响应于风格化处理请求,打开显示界面;
在所述显示界面接收输入的原图像,并对所述原图像进行分辨率调整显示;
对显示的图像进行截图处理,得到所述待处理图像。
根据本公开的一些实施例,本公开提供的风格图像生成方法中,所述获取包括人脸图像区域的待处理图像包括:
响应于风格化处理请求,打开目标摄像头;
基于确认指令,通过所述目标摄像头获取拍摄图片并显示;
对显示的图像进行截图处理,得到所述待处理图像。
根据本公开的一些实施例,本公开提供的风格图像生成方法中,所述基于所述目标人脸风格化算法对所述人脸图像区域进行风格化处理,得到人脸风格化图像包括:
基于所述人脸图像区域确定目标特征区域;
获取与所述目标特征区域对应的风格素材;
基于所述风格素材对所述目标特征区域进行处理,得到人脸风格化图像。
根据本公开的一些实施例,本公开提供的风格图像生成方法中,所述将所述人脸风格化图像与所述待处理图像进行处理,得到目标图像包括:
获取所述人脸风格化图像对应的位置信息和掩膜;
基于所述位置信息和所述掩膜确定所述待处理图像中的目标区域图像;
将所述人脸风格化图像替换所述目标区域图像,得到所述目标图像。
根据本公开的一些实施例,本公开提供了一种风格图像生成装置,包括:
获取图像模块,用于获取包括人脸图像区域的待处理图像;
获取算法模块,用于从预设的人脸风格化算法中随机获取目标人脸风格化算法;
风格化处理模块,用于基于所述目标人脸风格化算法对所述人脸图像区域进行风格化处理,得到人脸风格化图像;
处理模块,用于基于所述人脸风格化图像与所述待处理图像进行处理,得到目标图像;
切换显示模块,用于将所述待处理图像根据预设的渲染参数切换显示成所述目标图像。
根据本公开的一些实施例,本公开提供的风格图像生成装置中,所述切换显示模块具体用于:
基于所述渲染参数对所述目标图像进行灰度化处理,得到灰度图像,并确定所述灰度图像的图像曝光区域、以及所述图像曝光区域的曝光速度;
将所述待处理图像按照所述图像曝光区域的曝光速度切换显示成所述目标图像。
根据本公开的一些实施例,本公开提供的风格图像生成装置中,所述切换显示模块具体用于:
基于所述渲染参数确定渲染图片;
将所述待处理图像切换显示所述渲染图片后显示成所述目标图像。
根据本公开的一些实施例,本公开提供的风格图像生成装置中,所述获取算法模块具体用于:
基于预设选择规则从所述预设的人脸风格化算法中获取所述目标人脸风格化算法。
根据本公开的一些实施例,本公开提供的风格图像生成装置中,所述获取图像模块具体用于:
响应于风格化处理请求,打开显示界面;
在所述显示界面接收输入的原图像,并对所述原图像进行分辨率调整显示;
对显示的图像进行截图处理,得到所述待处理图像。
根据本公开的一些实施例,本公开提供的风格图像生成装置中,所述获取图像模 块具体用于:
响应于风格化处理请求,打开目标摄像头;
基于确认指令,通过所述目标摄像头获取拍摄图片并显示;
对显示的图像进行截图处理,得到所述待处理图像。
根据本公开的一些实施例,本公开提供的风格图像生成装置中,所述风格化处理模块具体用于:
基于所述人脸图像区域确定目标特征区域;
获取与所述目标特征区域对应的风格素材;
基于所述风格素材对所述目标特征区域进行处理,得到人脸风格化图像。
根据本公开的一些实施例,本公开提供的风格图像生成装置中,所述处理模块具体用于:
获取所述人脸风格化图像对应的位置信息和掩膜;
基于所述位置信息和所述掩膜确定所述待处理图像中的目标区域图像;
将所述人脸风格化图像替换所述目标区域图像,得到所述目标图像。
根据本公开的一些实施例,本公开提供了一种电子设备,包括:
处理器;
用于存储所述处理器可执行指令的存储器;
所述处理器,用于从所述存储器中读取所述可执行指令,并执行所述指令以实现如本公开提供的任一所述的风格图像生成方法。
根据本公开的一些实施例,本公开提供了一种计算机可读存储介质,所述存储介质存储有计算机程序,所述计算机程序被处理器执行时如本公开提供的任一所述的风格图像生成方法。
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。
此外,虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。同样地,虽然在上面论述中包含了若干具体实现细节,但是这些不应当被解 释为对本公开的范围的限制。在单独的实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地,在单个实施例的上下文中描述的各种特征也可以单独地或以任何合适的子组合的方式实现在多个实施例中。
尽管已经采用特定于结构特征和/或方法逻辑动作的语言描述了本主题,但是应当理解所附权利要求书中所限定的主题未必局限于上面描述的特定特征或动作。相反,上面所描述的特定特征和动作仅仅是实现权利要求书的示例形式。

Claims (18)

  1. 一种风格图像生成方法,包括:
    获取包括人脸图像区域的待处理图像;
    从预设的人脸风格化算法中获取目标人脸风格化算法,并基于所述目标人脸风格化算法对所述人脸图像区域进行风格化处理,得到人脸风格化图像;
    基于所述人脸风格化图像与所述待处理图像进行处理,得到目标图像;
    将所述待处理图像根据预设的渲染参数切换显示成所述目标图像。
  2. 根据权利要求1所述的风格图像生成方法,其中,所述将所述待处理图像根据预设的渲染参数切换显示成所述目标图像包括:
    基于所述渲染参数对所述目标图像进行灰度化处理,得到灰度图像,并确定所述灰度图像的图像曝光区域以及所述图像曝光区域的曝光速度;
    将所述待处理图像按照所述图像曝光区域的曝光速度切换显示成所述目标图像。
  3. 根据权利要求1所述的风格图像生成方法,其中,所述将所述待处理图像根据预设的渲染参数切换显示成所述目标图像包括:
    基于所述渲染参数确定渲染图片;
    将所述待处理图像切换显示所述渲染图片后显示成所述目标图像。
  4. 根据权利要求1-3任一项所述的风格图像生成方法,其中,所述从预设的人脸风格化算法中获取目标人脸风格化算法包括:
    基于预设选择规则从所述预设的人脸风格化算法中获取所述目标人脸风格化算法。
  5. 根据权利要求1-4任一项所述的风格图像生成方法,其中,所述获取包括人脸图像区域的待处理图像包括:
    响应于风格化处理请求,打开显示界面;
    在所述显示界面接收输入的原图像,并对所述原图像进行分辨率调整显示;
    对显示的图像进行截图处理,得到所述待处理图像。
  6. 根据权利要求1-4任一项所述的风格图像生成方法,其中,所述获取包括人脸图像区域的待处理图像包括:
    响应于风格化处理请求,打开目标摄像头;
    基于确认指令,通过所述目标摄像头获取拍摄图片并显示;
    对显示的图像进行截图处理,得到所述待处理图像。
  7. 根据权利要求1-6任一项所述的风格图像生成方法,其中,所述基于所述目标人脸风格化算法对所述人脸图像区域进行风格化处理,得到人脸风格化图像包括:
    基于所述人脸图像区域确定目标特征区域;
    获取与所述目标特征区域对应的风格素材;
    基于所述风格素材对所述目标特征区域进行处理,得到人脸风格化图像。
  8. 根据权利要求1-7任一项所述的风格图像生成方法,其中,所述将所述人脸风格化图像与所述待处理图像进行处理,得到目标图像包括:
    获取所述人脸风格化图像对应的位置信息和掩膜;
    基于所述位置信息和所述掩膜确定所述待处理图像中的目标区域图像;
    将所述人脸风格化图像替换所述目标区域图像,得到所述目标图像。
  9. 根据权利要求7所述的风格图像生成方法,其中,在所述目标特征区域为多个的情况下,不同的目标特征区域对应不同的风格素材,所述人脸风格化图像为多个。
  10. 一种风格图像生成装置,包括:
    获取图像模块,用于获取包括人脸图像区域的待处理图像;
    获取算法模块,用于从预设的人脸风格化算法中随机获取目标人脸风格化算法;
    风格化处理模块,用于基于所述目标人脸风格化算法对所述人脸图像区域进行风格化处理,得到人脸风格化图像;
    处理模块,用于基于所述人脸风格化图像与所述待处理图像进行处理,得到目标图像;
    切换显示模块,用于将所述待处理图像根据预设的渲染参数切换显示成所述目标图像。
  11. 根据权利要求10所述的风格图像生成装置,其中,
    所述切换显示模块具体用于基于所述渲染参数对所述目标图像进行灰度化处理,得到灰度图像,并确定所述灰度图像的图像曝光区域以及所述图像曝光区域的曝光速度,将所述待处理图像按照所述图像曝光区域的曝光速度切换显示成所述目标图像;或者
    所述切换显示模块具体用于基于所述渲染参数确定渲染图片,将所述待处理图像切换显示所述渲染图片后显示成所述目标图像。
  12. 根据权利要求10或11所述的风格图像生成装置,其中,所述获取算法模块 具体用于基于预设选择规则从所述预设的人脸风格化算法中获取所述目标人脸风格化算法。
  13. 根据权利要求10-12任一项所述的风格图像生成装置,其中,
    所述获取图像模块具体用于响应于风格化处理请求,打开显示界面,在所述显示界面接收输入的原图像,并对所述原图像进行分辨率调整显示,对显示的图像进行截图处理,得到所述待处理图像;或者,
    所述获取图像模块具体用于响应于风格化处理请求,打开目标摄像头,基于确认指令,通过所述目标摄像头获取拍摄图片并显示,对显示的图像进行截图处理,得到所述待处理图像。
  14. 根据权利要求10-13任一项所述的风格图像生成装置,其中,所述风格化处理模块具体用于基于所述人脸图像区域确定目标特征区域,获取与所述目标特征区域对应的风格素材,基于所述风格素材对所述目标特征区域进行处理,得到人脸风格化图像。
  15. 根据权利要求10-14任一项所述的风格图像生成装置,其中,所述处理模块具体用于获取所述人脸风格化图像对应的位置信息和掩膜,基于所述位置信息和所述掩膜确定所述待处理图像中的目标区域图像,将所述人脸风格化图像替换所述目标区域图像,得到所述目标图像。
  16. 一种电子设备,包括:
    处理器;
    用于存储所述处理器可执行指令的存储器;
    所述处理器,用于从所述存储器中读取所述可执行指令,并执行所述指令以实现上述权利要求1-9中任一所述的风格图像生成方法。
  17. 一种计算机可读存储介质,其中,所述存储介质存储有计算机程序,所述计算机程序被处理器执行时实现上述权利要求1-9中任一所述的风格图像生成方法。
  18. 一种计算机程序,包括:指令,所述指令被处理器执行时实现如权利要求1-9中任一项所述的风格图像生成方法。
PCT/CN2023/083653 2022-04-01 2023-03-24 风格图像生成方法、装置、设备及介质 Ceased WO2023185671A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US18/853,342 US20250252629A1 (en) 2022-04-01 2023-03-24 Style image generation method and apparatus, device and medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210347666.9 2022-04-01
CN202210347666.9A CN116934577A (zh) 2022-04-01 2022-04-01 一种风格图像生成方法、装置、设备及介质

Publications (1)

Publication Number Publication Date
WO2023185671A1 true WO2023185671A1 (zh) 2023-10-05

Family

ID=88199416

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/083653 Ceased WO2023185671A1 (zh) 2022-04-01 2023-03-24 风格图像生成方法、装置、设备及介质

Country Status (3)

Country Link
US (1) US20250252629A1 (zh)
CN (1) CN116934577A (zh)
WO (1) WO2023185671A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117036203A (zh) * 2023-10-08 2023-11-10 杭州黑岩网络科技有限公司 一种智能绘图方法及系统
CN117440574A (zh) * 2023-12-18 2024-01-23 深圳市千岩科技有限公司 灯屏设备及灯效生成方法和相应的装置、介质
CN118262077A (zh) * 2024-05-30 2024-06-28 深圳铅笔视界科技有限公司 全景立体风格化画面制作方法、装置、设备及存储介质
CN118522061A (zh) * 2024-07-24 2024-08-20 支付宝(杭州)信息技术有限公司 人脸识别控制方法及其效果监测方法、相关装置和系统

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118014854B (zh) * 2023-11-20 2024-09-27 北京汇畅数宇科技发展有限公司 基于ai模型的人脸风格化处理方法、装置及计算机设备
CN119583736B (zh) * 2024-12-02 2025-11-14 北京字跳网络技术有限公司 特效视频生成方法、装置、电子设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109559274A (zh) * 2018-11-30 2019-04-02 深圳市脸萌科技有限公司 图像处理方法、装置、电子设备及计算机可读存储介质
CN111243049A (zh) * 2020-01-06 2020-06-05 北京字节跳动网络技术有限公司 人脸图像的处理方法、装置、可读介质和电子设备
CN113160039A (zh) * 2021-04-28 2021-07-23 北京达佳互联信息技术有限公司 图像风格迁移方法、装置、电子设备及存储介质
CN113160038A (zh) * 2021-04-28 2021-07-23 北京达佳互联信息技术有限公司 一种图像风格迁移方法、装置、电子设备及存储介质
US20210241498A1 (en) * 2020-06-12 2021-08-05 Beijing Baidu Netcom Science And Technology Co., Ltd. Method and device for processing image, related electronic device and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109559274A (zh) * 2018-11-30 2019-04-02 深圳市脸萌科技有限公司 图像处理方法、装置、电子设备及计算机可读存储介质
CN111243049A (zh) * 2020-01-06 2020-06-05 北京字节跳动网络技术有限公司 人脸图像的处理方法、装置、可读介质和电子设备
US20210241498A1 (en) * 2020-06-12 2021-08-05 Beijing Baidu Netcom Science And Technology Co., Ltd. Method and device for processing image, related electronic device and storage medium
CN113160039A (zh) * 2021-04-28 2021-07-23 北京达佳互联信息技术有限公司 图像风格迁移方法、装置、电子设备及存储介质
CN113160038A (zh) * 2021-04-28 2021-07-23 北京达佳互联信息技术有限公司 一种图像风格迁移方法、装置、电子设备及存储介质

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117036203A (zh) * 2023-10-08 2023-11-10 杭州黑岩网络科技有限公司 一种智能绘图方法及系统
CN117036203B (zh) * 2023-10-08 2024-01-26 杭州黑岩网络科技有限公司 一种智能绘图方法及系统
CN117440574A (zh) * 2023-12-18 2024-01-23 深圳市千岩科技有限公司 灯屏设备及灯效生成方法和相应的装置、介质
CN117440574B (zh) * 2023-12-18 2024-04-02 深圳市千岩科技有限公司 灯屏设备及灯效生成方法和相应的装置、介质
CN118262077A (zh) * 2024-05-30 2024-06-28 深圳铅笔视界科技有限公司 全景立体风格化画面制作方法、装置、设备及存储介质
CN118522061A (zh) * 2024-07-24 2024-08-20 支付宝(杭州)信息技术有限公司 人脸识别控制方法及其效果监测方法、相关装置和系统

Also Published As

Publication number Publication date
CN116934577A (zh) 2023-10-24
US20250252629A1 (en) 2025-08-07

Similar Documents

Publication Publication Date Title
CN110827378B (zh) 虚拟形象的生成方法、装置、终端及存储介质
JP7604669B2 (ja) 特殊効果展示方法、装置、機器および媒体
WO2023185671A1 (zh) 风格图像生成方法、装置、设备及介质
CN110766777B (zh) 虚拟形象的生成方法、装置、电子设备及存储介质
JP7568378B2 (ja) 画像表示方法、装置、機器及び媒体
CN110782515A (zh) 虚拟形象的生成方法、装置、电子设备及存储介质
WO2021218325A1 (zh) 视频处理方法、装置、计算机可读介质和电子设备
CN115022696B (zh) 视频预览方法、装置、可读介质及电子设备
WO2021254502A1 (zh) 目标对象显示方法、装置及电子设备
CN115379105B (zh) 视频拍摄方法、装置、电子设备和存储介质
CN111833461B (zh) 一种图像特效的实现方法、装置、电子设备及存储介质
CN114168250B (zh) 页面显示方法、装置、电子设备和存储介质
US12271415B2 (en) Method, apparatus, device, readable storage medium and product for media content processing
CN114422698B (zh) 视频生成方法、装置、设备及存储介质
WO2024198947A1 (zh) 虚拟场景处理方法、装置、电子设备及存储介质
CN114697568B (zh) 特效视频确定方法、装置、电子设备及存储介质
WO2023140787A2 (zh) 视频的处理方法、装置、电子设备、存储介质和程序产品
WO2025056001A1 (zh) 视频生成方法、装置、电子设备及存储介质
CN111754613A (zh) 图像装饰方法、装置、计算机可读介质和电子设备
CN114429506B (zh) 图像处理方法、装置、设备、存储介质和程序产品
CN117095097A (zh) 一种虚拟形象生成方法、装置、电子设备和存储介质
WO2023088461A1 (zh) 图像处理方法、装置、电子设备及存储介质
WO2022213798A1 (zh) 图像处理方法、装置、电子设备和存储介质
CN113379644A (zh) 基于数据增强的训练样本获取方法、装置和电子设备
CN115623254B (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: 23778040

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 18853342

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 16/01/2025)

WWP Wipo information: published in national office

Ref document number: 18853342

Country of ref document: US

122 Ep: pct application non-entry in european phase

Ref document number: 23778040

Country of ref document: EP

Kind code of ref document: A1