CN113763233A - Image processing method, server and photographing device - Google Patents

Image processing method, server and photographing device Download PDF

Info

Publication number
CN113763233A
CN113763233A CN202110890846.7A CN202110890846A CN113763233A CN 113763233 A CN113763233 A CN 113763233A CN 202110890846 A CN202110890846 A CN 202110890846A CN 113763233 A CN113763233 A CN 113763233A
Authority
CN
China
Prior art keywords
image
stylized
target
processed
target image
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.)
Pending
Application number
CN202110890846.7A
Other languages
Chinese (zh)
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.)
Shenzhen Iwin Visual Technology Co ltd
Original Assignee
Shenzhen Iwin Visual 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 Shenzhen Iwin Visual Technology Co ltd filed Critical Shenzhen Iwin Visual Technology Co ltd
Priority to CN202110890846.7A priority Critical patent/CN113763233A/en
Publication of CN113763233A publication Critical patent/CN113763233A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • G06T3/04
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration by the use of more than one image, e.g. averaging, subtraction
    • G06T5/70
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging

Abstract

The application provides an image processing method, a server and a photographing device, relates to the technical field of image processing, and can effectively avoid the situations that an original image and a stylized image are obvious in split feeling and serious in style and do not overlap in the process of stylizing the image, and improve the stylized image quality of the image. The method comprises the following steps: the server obtains the image to be processed and the image style identification, after the image to be processed is subjected to target image matting processing, a first target image can be obtained, then the first target image is subjected to stylization processing by using the characteristic model corresponding to the image stylization identification to obtain a second target image, and then the second target image and the stylization background image corresponding to the image stylization identification are superposed and fused to obtain a stylized final target image.

Description

Image processing method, server and photographing device
Technical Field
The present application relates to the field of image processing technologies, and in particular, to an image processing method, a server, and a photographing apparatus.
Background
The stylized processing of images is more and more favored by users, and a plurality of image processing software exists in the market, wherein Photoshop has the most users and the strongest specialty. The user can style the image correspondingly through filters (such as watercolors, poster edges, splash and textures) carried by the user in Photoshop. With the appearance of Android and ios systems of mobile phones, mobile phone image processing software is also popular.
However, the existing mobile phone photographing App is limited by the mobile phone computing capability and App closed environment, the processing of the photo is mainly focused on beautifying effects such as whitening, the overall stylized processing of the photo cannot be realized, the stylized effect cannot reach expectation, the situations that the original image and the stylized original image have obvious split feeling, the style is serious and not overlapped obviously, the style is serious and not overlapped can occur, the stylized image quality cannot meet the actual aesthetic requirements of people, and the user experience is low.
Disclosure of Invention
The embodiment of the application provides an image processing method, a server and a shooting device, which can effectively avoid the situations that an original image and a stylized image are obviously split and have serious styles and do not overlap in the stylizing process of the image, and improve the stylized image quality of the image.
In a first aspect, the present application provides an image processing method, applied to a server, including: acquiring an image to be processed and an image stylized identifier sent by a photographing device; based on an image matting method, carrying out self-adaptive segmentation on a target and a background of an image to be processed to obtain a first target image; performing stylization processing on a feature model corresponding to the stylized identification of the first target image input image to obtain a second target image; according to the image stylized identification, taking a stylized background image corresponding to the image stylized identification; and overlapping and fusing the second target image and the stylized background image to obtain a stylized final target image.
In the embodiment of the application, the server obtains the to-be-processed image and the image style identifier, after the to-be-processed image is subjected to target image matting, a first target image can be obtained, a second target image is obtained after the first target image is subjected to stylization by using the feature model corresponding to the image stylization identifier, then the second target image and the stylized background image corresponding to the image stylization identifier are superposed and fused to obtain the stylized final target image, a high-quality stylized image can be obtained, the situations that an original image and the stylized image are obviously split in the stylization process of the image and the style is seriously not overlapped are effectively avoided, and the image quality of the stylized image is improved.
Exemplarily, the stylizing the feature model corresponding to the stylized identifier of the first target image input image to obtain the second target image includes:
acquiring an alpha channel of a first target image;
and performing stylization processing on an image area of which the alpha channel is larger than a preset value in the first target image through the characteristic model to obtain a second target image.
In the embodiment of the application, by obtaining an alpha channel of a first target image and comparing the alpha channel with a preset value, a transparent area and an opaque area in the first target image can be determined, by stylizing an image area of the first target image, in which the alpha channel is greater than the preset value, a first target image, namely the opaque area, in an image to be processed can be stylized, and a background area, namely the transparent area, in the image to be processed is not stylized, so that a second target image with the transparent channel can be obtained to better perform image stylization.
Illustratively, when the target and the background of the image to be processed are adaptively segmented based on the image matting method to obtain a first target image, the method further includes: analyzing and determining image noise in the image to be processed, and removing the determined image noise.
In the embodiment of the application, the interference of the image noise to the stylized image can be effectively reduced by analyzing and determining the image noise in the image to be processed, the fusion effect of the stylized image is further improved, and the high-quality stylized image is obtained.
After the second target image and the stylized background image are overlapped and fused to obtain the stylized final target image, the exemplary method includes: and generating and sending an image link of the final target image.
In the embodiment of the application, after the server obtains the stylized final target image, the server generates the image link of the final target image and sends the image link to the terminal equipment displaying the final target image, such as a smart phone, a photographing and experiential machine and the like, so that a user can browse the stylized final target image on suitable equipment, and user experience is improved.
Illustratively, when the target and the background of the image to be processed are adaptively segmented based on the image matting method to obtain the first target image, the method includes: the image edges of the first target image are extended by predetermined pixels.
In the embodiment of the application, in order to avoid the phenomenon that the cut feeling between the stylized image background and the final target image is obvious due to the fact that the image edge of the first target image is obtained to be too sharp, the image edge of the first target image can be expanded according to the preset pixels, so that the stylized first target image, namely the second target image, can be better fused with the stylized background image, and the stylized image with high image quality is obtained.
In a second aspect, the present application provides another image processing method applied to a photographing apparatus, including:
starting a shooting function to obtain an image to be processed; acquiring an image stylized identifier; and sending the image to be processed and the image stylized identification to a server, wherein the image to be processed and the image stylized identification are used for indicating the server to perform stylized processing on the image to be processed according to the image stylized identification so as to obtain a final target image.
Illustratively, the image processing method further includes:
receiving an image link sent by a server; and displaying the final target image and the image link on a screen terminal of the photographing device according to the image link.
In a third aspect, the present application provides an image processing apparatus comprising:
the image and identification acquisition unit is used for acquiring the to-be-processed image and the image stylized identification sent by the photographing equipment;
the image segmentation unit is used for carrying out self-adaptive segmentation on the target and the background of the image to be processed based on an image matting method to obtain a first target image;
the stylized processing unit is used for stylizing the characteristic model corresponding to the stylized identification of the first target image input image to obtain a second target image;
the stylized background image acquisition unit is used for acquiring a stylized background image corresponding to the image stylized identification according to the image stylized identification;
and the image fusion unit is used for superposing and fusing the second target image and the stylized background image to obtain a stylized final target image.
Specifically, the stylization processing unit includes:
an alpha channel acquiring subunit, configured to acquire an alpha channel of the first target image;
and the stylizing processing subunit is used for performing stylizing processing on an image area of which the alpha channel is larger than a preset value in the first target image through the characteristic model to obtain a second target image.
Specifically, the image segmentation unit is further configured to:
analyzing and determining image noise in the image to be processed, and removing the determined image noise.
Specifically, the image processing apparatus further includes:
and generating and sending an image link of the final target image.
Specifically, the image segmentation unit is further configured to:
the image edges of the first target image are extended by predetermined pixels.
In a fourth aspect, the present application provides another image processing apparatus, applied to a photographing device, including:
the image and identification acquisition unit is used for starting a shooting function to acquire an image to be processed; acquiring an image stylized identifier;
and the image and identifier sending unit is used for sending the image to be processed and the image stylized identifier to a server, and the image to be processed and the image stylized identifier are used for indicating the server to perform stylized processing on the image to be processed according to the image stylized identifier so as to obtain a final target image.
Illustratively, the image processing apparatus further includes:
the image link receiving unit is used for receiving the image link sent by the server;
and the image display unit is used for displaying the final target image and the image link on a screen terminal of the photographing device according to the image link.
In a fifth aspect, the present application provides a server comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, the processor implementing the method as described in the first aspect or any alternative form of the first aspect when executing the computer program.
In a sixth aspect, the present application provides a photographing apparatus comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, the processor implementing the method as described in the second aspect or any alternative manner of the second aspect when executing the computer program.
In a seventh aspect, the present application provides a computer readable storage medium storing a computer program which, when executed by a processor, performs the method as in the first aspect or any of the alternatives of the first aspect.
In an eighth aspect, embodiments of the present application provide a computer program product, which, when run on an image processing apparatus, causes the image processing apparatus to perform the steps of the image processing method of the first or second aspect.
It is to be understood that, the beneficial effects of the second to seventh aspects may be referred to the relevant description of the first aspect, and are not repeated herein.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic flowchart of an image processing method according to an embodiment of the present application;
fig. 2 is a schematic group of images provided by an embodiment of the present application, where (1) in fig. 2 is a schematic image of an image to be processed provided by an embodiment of the present application, and (2) in fig. 2 is a schematic image of a first target image obtained by performing adaptive segmentation on (1) in fig. 2, and (3) in fig. 2 is a schematic image of a second target image obtained by performing stylization on (2) in fig. 2;
FIG. 3 is a schematic flowchart of another image processing method provided in the embodiments of the present application;
FIG. 4 is a schematic image diagram of a final target image obtained by stylizing the image shown in FIG. 2 according to an embodiment of the present disclosure;
FIG. 5 is a schematic flowchart of another image processing method provided in the embodiments of the present application;
fig. 6 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of another image processing apparatus provided in an embodiment of the present application;
fig. 8 is a schematic structural diagram of a server provided in an embodiment of the present application;
fig. 9 is a schematic structural diagram of a photographing apparatus provided in an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It should be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items. Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
It should also be appreciated that reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
In the embodiment of the application, after the photographing device shoots an image, such as a smart phone, a photographing experience machine and the like, the photographing device is limited by the self limitation of the photographing device, such as lower computing capability, closed application environment and the like, the photographing device cannot perform high-quality stylized processing on the image, the photographing device can upload the shot image to the server for stylized processing, and the server returns the stylized image to the photographing device, so that a user can conveniently check the stylized image. The server has high calculation capacity and an open environment, so that the image processing is faster and the image with higher quality can be obtained.
In the embodiment of the application, the photographing device sends the photographed image and the stylized identifier to the server. After the server receives the image to be processed, namely the image shot by the shooting equipment and the image stylized identification, a proper feature model can be selected according to the image to be processed and the image stylized identification for stylized processing, the server sends the image obtained through the stylized processing to a screen of the shooting equipment for displaying, and a user can preview the stylized image conveniently. It should be noted that different image stylized identifiers correspond to different feature models. The server stores trained feature models of different styles, and the feature models can be used for stylizing the images according to the stylized identification of the images, wherein the stylized identification of the images corresponds to the styles of the images.
Referring to fig. 1, fig. 1 is a schematic flow chart of an image processing method according to an embodiment of the present application, which is detailed as follows:
and step S101, the server acquires the to-be-processed image and the image stylized identification sent by the photographing device.
In the embodiment of the application, after the photographing device photographs an image, according to a selected one of the stylized background images displayed on the photographing device by a user, an image style identifier corresponding to the stylized background image selected by the user is obtained, and then the photographed image, namely, the image to be processed and the obtained image style identifier are sent to the server. And the server finishes the stylization processing of the image according to the received image to be processed and the image style identification.
Specifically, a plurality of different style background images are displayed on a screen of the photographing device for a user to select, and when the user selects a certain style background image and performs photographing, the photographing device can acquire an image stylized identifier corresponding to the selected style background image.
In some embodiments of the present application, before sending the image to be processed and the image stylized identifier to the server, the photographing device needs to perform preprocessing on the image to be processed, for example, perform edge cropping on the image to be processed according to a preset size, where the preset size specifically depends on the resolution of the photographed image, and for example, the image to be processed may be cropped to an image with an aspect ratio of 4: 3; or the image to be processed is cropped into an image with the aspect ratio of 1: 1. Therefore, the problems that due to the fact that the length-width ratio of the image to be processed is high, the size of the portrait at the edge is too small, the out-of-focus is fuzzy and the like can be effectively avoided. Or the image to be processed after the stylized processing can be superposed and fused with the stylized background image.
In other embodiments of the present application, after receiving the processed image and the image stylization identifier sent by the photographing device, the server performs preprocessing on the image to be processed, for example, performing edge cropping on the image to be processed according to a preset size.
And S102, the server performs self-adaptive segmentation on the target and the background of the image to be processed based on an image matting method to obtain a first target image.
In the embodiment of the application, the target of the image to be processed specifically refers to a target image such as a character image, a face image and the like which needs to be stylized in the image to be processed; the background of the image to be processed specifically refers to other images except for the target image in the image to be processed, such as other images except for the person image in one image.
In the embodiment of the application, in order to avoid the situations that the visual effect is poor after the background in the image to be processed is stylized, the original image and the stylized image are obviously split, the style is serious and is not overlapped seriously, and the quality of the stylized image is not high, the target and the background of the image to be processed can be subjected to self-adaptive segmentation by an image matting method, a first target image only retaining a character image is obtained, the stylized object is concentrated on the first target image, the fusion effect of the character image and the stylized background image can be ensured, and the image quality of the stylized image is improved.
It should be noted that, after the stylized processing is performed on the first target image, the first target image can be stylized into a stylized image with consistent color, texture, and the like of the stylized background image corresponding to the image stylized identifier, so that the requirement on the precision of image matting in practical application is not high, and the target and the background of the image to be processed can be adaptively segmented by adopting the existing image matting method.
In some embodiments of the application, some uncontrollable factors exist in the image to be processed, for example, passerby appears in the image to be processed, and a human body is shielded by other objects, so that when the target and the background of the image to be processed are subjected to self-adaptive segmentation based on the image matting method, the obtained first target image has a large interference factor, and the stylized image quality is reduced.
When the image matting method is used for adaptively segmenting the target and the background of the image to be processed, the image noise in the image to be processed needs to be analyzed and determined, and after the determined image noise is removed, the image to be processed after the image noise is removed is adaptively segmented, so that the first target image with high reliability and high reliability is obtained.
Specifically, by analyzing the information such as the number, the position, the reliability and the like of the portrait in the image to be processed, the image noise such as an incomplete portrait in the image to be processed, a portrait with an excessively small proportion in the screen and an excessively large position edge is determined.
In some embodiments of the present application, the position information of the portrait in the image to be processed is marked by detecting the portrait in the image to be processed and by a portrait detection algorithm; according to the position information of the marked portrait in the image to be processed, carrying out image segmentation on the image to be processed to obtain a plurality of portrait image areas; calculating the length-width ratio and the area of each portrait area, and removing the portrait areas with the areas smaller than a preset area; and performing pixel point classification and contour detection on other portrait areas in the plurality of portrait areas after the portrait area with the area smaller than the preset area is removed through an image segmentation algorithm to obtain a first target image.
After pixel point classification and contour detection are carried out on other portrait areas in the plurality of portrait areas after the portrait areas with the areas smaller than the preset area are removed, the positions, the sizes and the like in the portrait areas are adjusted, and a first target image is obtained.
In other embodiments of the present application, in order to avoid a phenomenon that a cut feeling between a stylized image background and a final target image is obvious due to over-sharpening of an image edge of a first target image, after the first target image is obtained, an image edge of the first target image may be extended, and an image edge of the first target image, such as a person image, may be extended according to a predetermined pixel, so that a stylized first target image, that is, a second target image, may be better fused with the stylized background image, and a stylized image with a high image quality may be obtained.
And step S103, the server performs stylization processing on the characteristic model corresponding to the stylized identification of the first target image input image to obtain a second target image.
In the embodiment of the application, the server stores the trained feature models of various stylized images, and the feature models of images with different styles have different image stylized identifiers according to the difference of the stylized images, so that after the image stylized identifiers are confirmed, the corresponding feature models can be found according to the image stylized identifiers.
It should be noted that the feature model provided in the embodiment of the present application is a feature model obtained by training an anti-neural network using images of different styles, and the learning target of the feature model is the transformation between the styles of the data domain a and the data domain B, rather than the specific one-to-one mapping relationship between the data a and the data B, that is, the transformation between the image to be processed and the image finally stylized is not the one-to-one transformation of pixel points, but the transformation of the whole image, so that the selection of the images in the training set is not limited, and the size, the proportion, and the like of the images are not limited, and the feature model can be adapted to various types of photographing devices and photographing settings.
The second target image is a stylized image of a person image.
As shown in fig. 2, fig. 2 is a schematic group of images provided by an embodiment of the present application, where (1) in fig. 2 is a schematic image of an image to be processed provided by an embodiment of the present application, fig. 2 (2) is a schematic image of a first target image obtained by performing adaptive segmentation on (1) in fig. 2, and fig. 2 (3) is a schematic image of a second target image obtained by performing stylization on (2) in fig. 2.
In the embodiment of the application, after obtaining the first target image, the server obtains the corresponding feature model according to the image stylization identifier, and then inputs the first target image into the feature model corresponding to the image stylization identifier to perform stylization processing, so as to obtain the second target image shown in (3) in fig. 2.
Referring to fig. 3, fig. 3 is a schematic flow chart of another image processing method according to an embodiment of the present application, which is detailed as follows:
in step S301, an alpha channel of the first target image is acquired.
In the embodiments of the present application, an Alpha Channel (α Channel or Alpha Channel) refers to transparency and translucency of an image. In the process of performing stylization processing on the first target image by using the feature model, an Alpha channel of the first target image is detected, so that the problem that the image quality of the stylized image is reduced due to uncontrollable image noise caused by the stylization processing on the transparent area in the image is avoided.
Step S302, performing stylization processing on an image area with an alpha channel larger than a preset value in the first target image through the feature model to obtain a second target image.
In the embodiment of the present application, after the alpha channel of the first target image is obtained, by performing stylization on an image area of the first target image where the alpha channel is greater than a predetermined value, and not performing stylization on an image area of the first target image where the alpha channel is less than or equal to the predetermined value, a second target image with a transparent channel, which has the same image resolution as the first target image, is obtained as shown in (3) in fig. 2.
And step S104, the server acquires a stylized background image corresponding to the image stylized identification according to the image stylized identification.
In the embodiment of the application, a large number of stylized background images are stored in the stylized background image library of the server, each stylized background image corresponds to a unique image stylized identifier, and according to the image stylized identifier, the corresponding stylized background image can be acquired from the stylized background image library.
In some embodiments of the application, when a stylized background image corresponding to a certain image stylized identifier does not exist in the stylized background gallery, the server sends image request information to the photographing device or the third-party server, where the image request information includes the image stylized identifier, and after the photographing device or the third-party server returns a stylized background image corresponding to the image stylized identifier, the returned stylized background image and the image stylized identifier corresponding to the returned stylized background image are stored in the stylized background gallery in an associated manner, so as to facilitate processing of a subsequent stylized image.
And S105, the server superposes and fuses the second target image and the stylized background image to obtain a stylized final target image.
In the embodiment of the application, the server adds the obtained second target image and the pixel points corresponding to each position in the stylized background image, and determines the stylized final target image according to the pixel points after the pixel points are added.
As shown in fig. 4, fig. 4 is an image schematic diagram of a final target image obtained by stylizing the image shown in fig. 2 according to the embodiment of the present application.
In the embodiment of the application, after the stylized final target image is rapidly obtained by the server, the server generates the image link and/or the two-dimensional code of the final target image, so that the photographing device can display the corresponding final target image on the screen of the photographing device through the image link and/or the two-dimensional code.
After the server generates the image link and/or the two-dimensional code of the final target image, the server sends the generated image link and/or the two-dimensional code to the photographing device, so that the user can preview the final target image on the photographing device.
In the embodiment of the application, the server obtains the to-be-processed image and the image style identifier, after the to-be-processed image is subjected to target image matting, a first target image can be obtained, then the first target image is subjected to stylization by using the feature model corresponding to the image stylization identifier to obtain a second target image, then the second target image and the stylized background image corresponding to the image stylization identifier are superposed and fused to obtain a stylized final target image, the situations that the original image and the stylized image are obviously split and the style is not overlapped seriously in the image stylization process can be effectively avoided, and the image quality of the image stylization is improved.
Referring to fig. 5, fig. 5 is a schematic flow chart of another image processing method according to an embodiment of the present application, which is detailed as follows:
in step S501, the photographing apparatus starts a photographing function to obtain an image to be processed.
In the embodiment of the application, when a user uses the photographing device to photograph, the photographing device starts a photographing function to photograph so as to obtain an image to be processed.
Step S502, the photographing device acquires the stylized identifier of the image.
In the embodiment of the application, after the photographing device photographs the image, the image style identification corresponding to the stylized background image selected by the user is obtained according to the selected one of the stylized background images displayed on the photographing device by the user.
Step S503, the photographing device sends the image to be processed and the image stylized identifier to a server, wherein the image to be processed and the image stylized identifier are used for indicating the server to perform stylized processing on the image to be processed according to the image stylized identifier so as to obtain a final target image.
In the embodiment of the application, a plurality of different style background images are displayed on a screen of the photographing device for a user to select, and when the user selects a certain style background image and photographs the image, the photographing device can acquire the stylized image identifier corresponding to the selected style background image.
In some embodiments of the present application, before sending the image to be processed and the image stylized identifier to the server, the photographing device needs to perform preprocessing on the image to be processed, for example, perform edge cropping on the image to be processed according to a preset size, where the preset size specifically depends on the resolution of the photographed image, and for example, the image to be processed may be cropped to an image with an aspect ratio of 4: 3; or the image to be processed is cropped into an image with the aspect ratio of 1: 1. Therefore, the problems that due to the fact that the length-width ratio of the image to be processed is high, the size of the portrait at the edge is too small, the out-of-focus is fuzzy and the like can be effectively avoided. Or the image to be processed after the stylized processing can be superposed and fused with the stylized background image.
In some embodiments of the present application, the photographing apparatus receives the image link sent by the server; and displaying the final target image and the image link on a screen terminal of the photographing device according to the image link.
It should be noted that the step of stylizing the image by the server may also be performed on the side of the photographing apparatus, with the capability of the photographing apparatus supporting.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Based on the image processing method provided by the above embodiment, the embodiment of the present application further provides an embodiment of an apparatus for implementing the above method embodiment.
Referring to fig. 6, fig. 6 is a schematic diagram of an image processing apparatus according to an embodiment of the present disclosure. The units are included for performing the steps in the corresponding embodiment of fig. 1. Please refer to fig. 1 for the related description of the corresponding embodiment. For convenience of explanation, only the portions related to the present embodiment are shown. Referring to fig. 6, the image processing apparatus 6 includes:
the image and identification acquiring unit 61 is used for acquiring the to-be-processed image and the image stylized identification sent by the photographing device;
the image segmentation unit 62 is configured to perform adaptive segmentation on a target and a background of an image to be processed based on an image matting method to obtain a first target image;
the stylized processing unit 63 is configured to perform stylized processing on the feature model corresponding to the stylized identifier of the first target image input image to obtain a second target image;
the stylized background image obtaining unit 64 is configured to obtain, according to the image stylized identifier, a stylized background image corresponding to the image stylized identifier;
and the image fusion unit 65 is configured to perform superposition fusion on the second target image and the stylized background image to obtain a stylized final target image.
Specifically, the stylization processing unit 63 includes:
an alpha channel acquiring subunit, configured to acquire an alpha channel of the first target image;
and the stylizing processing subunit is used for performing stylizing processing on an image area of which the alpha channel is larger than a preset value in the first target image through the characteristic model to obtain a second target image.
Specifically, the image segmentation unit 62 is further configured to:
analyzing and determining image noise in the image to be processed, and removing the determined image noise.
Specifically, the image processing apparatus further includes:
and generating and sending an image link of the final target image.
Specifically, the image segmentation unit 62 is further configured to:
the image edges of the first target image are extended by predetermined pixels.
Referring to fig. 7, fig. 7 is a schematic diagram of another image processing apparatus according to an embodiment of the present disclosure. The units are included for performing the steps in the corresponding embodiment of fig. 1. Please refer to fig. 5 for a related description of the embodiment. For convenience of explanation, only the portions related to the present embodiment are shown. Referring to fig. 7, the image processing apparatus 7 includes:
a to-be-processed image acquisition unit 71 configured to start a shooting function to acquire a to-be-processed image;
an image stylized identifier acquiring unit 72, configured to acquire an image stylized identifier;
and the image and identifier sending unit 73 is configured to send the image to be processed and the image stylized identifier to the server, where the image to be processed and the image stylized identifier are used to instruct the server to perform stylization processing on the image to be processed according to the image stylized identifier to obtain a final target image.
Illustratively, the image processing apparatus further includes:
the image link receiving unit is used for receiving the image link sent by the server;
and the image display unit is used for displaying the final target image and the image link on the screen terminal of the photographing device according to the image link.
It should be noted that, because the contents of information interaction, execution process, and the like between the modules are based on the same concept as that of the embodiment of the method of the present application, specific functions and technical effects thereof may be specifically referred to a part of the embodiment of the method, and details are not described here.
Fig. 8 is a schematic diagram of a server provided in an embodiment of the present application. As shown in fig. 8, the server 8 of this embodiment includes: a processor 80, a memory 81, and a computer program 82, such as a speech recognition program, stored in the memory 81 and operable on the processor 80. The processor 80, when executing the computer program 82, implements the steps in the above-described embodiments of the image processing method, such as the steps 101-105 shown in fig. 1. Alternatively, the processor 80, when executing the computer program 82, implements the functionality of the various modules/units in the various device embodiments described above, such as the functionality of the units 61-65 shown in FIG. 6.
Illustratively, the computer program 82 may be divided into one or more modules/units, which are stored in the memory 81 and executed by the processor 80 to accomplish the present application. One or more of the modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 82 in the server 8. For example, the computer program 82 may be divided into an image and identifier obtaining unit 61, an image dividing unit 62, a stylized processing unit 63, a stylized background image obtaining unit 64, and an image fusion unit 65, and specific functions of each unit refer to relevant descriptions in the embodiment corresponding to fig. 1, which are not described herein again.
The server may include, but is not limited to, a processor 80, a memory 81. Those skilled in the art will appreciate that fig. 8 is merely an example of a server 8 and does not constitute a limitation of server 8, and may include more or fewer components than shown, or some components in combination, or different components, e.g., the server may also include input-output devices, network access devices, buses, etc.
The Processor 80 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 81 may be an internal storage unit of the server 8, such as a hard disk or a memory of the server 8. The memory 81 may also be an external storage device of the server 8, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the server 8. Further, the memory 81 may also include both an internal storage unit of the server 8 and an external storage device. The memory 81 is used to store computer programs and other programs and data required by the server. The memory 81 may also be used to temporarily store data that has been output or is to be output.
Fig. 9 is a schematic diagram of a photographing apparatus provided in an embodiment of the present application. As shown in fig. 9, the photographing apparatus 9 of this embodiment includes: a processor 90, a memory 91, and a computer program 92, such as a speech recognition program, stored in the memory 91 and operable on the processor 90. The processor 90, when executing the computer program 92, implements the steps in the above-described embodiments of the image processing method, such as the steps 501-503 shown in fig. 5. Alternatively, the processor 90, when executing the computer program 92, implements the functionality of the various modules/units in the various device embodiments described above, such as the functionality of the units 71-73 shown in FIG. 7.
Illustratively, the computer program 92 may be partitioned into one or more modules/units, which are stored in the memory 91 and executed by the processor 90 to accomplish the present application. One or more of the modules/units may be a series of computer program instruction segments capable of performing specific functions that describe the execution of the computer program 92 in the photographing apparatus 9. For example, the computer program 92 may be divided into the to-be-processed image obtaining unit 71, the image stylized identifier obtaining unit 72, and the image and identifier sending unit 73, and specific functions of each unit are described in the embodiment corresponding to fig. 5, which is not described herein again.
The photographing apparatus may include, but is not limited to, a processor 90, a memory 91. Those skilled in the art will appreciate that fig. 9 is merely an example of the photographing apparatus 9 and does not constitute a limitation of the photographing apparatus 9 and may include more or less components than those shown, or combine certain components, or different components, for example, the photographing apparatus may further include an input-output device, a network access device, a bus, etc.
The Processor 90 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 91 may be an internal storage unit of the photographing apparatus 9, such as a hard disk or a memory of the photographing apparatus 9. The memory 91 may also be an external storage device of the photographing apparatus 9, such as a plug-in hard disk provided on the photographing apparatus 9, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like. Further, the memory 91 may also include both an internal storage unit of the photographing apparatus 9 and an external storage apparatus. The memory 91 is used to store computer programs and other programs and data required by the photographing apparatus. The memory 91 may also be used to temporarily store data that has been output or is to be output.
The embodiment of the application also provides a computer readable storage medium, which stores a computer program, and the computer program can realize the image processing method when being executed by a processor.
The embodiment of the application provides a computer program product, and when the computer program product runs on a photographing device, the photographing device can realize the image processing method when executed.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules, so as to perform all or part of the functions described above. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. An image processing method applied to a server, the image processing method comprising:
acquiring an image to be processed and an image stylized identifier sent by a photographing device;
based on an image matting method, carrying out self-adaptive segmentation on the target and the background of the image to be processed to obtain a first target image;
inputting the first target image into a feature model corresponding to the image stylizing identification for stylizing to obtain a second target image;
acquiring a stylized background image corresponding to the image stylized identification according to the image stylized identification;
and overlapping and fusing the second target image and the stylized background image to obtain a stylized final target image.
2. The image processing method of claim 1, wherein the inputting the first target image into the feature model corresponding to the image stylized identifier for stylization to obtain a second target image comprises:
acquiring an alpha channel of the first target image;
and performing stylization processing on an image area with an alpha channel larger than a preset value in the first target image through the characteristic model to obtain a second target image.
3. The image processing method as claimed in claim 1, wherein when the image matting based method adaptively segments the target and the background of the image to be processed to obtain the first target image, the method further comprises:
and analyzing and determining the image noise in the image to be processed, and removing the determined image noise.
4. The image processing method according to claim 1, wherein after the superimposing and fusing the second target image and the stylized background image to obtain a stylized final target image, the method comprises:
and generating an image link of the final target image, and sending the image link to the photographing device.
5. The image processing method according to any one of claims 1 to 4, wherein the adaptively segmenting the target and the background of the image to be processed based on the image matting method to obtain the first target image comprises:
the image edge of the first target image is expanded by predetermined pixels.
6. An image processing method applied to a photographing apparatus, the image processing method comprising:
starting a shooting function to obtain an image to be processed;
acquiring an image stylized identifier;
and sending the image to be processed and the image stylized identification to a server, wherein the image to be processed and the image stylized identification are used for indicating the server to perform stylized processing on the image to be processed according to the image stylized identification so as to obtain a final target image.
7. The image processing method according to claim 6, further comprising:
receiving an image link sent by a server;
and displaying the final target image and the image link on a screen terminal of the photographing device according to the image link.
8. A server, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the image processing method according to any one of claims 1 to 5 when executing the computer program.
9. A photographing apparatus comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the image processing method according to claim 6 or 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out an image processing method according to any one of claims 1 to 5 or 6 to 7.
CN202110890846.7A 2021-08-04 2021-08-04 Image processing method, server and photographing device Pending CN113763233A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110890846.7A CN113763233A (en) 2021-08-04 2021-08-04 Image processing method, server and photographing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110890846.7A CN113763233A (en) 2021-08-04 2021-08-04 Image processing method, server and photographing device

Publications (1)

Publication Number Publication Date
CN113763233A true CN113763233A (en) 2021-12-07

Family

ID=78788520

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110890846.7A Pending CN113763233A (en) 2021-08-04 2021-08-04 Image processing method, server and photographing device

Country Status (1)

Country Link
CN (1) CN113763233A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115272146A (en) * 2022-07-27 2022-11-01 天翼爱音乐文化科技有限公司 Stylized image generation method, system, device and medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110830706A (en) * 2018-08-08 2020-02-21 Oppo广东移动通信有限公司 Image processing method and device, storage medium and electronic equipment
CN110956679A (en) * 2018-09-26 2020-04-03 Oppo广东移动通信有限公司 Image processing method and device, electronic equipment and computer readable storage medium
CN111210487A (en) * 2020-02-28 2020-05-29 深圳壹账通智能科技有限公司 Pattern generation method and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110830706A (en) * 2018-08-08 2020-02-21 Oppo广东移动通信有限公司 Image processing method and device, storage medium and electronic equipment
CN110956679A (en) * 2018-09-26 2020-04-03 Oppo广东移动通信有限公司 Image processing method and device, electronic equipment and computer readable storage medium
CN111210487A (en) * 2020-02-28 2020-05-29 深圳壹账通智能科技有限公司 Pattern generation method and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115272146A (en) * 2022-07-27 2022-11-01 天翼爱音乐文化科技有限公司 Stylized image generation method, system, device and medium

Similar Documents

Publication Publication Date Title
CN103500066B (en) Screenshot device and method suitable for touch screen equipment
CN110300264B (en) Image processing method, image processing device, mobile terminal and storage medium
CN104486552B (en) A kind of method and electronic equipment obtaining image
CN108830892B (en) Face image processing method and device, electronic equipment and computer readable storage medium
JP2019053732A (en) Dynamic generation of image of scene based on removal of unnecessary object existing in the scene
CN111008935B (en) Face image enhancement method, device, system and storage medium
US11113998B2 (en) Generating three-dimensional user experience based on two-dimensional media content
TW202016876A (en) Method, apparatus and electronic device for image processing and storage medium thereof
CN107564085B (en) Image warping processing method and device, computing equipment and computer storage medium
WO2017173578A1 (en) Image enhancement method and device
CN110266926B (en) Image processing method, image processing device, mobile terminal and storage medium
CN109495778B (en) Film editing method, device and system
CN109361850B (en) Image processing method, image processing device, terminal equipment and storage medium
CN113763233A (en) Image processing method, server and photographing device
CN109726613B (en) Method and device for detection
CN110177216B (en) Image processing method, image processing device, mobile terminal and storage medium
CN110874814A (en) Image processing method, image processing device and terminal equipment
CN108805883A (en) A kind of image partition method, image segmentation device and electronic equipment
CN114998115A (en) Image beautification processing method and device and electronic equipment
CN113542847B (en) Image display method, device, equipment and storage medium
CN112887611A (en) Image processing method, device, equipment and storage medium
CN113256484A (en) Method and device for stylizing image
CN113610864A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN112561787A (en) Image processing method, image processing device, electronic equipment and storage medium
CN112036342A (en) Document snapshot method, device and computer storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination