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

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

Info

Publication number
WO2023138549A1
WO2023138549A1 PCT/CN2023/072498 CN2023072498W WO2023138549A1 WO 2023138549 A1 WO2023138549 A1 WO 2023138549A1 CN 2023072498 W CN2023072498 W CN 2023072498W WO 2023138549 A1 WO2023138549 A1 WO 2023138549A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
edge
sample
display
target
Prior art date
Application number
PCT/CN2023/072498
Other languages
English (en)
French (fr)
Inventor
朱渊略
Original Assignee
北京字跳网络技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京字跳网络技术有限公司 filed Critical 北京字跳网络技术有限公司
Publication of WO2023138549A1 publication Critical patent/WO2023138549A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance

Definitions

  • Embodiments of the present disclosure relate to the technical field of image processing, for example, to an image processing method, device, electronic equipment, and storage medium.
  • Embodiments of the present disclosure provide an image processing method, device, electronic equipment, and storage medium to enrich image display effects.
  • an embodiment of the present disclosure provides an image processing method, the method including:
  • an embodiment of the present disclosure further provides an image processing device, which includes:
  • the trigger operation receiving module is configured to receive an edge special effect trigger operation for enabling edge display special effects for target display image input;
  • the edge special effect display module is set to display the edge of the special effect in the target display image with the first
  • the default display method is displayed in the target display area
  • the regular display module is configured to display the area of the target display image except the edge of the special effect display in the target display area in a second preset display manner.
  • an embodiment of the present disclosure further provides an electronic device, which includes:
  • the processor When the program is executed by the processor, the processor is enabled to implement the image processing method provided in any embodiment of the present disclosure.
  • an embodiment of the present disclosure further provides a computer-readable storage medium, where a computer program is stored on the storage medium, and when the computer program is executed by a processor, the image processing method provided in any embodiment of the present disclosure is implemented.
  • FIG. 1 is a schematic flow chart of an image processing method provided in Embodiment 1 of the present disclosure
  • FIG. 2 is a schematic flowchart of an image processing method provided by Embodiment 2 of the present disclosure
  • FIG. 3 is a schematic flowchart of an image processing method provided by Embodiment 3 of the present disclosure.
  • FIG. 4 is a schematic flowchart of an image processing method provided by Embodiment 4 of the present disclosure.
  • Fig. 5 is a schematic flowchart of an image processing method provided by Embodiment 5 of the present disclosure
  • FIG. 6 is a schematic structural diagram of an image processing device provided by Embodiment 6 of the present disclosure.
  • FIG. 7 is a schematic structural diagram of an electronic device provided by Embodiment 1 of the present disclosure.
  • the term “comprise” and its variations are open-ended, ie “including but not limited to”.
  • the term “based on” is “based at least in part on”.
  • the term “one embodiment” means “at least one embodiment”; the term “another embodiment” means “at least one further embodiment”; the term “some embodiments” means “at least some embodiments.” Relevant definitions of other terms will be given in the description below.
  • Embodiment 1 is a schematic flow chart of an image processing method provided by Embodiment 1 of the present disclosure. This embodiment is applicable to the case of an image processing method.
  • the method can be executed by an image processing device, which can be implemented by software and/or hardware, and can be configured in a terminal and/or server to implement the image processing method in the embodiment of the present disclosure.
  • the method of this embodiment may include:
  • the edge effect triggering operation can be understood as being used to trigger the system to perform an operation of enabling the edge display special effect after the operation is executed.
  • the edge special effect trigger operation may be generated through voice information, gesture information, preset time conditions, preset special effect display trigger controls, and the like.
  • the preset special effect display trigger control may be a virtual sign set on the software interface.
  • the triggering of the preset special effect display trigger control can be used to represent the start and perform image display in a preset special effect manner.
  • a special effect display effect may be applied to a special effect display edge in the target display image for image display.
  • receiving an edge special effect trigger operation for enabling an edge display special effect input for a target display image may include at least one of the following operations: receiving voice information containing a target keyword; collecting preset gesture information; receiving a click operation or a press operation input for a preset image display control; detecting that the target display image contains preset image information, and the like.
  • the preset image information may be preset subject information, such as characters, patterns, buildings or flowers and trees.
  • an edge special effect trigger operation may be generated by uploading an image.
  • receiving an edge special effect trigger operation for enabling edge display special effects input for a target display image may include: receiving a control trigger operation for a preset edge special effect trigger control, and displaying an image acquisition interface; wherein the image acquisition interface includes an image acquisition control; acquiring a target display image based on the image acquisition control, and receiving an upload trigger operation for the target display image.
  • the image acquisition interface can be displayed, and then when an image upload operation on the image acquisition interface is detected, the uploaded image can be used as the target display avatar, and the edge display special effect can be enabled for the target display image.
  • the target display image may be understood as an image to be displayed with an edge display special effect.
  • the acquisition method and acquisition timing of the target display image may be set according to actual requirements.
  • the target display image may be acquired first, and then a preset edge special effect display control may be triggered; or the preset edge special effect display control may be triggered first, and then the target display image may be acquired.
  • the acquisition method of the target display image may be to select the target display image from the existing image library and upload it to the image acquisition interface, or to call the shooting device to acquire the target display image based on the image acquisition control.
  • Take displaying edge display effects on the terminal as an example, it can be, click the image acquisition control, turn on the camera, capture the current scene image, and use the captured current scene image as the target display image.
  • the edge display special effect can be understood as a special display effect given by the special effect display edge in the target display image.
  • the aim is to highlight the display edge of the special effect in the target display image, or to display the edge of the special effect display in the target display image in a set manner.
  • the special effect display edge may be understood as an edge that needs to be displayed with a preset edge special effect.
  • the preset edge display special effect may be displaying a special effect display edge in a first preset display manner. It can be understood that the first preset display manner may be set according to actual needs.
  • the first preset display method may include at least one of the following display methods: display in a preset form, wherein the preset form includes at least one of morphological information such as brightness, flicker, color, shape, and thickness; display by superimposing preset elements; perform dynamic display in a preset change method, wherein the preset change method may include At least one of various dynamic display methods such as edge brightness changes, edge color depth changes, and edge pixel points are sequentially superimposed and displayed with special effects.
  • the first preset display method may also be a superimposed display of two or more display methods, for example, display in a preset form and a preset change method.
  • the special effect display edge in the target display image can also be displayed in the target display area in a manner of flickering and changing from dark to bright, or the target edge points at the special effect display edge in the target display image can be dynamically displayed in the target display area in a manner of lighting up in a preset order.
  • This display method can highlight the edge of the special effect display in the target display image, improve the image display effect, and improve user experience.
  • the second preset display manner may be understood as a display manner corresponding to an area of the target display image except for the display edge of the special effect.
  • the second preset presentation manner may be set according to actual needs.
  • the second preset presentation manner may be the presentation manner of the image itself, or may be a preset presentation manner different from the presentation manner of the image itself, which is preset for the region of the target presentation image except for the display edge of the special effect.
  • the second preset presentation manner may be a presentation manner different from the first preset presentation manner.
  • it may be a presentation manner opposite to the first preset presentation manner.
  • the second preset display mode may be that the area in the target display image except for the edge displayed by the special effect changes from bright to dark.
  • the first preset presentation method is to display the edge with a set color
  • the second preset display method may be to display the area of the target display image except for the special effect display edge with a preset color and the like.
  • the main color of the preset color can belong to the same color system as the set color or can belong to a different color system from the set color.
  • first and second in the “first preset display manner” and “second preset display manner” are used to distinguish the display manners corresponding to different display objects.
  • the preset display mode can be set according to image style and/or image type and other information.
  • the user can interact with the user to meet the user's demand for special effect display of the edge in the target display image, and then, in response to the edge special effect trigger operation, the special effect display edge in the target display image is displayed in the target display area in the first preset display mode, and the area other than the special effect display edge in the target display image is displayed in the target display area in the second preset display mode, and the special effect display edge is displayed differently from other image information to highlight the display target Displaying the edge information in the image solves the problem that the image display method is single and the image display cannot highlight the key information, and realizes the effect of increasing the richness and interest of the image display and improving the user's viewing experience.
  • FIG. 2 is a schematic flowchart of an image processing method provided by Embodiment 2 of the present disclosure.
  • This embodiment describes the extraction of special effect display edges of a target display image on the basis of any optional implementation in the embodiments of the present disclosure.
  • the method further includes: inputting the target display image into a pre-trained target edge extraction model to obtain a target edge mask image corresponding to the target display image, wherein the target edge mask image includes the target extraction edge in the target display image; and determining the special effect display edge in the target display image according to the target extraction edge.
  • the method of this embodiment may include:
  • the target edge extraction model can be understood as a model for extracting the target extraction edge in the target presentation image.
  • the target edge extraction model can be obtained by training a pre-established initial edge extraction model according to a sample presentation image and a sample edge mask image corresponding to the sample presentation image, wherein the sample edge mask image includes the expected extraction edge in the sample presentation image.
  • the initial edge extraction model may include a convolutional neural network and other deep learning networks with image segmentation functions.
  • the convolutional neural network may include at least one of models such as a convolutional neural network (Convolutional Neural Networks, CNN), a recurrent neural network (Recurrent Neural Network, RNN), a u2net model, a unet model, a deeplab model, a transformer model, and a pidinet model.
  • the method before inputting the target display image into the pre-trained target edge extraction model, the method further includes: training the pre-established initial edge extraction model according to the sample display image and the sample edge mask image corresponding to the sample display image.
  • the sample display image can be used as an input of the initial edge extraction model to obtain a segmented edge mask image corresponding to the sample display image, and then, model parameters are adjusted according to the segmented edge mask image corresponding to the sample display image and the sample edge mask image corresponding to the sample display image to obtain the target extraction edge.
  • the pre-established initial edge extraction model can also be a generative confrontation network.
  • the generative confrontation network may include a generator and a discriminator.
  • the generator can include a semantic segmentation network.
  • the semantic segmentation network may use the aforementioned convolutional neural network
  • the discriminator may use a multi-scale feature discriminant structure.
  • the target extraction edge is used as the special effect display edge in the target display image, or the target extraction edge is selected according to preset edge selection conditions, and the selected target extraction edge is determined as the special effect display edge in the target display image.
  • the preset edge selection condition can be set according to the actual situation. For example, it may be the continuous length of the target extraction edge, etc.
  • the target edge mask image corresponding to the target display image is obtained through the pre-trained target edge extraction model, and then the special effect display edge in the target display image is determined according to the target extraction edge, and the special effect display edge in the target display image can be extracted simply, conveniently, quickly and intelligently, so that when receiving the edge special effect trigger operation for enabling the edge display special effect input for the target display image, the edge special effect trigger operation can be quickly responded.
  • FIG. 3 is a schematic flowchart of an image processing method provided by Embodiment 3 of the present disclosure.
  • This embodiment describes the method of generating a target edge extraction model based on any optional implementation in the embodiments of the present disclosure, so as to more accurately extract special effect edge information of a target display image.
  • the method before inputting the target display image into the pre-trained target edge extraction model, the method further includes: acquiring a sample display image and a sample edge mask image corresponding to the sample display image, wherein the sample edge mask image includes the expected extraction edge in the sample display image; training an initial edge extraction model according to the sample display image and the sample edge mask image, wherein the initial edge extraction model includes a semantic segmentation network and a discriminator; taking the trained semantic segmentation network as the target edge extraction model.
  • the method before inputting the target display image into the pre-trained target edge extraction model, the method further includes: acquiring a sample display image and a sample edge mask image corresponding to the sample display image, wherein the sample edge mask image includes the expected
  • the method of this embodiment may include:
  • the sample display image may be an original sample image to be subjected to edge extraction.
  • sample The edge mask image may be an image corresponding to the sample display image for representing edge information.
  • the expected edge extraction can be understood as the edge information expected to be obtained after edge extraction via the target edge model.
  • extracting edges includes displaying edges with special effects.
  • the special effect display edge may be a part of the desired edge to be extracted, or may be all extracted desired edges.
  • the initial sample image to be extracted and the sample edge mask image corresponding to the sample presentation image may be obtained from an existing database. It is also possible to acquire the sample display extraction image first, and then perform edge information labeling on the sample display image to obtain a sample edge mask image corresponding to the sample display image.
  • the initial edge extraction model may be a generative adversarial network.
  • the semantic segmentation network can be understood as the generator in the generative confrontation network, and the discriminator forms a confrontation for training.
  • the Generative Adversarial Network uses the semantic segmentation network G (Generator) and the discriminator D (Discriminator) to continuously play games, so as to continuously optimize its own model parameters to obtain the target edge extraction model.
  • the semantic segmentation network continuously optimizes its own model parameters, so that the discriminator can judge the image output by the semantic segmentation network as true, or in other words, so that the discriminator cannot distinguish which images are the images output by the semantic segmentation network; for the discriminator, the discriminator needs to continuously optimize its own model parameters, so that it can accurately distinguish the image output by the semantic segmentation network as false. Thereby continuously improving the model accuracy.
  • training the initial edge extraction model according to the sample display image and the sample edge mask image includes: training the initial edge extraction model according to the sample display image and the sample edge mask image may be: input the sample display image as an input image of the semantic segmentation network into the semantic segmentation network to obtain a segmented edge mask image, and then adjust the model parameters of the semantic segmentation network according to the loss between the segmented edge mask image and the sample edge mask image corresponding to the input image to optimize the semantic segmentation network.
  • training the initial edge extraction model according to the sample display image and the sample edge mask image further includes: training the discriminator according to the image output by the semantic segmentation network, the expected output image corresponding to the image output by the semantic segmentation network, and the expected discrimination result, and optimizing the discriminator.
  • the discriminator in addition to acting as an anomaly detector, can also adjust the model parameters of the semantic segmentation network according to the model discrimination loss of the discriminator, so that the semantic segmentation network can focus on the unlearned parts, thereby improving the edge extraction effect of the semantic segmentation network.
  • model training is determined as the semantic segmentation network training is completed; or, when the number of training iterations reaches the preset number threshold, it is determined that the model training is completed as the semantic segmentation network training is completed, or, when it is detected that the edge extraction effect of the semantic segmentation network reaches the expected goal, the model training is determined as the semantic segmentation network training is completed.
  • the number of training iterations reaching the preset number threshold may be determined by the number of times the sample image is traversed.
  • the edge extraction effect can be determined according to the difference information between the edge mask image actually output by the semantic segmentation network and the sample edge mask image.
  • the adversarial network architecture is adopted, the initial edge extraction model is used as the generator in the adversarial network, the semantic segmentation network and the discriminator are alternately trained, and the semantic segmentation network is reversely adjusted according to the training situation of the discriminator, so that the trained semantic segmentation network has more accurate edge extraction capabilities and ensures the effect of edge special effects display.
  • FIG. 4 is a schematic flowchart of an image processing method provided in Embodiment 4 of the present disclosure.
  • This embodiment describes the training method of the semantic segmentation model on the basis of any optional implementation in the embodiments of the present disclosure, so as to improve the extraction accuracy of the special effect edge information of the target display image.
  • the training of the initial edge extraction model according to the sample display image and the sample edge mask image includes: inputting the sample display image into a semantic segmentation network to obtain a segmented edge mask image; determining a model generation loss based on a generation loss function of the semantic segmentation network, the segmented edge mask image, and the sample edge mask image, wherein the model generation loss includes an image generation loss of a semantic segmentation network and an image discrimination loss of a discriminator for the segmented edge mask image; and adjusting model parameters of the semantic segmentation network according to the model generation loss.
  • the method of this embodiment may include:
  • S430 Input the sample presentation image into a semantic segmentation network to obtain a segmented edge mask image; determine a model generation loss based on a generation loss function of the semantic segmentation network, the segmented edge mask image, and the sample edge mask image, wherein the model generation loss includes an image generation loss of a semantic segmentation network and an image discrimination loss of a discriminator for the segmented edge mask image.
  • the generation loss function of the semantic segmentation network can be understood as a function for judging the loss generated when the semantic segmentation network performs edge extraction.
  • the generation loss function of the semantic segmentation network may include only one type of loss function, or may include two or more types of loss functions.
  • generating a loss function may include a first loss function and a second loss function.
  • determining the model generation loss based on the generation loss function of the semantic segmentation network, the segmentation edge mask image, and the sample edge mask image may include: calculating the loss between the segmentation edge mask image and the sample edge mask image based on the first loss function as the image generation loss of the semantic segmentation network; calculating the image discrimination loss between the output discrimination result corresponding to the segmentation edge mask image output by the discriminator and the expected discrimination result based on the second loss function; determining the model generation of the semantic segmentation network according to the image generation loss and the image discrimination loss loss.
  • the manner of determining the model generation loss of the semantic segmentation network according to the image generation loss and the image discrimination loss may be: summing or weighted summing the image generation loss and the image discrimination loss to obtain the model generation loss of the semantic segmentation network.
  • the first loss function and the second loss function may be the same or different.
  • the first loss function includes a binary cross-entropy loss function
  • the second loss function includes a least squares loss function.
  • the generation loss function of the semantic segmentation network is expressed based on the following formula:
  • x represents the sample display image
  • G(x) represents the segmented edge mask image corresponding to the sample display image output by the semantic segmentation network
  • y represents the sample edge mask image corresponding to the sample display image
  • L G (G(x), y) represents the generation loss function of the semantic segmentation network
  • L bce (G(x), y) represents the binary used to calculate the loss between the segmented edge mask image and the sample edge mask image Classification cross-entropy loss function
  • c[G(x), x] represents the false sample image obtained by splicing the segmentation edge mask image and the sample display image
  • D k (c[G(x), x]) represents the image discrimination result of the false sample image output by the kth layer network of the discriminator
  • n represents the maximum value of k, which is a positive integer greater than 1
  • ⁇ j represents the weight value of the jth pixel
  • m represents the maximum value of j, which is a positive integer greater than 1.
  • the edge pixels in the sample edge mask image can be used as positive samples, and the pixels other than the edge pixels in the sample edge mask image can be used as negative samples.
  • the ratio of the number of pixels in the positive sample to the total number of pixels and the ratio of the number of pixels in the negative sample to the total number of pixels determine the weight corresponding to each pixel to balance.
  • the method before calculating the image discrimination loss between the output discrimination result corresponding to the segmented edge mask image output by the discriminator and the expected discrimination result based on the second loss function, the method further includes: determining a target weight value of the second loss function according to the number of edge pixels corresponding to the expected discrimination result and pixels outside the edge pixel point and the total number of pixels corresponding to the expected discrimination result, and weighting the second loss function based on the target weight value. Furthermore, an image discrimination loss between an output discrimination result output by the discriminator corresponding to the segmented edge mask image and an expected discrimination result may be calculated by weighting.
  • the sample display image before inputting the sample display image into the semantic segmentation network, it may also include preprocessing the sample display image, wherein the preprocessing includes at least one of noise reduction processing, sharpening processing, scaling processing, cropping processing, and interpolation processing.
  • preprocessing includes at least one of noise reduction processing, sharpening processing, scaling processing, cropping processing, and interpolation processing.
  • the purpose of adjusting the model parameters of the semantic segmentation network through the model generation loss is to make the segmentation edge mask image corresponding to the sample display image generated by the semantic segmentation network closer to the sample edge mask image corresponding to the sample display image, so that the discriminator cannot distinguish the difference between the segmentation edge mask image and the sample edge mask image as much as possible.
  • the segmentation edge mask image output by the semantic segmentation network, the generation loss function, and the sample edge mask image are used to determine the image generation loss of the semantic segmentation network and the image discrimination loss of the discriminator for the segmentation edge mask image, not only considering the image generation loss of the semantic segmentation network itself in edge extraction, but also combining the image discrimination loss of the discriminator for the segmentation edge mask image.
  • the confrontation between the semantic segmentation model and the discriminator enables the trained semantic segmentation network to have more accurate edge extraction capabilities, ensuring the effect of edge special effects display.
  • Embodiment 5 is a schematic flow chart of an image processing method provided by Embodiment 5 of the present disclosure.
  • This embodiment describes the training method of the discriminator on the basis of any optional implementation in the embodiments of the present disclosure, so as to better assist in improving the training effect of the semantic segmentation network, thereby improving the edge extraction accuracy.
  • the semantic segmentation network outputting the segmentation edge mask image corresponding to the sample display image, the sample display image and the sample edge mask image to determine a sample training image of the discriminator, wherein the sample training image includes a real sample image and a fake sample image; input the sample training image into the discriminator to obtain the output discrimination result of the discriminator, and determine the model discrimination loss of the discriminator according to the discrimination loss function of the discriminator, the output discrimination result and the expected discrimination result;
  • the model parameters of the discriminator are adjusted.
  • the method of this embodiment may include:
  • S530 Determine a sample training image of a discriminator based on the semantic segmentation network outputting a segmented edge mask image corresponding to the sample presentation image, the sample presentation image, and the sample edge mask image, wherein the sample training image includes a real sample image and a fake sample image.
  • the sample edge mask image and the segmentation mask image can be converted into two-channel or more than two-channel images by means of image stitching.
  • the sample display image and the semantic segmentation network output corresponding to the sample display image Segmenting the edge mask image and splicing to obtain a false sample image of the discriminant model, and splicing the sample display image and the sample edge mask image to obtain a real sample image of the discriminant model.
  • the sample edge mask image can also be spliced with the semantic segmentation network output and the segmented edge mask image corresponding to the sample display image to obtain a fake sample image of the discriminant model, and the sample edge mask image can be spliced with the sample edge mask image to obtain a real sample image of the discriminant model.
  • the discriminant loss function of the discriminator can be understood as a function for judging the loss generated by the discriminator when performing classification and discrimination.
  • the discriminant loss function may include only one type of loss function, or may include two or more types of loss functions.
  • the discrimination loss function includes a third loss function and a fourth loss function. The image discrimination loss of the fake sample image in the sample training image can be calculated by the third loss function, the image discrimination loss of the real sample image in the sample training image can be calculated by the fourth loss function, and then the model discrimination loss of the discriminator is determined based on the image discrimination loss of the fake sample image and the image discrimination loss of the real sample image.
  • the determining the model discrimination loss of the discriminator according to the discriminator loss function, the output discrimination result and the expected discrimination result may include: calculating the output discrimination result corresponding to the fake sample image and the expected discrimination result output by the discriminator according to the third loss function to determine the false sample discrimination loss of the discriminator; calculating the output discrimination result corresponding to the real sample image and the expected discrimination result output by the discriminator according to the fourth loss function to determine the true sample discrimination loss of the discriminator; The sample discriminative loss and the true sample discriminative loss determine the model discriminative loss of the discriminator.
  • the weight of the third loss function and/or the fourth loss function can be determined through the ratio of positive and negative samples to achieve equalization.
  • the method of determining the model discrimination loss of the discriminator according to the fake sample discrimination loss and the real sample discrimination loss may be to sum or weighted the fake sample discrimination loss and the real sample discrimination loss to obtain the model discrimination loss of the discriminator.
  • the third loss function and the fourth loss function may be the same or different.
  • the third loss function includes a binary cross-entropy loss function
  • the fourth loss function includes a least squares loss function.
  • model discrimination loss of the discriminator can be expressed based on the following formula:
  • x represents the sample display image
  • G(x) represents the segmentation edge mask image corresponding to the sample display image output by the semantic segmentation network
  • y represents the sample edge mask image corresponding to the sample display image
  • L D. (G(x), y) represents the discriminant loss function of the discriminator
  • c[G(x), x] represents the fake sample image obtained by splicing the segmented edge mask image and the sample display image
  • d k Represents the image discrimination result corresponding to the false sample image that the k-th layer network of the discriminator expects to output
  • L bce (D k (c[G(x),x]),d k ) represents the binary cross-entropy loss function used to calculate the loss between the segmented edge mask image and the sample edge mask image
  • c[y, x] represents the true sample image obtained by splicing the sample edge mask image and the sample display image
  • D k (c[y,x]) represents the image discrimination result of the real sample
  • the method before determining the model discrimination loss of the discriminator according to the discrimination loss function of the discriminator, the output discrimination result and the expected discrimination result, the method further includes: determining the expected discrimination result corresponding to the sample presentation image that is expected to be output by the discriminator.
  • the expected discrimination result corresponding to the sample presentation image includes: the expected discrimination result corresponding to the segmentation edge mask image corresponding to the sample presentation image, and the expected discrimination result corresponding to the sample edge mask image corresponding to the sample presentation image.
  • determining the expected discrimination result corresponding to the sample display image output by the discriminator may include: performing dilation processing on the sample edge mask image to obtain a first edge mask image; performing binarization processing on the segmented edge mask image to obtain a second edge mask image; performing a multiplication operation on the first edge mask image and the second edge mask image to obtain an expected discrimination result corresponding to the sample display image output by the discriminator.
  • multiplying the first edge mask image after dilation of the sample edge mask image and the second edge mask image after the binarization of the segmented edge mask image can reduce the interference of non-edge points with pixel values other than 0 in the segmented edge mask image to the edge points, so that the obtained desired discrimination results focus on the discrimination of the extracted edge pixel points.
  • a discriminator may be used to perform multi-scale feature discrimination on sample training images.
  • the average pooling x4 algorithm can also be called a 4-layer average pooling method.
  • the expected discrimination result of each model discrimination layer in the discriminator can be determined respectively.
  • the method further includes: performing size conversion processing on the expected discrimination result corresponding to the sample display image, and determining the feature value corresponding to each pixel in each expected discrimination result after size conversion, and obtaining the desired discrimination result corresponding to each model discrimination layer.
  • the feature value can be understood as a discriminant value for judging whether the target area is an edge point.
  • the size of the expected discrimination result corresponding to the sample display image is 512x512. If it is scaled to 16x16, each pixel of the small grid actually represents the result of a 32x32 feature value. It can be understood that, from 512x512 to 16x16, it is equivalent to calculating the average value of every 32x32 pixels in 512x512 to become a pixel value result in 16x16.
  • the ratio of the eigenvalues of the eigenvalues corresponding to the small grid reaches a preset ratio, for example, the error ratio reaches 1/16, 1/32, 1/64 1/128, etc., the eigenvalue corresponding to the pixel of the small grid is determined as a discrimination error.
  • the loss value of the expected discrimination result and the output discrimination result of each model discrimination layer can be calculated according to the discrimination loss function, and then the model discrimination loss of the discriminator can be calculated by summing, or summing and averaging, or weighted summing and averaging.
  • the purpose of adjusting the model parameters of the discriminator through the model discrimination loss is to improve the discriminant accuracy of the discriminator, and to better distinguish between fake sample images and real sample images. Therefore, it forms a confrontation with the semantic segmentation network, so as to promote the segmentation edge mask image corresponding to the sample display image generated by the semantic segmentation network to be closer to the sample edge mask image corresponding to the sample display image.
  • the sample training image of the discriminator is obtained by splicing the sample display image and the segmented edge mask image, and the sample display image and the sample edge mask image. While meeting the requirements of the discriminator for the input image, the sample display image can be distinguished from the output of the discriminator The results are correlated, and then, according to the discriminator’s discriminant loss function, the output discriminant result and the expected discriminant result, the model discriminant loss of the discriminator is determined, and the model parameters of the discriminator are adjusted, so that the discriminator can achieve a better discriminative effect, so as to better fight against the semantic segmentation network, assist in optimizing the semantic segmentation network, and improve the effect of edge extraction.
  • FIG. 6 is a schematic structural diagram of an image processing device provided in Embodiment 6 of the present disclosure.
  • the image processing device provided in this embodiment can be implemented by software and/or hardware, and can be configured in a terminal and/or server to implement the image processing method in the embodiment of the present disclosure.
  • the device may include: a trigger operation receiving module 610 , an edge special effect display module 620 and a regular effect display module 630 .
  • the trigger operation receiving module 610 is configured to receive an edge special effect trigger operation for enabling the edge display special effect input for the target display image;
  • the edge special effect display module 620 is configured to display the special effect display edge in the target display image in the target display area in a first preset display manner;
  • the conventional effect display module 630 is configured to display the area in the target display image except for the special effect display edge in the target display area in a second preset display manner.
  • the user by receiving the edge special effect triggering operation for enabling edge display special effects input for the target display image, the user can interact with the user to meet the needs of the user for displaying special effects on the edges in the target display image, and then, in response to the edge special effect triggering operation, the special effect display edge in the target display image is displayed in the target display area in the first preset display mode, and the area other than the special effect display edge is displayed in the target display area in the second preset display mode, and the special effect display edge is displayed differently from other image information, highlighting the target display image.
  • the edge information solves the problem that the image display method is single and the image display cannot highlight the key information, and realizes the effect of increasing the richness and interest of the image display and improving the user's viewing experience.
  • the edge special effect display module is configured to display the special effect display edge in the target display image in the target display area in a first preset display manner in the following manner:
  • the target edge points at the edge of the special effect display in the target display image are dynamically displayed in the target display area in a manner of lighting up in a preset order.
  • the trigger operation receiving module is configured to receive an edge special effect trigger operation for enabling an edge display special effect for the target display image input in the following manner:
  • the image acquisition interface includes an image acquisition control
  • the image processing device further includes:
  • the target edge mask image output module is configured to input the target display image into a pre-trained target edge extraction model before displaying the special effect display edge in the target display image in the target display area in a first preset display manner, to obtain a target edge mask image corresponding to the target display image, wherein the target edge mask image includes the target extraction edge in the target display image;
  • the special effect display edge determination module is configured to determine the special effect display edge in the target display image according to the target extraction edge.
  • the image processing device further includes:
  • the sample image acquisition module is configured to acquire a sample display image and a sample edge mask image corresponding to the sample display image before the input of the target display image into the pre-trained target edge extraction model, wherein the sample edge mask image includes the expected extraction edge in the sample display image;
  • Generate a model training module configured to train an initial edge extraction model according to the sample display image and the sample edge mask image, wherein the initial edge extraction model includes a semantic segmentation network and a discriminator;
  • the target edge extraction model determination module is configured to use the trained semantic segmentation network as the target edge extraction model.
  • the model training module includes:
  • the segmented edge mask image output unit is configured to input the sample display image into the semantic segmentation network to obtain the segmented edge mask image
  • the model generation loss determination unit is configured to determine the model generation loss based on the generation loss function of the semantic segmentation network, the segmentation edge mask image and the sample edge mask image, wherein the model generation loss includes the image generation loss of the semantic segmentation network and the image discrimination loss of the discriminator for the segmentation edge mask image;
  • the semantic segmentation network adjustment unit is configured to adjust the model parameters of the semantic segmentation network according to the model generation loss.
  • the generation loss function of the semantic segmentation network includes a first loss function and a second loss function
  • the model generation loss determination unit is configured to determine the model generation loss based on the generation loss function of the semantic segmentation network, the segmentation edge mask image, and the sample edge mask image in the following manner:
  • a model generative loss for the semantic segmentation network is determined from the image generative loss and the image discriminative loss.
  • the first loss function includes a binary cross-entropy loss function
  • the second loss function includes a least squares loss function
  • the generation loss function of the semantic segmentation network is expressed based on the following formula:
  • x represents the sample display image
  • G(x) represents the segmentation edge mask image corresponding to the sample display image output by the semantic segmentation network
  • y represents the sample edge mask image corresponding to the sample display image
  • L G (G(x), y) represents the generation loss function of the semantic segmentation network
  • L bce (G(x), y) represents a binary cross-entropy loss function used to calculate the loss between the segmented edge mask image and the sample edge mask image
  • c[G(x), x] represents a false sample image obtained by splicing the segmented edge mask image and the sample display image
  • D k (c[G(x),x]) represents the image discrimination result of the fake sample image output by the k-th layer network of the discriminator
  • n represents the maximum value of k, which is a positive integer greater than 1
  • ⁇ i Indicates the weight value of the i-th pixel.
  • the model generation loss determination unit is set to:
  • the target weight value of the second loss function Before calculating the image discrimination loss between the output discrimination result corresponding to the segmentation edge mask image output by the discriminator and the expected discrimination result based on the second loss function, according to the number of edge pixels corresponding to the expected discrimination result and the number of pixels outside the edge pixel and the total number of pixels corresponding to the expected discrimination result, determine the target weight value of the second loss function, and weight the second loss function based on the target weight value.
  • the model training module further includes:
  • the discriminator sample image generating unit is configured to output a segmentation edge mask image corresponding to the sample display image, the sample display image and the sample edge mask image according to the semantic segmentation network to determine a sample training image of the discriminator, wherein the sample training image includes a real sample image and a false sample image;
  • the model discrimination loss determination unit is configured to input the sample training image into the discriminator, obtain the output discrimination result of the discriminator, and determine the model discrimination loss of the discriminator according to the discrimination loss function of the discriminator, the output discrimination result and the expected discrimination result;
  • the discriminator determination unit is configured to adjust the model parameters of the discriminator according to the model discrimination loss.
  • the discriminator sample image generating unit is configured to determine a sample training image of the discriminator according to the semantic segmentation network outputting the segmented edge mask image corresponding to the sample display image, the sample display image, and the sample edge mask image in the following manner:
  • the discriminant loss function includes a third loss function and a fourth loss function
  • the model discrimination loss determining unit is configured to determine the model discrimination loss of the discriminator according to the discrimination loss function of the discriminator, the output discrimination result and the expected discrimination result in the following manner:
  • a model discriminative loss of the discriminator is determined according to the fake sample discriminative loss and the real sample discriminative loss.
  • the third loss function includes a binary cross-entropy loss function
  • the fourth loss function includes a least squares loss function
  • the model discrimination loss of the discriminator is expressed based on the following formula:
  • x represents the sample display image
  • G(x) represents the output of the semantic segmentation network and the sample ⁇ ,y ⁇ ,L D (G(x),y) ⁇ ,c[G(x),x] ⁇ ,d k ⁇ k ⁇ ,L bce (D k (c[G(x),x]),d k ) ⁇ ,c[y,x] ⁇ ,D k (c[y,x]) ⁇ k ⁇ ,n ⁇ k ⁇ , ⁇ 1 ⁇ , ⁇ j ⁇ j ⁇ ,m ⁇ j ⁇ , ⁇ 1 ⁇
  • the model training module further includes:
  • the sample edge mask graphics expansion unit is configured to perform expansion processing on the sample edge mask image to obtain a first edge mask image before determining the model discrimination loss of the discriminator according to the discrimination loss function of the discriminator, the output discrimination result and the expected discrimination result;
  • the segmented edge mask image binarization unit is configured to perform binarization processing on the segmented edge mask image to obtain a second edge mask image
  • the expected discrimination result generation unit is configured to perform a multiplication operation on the first edge mask image and the second edge mask image to obtain an expected discrimination result corresponding to the sample display image expected to be output by the discriminator.
  • the above image processing device can execute the image processing method provided by any embodiment of the present disclosure, and has corresponding functional modules and beneficial effects for executing the image processing method.
  • FIG. 7 is a schematic structural diagram of an electronic device provided by Embodiment 7 of the present disclosure.
  • the terminal equipment in the embodiments of the present disclosure may include mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, personal digital assistants (Personal Digital Assistant, PDA), tablet computers (Portable Android Device, PAD), portable multimedia players (Portable Media Player, PMP), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and mobile terminals such as digital A fixed terminal of a television (television, TV), a desktop computer, and the like.
  • the electronic device shown in FIG. 7 is just an example.
  • the electronic device 700 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 701, and the electronic device 700 may perform various appropriate actions and processes according to a program stored in a read-only memory (Read-Only Memory, ROM) 702 or a program loaded from a storage device 708 into a random access memory (Random Access Memory, RAM) 703.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • various programs and data necessary for the operation of the electronic device 700 are also stored.
  • the processing device 701, the ROM 702, and the RAM 703 are connected to each other through a bus 705.
  • An input/output (Input/Output, I/O) interface 704 is also connected to the bus 705 .
  • the following devices can be connected to the I/O interface 704: an input device 706 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 707 including, for example, a liquid crystal display (Liquid Crystal Display, LCD), a speaker, a vibrator, etc.; a storage device 708 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 709.
  • the communication means 709 may allow the electronic device 700 to communicate with other devices wirelessly or by wire to exchange data. While FIG. 7 shows electronic device 700 having various means, it should be understood that implementing or having all of the means shown is not a requirement. More or fewer means may alternatively be implemented or provided.
  • embodiments of the present disclosure include a computer program product, the computer program includes a computer program carried on a non-transitory computer readable medium, and the computer program includes program code for executing the method shown in the flowchart.
  • the computer program may be downloaded and installed from a network via communication means 709, or from storage means 708, or from ROM 702.
  • the processing device 701 the above-mentioned functions in the methods of the embodiments of the present disclosure are executed.
  • the electronic device provided by the embodiment of the present disclosure belongs to the same inventive concept as the image processing method provided by the above embodiment.
  • the technical details not described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
  • An embodiment of the present disclosure provides a computer storage medium, on which a computer program is stored, and when the program is executed by a processor, the image processing method provided in the foregoing embodiments is implemented.
  • the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium Or a computer readable storage medium or any combination of the above two.
  • a computer-readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof.
  • the computer-readable storage medium may include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (Compact Disc Read-Only Memory, CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave carrying computer-readable program code therein. Such propagated data signals may take many forms, including electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
  • the program code contained on the computer readable medium can be transmitted by any appropriate medium, including: electric wire, optical cable, radio frequency (Radio Frequency, RF), etc., or any appropriate combination of the above.
  • the client and the server can communicate using any currently known or future-developed network protocols such as HyperText Transfer Protocol (HyperText Transfer Protocol, HTTP), and can be interconnected with any form or medium of digital data communication (for example, a communication network).
  • HTTP HyperText Transfer Protocol
  • Examples of communication networks include local area networks (Local Area Networks, LANs), wide area networks (Wide Area Networks, WANs), internetworks (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device, or may exist independently without being incorporated into the electronic device.
  • the above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device:
  • the computer program code for carrying out the operations of the present disclosure can be written in one or more programming languages or a combination thereof,
  • Such programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as the "C" language 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 computer through any kind of network, including a LAN or WAN, or it can be connected to an external computer (eg via the Internet using an Internet Service Provider).
  • each block in the flowchart or block diagram may represent a module, program segment, or portion of code that includes one or more executable instructions for implementing specified logical functions.
  • the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • the units involved in the embodiments described in the present disclosure may be implemented by software or by hardware. Wherein, the name of the unit does not constitute a limitation of the unit itself under certain circumstances, for example, the first obtaining unit may also be described as "a unit for obtaining at least two Internet Protocol addresses".
  • exemplary types of hardware logic components include: Field Programmable Gate Array (Field Programmable Gate Array, FPGA), Application Specific Integrated Circuit (ASIC), Application Specific Standard Parts (ASSP), System on Chip (SOC), Complex Programmable Logic Device (Complex Programmable Logic Device) , CPLD) and so on.
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device.
  • a machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • a machine-readable medium may comprise an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing.
  • the machine-readable storage medium may include one or more wire-based electrical connections, portable computer discs, hard drives, RAM, ROM, erasable programmable read-only memory (EPROM or flash memory), optical fibers, CD-ROMs, optical storage devices, Magnetic storage devices, or any suitable combination of the foregoing.
  • Example 1 provides an element display method, which includes:
  • Example 2 provides an element display method, the method further includes:
  • displaying the special effect display edge in the target display image in the target display area in a first preset display manner includes:
  • the target edge points at the edge of the special effect display in the target display image are dynamically displayed in the target display area in a manner of lighting up in a preset order.
  • Example 3 provides an element display method, the method further includes:
  • the receiving an edge effect triggering operation for enabling an edge display effect for the target display image input includes:
  • the image acquisition interface includes an image acquisition control
  • Example 4 provides an element display method, the method further includes:
  • the method before displaying the special effect display edge in the target display image in the target display area in a first preset display manner, the method further includes:
  • Example 5 provides an element display method, The method also includes:
  • the method before inputting the target presentation image into the pre-trained target edge extraction model, the method further includes:
  • An initial edge extraction model is trained according to the sample display image and the sample edge mask image, wherein the initial edge extraction model includes a semantic segmentation network and a discriminator;
  • the trained semantic segmentation network is used as the target edge extraction model.
  • Example 6 provides an element display method, the method further includes:
  • the training the initial edge extraction model according to the sample display image and the sample edge mask image includes:
  • the sample display image is input into the semantic segmentation network to obtain a segmented edge mask image
  • model generation loss based on the generation loss function of the semantic segmentation network, the segmented edge mask image, and the sample edge mask image, wherein the model generation loss includes an image generation loss of the semantic segmentation network and an image discrimination loss of the discriminator for the segmented edge mask image;
  • the model parameters of the semantic segmentation network are adjusted according to the model generation loss.
  • Example 7 provides an element display method, the method further includes:
  • the generation loss function of the semantic segmentation network includes a first loss function and a second loss function
  • the generation loss function based on the semantic segmentation network, the segmentation edge mask image and the sample edge mask image determine the model generation loss, including:
  • a model generative loss for the semantic segmentation network is determined from the image generative loss and the image discriminative loss.
  • Example 8 provides an element display method, the method further includes:
  • the first loss function includes a binary cross-entropy loss function
  • the second loss function includes a least squares loss function
  • the generation loss function of the semantic segmentation network is expressed based on the following formula:
  • x represents the sample display image
  • G(x) represents the segmentation edge mask image corresponding to the sample display image output by the semantic segmentation network
  • y represents the sample edge mask image corresponding to the sample display image
  • L G (G(x), y) represents the generation loss function of the semantic segmentation network
  • L bce (G(x), y) represents a binary cross-entropy loss function used to calculate the loss between the segmented edge mask image and the sample edge mask image
  • c[G(x), x] represents a false sample image obtained by splicing the segmented edge mask image and the sample display image
  • D k (c[G(x),x]) represents the image discrimination result of the fake sample image output by the k-th layer network of the discriminator
  • n represents the maximum value of k, which is a positive integer greater than 1
  • ⁇ i Indicates the weight value of the i-th pixel.
  • Example 9 provides an element display method, the method further includes:
  • the method before calculating the image discrimination loss between the output discrimination result corresponding to the segmentation edge mask image output by the discriminator and the expected discrimination result based on the second loss function, the method further includes:
  • Example 10 provides an element display method, the method further includes:
  • the training the initial edge extraction model according to the sample display image and the sample edge mask image includes:
  • the model parameters of the discriminator are adjusted according to the model discrimination loss.
  • Example 11 provides an element display method, The method also includes:
  • the outputting the segmentation edge mask image corresponding to the sample display image, the sample display image and the sample edge mask image according to the semantic segmentation network to determine the sample training image of the discriminator includes:
  • Example 12 provides an element display method, the method further includes:
  • the discriminant loss function includes a third loss function and a fourth loss function
  • the determining the model discrimination loss of the discriminator according to the discrimination loss function of the discriminator, the output discrimination result and the expected discrimination result includes:
  • a model discriminative loss of the discriminator is determined according to the fake sample discriminative loss and the real sample discriminative loss.
  • Example 13 provides an element display method, the method further includes:
  • the third loss function includes a binary cross-entropy loss function
  • the fourth loss function includes a least squares loss function
  • the model discrimination loss of the discriminator is expressed based on the following formula:
  • n represents the maximum value of k, which is a positive integer greater than 1
  • ⁇ j represents the weight value of the jth pixel point, which represents the maximum value of j, which is a positive integer greater than 1.
  • Example Fourteen provides an element display method, the method further includes:
  • the method before determining the model discrimination loss of the discriminator according to the discrimination loss function of the discriminator, the output discrimination result and the expected discrimination result, the method further includes:
  • the first edge mask image is multiplied by the second edge mask image to obtain an expected discrimination result that is expected to be output by the discriminator and corresponds to the sample display image.
  • Example 15 provides an element display device, which includes:
  • the trigger operation receiving module is configured to receive an edge special effect trigger operation for enabling edge display special effects for target display image input;
  • the edge special effect display module is configured to display the special effect display edge in the target display image in the target display area in a first preset display manner
  • the regular effect display module is configured to display the area of the target display image except the edge of the special effect display in the target display area in a second preset display manner.

Abstract

本公开实施例公开了一种图像处理方法、装置、电子设备及存储介质,其中,该方法包括:接收针对目标展示图像输入的用于启用边缘展示特效的边缘特效触发操作;将所述目标展示图像中的特效展示边缘以第一预设展示方式展示于目标展示区域中;将所述目标展示图像中除所述特效展示边缘之外的区域以第二预设展示方式展示于所述目标展示区域中。

Description

图像处理方法、装置、电子设备及存储介质
本公开要求在2022年01月20日提交中国专利局、申请号为202210068603.X的中国专利申请的优先权,该申请的全部内容通过引用结合在本公开中。
技术领域
本公开实施例涉及图像处理技术领域,例如涉及一种图像处理方法、装置、电子设备及存储介质。
背景技术
随着信息多样化以及拍摄设备的发展,通过拍摄设备拍摄图像并分享图像,已成为目前较受欢迎的一种信息展示方式。例如,通过将图像制作为短视频,以短视频的方式展示图像信息。
相关图像展示技术在展示图像时,往往会对图像进行静态展示,这种图像展示方式较为单一,缺乏趣味性,而且,尤其当图像中包含多个主体时,所展示信息没有重点突出,导致观感较差,从而影响用户体验。
发明内容
本公开实施例提供了一种图像处理方法、装置、电子设备及存储介质,以丰富图像展示效果。
第一方面,本公开实施例提供了一种图像处理方法,该方法包括:
接收针对目标展示图像输入的用于启用边缘展示特效的边缘特效触发操作;
将所述目标展示图像中的特效展示边缘以第一预设展示方式展示于目标展示区域中;
将所述目标展示图像中除所述特效展示边缘之外的区域以第二预设展示方式展示于所述目标展示区域中。
第二方面,本公开实施例还提供了图像处理装置,该装置包括:
触发操作接收模块,设置为接收针对目标展示图像输入的用于启用边缘展示特效的边缘特效触发操作;
边缘特效展示模块,设置为将所述目标展示图像中的特效展示边缘以第一 预设展示方式展示于目标展示区域中;
常规展示模块,设置为将所述目标展示图像中除所述特效展示边缘之外的区域以第二预设展示方式展示于所述目标展示区域中。
第三方面,本公开实施例还提供了一种电子设备,该电子设备包括:
处理器;
存储装置,用于存储程序,
当所述程序被所述处理器执行,使得所述处理器实现本公开任意实施例所提供图像处理方法。
第四方面,本公开实施例还提供了一种计算机可读存储介质,所述存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现本公开任意实施例所提供图像处理方法。
附图说明
下面对描述实施例中所需要用到的附图做一简单介绍。显然,所介绍的附图只是本实用新型所要描述的一部分实施例的附图,而不是全部的附图,对于本领域普通技术人员,在不付出创造性劳动的前提下,还可以根据这些附图得到其他的附图。
图1为本公开实施例一所提供的一种图像处理方法的流程示意图;
图2是为本公开实施例二所提供的一图像处理方法的流程示意图;
图3是为本公开实施例三所提供的一种图像处理方法的流程示意图;
图4是为本公开实施例四所提供的一图像处理方法的流程示意图;
图5是为本公开实施例五所提供的一种图像处理方法的流程示意图
图6是为本公开实施例六所提供的一种图像处理装置的结构示意图;
图7是为本公开实施例一所提供的一种电子设备的结构示意图。
具体实施方式
下面将参照附图描述本公开的实施例。虽然附图中显示了本公开的某些实施例,然而应当理解的是,本公开可以通过多种形式来实现,提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用。
应当理解,本公开的方法实施方式中记载的各个步骤可以按照不同的顺序执行,和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。
本文使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。术语“基于”是“至少部分地基于”。术语“一个实施例”表示“至少一个实施例”;术语“另一实施例”表示“至少一个另外的实施例”;术语“一些实施例”表示“至少一些实施例”。其他术语的相关定义将在下文描述中给出。
需要注意,本公开中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分。需要注意,本公开中提及的“一个”、“多个”的修饰是示意性,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。
本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的。
实施例一
图1为本公开实施例一所提供的一种图像处理方法的流程示意图,本实施例可适用于图像处理方法情况,该方法可以由图像处理装置来执行,该装置可以通过软件和/或硬件来实现,可配置于终端和/或服务器中来实现本公开实施例中的图像处理方法。
如图1所示,本实施例的方法可包括:
S110、接收针对目标展示图像输入的用于启用边缘展示特效的边缘特效触发操作。
本实施例中,边缘特效触发操作可以理解为用于执行该操作后可以触发系统执行启用边缘展示特效的操作。边缘特效触发操作的生成方式有多种,例如可以是,通过语音信息、手势信息、预设时间条件以及预设特效展示触发控件等生成。其中,预设特效展示触发控件可以是设置于软件界面上的虚拟标识。预设特效展示触发控件的触发可以用于表征开始并以预设特效方式进行图像展示。在本公开实施例中,可以针对目标展示图像中的特效展示边缘施加特效展示效果进行图像展示。
示例性地,接收针对目标展示图像输入的用于启用边缘展示特效的边缘特效触发操作可包括下述操作中的至少一种:接收到包含有目标关键词的语音信息;采集到预设手势信息;接收到针对预设图像展示控件输入的点击操作或按压操作;检测到目标展示图像中包含预设图像信息等。其中,预设图像信息可以是预设主体信息,如,文字、图案、建筑物或花草树木等。
作为本公开实施例的一种可选方案,可以通过上传图像来生成边缘特效触发操作。示例性地,接收针对目标展示图像输入的用于启用边缘展示特效的边缘特效触发操作,可包括:接收针对预先设置的边缘特效触发控件的控件触发操作,展示图像获取界面;其中,所述图像获取界面包括图像获取控件;基于所述图像获取控件获取目标展示图像,并接收针对所述目标展示图像的上传触发操作。换言之,可在触发预先设置的边缘特效触发控件后,展示图像获取界面,进而检测到在图像获取界面的图像上传操作时,将上传的图像作为目标展示头像,针对目标展示图像启用边缘展示特效。
本实施例中,目标展示图像可以理解为待采用边缘展示特效进行展示的图像。需要说明的是,目标展示图像的获取方式和获取时机可以根据实际需求进行设置。示例性地,可以先获取目标展示图像,然后触发预设的边缘特效展示控件;也可以先触发预设的边缘特效展示控件,再获取目标展示图像。目标展示图像的获取方式可以是从现有的图像库中选取目标展示图像上传至图像获取界面,也可以是,基于图像获取控件调用拍摄装置采集目标展示图像。以在终端上展示边缘展示特效为例,可以是,点击图像获取控件,打开摄像头,拍摄当前场景图像,将拍摄到的当前场景图像作为目标展示图像。
在本公开实施例中,边缘展示特效可以理解为针对目标展示图像中的特效展示边缘所赋予的特殊展示效果。旨在将目标展示图像中的特效展示边缘进行突出展示,或者,将目标展示图像中的特效展示边缘进行设定方式的展示。
S120、将所述目标展示图像中的特效展示边缘以第一预设展示方式展示于目标展示区域中。
本实施例中,特效展示边缘可以理解为需要以预设边缘特效进行展示的边缘。在本公开实施例中,预设边缘展示特效可以是以第一预设展示方式展示特效展示边缘。可以理解的是,第一预设展示方式可以根据实际需求进行设定。示例性地,第一预设展示方式可以包括下述展示方式中的至少一种:以预设形态进行展示,其中,预设形态包括亮度、闪烁、颜色、形状及粗细等中形态信息的至少一种;叠加预设元素进行展示;以预设变化方式进行动态展示,其中,预设变化方式可以包括边缘亮度的高低变化、边缘颜色深浅变化以及边缘像素点依序叠加特效展示等各种动态展示方式中的至少一种。
需要说明的是,第一预设展示方式还可以是两种或两种以上的展示方式叠加展示,例如,以预设形态以及预设变化方式进行展示。示例性地,还可以将所述目标展示图像中的特效展示边缘以闪烁且由暗变亮的方式展示于目标展示区域中,或者,将所述目标展示图像中的特效展示边缘处的目标边缘点,以按照预设顺序进行点亮的方式,动态展示于目标展示区域中。采用本方案,能够 从视觉效果上体验到边缘逐渐被点亮,或者,边缘有流光的效果。这种展示方式能够突出目标展示图像中的特效展示边缘,提升图像展示效果,提升用户体验。
S130、将所述目标展示图像中除所述特效展示边缘之外的区域以第二预设展示方式展示于所述目标展示区域中。
本实施例中,第二预设展示方式可以理解为与目标展示图像中除特效展示边缘之外的区域对应的展示方式。在本开实施例中,第二预设展示方式可以根据实际需求进行设定。可选地,第二预设展示方式可以是图像本身的展示方式,也可以是针对目标展示图像中除特效展示边缘之外的区域预先设定的区别于图像本身展示方式的展示方式。
示例性地,第二预设展示方式可以是与第一预设展示方式不同的展示方式。例如,可以是与第一预设展示方式相反的展示方式。可选地,当第一预设展示方式为边缘由暗变亮时,第二预设展示方式可以是目标展示图像中除特效展示边缘之外的区域由亮变暗。当第一预设展示方式为边缘以设定颜色进行展示时,第二预设展示方式可以是目标展示图像中除特效展示边缘之外的区域以预设色调进行展示等。预设色调的主色调可以与设定颜色属于同色系也可以与设定颜色属于不同于色系。
需要说明的是,“第一预设展示方式”和“第二预设展示方式”中的“第一”和“第二”用于区分不同的展示对象所对应的展示方式。预设展示方式可以根据图像风格和/或图像类型等信息进行设置。
本实施例通过接收针对目标展示图像输入的用于启用边缘展示特效的边缘特效触发操作,能够通过与用户交互的方式,满足用户对目标展示图像中的边缘进行特效展示的需求,进而,响应于边缘特效触发操作,将目标展示图像中的特效展示边缘以第一预设展示方式展示于目标展示区域中,并将所述目标展示图像中除特效展示边缘之外的区域以第二预设展示方式展示于目标展示区域中,将特效展示边缘区别于其他图像信息进行展示,突出展示目标展示图像中的边缘信息,解决了图像展示方式单一以及图像展示无法突出重点信息的问题,实现增加了图像展示的丰富性和趣味性,提升用户观感体验的效果。
实施例二
图2为本公开实施例二所提供的一种图像处理方法的流程示意图,本实施例在本公开实施例中任一可选实施方式的基础上,对目标展示图像的特效展示边缘的提取进行了描述。可选地,在所述将所述目标展示图像中的特效展示边 缘以第一预设展示方式展示于目标展示区域中之前,所述方法还包括:将所述目标展示图像输入至预先训练完成的目标边缘提取模型中,得到与所述目标展示图像对应的目标边缘掩膜图像,其中,所述目标边缘掩膜图像中包括所述目标展示图像中的目标提取边缘;根据所述目标提取边缘确定所述目标展示图像中的特效展示边缘。具体实施方式可以参见本实施例的说明。其中,与前述实施例相同或相似的技术特征在此不再赘述。
如图2所示,本实施例的方法可包括:
S210、接收针对目标展示图像输入的用于启用边缘展示特效的边缘特效触发操作。
S220、将所述目标展示图像输入至预先训练完成的目标边缘提取模型中,得到与所述目标展示图像对应的目标边缘掩膜图像,其中,所述目标边缘掩膜图像中包括所述目标展示图像中的目标提取边缘。
本实施例中,目标边缘提取模型可以理解为用于提取目标展示图像中的目标提取边缘的模型。可选地,目标边缘提取模型可以根据样本展示图像以及与所述样本展示图像对应的样本边缘掩膜图像对预先建立的初始边缘提取模型训练得到,其中,所述样本边缘掩膜图像中包括所述样本展示图像中的期望提取边缘。
示例性地,初始边缘提取模型可以包括卷积神经网络及其他具有图像分割功能的深度学习网络。其中,卷积神经网络可以包括卷积神经网络(Convolutional Neural Networks,CNN)、循环神经网络(Recurrent Neural Network,RNN)、u2net模型、unet模型、deeplab模型、transformer模型以及pidinet模型等模型中的至少一种。
可以理解的是,在将所述目标展示图像输入至预先训练完成的目标边缘提取模型中之前,所述方法还包括;根据样本展示图像以及与所述样本展示图像对应的样本边缘掩膜图像对预先建立的初始边缘提取模型训练。可选地,可以将所述样本展示图像作为初始边缘提取模型的输入,得到与样本展示图像对应的分割边缘掩膜图像,进而,根据与样本展示图像对应的分割边缘掩膜图像以及与所述样本展示图像对应的样本边缘掩膜图像对模型参数进行调整,以得到目标提取边缘。
可选地,预先建立的初始边缘提取模型还可以是生成对抗网络。所述生成对抗网络可以包括生成器和判别器。其中,生成器可以包括语义分割网络。示例性地,所述语义分割网络可以采用前述的卷积神经网络,所述判别器可以采用多尺度特征判别结构。
S230、根据所述目标提取边缘确定所述目标展示图像中的特效展示边缘。
可选地,将所述目标提取边缘作为所述目标展示图像中的特效展示边缘,或者,根据预设的边缘选取条件对所述目标提取边缘进行选取,将选中的目标提取边缘确定为所述目标展示图像中的特效展示边缘。其中,预设的边缘选取条件可以根据实际情况进行设置。例如,可以是目标提取边缘的连续长度等。
S240、将所述目标展示图像中的特效展示边缘以第一预设展示方式展示于目标展示区域中。
S250、将所述目标展示图像中除所述特效展示边缘之外的区域以第二预设展示方式展示于所述目标展示区域中。
本实施例通过预先训练完成的目标边缘提取模型得到与目标展示图像对应的目标边缘掩膜图像,进而,根据所述目标提取边缘确定所述目标展示图像中的特效展示边缘,能够简单、便捷、快速且智能地提取出目标展示图像中的特效展示边缘,从而能够在接收到针对目标展示图像输入的用于启用边缘展示特效的边缘特效触发操作时,快速响应该边缘特效触发操作。
实施例三
图3为本公开实施例三所提供的一种图像处理方法的流程示意图,本实施例在本公开实施例中任一可选实施方式的基础上,对生成目标边缘提取模型的方式进行了描述,以更为精准地提取出目标展示图像的特效边缘信息。可选地,在所述将所述目标展示图像输入至预先训练完成的目标边缘提取模型中之前,所述方法还包括:获取样本展示图像以及与所述样本展示图像对应的样本边缘掩膜图像,其中,所述样本边缘掩膜图像中包括所述样本展示图像中的期望提取边缘;根据所述样本展示图像以及所述样本边缘掩膜图像对初始边缘提取模型进行训练,其中,初始边缘提取模型包括语义分割网络和判别器;将训练完成的语义分割网络作为目标边缘提取模型。具体实施方式可以参见本实施例的说明。其中,与前述实施例相同或相似的技术特征在此不再赘述。
如图3所示,本实施例的方法可包括:
S310、接收针对目标展示图像输入的用于启用边缘展示特效的边缘特效触发操作。
S320、获取样本展示图像以及与所述样本展示图像对应的样本边缘掩膜图像,其中,所述样本边缘掩膜图像中包括所述样本展示图像中的期望提取边缘。
本实施例中,样本展示图像可以是待进行边缘提取的原始样本图像。样本 边缘掩膜图像可以是与样本展示图像相对应的用于表征边缘信息的图像。期望提取边缘可以理解为期望经由目标边缘模型进行边缘提取后得到的边缘信息。
需要说明的是,期望提取边缘包括特效展示边缘。特效展示边缘可以是期望提取边缘的部分边缘,也可以是提取到的全部期望提取边缘。
示例性地,可以从现有数据库中获取样本初始待提取图像以及与样本展示图像对应的样本边缘掩膜图像。也可以先获取样本展示提取图像,进而,对样本展示图像进行边缘信息标注,得到与样本展示图像相对应的样本边缘掩膜图像。
S330、根据所述样本展示图像以及所述样本边缘掩膜图像对初始边缘提取模型进行训练,其中,初始边缘提取模型包括语义分割网络和判别器。
在本公开实施例中,初始边缘提取模型可以是生成对抗网络。语义分割网络可以理解为生成对抗网络中的生成器,和判别器形成对抗,进行训练。可选地,生成对抗网络是通过语义分割网络G(Generator)和判别器D(Discriminator)不断博弈,从而不断优化自身模型参数,以得到目标边缘提取模型。
在模型训练的过程中,对于语义分割网络而言,语义分割网络不断优化自身模型参数,以使判别器将语义分割网络输出的图像判别为真,或者说,以使判别器判别不出那些图像是语义分割网络输出的图像;对于判别器而言,判别器需要不断优化自身的模型参数,以能够准确地将语义分割网络输出的图像判别为假。从而不断提高模型精度。
在本公开实施例中,可选地,根据所述样本展示图像以及所述样本边缘掩膜图像对初始边缘提取模型进行训练,包括:根据所述样本展示图像以及所述样本边缘掩膜图像对初始边缘提取模型进行训练的方式可以是,将样本展示图像作为语义分割网络的输入图像,输入至语义分割网络中,得到分割边缘掩膜图像,进而,根据分割边缘掩膜图像与该输入图像对应的样本边缘掩膜图像之间的损失对语义分割网络进行模型参数调整,优化语义分割网络。
在此基础上,可选地,根据所述样本展示图像以及所述样本边缘掩膜图像对初始边缘提取模型进行训练,还包括:根据语义分割网络输出的图像、与语义分割网络输出的图像对应的期望输出图像以及期望判别结果对判别器进行训练,优化判别器。
可选地,在本公开实施例中,判别器除了充当了一个异常检测器的功能之外,还可以根据判别器的模型判别损失对语义分割网络的模型参数进行调整,让语义分割网络关注于未学好部分,从而提升语义分割网络的边缘提取效果。
S340、将训练完成的语义分割网络作为目标边缘提取模型。
在本公开实施例中,确定模型训练完成的方式有多种。可选地,当语义分割网络的生成损失函数收敛时,确定模型训练完成的方式为语义分割网络训练完成;或者,当训练迭代次数达到预设次数阈值时,确定模型训练完成的方式为语义分割网络训练完成,又或者,将检测出所述语义分割网络的边缘提取效果达到预期目标时,确定模型训练完成的方式为语义分割网络训练完成。
本实施例中,训练迭代次数达到预设次数阈值可以通过样本图像被遍历的次数确定。边缘提取效果可以根据语义分割网络实际输出的边缘掩膜图像与样本边缘掩膜图像之间的差异信息确定。
S350、将所述目标展示图像输入至预先训练完成的目标边缘提取模型中,得到与所述目标展示图像对应的目标边缘掩膜图像,其中,所述目标边缘掩膜图像中包括所述目标展示图像中的目标提取边缘。
S360、根据所述目标提取边缘确定所述目标展示图像中的特效展示边缘。
S370、将所述目标展示图像中的特效展示边缘以第一预设展示方式展示于目标展示区域中。
S380、将所述目标展示图像中除所述特效展示边缘之外的区域以第二预设展示方式展示于所述目标展示区域中。
本实施例通过采用对抗网络架构,将初始边缘提取模型作为对抗网络中的生成器,交替训练语义分割网络和判别器,并通过判别器的训练情况反调整语义分割网络,使得训练完成的语义分割网络具有更为精准地边缘提取能力,保证边缘特效展示的效果。
实施例四
图4为本公开实施例四所提供的一种图像处理方法的流程示意图,本实施例在本公开实施例中任一可选实施方式的基础上,对语义分割模型的训练方式进行了描述,以提高目标展示图像的特效边缘信息的提取精度。可选地,所述根据所述样本展示图像以及所述样本边缘掩膜图像对初始边缘提取模型进行训练,包括:将所述样本展示图像输入至语义分割网络中,得到分割边缘掩膜图像;基于所述语义分割网络的生成损失函数、所述分割边缘掩膜图像以及所述样本边缘掩膜图像确定模型生成损失,其中,所述模型生成损失包括语义分割网络的图像生成损失以及判别器对所述分割边缘掩膜图像的图像判别损失;根据所述模型生成损失对所述语义分割网络的模型参数进行调整。具体实施方式可以参见本实施例的说明。其中,与前述实施例相同或相似的技术特征在此不再赘述。
如图4所示,本实施例的方法可包括:
S410、接收针对目标展示图像输入的用于启用边缘展示特效的边缘特效触发操作。
S420、获取样本展示图像以及与所述样本展示图像对应的样本边缘掩膜图像,其中,所述样本边缘掩膜图像中包括所述样本展示图像中的期望提取边缘。
S430、将所述样本展示图像输入至语义分割网络中,得到分割边缘掩膜图像;基于所述语义分割网络的生成损失函数、所述分割边缘掩膜图像以及所述样本边缘掩膜图像确定模型生成损失,其中,所述模型生成损失包括语义分割网络的图像生成损失以及判别器对所述分割边缘掩膜图像的图像判别损失。
本实施例中,语义分割网络的生成损失函数可以理解为用于判断语义分割网络的进行边缘提取时所产生的损失的函数。在本公开实施例中,所述语义分割网络的生成损失函数可以仅包含一种损失函数,也可以是包含两种或两种以上的损失函数。示例性地,生成损失函数可包括第一损失函数和第二损失函数。
可选地,所述基于所述语义分割网络的生成损失函数、所述分割边缘掩膜图像以及所述样本边缘掩膜图像确定模型生成损失,可以包括:基于第一损失函数计算所述分割边缘掩膜图像以及所述样本边缘掩膜图像之间的损失,作为语义分割网络的图像生成损失;基于第二损失函数计算所述判别器输出的与所述分割边缘掩膜图像对应的输出判别结果与期望判别结果之间的图像判别损失;根据所述图像生成损失和所述图像判别损失确定所述语义分割网络的模型生成损失。
示例性地,根据所述图像生成损失和所述图像判别损失确定所述语义分割网络的模型生成损失的方式可以是,将所述图像生成损失和所述图像判别损失进行求和或加权求和得到语义分割网络的模型生成损失。
本实施例中,第一损失函数和第二损失函数可以相同也可以不同。示例性地,所述第一损失函数包括二分类交叉熵损失函数,所述第二损失函数包括最小二乘损失函数。
可选地,所述语义分割网络的生成损失函数基于如下公式表示:
其中,x表示样本展示图像,G(x)表示所述语义分割网络输出的与所述样本展示图像对应的分割边缘掩膜图像,y表示与所述样本展示图像对应的样本边缘掩膜图像,LG(G(x),y)表示所述语义分割网络的生成损失函数,Lbce(G(x),y)表示用于计算所述分割边缘掩膜图像以及所述样本边缘掩膜图像之间的损失的二 分类交叉熵损失函数,c[G(x),x]表示由所述分割边缘掩膜图像与所述样本展示图像进行拼接得到的假样本图像,Dk(c[G(x),x])表示判别器的第k层网络所输出的假样本图像的图像判别结果,n表示k的最大取值,为大于1的正整数,βj表示第j个像素点的权重值,m表示j的最大取值,为大于1的正整数。
由于图像中的边缘信息在图像的整体信息中所占的比例往往较少,在通过模型进行边缘提取的场景中,对所有的像素点进行同样的学习时,会存在样本失衡的问题。因此,可以将样本边缘掩膜图像中的边缘像素点作为正样本,样本边缘掩膜图像中除边缘像素点之外的像素点作为负样本,通过正样本的像素点数量占总像素点数量的比例与负样本的像素点数量占总像素点数量比例确定每个像素点对应的权重来均衡。可选地,在所述基于第二损失函数计算所述判别器输出的与所述分割边缘掩膜图像对应的输出判别结果与期望判别结果之间的图像判别损失之前,所述方法还包括:根据所述期望判别结果对应的边缘像素点和出所述边缘像素点之外的像素点的数量以及所述期望判别结果对应的像素点总数量,确定所述第二损失函数的目标权重值,并基于所述目标权重值对所述第二损失函数进行加权。进而,可以通过加权计算所述判别器输出的与所述分割边缘掩膜图像对应的输出判别结果与期望判别结果之间的图像判别损失。
可选地,在将所述样本展示图像输入至语义分割网络中之前,还可以包括对所述样本展示图像进行预处理,其中,所述预处理包括降噪处理、锐化处理、缩放处理、裁剪处理及插值处理中的至少一种。
S440、根据所述模型生成损失对所述语义分割网络的模型参数进行调整,将训练完成的语义分割网络作为目标边缘提取模型。
需要说明的是,通过模型生成损失对语义分割网络的模型参数进行调整的目的在于使得语义分割网络生成的与样本展示图像对应的分割边缘掩膜图像更接近与样本展示图像对应的样本边缘掩膜图像,以使判别器尽可能地判别不出分割边缘掩膜图像以及样本边缘掩膜图像之间的差别。
S450、将所述目标展示图像输入至预先训练完成的目标边缘提取模型中,得到与所述目标展示图像对应的目标边缘掩膜图像,其中,所述目标边缘掩膜图像中包括所述目标展示图像中的目标提取边缘。
S460、根据所述目标提取边缘确定所述目标展示图像中的特效展示边缘。
S470、将所述目标展示图像中的特效展示边缘以第一预设展示方式展示于目标展示区域中。
S480、将所述目标展示图像中除所述特效展示边缘之外的区域以第二预设展示方式展示于所述目标展示区域中。
本实施例,通过在对语义分割模型进行模型参数调整时,将语义分割网络输出的分割边缘掩膜图像、生成损失函数以及所述样本边缘掩膜图像确定语义分割网络的图像生成损失以及判别器对分割边缘掩膜图像的图像判别损失,不仅考虑了语义分割网络自身在边缘提取中的图像生成损失,还结合了判别器对分割边缘掩膜图像的图像判别损失,能够关注到通过判别器对分割边缘掩膜图像的判别结果,从而调整分割模型,充分应用了语义分割模型与判别器之间的对抗,使得训练完成的语义分割网络具有更为精准地边缘提取能力,保证边缘特效展示的效果。
实施例五
图5为本公开实施例五所提供的一种图像处理方法的流程示意图,本实施例在本公开实施例中任一可选实施方式的基础上,对判别器的训练方式进行了描述,以更好地辅助提升语义分割网络的训练效果,进而提升边缘提取精度。可选地,所述根据语义分割网络输出与所述样本展示图像对应的分割边缘掩膜图像、所述样本展示图像以及所述样本边缘掩膜图像确定判别器的样本训练图像,其中,所述样本训练图像包括真样本图像和假样本图像;将所述样本训练图像输入至判别器中,得到所述判别器的输出判别结果,并根据所述判别器的判别损失函数、所述输出判别结果与期望判别结果确定所述判别器的模型判别损失;根据所述模型判别损失对所述判别器的模型参数进行调整。具体实施方式可以参见本实施例的说明。其中,与前述实施例相同或相似的技术特征在此不再赘述。
如图5所示,本实施例的方法可包括:
S510、接收针对目标展示图像输入的用于启用边缘展示特效的边缘特效触发操作。
S520、获取样本展示图像以及与所述样本展示图像对应的样本边缘掩膜图像,其中,所述样本边缘掩膜图像中包括所述样本展示图像中的期望提取边缘。
S530、根据语义分割网络输出与所述样本展示图像对应的分割边缘掩膜图像、所述样本展示图像以及所述样本边缘掩膜图像确定判别器的样本训练图像,其中,所述样本训练图像包括真样本图像和假样本图像。
由于掩膜图像为一通道图像,为了与判别器适配,可选地,可以通过图像拼接的方式将样本边缘掩膜图像以及分割掩膜图像转化为两通道或两通道以上的图像。考虑到样本边缘掩膜图像以及分割掩膜图像均与样本展示图像对应,可选地,将所述样本展示图像与语义分割网络输出与所述样本展示图像对应的 分割边缘掩膜图像进行拼接,得到判别模型的假样本图像,将所述样本展示图像与所述样本边缘掩膜图像进行拼接,得到判别模型的真样本图像。
作为本公开实施例的一可选方式,还可以将所述样本边缘掩膜图像与语义分割网络输出与所述样本展示图像对应的分割边缘掩膜图像进行拼接,得到判别模型的假样本图像,将所述样本边缘掩膜图像与所述样本边缘掩膜图像进行拼接,得到判别模型的真样本图像。
S540、将所述样本训练图像输入至判别器中,得到所述判别器的输出判别结果,并根据所述判别器的判别损失函数、所述输出判别结果与期望判别结果确定所述判别器的模型判别损失。
本实施例中,判别器的判别损失函数可以理解为用于判断判别器在进行分类判别时所产生的损失的函数。在本公开实施例中,所述判别损失函数可以仅包含一种损失函数,也可以是包含两种或两种以上的损失函数。示例性地,所述判别损失函数包括第三损失函数和第四损失函数。可以通过第三损失函数计算样本训练图像中假样本图像的图像判别损失,通过第四损失函数计算样本训练图像中真样本图像的图像判别损失,进而基于假样本图像的图像判别损失和真样本图像的图像判别损失确定所述判别器的模型判别损失。
可选地,所述根据所述判别器的判别损失函数、输出判别结果与期望判别结果确定所述判别器的模型判别损失,可以包括:根据第三损失函数计算所述判别器所输出的与所述假样本图像对应的输出判别结果与期望判别结果确定所述判别器的假样本判别损失;根据第四损失函数计算所述判别器所输出的与所述真样本图像对应的输出判别结果与期望判别结果确定所述判别器的真样本判别损失;根据所述假样本判别损失和所述真样本判别损失确定所述判别器的模型判别损失。
由于图像中的边缘信息在图像的整体信息中所占的比例往往较少,在通过模型进行边缘提取的场景中,对所有的像素点进行同样的学习时,会存在样本失衡的问题。因此,可以通过正负样本比例确定第三损失函数和/或第四损失函数的权重来均衡。
示例性地,根据所述假样本判别损失和所述真样本判别损失确定所述判别器的模型判别损失的方式可以是将假样本判别损失和所述真样本判别损失进行求和或加权求和得到判别器的模型判别损失。
本实施例中,第三损失函数和第四损失函数可以相同也可以不同。可选地,所述第三损失函数包括二分类交叉熵损失函数,所述第四损失函数包括最小二乘损失函数。
可选地,所述判别器的模型判别损失可基于如下公式表示:
其中,x表示样本展示图像,G(x)表示所述语义分割网络输出的与所述样本展示图像对应的分割边缘掩膜图像,y表示与所述样本展示图像对应的样本边缘掩膜图像,LD(G(x),y)表示所述判别器的判别损失函数,c[G(x),x]表示由所述分割边缘掩膜图像与所述样本展示图像进行拼接得到的假样本图像,dk表示判别器的第k层网络期望输出的与所述假样本图像对应的图像判别结果,Lbce(Dk(c[G(x),x]),dk)表示用于计算所述分割边缘掩膜图像以及所述样本边缘掩膜图像之间的损失的二分类交叉熵损失函数,c[y,x]表示由所述样本边缘掩膜图像与所述样本展示图像进行拼接得到的真样本图像,Dk(c[y,x])表示判别器的第k层网络实际输出的真样本图像的图像判别结果,n表示k的最大取值,为大于1的正整数,αi表示第i个像素点的权重值。
可选地,在所述根据所述判别器的判别损失函数、所述输出判别结果与期望判别结果确定所述判别器的模型判别损失之前,所述方法还包括:确定期望所述判别器输出的与所述样本展示图像对应的期望判别结果。其中,与所述样本展示图像对应的期望判别结果包括:与所述样本展示图像对应的分割边缘掩膜图像对应的期望判别结果,以及与所述样本展示图像对应的样本边缘掩膜图像对应的期望判别结果。
如果仅仅是语义分割网络加判别器的常规训练,判别器往往起不到很好的作用,因为通常预测的分割边缘掩膜图像的结果中,只有局部像素点的预测结果是错误的,而大部分像素点的预测结果是正确的。常规判别器捕捉的大部分信息是具有误导性的,不能起到较好地约束的作用。因此,可选地,确定期望所述判别器输出的与所述样本展示图像对应的期望判别结果,可包括:对所述样本边缘掩膜图像进行膨胀处理,得到第一边缘掩膜图像;对所述分割边缘掩膜图像进行二值化处理,得到第二边缘掩膜图像;将所述第一边缘掩膜图像与所述第二边缘掩膜图像进行乘法运算,得到期望所述判别器输出的与所述样本展示图像对应的期望判别结果。
针对分割边缘掩膜图像,将样本边缘掩膜图像膨胀后的第一边缘掩膜图像与分割边缘掩膜图像二值化后的第二边缘掩膜图像进行乘法运算,可以减少分割边缘掩膜图像中像素值不为0的非边缘点对边缘点的干扰,使得得到的期望判别结果重点关注于对所提取的边缘像素点的判别。
在本公开实施例中,可以采用判别器对样本训练图像进行多尺度特征判别。例如,通过average pooling x4的算法,也可以称为4层平均池的方式。
在本公开实施例中,可以分别确定判别器中每一个模型判别层的期望判别结果。可选地,可以在将所述第一边缘掩膜图像与所述第二边缘掩膜图像进行乘法运算,得到期望所述判别器输出的与所述样本展示图像对应的期望判别结果之后,所述方法还包括:对与所述样本展示图像对应的期望判别结果进行尺寸转换处理,并确定尺寸转换后每个期望判别结果中的每个像素点对应的特征值,得到与每一个模型判别层对应的期望判别结果。其中,特征值可以理解为用于判别该目标区域是否为边缘点的判别值。
示例性地,与所述样本展示图像对应的期望判别结果的尺寸为512x512,如果缩放到16x16的话,那么每一个小格子的像素其实代表着32x32的特征值的结果。可以理解为,512x512到16x16,相当于512x512中每32x32个像素求了均值变成了16x16中的一个像素值结果。当小格子对应的特征值中判别错误的特征值的比例达到预设比例时,例如,错误比例达到1/16,1/32,1/64 1/128等,将该小格子的像素对应的特征值确定为判别错误。
在计算判别器的模型判别损失时,可以分别根据判别损失函数计算每一个模型判别层的期望判别结果与输出判别结果的损失值,进而通过求和、或者求和再求平均、或者加权求和再求平均等方式计算出判别器的模型判别损失。
S550、根据所述模型判别损失对所述判别器的模型参数进行调整。
需要说明的是,通过模型判别损失对判别器的模型参数进行调整的目的在于提升判别器的判别准确率,能够更好地判别假样本图像和真样本图像。从而,与语义分割网络形成对抗,以促使语义分割网络生成的与样本展示图像对应的分割边缘掩膜图像更接近与样本展示图像对应的样本边缘掩膜图像。
S560、将训练完成的语义分割网络作为目标边缘提取模型,将所述目标展示图像输入至预先训练完成的目标边缘提取模型中,得到与所述目标展示图像对应的目标边缘掩膜图像,其中,所述目标边缘掩膜图像中包括所述目标展示图像中的目标提取边缘。
S570、根据所述目标提取边缘确定所述目标展示图像中的特效展示边缘。
S580、将所述目标展示图像中的特效展示边缘以第一预设展示方式展示于目标展示区域中。
S590、将所述目标展示图像中除所述特效展示边缘之外的区域以第二预设展示方式展示于所述目标展示区域中。
本实施例,通过将样本展示图像与分割边缘掩膜图像,以及将样本展示图像与样本边缘掩膜图像进行拼接的方式,得到判别器的样本训练图像,在满足判别器对输入的图像的要求的同时,能够将样本展示图像与判别器的输出判别 结果相关联,进而,根据判别器的判别损失函数、输出判别结果与期望判别结果确定判别器的模型判别损失,对判别器进行模型参数调整,使得判别器达到更好地判别效果,从而更好地与语义分割网络进行对抗,以辅助优化语义分割网络,提升边缘提取的效果。
实施例六
图6为本公开实施例六提供的一种图像处理装置的结构示意图,本实施例所提供的图像处理装置可以通过软件和/或硬件来实现,可配置于终端和/或服务器中来实现本公开实施例中的图像处理方法。如图6所示,该装置可包括:触发操作接收模块610、边缘特效展示模块620和常规效果展示模块630。
其中,触发操作接收模块610,设置为接收针对目标展示图像输入的用于启用边缘展示特效的边缘特效触发操作;边缘特效展示模块620,设置为将所述目标展示图像中的特效展示边缘以第一预设展示方式展示于目标展示区域中;常规效果展示模块630,设置为将所述目标展示图像中除所述特效展示边缘之外的区域以第二预设展示方式展示于所述目标展示区域中。
本公开实施例,通过接收针对目标展示图像输入的用于启用边缘展示特效的边缘特效触发操作,能够通过与用户交互的方式,满足用户对目标展示图像中的边缘进行特效展示的需求,进而,响应于边缘特效触发操作,将目标展示图像中的特效展示边缘以第一预设展示方式展示于目标展示区域中,并将除特效展示边缘之外的区域以第二预设展示方式展示于目标展示区域中,将特效展示边缘区别于其他图像信息进行展示,突出展示目标展示图像中的边缘信息,解决了图像展示方式单一以及图像展示无法突出重点信息的问题,实现增加了图像展示的丰富性和趣味性,提升用户观感体验的效果。
在本公开实施例中任一可选实施方式的基础上,可选地,所述边缘特效展示模块设置为通过以下方式将所述目标展示图像中的特效展示边缘以第一预设展示方式展示于目标展示区域中:
将所述目标展示图像中的特效展示边缘处的目标边缘点,以按照预设顺序进行点亮的方式,动态展示于目标展示区域中。
在本公开实施例中任一可选实施方式的基础上,可选地,所述触发操作接收模块设置为通过以下方式接收针对目标展示图像输入的用于启用边缘展示特效的边缘特效触发操作:
接收针对预先设置的边缘特效触发控件的控件触发操作,展示图像获取界面;其中,所述图像获取界面包括图像获取控件;
基于所述图像获取控件获取目标展示图像,并接收针对所述目标展示图像的上传触发操作。
在本公开实施例中任一可选实施方式的基础上,可选地,所述图像处理装置还包括:
目标边缘掩膜图像输出模块,设置为在所述将所述目标展示图像中的特效展示边缘以第一预设展示方式展示于目标展示区域中之前,将所述目标展示图像输入至预先训练完成的目标边缘提取模型中,得到与所述目标展示图像对应的目标边缘掩膜图像,其中,所述目标边缘掩膜图像中包括所述目标展示图像中的目标提取边缘;
特效展示边缘确定模块,设置为根据所述目标提取边缘确定所述目标展示图像中的特效展示边缘。
在本公开实施例中任一可选实施方式的基础上,可选地,所述图像处理装置还包括:
样本图像获取模块,设置为在所述将所述目标展示图像输入至预先训练完成的目标边缘提取模型中之前,获取样本展示图像以及与所述样本展示图像对应的样本边缘掩膜图像,其中,所述样本边缘掩膜图像中包括所述样本展示图像中的期望提取边缘;
生成模型训练模块,设置为根据所述样本展示图像以及所述样本边缘掩膜图像对初始边缘提取模型进行训练,其中,初始边缘提取模型包括语义分割网络和判别器;
目标边缘提取模型确定模块,设置为将训练完成的语义分割网络作为目标边缘提取模型。
在本公开实施例中任一可选实施方式的基础上,可选地,所述模型训练模块包括:
分割边缘掩膜图像输出单元,设置为将所述样本展示图像输入至语义分割网络中,得到分割边缘掩膜图像;
模型生成损失确定单元,设置为基于所述语义分割网络的生成损失函数、所述分割边缘掩膜图像以及所述样本边缘掩膜图像确定模型生成损失,其中,所述模型生成损失包括语义分割网络的图像生成损失以及判别器对所述分割边缘掩膜图像的图像判别损失;
语义分割网络调整单元,设置为根据所述模型生成损失对所述语义分割网络的模型参数进行调整。
在本公开实施例中任一可选实施方式的基础上,可选地,所述语义分割网络的生成损失函数包括第一损失函数和第二损失函数;
相应地,所述模型生成损失确定单元设置为通过以下方式基于所述语义分割网络的生成损失函数、所述分割边缘掩膜图像以及所述样本边缘掩膜图像确定模型生成损失:
基于第一损失函数计算所述分割边缘掩膜图像以及所述样本边缘掩膜图像之间的损失,作为语义分割网络的图像生成损失;
基于第二损失函数计算所述判别器输出的与所述分割边缘掩膜图像对应的输出判别结果与期望判别结果之间的图像判别损失;
根据所述图像生成损失和所述图像判别损失确定所述语义分割网络的模型生成损失。
在本公开实施例中任一可选实施方式的基础上,可选地,所述第一损失函数包括二分类交叉熵损失函数,所述第二损失函数包括最小二乘损失函数,所述语义分割网络的生成损失函数基于如下公式表示:
其中,x表示样本展示图像,G(x)表示所述语义分割网络输出的与所述样本展示图像对应的分割边缘掩膜图像,y表示与所述样本展示图像对应的样本边缘掩膜图像,LG(G(x),y)表示所述语义分割网络的生成损失函数,Lbce(G(x),y)表示用于计算所述分割边缘掩膜图像以及所述样本边缘掩膜图像之间的损失的二分类交叉熵损失函数,c[G(x),x]表示由所述分割边缘掩膜图像与所述样本展示图像进行拼接得到的假样本图像,Dk(c[G(x),x])表示判别器的第k层网络所输出的假样本图像的图像判别结果,n表示k的最大取值,为大于1的正整数,αi表示第i个像素点的权重值。
在本公开实施例中任一可选实施方式的基础上,可选地,所述模型生成损失确定单元设置为:
在所述基于第二损失函数计算所述判别器输出的与所述分割边缘掩膜图像对应的输出判别结果与期望判别结果之间的图像判别损失之前,根据所述期望判别结果对应的边缘像素点和出所述边缘像素点之外的像素点的数量以及所述期望判别结果对应的像素点总数量,确定所述第二损失函数的目标权重值,并基于所述目标权重值对所述第二损失函数进行加权。
在本公开实施例中任一可选实施方式的基础上,可选地,所述模型训练模块还包括:
判别器样本图像生成单元,设置为根据语义分割网络输出与所述样本展示图像对应的分割边缘掩膜图像、所述样本展示图像以及所述样本边缘掩膜图像确定判别器的样本训练图像,其中,所述样本训练图像包括真样本图像和假样本图像;
模型判别损失确定单元,设置为将所述样本训练图像输入至判别器中,得到所述判别器的输出判别结果,并根据所述判别器的判别损失函数、所述输出判别结果与期望判别结果确定所述判别器的模型判别损失;
判别器确定单元,设置为根据所述模型判别损失对所述判别器的模型参数进行调整。
在本公开实施例中任一可选实施方式的基础上,可选地,所述判别器样本图像生成单元设置为通过以下方式根据语义分割网络输出与所述样本展示图像对应的分割边缘掩膜图像、所述样本展示图像以及所述样本边缘掩膜图像确定判别器的样本训练图像:
将所述样本展示图像与语义分割网络输出与所述样本展示图像对应的分割边缘掩膜图像进行拼接,得到判别模型的假样本图像,将所述样本展示图像与所述样本边缘掩膜图像进行拼接,得到判别模型的真样本图像。
在本公开实施例中任一可选实施方式的基础上,可选地,所述判别损失函数包括第三损失函数和第四损失函数;
所述模型判别损失确定单元设置为通过以下方式根据所述判别器的判别损失函数、输出判别结果与期望判别结果确定所述判别器的模型判别损失:
根据第三损失函数计算所述判别器所输出的与所述假样本图像对应的输出判别结果与期望判别结果确定所述判别器的假样本判别损失;
根据第四损失函数计算所述判别器所输出的与所述真样本图像对应的输出判别结果与期望判别结果确定所述判别器的真样本判别损失;
根据所述假样本判别损失和所述真样本判别损失确定所述判别器的模型判别损失。
在本公开实施例中任一可选实施方式的基础上,可选地,所述第三损失函数包括二分类交叉熵损失函数,所述第四损失函数包括最小二乘损失函数,所述判别器的模型判别损失基于如下公式表示:
其中,x表示样本展示图像,G(x)表示所述语义分割网络输出的与所述样本 展示图像对应的分割边缘掩膜图像,y表示与所述样本展示图像对应的样本边缘掩膜图像,LD(G(x),y)表示所述判别器的判别损失函数,c[G(x),x]表示由所述分割边缘掩膜图像与所述样本展示图像进行拼接得到的假样本图像,dk表示判别器的第k层网络所期望输出的与所述假样本图像对应的期望判别结果,Lbce(Dk(c[G(x),x]),dk)表示用于计算所述分割边缘掩膜图像以及所述样本边缘掩膜图像之间的损失的二分类交叉熵损失函数,c[y,x]表示由所述样本边缘掩膜图像与所述样本展示图像进行拼接得到的真样本图像,Dk(c[y,x])表示判别器的第k层网络实际输出的真样本图像的图像判别结果,n表示k的最大取值,为大于1的正整数,βj表示第j个像素点的权重值,m表示j的最大取值,为大于1的正整数。
在本公开实施例中任一可选实施方式的基础上,可选地,所述模型训练模块还包括:
样本边缘掩膜图形膨胀单元,设置为在所述根据所述判别器的判别损失函数、所述输出判别结果与期望判别结果确定所述判别器的模型判别损失之前,对所述样本边缘掩膜图像进行膨胀处理,得到第一边缘掩膜图像;
分割边缘掩膜图像二值化单元,设置为对所述分割边缘掩膜图像进行二值化处理,得到第二边缘掩膜图像;
期望判别结果生成单元,设置为将所述第一边缘掩膜图像与所述第二边缘掩膜图像进行乘法运算,得到期望所述判别器输出的与所述样本展示图像对应的期望判别结果。
上述图像处理装置可执行本公开任意实施例所提供的图像处理方法,具备执行图像处理方法相应的功能模块和有益效果。
值得注意的是,上述图像处理装置所包括的各个单元和模块只是按照功能逻辑进行划分的,只要能够实现相应的功能即可;另外,各功能单元的具体名称也只是为了便于相互区分。
实施例七
图7为本公开实施例七所提供的一种电子设备的结构示意图。下面参考图7,示出了适于用来实现本公开实施例的电子设备(例如图7中的终端设备或服务器)700的结构示意图。本公开实施例中的终端设备可以包括诸如移动电话、笔记本电脑、数字广播接收器、个人数字助理(Personal Digital Assistant,PDA)、平板电脑(Portable Android Device,PAD)、便携式多媒体播放器(Portable Media Player,PMP)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字 电视(television,TV)、台式计算机等等的固定终端。图7示出的电子设备仅仅是一个示例。
如图7所示,电子设备700可以包括处理装置(例如中央处理器、图形处理器等)701,电子设备700可以根据存储在只读存储器(Read-Only Memory,ROM)702中的程序或者从存储装置708加载到随机访问存储器(Random Access Memory,RAM)703中的程序而执行各种适当的动作和处理。在RAM 703中,还存储有电子设备700操作所需的各种程序和数据。处理装置701、ROM 702以及RAM 703通过总线705彼此相连。输入/输出(Input/Output,I/O)接口704也连接至总线705。
通常,以下装置可以连接至I/O接口704:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置706;包括例如液晶显示器(Liquid Crystal Display,LCD)、扬声器、振动器等的输出装置707;包括例如磁带、硬盘等的存储装置708;以及通信装置709。通信装置709可以允许电子设备700与其他设备进行无线或有线通信以交换数据。虽然图7示出了具有各种装置的电子设备700,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,该计算机程序包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置709从网络上被下载和安装,或者从存储装置708被安装,或者从ROM 702被安装。在该计算机程序被处理装置701执行时,执行本公开实施例的方法中的上述功能。
本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。
本公开实施例提供的电子设备与上述实施例提供的图像处理方法属于同一发明构思,未在本实施例中详尽描述的技术细节可参见上述实施例,并且本实施例与上述实施例具有相同的有益效果。
实施例八
本公开实施例提供了一种计算机存储介质,其上存储有计算机程序,该程序被处理器执行时实现上述实施例所提供的图像处理方法。
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质 或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质可以包括:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器、只读存储器、可擦式可编程只读存储器(Erasable Programmable Read-Only Memory,EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(Compact Disc Read-Only Memory,CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括:电线、光缆、射频(Radio Frequency,RF)等等,或者上述的任意合适的组合。
在一些实施方式中,客户端、服务器可以利用诸如超文本传输协议(HyperText Transfer Protocol,HTTP)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(Local Area Network,LAN),广域网(Wide Area Network,WAN),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:
接收针对目标展示图像输入的用于启用边缘展示特效的边缘特效触发操作;
将所述目标展示图像中的特效展示边缘以第一预设展示方式展示于目标展示区域中;
将所述目标展示图像中除所述特效展示边缘之外的区域以第二预设展示方式展示于所述目标展示区域中。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,
上述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括LAN或WAN—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元的名称在某种情况下并不构成对该单元本身的限定,例如,第一获取单元还可以被描述为“获取至少两个网际协议地址的单元”。
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(Field Programmable Gate Array,FPGA)、专用集成电路(Application Specific Integrated Circuit,ASIC)、专用标准产品(Application Specific Standard Parts,ASSP)、片上系统(System on Chip,SOC)、复杂可编程逻辑设备(Complex Programmable Logic Device,CPLD)等等。
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质可以包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、RAM、ROM、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、CD-ROM、光学储存设备、 磁储存设备、或上述内容的任何合适组合。
根据本公开的一个或多个实施例,【示例一】提供了一种元素展示方法,该方法包括:
接收针对目标展示图像输入的用于启用边缘展示特效的边缘特效触发操作;
将所述目标展示图像中的特效展示边缘以第一预设展示方式展示于目标展示区域中;
将所述目标展示图像中除所述特效展示边缘之外的区域以第二预设展示方式展示于所述目标展示区域中。
根据本公开的一个或多个实施例,【示例二】提供了一种元素展示方法,该方法,还包括:
可选的,所述将所述目标展示图像中的特效展示边缘以第一预设展示方式展示于目标展示区域中,包括:
将所述目标展示图像中的特效展示边缘处的目标边缘点,以按照预设顺序进行点亮的方式,动态展示于目标展示区域中。
根据本公开的一个或多个实施例,【示例三】提供了一种元素展示方法,该方法,还包括:
可选地,所述接收针对目标展示图像输入的用于启用边缘展示特效的边缘特效触发操作,包括:
接收针对预先设置的边缘特效触发控件的控件触发操作,展示图像获取界面;其中,所述图像获取界面包括图像获取控件;
基于所述图像获取控件获取目标展示图像,并接收针对所述目标展示图像的上传触发操作。
根据本公开的一个或多个实施例,【示例四】提供了一种元素展示方法,该方法,还包括:
可选的,在所述将所述目标展示图像中的特效展示边缘以第一预设展示方式展示于目标展示区域中之前,所述方法还包括:
将所述目标展示图像输入至预先训练完成的目标边缘提取模型中,得到与所述目标展示图像对应的目标边缘掩膜图像,其中,所述目标边缘掩膜图像中包括所述目标展示图像中的目标提取边缘;
根据所述目标提取边缘确定所述目标展示图像中的特效展示边缘。
根据本公开的一个或多个实施例,【示例五】提供了一种元素展示方法, 该方法,还包括:
可选的,在所述将所述目标展示图像输入至预先训练完成的目标边缘提取模型中之前,所述方法还包括:
获取样本展示图像以及与所述样本展示图像对应的样本边缘掩膜图像,其中,所述样本边缘掩膜图像中包括所述样本展示图像中的期望提取边缘;
根据所述样本展示图像以及所述样本边缘掩膜图像对初始边缘提取模型进行训练,其中,初始边缘提取模型包括语义分割网络和判别器;
将训练完成的语义分割网络作为目标边缘提取模型。
根据本公开的一个或多个实施例,【示例六】提供了一种元素展示方法,该方法,还包括:
可选的,所述根据所述样本展示图像以及所述样本边缘掩膜图像对初始边缘提取模型进行训练,包括:
将所述样本展示图像输入至语义分割网络中,得到分割边缘掩膜图像;
基于所述语义分割网络的生成损失函数、所述分割边缘掩膜图像以及所述样本边缘掩膜图像确定模型生成损失,其中,所述模型生成损失包括语义分割网络的图像生成损失以及判别器对所述分割边缘掩膜图像的图像判别损失;
根据所述模型生成损失对所述语义分割网络的模型参数进行调整。
根据本公开的一个或多个实施例,【示例七】提供了一种元素展示方法,该方法,还包括:
可选的,所述语义分割网络的生成损失函数包括第一损失函数和第二损失函数;
所述基于所述语义分割网络的生成损失函数、所述分割边缘掩膜图像以及所述样本边缘掩膜图像确定模型生成损失,包括:
基于第一损失函数计算所述分割边缘掩膜图像以及所述样本边缘掩膜图像之间的损失,作为语义分割网络的图像生成损失;
基于第二损失函数计算所述判别器输出的与所述分割边缘掩膜图像对应的输出判别结果与期望判别结果之间的图像判别损失;
根据所述图像生成损失和所述图像判别损失确定所述语义分割网络的模型生成损失。
根据本公开的一个或多个实施例,【示例八】提供了一种元素展示方法,该方法,还包括:
可选的,所述第一损失函数包括二分类交叉熵损失函数,所述第二损失函数包括最小二乘损失函数,所述语义分割网络的生成损失函数基于如下公式表示:
其中,x表示样本展示图像,G(x)表示所述语义分割网络输出的与所述样本展示图像对应的分割边缘掩膜图像,y表示与所述样本展示图像对应的样本边缘掩膜图像,LG(G(x),y)表示所述语义分割网络的生成损失函数,Lbce(G(x),y)表示用于计算所述分割边缘掩膜图像以及所述样本边缘掩膜图像之间的损失的二分类交叉熵损失函数,c[G(x),x]表示由所述分割边缘掩膜图像与所述样本展示图像进行拼接得到的假样本图像,Dk(c[G(x),x])表示判别器的第k层网络所输出的假样本图像的图像判别结果,n表示k的最大取值,为大于1的正整数,αi表示第i个像素点的权重值。
根据本公开的一个或多个实施例,【示例九】提供了一种元素展示方法,该方法,还包括:
可选的,在所述基于第二损失函数计算所述判别器输出的与所述分割边缘掩膜图像对应的输出判别结果与期望判别结果之间的图像判别损失之前,所述方法还包括:
根据所述期望判别结果对应的边缘像素点和出所述边缘像素点之外的像素点的数量以及所述期望判别结果对应的像素点总数量,确定所述第二损失函数的目标权重值,并基于所述目标权重值对所述第二损失函数进行加权。
根据本公开的一个或多个实施例,【示例十】提供了一种元素展示方法,该方法,还包括:
可选的,所述根据所述样本展示图像以及所述样本边缘掩膜图像对初始边缘提取模型进行训练,包括:
根据语义分割网络输出与所述样本展示图像对应的分割边缘掩膜图像、所述样本展示图像以及所述样本边缘掩膜图像确定判别器的样本训练图像,其中,所述样本训练图像包括真样本图像和假样本图像;
将所述样本训练图像输入至判别器中,得到所述判别器的输出判别结果,并根据所述判别器的判别损失函数、所述输出判别结果与期望判别结果确定所述判别器的模型判别损失;
根据所述模型判别损失对所述判别器的模型参数进行调整。
根据本公开的一个或多个实施例,【示例十一】提供了一种元素展示方法, 该方法,还包括:
可选地,所述根据语义分割网络输出与所述样本展示图像对应的分割边缘掩膜图像、所述样本展示图像以及所述样本边缘掩膜图像确定判别器的样本训练图像,包括:
将所述样本展示图像与语义分割网络输出与所述样本展示图像对应的分割边缘掩膜图像进行拼接,得到判别模型的假样本图像,将所述样本展示图像与所述样本边缘掩膜图像进行拼接,得到判别模型的真样本图像。
根据本公开的一个或多个实施例,【示例十二】提供了一种元素展示方法,该方法,还包括:
可选的,所述判别损失函数包括第三损失函数和第四损失函数;
所述根据所述判别器的判别损失函数、输出判别结果与期望判别结果确定所述判别器的模型判别损失,包括:
根据第三损失函数计算所述判别器所输出的与所述假样本图像对应的输出判别结果与期望判别结果确定所述判别器的假样本判别损失;
根据第四损失函数计算所述判别器所输出的与所述真样本图像对应的输出判别结果与期望判别结果确定所述判别器的真样本判别损失;
根据所述假样本判别损失和所述真样本判别损失确定所述判别器的模型判别损失。
根据本公开的一个或多个实施例,【示例十三】提供了一种元素展示方法,该方法,还包括:
可选的,所述第三损失函数包括二分类交叉熵损失函数,所述第四损失函数包括最小二乘损失函数,所述判别器的模型判别损失基于如下公式表示:
其中,x表示样本展示图像,G(x)表示所述语义分割网络输出的与所述样本展示图像对应的分割边缘掩膜图像,y表示与所述样本展示图像对应的样本边缘掩膜图像,LD(G(x),y)表示所述判别器的判别损失函数,c[G(x),x]表示由所述分割边缘掩膜图像与所述样本展示图像进行拼接得到的假样本图像,dk表示判别器的第k层网络所期望输出的与所述假样本图像对应的期望判别结果,Lbce(Dk(c[G(x),x]),dk)表示用于计算所述分割边缘掩膜图像以及所述样本边缘掩膜图像之间的损失的二分类交叉熵损失函数,c[y,x]表示由所述样本边缘掩膜图像与所述样本展示图像进行拼接得到的真样本图像,Dk(c[y,x])表示判别器的 第k层网络实际输出的真样本图像的图像判别结果,n表示k的最大取值,为大于1的正整数,βj表示第j个像素点的权重值,表示j的最大取值,为大于1的正整数。
根据本公开的一个或多个实施例,【示例十四】提供了一种元素展示方法,该方法,还包括:
可选的,在所述根据所述判别器的判别损失函数、所述输出判别结果与期望判别结果确定所述判别器的模型判别损失之前,所述方法还包括:
对所述样本边缘掩膜图像进行膨胀处理,得到第一边缘掩膜图像;
对所述分割边缘掩膜图像进行二值化处理,得到第二边缘掩膜图像;
将所述第一边缘掩膜图像与所述第二边缘掩膜图像进行乘法运算,得到期望所述判别器输出的与所述样本展示图像对应的期望判别结果。
根据本公开的一个或多个实施例,【示例十五】提供了一种元素展示装置,该装置,包括:
触发操作接收模块,设置为接收针对目标展示图像输入的用于启用边缘展示特效的边缘特效触发操作;
边缘特效展示模块,设置为将所述目标展示图像中的特效展示边缘以第一预设展示方式展示于目标展示区域中;
常规效果展示模块,设置为将所述目标展示图像中除所述特效展示边缘之外的区域以第二预设展示方式展示于所述目标展示区域中。

Claims (17)

  1. 一种图像处理方法,包括:
    接收针对目标展示图像输入的用于启用边缘展示特效的边缘特效触发操作;
    将所述目标展示图像中的特效展示边缘以第一预设展示方式展示于目标展示区域中;
    将所述目标展示图像中除所述特效展示边缘之外的区域以第二预设展示方式展示于所述目标展示区域中。
  2. 根据权利要求1所述的方法,其中,所述将所述目标展示图像中的特效展示边缘以第一预设展示方式展示于目标展示区域中,包括:
    将所述目标展示图像中的特效展示边缘处的目标边缘点,以按照预设顺序进行点亮的方式,动态展示于目标展示区域中。
  3. 根据权利要求1所述的方法,其中,所述接收针对目标展示图像输入的用于启用边缘展示特效的边缘特效触发操作,包括:
    接收针对预先设置的边缘特效触发控件的控件触发操作,展示图像获取界面;其中,所述图像获取界面包括图像获取控件;
    基于所述图像获取控件获取目标展示图像,并接收针对所述目标展示图像的上传触发操作。
  4. 根据权利要求1所述的方法,在所述将所述目标展示图像中的特效展示边缘以第一预设展示方式展示于目标展示区域中之前,所述方法还包括:
    将所述目标展示图像输入至预先训练完成的目标边缘提取模型中,得到与所述目标展示图像对应的目标边缘掩膜图像,其中,所述目标边缘掩膜图像中包括所述目标展示图像中的目标提取边缘;
    根据所述目标提取边缘确定所述目标展示图像中的特效展示边缘。
  5. 根据权利要求4所述的方法,在所述将所述目标展示图像输入至预先训练完成的目标边缘提取模型中之前,所述方法还包括:
    获取样本展示图像以及与所述样本展示图像对应的样本边缘掩膜图像,其中,所述样本边缘掩膜图像中包括所述样本展示图像中的期望提取边缘;
    根据所述样本展示图像以及所述样本边缘掩膜图像对初始边缘提取模型进行训练,其中,初始边缘提取模型包括语义分割网络和判别器;
    将训练完成的语义分割网络作为目标边缘提取模型。
  6. 根据权利要求5所述的方法,其中,所述根据所述样本展示图像以及所述样本边缘掩膜图像对初始边缘提取模型进行训练,包括:
    将所述样本展示图像输入至语义分割网络中,得到分割边缘掩膜图像;
    基于所述语义分割网络的生成损失函数、所述分割边缘掩膜图像以及所述样本边缘掩膜图像确定模型生成损失,其中,所述模型生成损失包括语义分割网络的图像生成损失以及判别器对所述分割边缘掩膜图像的图像判别损失;
    根据所述模型生成损失对所述语义分割网络的模型参数进行调整。
  7. 根据权利要求6所述的方法,其中,所述语义分割网络的生成损失函数包括第一损失函数和第二损失函数;
    所述基于所述语义分割网络的生成损失函数、所述分割边缘掩膜图像以及所述样本边缘掩膜图像确定模型生成损失,包括:
    基于第一损失函数计算所述分割边缘掩膜图像以及所述样本边缘掩膜图像之间的损失,作为语义分割网络的图像生成损失;
    基于第二损失函数计算所述判别器输出的与所述分割边缘掩膜图像对应的输出判别结果与期望判别结果之间的图像判别损失;
    根据所述图像生成损失和所述图像判别损失确定所述语义分割网络的模型生成损失。
  8. 根据权利要求7所述的方法,其中,所述第一损失函数包括二分类交叉熵损失函数,所述第二损失函数包括最小二乘损失函数,所述语义分割网络的生成损失函数基于如下公式表示:
    其中,x表示样本展示图像,G(x)表示所述语义分割网络输出的与所述样本展示图像对应的分割边缘掩膜图像,y表示与所述样本展示图像对应的样本边缘掩膜图像,LG(G(x),y)表示所述语义分割网络的生成损失函数,Lbce(G(x),y)表示用于计算所述分割边缘掩膜图像以及所述样本边缘掩膜图像之间的损失的二分类交叉熵损失函数,c[G(x),x]表示由所述分割边缘掩膜图像与所述样本展示图像进行拼接得到的假样本图像,Dk(c[G(x),x])表示判别器的第k层网络所输出的假样本图像的图像判别结果,n表示k的最大取值,为大于1的正整数,αi表示第i个像素点的权重值。
  9. 根据权利要求7所述的方法,在所述基于第二损失函数计算所述判别器输出的与所述分割边缘掩膜图像对应的输出判别结果与期望判别结果之间的图像判别损失之前,所述方法还包括:
    根据所述期望判别结果对应的边缘像素点和除所述边缘像素点之外的像素点的数量以及所述期望判别结果对应的像素点总数量,确定所述第二损失函数 的目标权重值,并基于所述目标权重值对所述第二损失函数进行加权。
  10. 根据权利要求5所述的方法,其中,所述根据所述样本展示图像以及所述样本边缘掩膜图像对初始边缘提取模型进行训练,包括:
    根据语义分割网络输出与所述样本展示图像对应的分割边缘掩膜图像、所述样本展示图像以及所述样本边缘掩膜图像确定判别器的样本训练图像,其中,所述样本训练图像包括真样本图像和假样本图像;
    将所述样本训练图像输入至判别器中,得到所述判别器的输出判别结果,并根据所述判别器的判别损失函数、所述输出判别结果与期望判别结果确定所述判别器的模型判别损失;
    根据所述模型判别损失对所述判别器的模型参数进行调整。
  11. 根据权利要求10所述的方法,其中,所述根据语义分割网络输出与所述样本展示图像对应的分割边缘掩膜图像、所述样本展示图像以及所述样本边缘掩膜图像确定判别器的样本训练图像,包括:
    将所述样本展示图像与语义分割网络输出与所述样本展示图像对应的分割边缘掩膜图像进行拼接,得到判别模型的假样本图像,将所述样本展示图像与所述样本边缘掩膜图像进行拼接,得到判别模型的真样本图像。
  12. 根据权利要求10所述的方法,其中,所述判别损失函数包括第三损失函数和第四损失函数;
    所述根据所述判别器的判别损失函数、输出判别结果与期望判别结果确定所述判别器的模型判别损失,包括:
    根据第三损失函数计算所述判别器所输出的与所述假样本图像对应的输出判别结果与期望判别结果确定所述判别器的假样本判别损失;
    根据第四损失函数计算所述判别器所输出的与所述真样本图像对应的输出判别结果与期望判别结果确定所述判别器的真样本判别损失;
    根据所述假样本判别损失和所述真样本判别损失确定所述判别器的模型判别损失。
  13. 根据权利要求12所述的方法,其中,所述第三损失函数包括二分类交叉熵损失函数,所述第四损失函数包括最小二乘损失函数,所述判别器的模型判别损失基于如下公式表示:
    其中,x表示样本展示图像,G(x)表示所述语义分割网络输出的与所述样本 展示图像对应的分割边缘掩膜图像,y表示与所述样本展示图像对应的样本边缘掩膜图像,LD(G(x),y)表示所述判别器的判别损失函数,c[G(x),x]表示由所述分割边缘掩膜图像与所述样本展示图像进行拼接得到的假样本图像,dk表示判别器的第k层网络所期望输出的与所述假样本图像对应的期望判别结果,Lbce(Dk(c[G(x),x]),dk)表示用于计算所述分割边缘掩膜图像以及所述样本边缘掩膜图像之间的损失的二分类交叉熵损失函数,c[y,x]表示由所述样本边缘掩膜图像与所述样本展示图像进行拼接得到的真样本图像,Dk(c[y,x])表示判别器的第k层网络实际输出的真样本图像的图像判别结果,n表示k的最大取值,为大于1的正整数,βj表示第j个像素点的权重值,m表示j的最大取值,为大于1的正整数。
  14. 根据权利要求7所述的方法,在所述根据所述判别器的判别损失函数、所述输出判别结果与期望判别结果确定所述判别器的模型判别损失之前,所述方法还包括:
    对所述样本边缘掩膜图像进行膨胀处理,得到第一边缘掩膜图像;
    对所述分割边缘掩膜图像进行二值化处理,得到第二边缘掩膜图像;
    将所述第一边缘掩膜图像与所述第二边缘掩膜图像进行乘法运算,得到期望所述判别器输出的与所述样本展示图像对应的期望判别结果。
  15. 一种图像处理装置,包括:
    触发操作接收模块,设置为接收针对目标展示图像输入的用于启用边缘展示特效的边缘特效触发操作;
    边缘特效展示模块,设置为将所述目标展示图像中的特效展示边缘以第一预设展示方式展示于目标展示区域中;
    常规效果展示模块,设置为将所述目标展示图像中除所述特效展示边缘之外的区域以第二预设展示方式展示于所述目标展示区域中。
  16. 一种电子设备,所述电子设备包括:
    处理器;
    存储装置,用于存储程序,
    当所述程序被所述处理器执行,使得所述处理器实现如权利要求1-14中任一所述的图像处理方法。
  17. 一种计算机可读存储介质,所述存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1-14中任一所述的图像处理方法。
PCT/CN2023/072498 2022-01-20 2023-01-17 图像处理方法、装置、电子设备及存储介质 WO2023138549A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210068603.X 2022-01-20
CN202210068603.XA CN114416260A (zh) 2022-01-20 2022-01-20 图像处理方法、装置、电子设备及存储介质

Publications (1)

Publication Number Publication Date
WO2023138549A1 true WO2023138549A1 (zh) 2023-07-27

Family

ID=81276211

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/072498 WO2023138549A1 (zh) 2022-01-20 2023-01-17 图像处理方法、装置、电子设备及存储介质

Country Status (2)

Country Link
CN (1) CN114416260A (zh)
WO (1) WO2023138549A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114416260A (zh) * 2022-01-20 2022-04-29 北京字跳网络技术有限公司 图像处理方法、装置、电子设备及存储介质
CN117333586A (zh) * 2023-11-30 2024-01-02 浙江口碑网络技术有限公司 一种图像处理方法及装置、存储介质和电子设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105357451A (zh) * 2015-12-04 2016-02-24 Tcl集团股份有限公司 基于滤镜特效的图像处理方法及装置
CN112347395A (zh) * 2019-08-07 2021-02-09 阿里巴巴集团控股有限公司 特效展示方法、装置、电子设备及计算机存储介质
JP2021174090A (ja) * 2020-04-21 2021-11-01 セイコーエプソン株式会社 情報処理装置、特色を確認する処理方法、及び、処理プログラム
CN114416260A (zh) * 2022-01-20 2022-04-29 北京字跳网络技术有限公司 图像处理方法、装置、电子设备及存储介质

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102749601B (zh) * 2011-04-22 2016-02-10 株式会社东芝 图像处理装置、图像处理方法、以及磁共振成像装置
CN102665051A (zh) * 2012-04-06 2012-09-12 安科智慧城市技术(中国)有限公司 基于嵌入式系统的播放终端及其字幕显示方法、系统
CN102855648B (zh) * 2012-08-09 2016-06-08 小米科技有限责任公司 一种图像处理方法及装置
CN104484871B (zh) * 2014-11-27 2018-09-04 小米科技有限责任公司 边缘提取方法和装置
CN107679479A (zh) * 2017-09-27 2018-02-09 武汉颂大教育科技股份有限公司 一种基于图像形态学处理的客观填涂识别方法
CN107993191B (zh) * 2017-11-30 2023-03-21 腾讯科技(深圳)有限公司 一种图像处理方法和装置
CN108537292B (zh) * 2018-04-10 2020-07-31 上海白泽网络科技有限公司 语义分割网络训练方法、图像语义分割方法及装置
CN109064390B (zh) * 2018-08-01 2023-04-07 Oppo(重庆)智能科技有限公司 一种图像处理方法、图像处理装置及移动终端
CN111369582B (zh) * 2020-03-06 2023-04-07 腾讯科技(深圳)有限公司 图像分割方法、背景替换方法、装置、设备及存储介质
CN111539877B (zh) * 2020-03-17 2022-10-18 杭州小影创新科技股份有限公司 一种漫画风格边缘增强的图像锐化方法
CN112235520B (zh) * 2020-12-07 2021-05-04 腾讯科技(深圳)有限公司 一种图像处理方法、装置、电子设备及存储介质
CN113382275B (zh) * 2021-06-07 2023-03-07 广州博冠信息科技有限公司 直播数据的生成方法、装置、存储介质及电子设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105357451A (zh) * 2015-12-04 2016-02-24 Tcl集团股份有限公司 基于滤镜特效的图像处理方法及装置
CN112347395A (zh) * 2019-08-07 2021-02-09 阿里巴巴集团控股有限公司 特效展示方法、装置、电子设备及计算机存储介质
JP2021174090A (ja) * 2020-04-21 2021-11-01 セイコーエプソン株式会社 情報処理装置、特色を確認する処理方法、及び、処理プログラム
CN114416260A (zh) * 2022-01-20 2022-04-29 北京字跳网络技术有限公司 图像处理方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
CN114416260A (zh) 2022-04-29

Similar Documents

Publication Publication Date Title
WO2023138549A1 (zh) 图像处理方法、装置、电子设备及存储介质
WO2018177379A1 (zh) 手势识别、控制及神经网络训练方法、装置及电子设备
KR102385463B1 (ko) 얼굴 특징 추출 모델 학습 방법, 얼굴 특징 추출 방법, 장치, 디바이스 및 저장 매체
CN110189246B (zh) 图像风格化生成方法、装置及电子设备
CN108197618B (zh) 用于生成人脸检测模型的方法和装置
WO2023125374A1 (zh) 图像处理方法、装置、电子设备及存储介质
WO2022041830A1 (zh) 行人重识别方法和装置
CN111669502B (zh) 目标对象显示方法、装置及电子设备
WO2023093897A1 (zh) 图像处理方法、装置、电子设备及存储介质
US20200294249A1 (en) Network module and distribution method and apparatus, electronic device, and storage medium
CN112562019A (zh) 图像色彩调整方法及装置、计算机可读介质和电子设备
WO2023138560A1 (zh) 风格化图像生成方法、装置、电子设备及存储介质
CN113050860B (zh) 一种控件识别方法和相关装置
WO2023109842A1 (zh) 图像展示方法、装置、电子设备及存储介质
WO2023125181A1 (zh) 图像处理方法、装置、电子设备和存储介质
CN113449851A (zh) 数据处理方法及设备
CN114330236A (zh) 文字生成方法、装置、电子设备及存储介质
CN113902636A (zh) 图像去模糊方法及装置、计算机可读介质和电子设备
CN112785669B (zh) 一种虚拟形象合成方法、装置、设备及存储介质
CN110197459B (zh) 图像风格化生成方法、装置及电子设备
CN112967193A (zh) 图像校准方法及装置、计算机可读介质和电子设备
WO2023071694A1 (zh) 图像处理方法、装置、电子设备及存储介质
WO2023197648A1 (zh) 截图处理方法及装置、电子设备和计算机可读介质
WO2023138540A1 (zh) 边缘提取方法、装置、电子设备及存储介质
CN114973293A (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: 23742864

Country of ref document: EP

Kind code of ref document: A1