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

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

Info

Publication number
WO2023020316A1
WO2023020316A1 PCT/CN2022/110798 CN2022110798W WO2023020316A1 WO 2023020316 A1 WO2023020316 A1 WO 2023020316A1 CN 2022110798 W CN2022110798 W CN 2022110798W WO 2023020316 A1 WO2023020316 A1 WO 2023020316A1
Authority
WO
WIPO (PCT)
Prior art keywords
matting
cutout
result
image
preset
Prior art date
Application number
PCT/CN2022/110798
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 北京字跳网络技术有限公司
Priority to EP22857628.6A priority Critical patent/EP4369296A1/en
Publication of WO2023020316A1 publication Critical patent/WO2023020316A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/60Editing figures and text; Combining figures or text
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/194Segmentation; Edge detection involving foreground-background segmentation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
    • H04N5/272Means for inserting a foreground image in a background image, i.e. inlay, outlay
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20092Interactive image processing based on input by user
    • G06T2207/20104Interactive definition of region of interest [ROI]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging

Definitions

  • the present disclosure relates to the field of data processing, and in particular to an image processing method, device, equipment and storage medium.
  • Cutout is one of the commonly used operations in image processing. Specifically, it is to accurately separate a part of the original image from the original image and become a separate layer, which serves as an important basis for subsequent image processing.
  • the cutout mode can be divided into manual cutout mode, automatic cutout mode and semi-automatic cutout mode based on the degree of intelligence, and cutout users can only choose one of the cutout modes to process the original image.
  • the same original image cannot be matted using multiple matting modes at the same time.
  • the automatic matting mode has a higher degree of intelligence, which can save the user's matting time, while the semi-automatic matting mode and manual matting mode have higher matting precision. , which can improve the matting quality.
  • the present disclosure provides an image processing method, device, equipment and storage medium, by drawing the cutout results in different cutout modes on the same canvas, to realize It provides the function of performing matting processing on the same image by using multiple matting modes at the same time.
  • the present disclosure provides an image processing method, the method comprising:
  • a matting effect map of the image to be processed is determined.
  • the first cutout mode and the second cutout mode respectively belong to one of the preset automatic cutout mode, the preset manual cutout mode and the preset semi-automatic cutout mode A cutout mode, and the first cutout mode and the second cutout mode belong to different cutout modes.
  • the first cutout mode belongs to a preset semi-automatic cutout mode, and the cutout operation is obtained in response to a cutout operation triggered for an image to be processed in the first cutout mode
  • the corresponding matting result includes:
  • the previous matting result and the image to be processed and according to a preset semi-automatic matting algorithm, obtain a matting algorithm result map corresponding to the matting operation;
  • a matting result corresponding to the matting operation is obtained as a first matting result.
  • the previous cutout result corresponding to the cutout operation is stored in a preset array, and the preset array is used to store each cutout in the preset semi-automatic cutout mode according to the order of execution.
  • the obtaining a matting result corresponding to the matting operation based on the matting algorithm result graph, as the first matting result includes:
  • the drawing the first matting result on the preset canvas includes:
  • the present disclosure provides an image processing device, the device comprising:
  • An obtaining module configured to obtain a cutout result corresponding to the cutout operation as a first cutout result in response to a cutout operation triggered for the image to be processed in the first cutout mode
  • a drawing module configured to draw the first matting result on a preset canvas; wherein, a second matting result is drawn on the preset canvas, and the second matting result is in a second matting mode
  • a determining module configured to determine a cutout effect map of the image to be processed based on the first cutout result and the second cutout result on the preset canvas.
  • the present disclosure provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are run on a terminal device, the terminal device is made to implement the above method.
  • the present disclosure provides a device, including: a memory, a processor, and a computer program stored on the memory and operable on the processor, when the processor executes the computer program, Implement the above method.
  • the present disclosure provides a computer program product, where the computer program product includes a computer program/instruction, and when the computer program/instruction is executed by a processor, the above method is implemented.
  • An embodiment of the present disclosure provides an image processing method. First, in the first image matting mode, when a matting operation triggered for an image to be processed is received, the matting result corresponding to the matting operation is obtained as the first matting operation. Cutout result. Then, the first matting result is drawn on the preset canvas; wherein, the second matting result is drawn on the preset canvas, and the second matting result is the matting result of the image to be processed in the second matting mode. Furthermore, based on the first matting result and the second matting result on the preset canvas, a matting effect map of the image to be processed is determined. In the embodiment of the present disclosure, by drawing the matting results of the same image to be processed in different matting modes on the same canvas, the function of matting the same image by using multiple matting modes at the same time is realized.
  • FIG. 1 is a flowchart of an image processing method provided by an embodiment of the present disclosure
  • FIG. 2 is a schematic diagram of drawing matting results on a preset canvas provided by an embodiment of the present disclosure
  • FIG. 3 is a schematic diagram of a cutout result in a semi-automatic cutout mode in the prior art
  • FIG. 4 is a schematic diagram of a cutout result in a semi-automatic cutout mode provided by an embodiment of the present disclosure
  • FIG. 5 is a schematic structural diagram of an image processing device provided by an embodiment of the present disclosure.
  • FIG. 6 is a schematic structural diagram of an image processing device provided by an embodiment of the present disclosure.
  • the cutout mode can be divided into a manual cutout mode, an automatic cutout mode and a semi-automatic cutout mode based on the degree of intelligence.
  • the manual cutout mode refers to generating a cutout result based only on the stroke area manually drawn by the user.
  • the degree of intelligence is low, but the fineness of the cutout is high, and the user can manually select the cutout region of interest.
  • the automatic matting mode refers to the automatic generation of matting results based on matting models or matting algorithms. It is highly intelligent, but the matting results may not meet user needs.
  • the semi-automatic matting mode means that after the user draws the stroke area manually, based on the feature correlation between the pixels in the stroke area and the pixels in the surrounding area, a matting result including the stroke area drawn manually by the user is generated.
  • an embodiment of the present disclosure provides an image processing method. First, in the first cutout mode, when a cutout operation triggered for an image to be processed is received, a cutout result corresponding to the cutout operation is obtained, As the first matting result; then, draw the first matting result on the preset canvas; wherein, the second matting result is drawn on the preset canvas, and the second matting result is at the The matting result of the image to be processed in the second matting mode. Furthermore, based on the first matting result and the second matting result on the preset canvas, a matting effect map of the image to be processed is determined. In the embodiment of the present disclosure, by drawing the matting results of the same image to be processed in different matting modes on the same canvas, the function of matting the same image by using multiple matting modes at the same time is realized.
  • FIG. 1 it is a flowchart of an image processing method provided by an embodiment of the present disclosure. The method includes:
  • the first cutout mode may be any one of a preset automatic cutout mode, a preset manual cutout mode, and a preset semi-automatic cutout mode.
  • the matting result corresponding to the matting operation is obtained as the first matting result.
  • the image cutout operation triggered for the image to be processed may include operations such as clicking or touching a preset automatic image cutout button.
  • the image to be processed is automatically cut out to obtain the first image cutout result.
  • the embodiment of the present disclosure does not limit the manner in which the image to be processed is automatically matted.
  • the cutout operation triggered for the image to be processed may be an operation for the user to draw a stroke on the image to be processed.
  • a matting process is performed based on the stroke area of the stroke to obtain a first matting result.
  • the area corresponding to the first matting result coincides with the stroke area of the stroke.
  • the cutout operation triggered for the image to be processed may also be an operation for the user to draw a stroke on the image to be processed.
  • the matting result including the stroke area is obtained as The first cutout result.
  • the semi-automatic image matting algorithm adopted by the preset semi-automatic image matting mode in the embodiments of the present disclosure is not limited here.
  • S102 Draw the first matting result on the preset canvas; wherein, the second matting result is drawn on the preset canvas, and the second matting result is described in the second matting mode The matting result of the image to be processed.
  • the first matting result corresponding to the matting operation is obtained, the first matting result is drawn on a preset canvas.
  • the matting results of the same image to be processed in different matting modes are all drawn on the same canvas, that is, the preset canvas in the embodiment of the present disclosure, so as to ensure that different matting modes can be used for image processing.
  • the function of performing matting processing on the same image to be processed meets the diverse matting needs of users.
  • the preset canvas contains an image drawn based on the matting result of the image to be processed in the second matting mode
  • the first matting result in the first matting mode for the pending mode is obtained Afterwards, the first matting result in the first matting mode is drawn on the preset canvas.
  • the pixels drawn in the overlapping area on the preset canvas can be The opacity value of the point is set. Specifically, among the pixels having the same position coordinates in the first matting result in the first matting mode and the drawn image on the preset canvas, the transparency value of the pixel with a larger transparency value can be determined as the preset Set the transparency value of the pixel point on the canvas at the same position coordinates, so as to avoid the transparency of the overlapping area being lower than that of other areas, which will affect the display effect of the matting result.
  • the first pixel in the first matting result in the first matting mode has the same position coordinates as the second pixel in the drawn image on the preset canvas
  • the first pixel and the second pixel are determined
  • the greater transparency value among the transparency values of the two pixels is used as the transparency value of the pixel at the same position coordinates on the preset canvas.
  • draw the first matting result on the preset canvas based on the transparency values of the pixels on the preset canvas.
  • FIG. 2 it is a schematic diagram of drawing matting results on a preset canvas provided by an embodiment of the present disclosure, wherein, for the preset automatic matting mode, the preset manual matting mode and the preset semi-automatic matting mode
  • the matting results can be output to the same preset canvas, so as to ensure the matting effect of the image to be processed based on the preset canvas, and improve the matting effect for the matting effect of multiple matting modes at the same time. Cutout user experience.
  • the embodiment of the present disclosure after the matting results of the same image to be processed in different matting modes are drawn on the preset canvas, based on the image drawn on the preset canvas, the matting effect of the image to be processed is displayed picture. Since the image drawn on the preset canvas contains the matting results for the same image to be processed in each matting mode, the embodiment of the present disclosure can realize matting processing on the same image by using multiple matting modes at the same time Function.
  • the matting result corresponding to the matting operation is obtained as the first matting Figure results. Then, the first matting result is drawn on a preset canvas, wherein a second matting result is drawn on the preset canvas, and the second matting result is the to-be-processed result in the second matting mode. The matting result of the image. Furthermore, based on the first matting result and the second matting result on the preset canvas, a matting effect map of the image to be processed is determined. In the embodiment of the present disclosure, by drawing the matting results of the same image to be processed in different matting modes on the same canvas, the function of matting the same image by using multiple matting modes at the same time is realized.
  • the embodiment of the present disclosure provides a method for obtaining a cutout result in a preset semi-automatic cutout mode. Specifically, in the preset semi-automatic cutout mode, the cutout result corresponding to the current cutout operation The determination of is not only related to the stroke area drawn by the user this time, but also related to the previous matting result corresponding to the current matting operation.
  • FIG. 3 it is a schematic diagram of a cutout result in a semi-automatic cutout mode in the prior art, wherein the semi-automatic cutout mode corresponds to the “quick cutout” button in FIG. 3 .
  • the gap in Figure 3 is not drawn, but in fact the gap in Figure 3 belongs to the matting area of interest of the matting user. Therefore, in the semi-automatic matting mode, it can automatically The seam is identified as being included in the matting result corresponding to the current matting operation.
  • the embodiment of the present disclosure needs to at least store the previous image cutout result corresponding to the current image cutout operation in the preset semi-automatic image cutout mode.
  • the stroke area corresponding to the matting operation is obtained, and the previous matting result corresponding to the matting operation is obtained.
  • the stroke area, the previous matting result and the image to be processed are used as input parameters of the preset semi-automatic matting algorithm, and after processing according to the preset semi-automatic matting algorithm, the corresponding matting operation is obtained.
  • the result map of the matting algorithm is used as input parameters of the preset semi-automatic matting algorithm.
  • the preset semi-automatic matting algorithm is used based on the stroke area corresponding to the current matting operation, the previous matting result, and the to-be-processed
  • the object is to determine the matting algorithm result map corresponding to the matting operation, wherein the preset semi-automatic matting algorithm can identify the gap as shown in FIG. 3 as being included in the matting result corresponding to the matting operation.
  • the previous cutout result can be the cutout result generated by the user clicking the "Smart Cutout” button to enter the automatic cutout mode, or the result generated by the user clicking the "Quick Cutout” button to enter the semi-automatic cutout mode
  • the cutout result after the user clicks the "Quick Cutout” button again to enter the preset semi-automatic cutout mode, obtain the stroke area drawn by the user this time, and use the preset semi-automatic cutout algorithm based on the previous cutout result, the stroke area and the object to be processed determine the result map of the matting algorithm.
  • FIG. 4 it is a schematic diagram of the cutout result in the semi-automatic cutout mode obtained after the processing of the embodiment of the present disclosure. It can be seen that in the semi-automatic cutout mode, the gap shown in FIG. 3 can be automatically identified as included in the current In the cutout result corresponding to the cutout operation.
  • the preset array in the semi-automatic matting mode, can be used to store the matting results corresponding to each step of the matting operation according to the execution order of the matting operation, so as to be used to determine the semi-automatic The cutout result of the current cutout operation in cutout mode.
  • the semi-automatic image cutout mode has the function of undo operation (undo operation), as shown in FIG. 4 , the undo operation corresponds to the sign of "retracting forward".
  • the embodiment of the present disclosure can implement the undo operation based on the cutout results corresponding to the cutout operations stored in the preset array in order of execution. Specifically, when an undo operation for any image cutout operation is received, the cutout result corresponding to the cutout operation in the preset array may be marked as a revocation flag to indicate that the cutout result has performed the undo operation.
  • the matting result with the undo flag in the preset array is deleted, and the matting result corresponding to the newly added stroke operation is stored in the In the preset array, to ensure that when the undo operation is performed again, the undo is to the valid cutout result, not the cutout result with the undo flag.
  • the matting algorithm result image output by the preset semi-automatic matting algorithm is a small image, usually with a size smaller than 512*512, to save system computing resources.
  • the matting result drawn on the preset canvas is a large image, usually with a size of 2048*1080.
  • the small image is first enlarged to obtain the corresponding large image. Therefore, the embodiments of the present disclosure can save computing resources of the system under the premise of ensuring the user experience in the semi-automatic cutout mode.
  • the embodiments of the present disclosure firstly perform Gaussian blur processing on the result map of the matting algorithm corresponding to the matting operation to obtain the result map of the Gaussian blur. Then, after the Gaussian blur result map is enlarged according to a preset multiple, binarization processing is performed to obtain a cutout result corresponding to the cutout operation. After binarization processing, the edges and corners of the matting result can be made clear, thereby improving the quality of the matting effect map of the image to be processed.
  • the operator (m, n) can be used to perform 1 to 3 passes of Gaussian blur processing on the map matting algorithm result image, where m and n both belong to any value in 3 to 5.
  • any value in the range of 0.6-0.8 may be used as the threshold of the binarization process, so as to obtain a cutout effect map with clear edges and corners.
  • the matting algorithm result map output by the preset semi-automatic matting algorithm in the semi-automatic matting mode is a small image, and the small image is enlarged and drawn before being drawn on the preset canvas, Therefore, on the premise of ensuring the user experience, the computing resources of the system are saved.
  • the embodiment of the present disclosure can also reduce the jaggedness of the result map of the matting algorithm by performing Gaussian blur processing on the result map of the matting algorithm, and improve the quality of the matting effect map of the image to be processed.
  • the embodiment of the present disclosure can also obtain a cutout effect map with sharp edges and corners through binarization processing, which further improves the quality of the cutout effect map of the image to be processed.
  • FIG. 5 it is a schematic structural diagram of an image processing device provided by an embodiment of the present disclosure, and the device includes:
  • the obtaining module 501 is configured to obtain a cutout result corresponding to the cutout operation as a first cutout result in response to a cutout operation triggered for the image to be processed in the first cutout mode;
  • a drawing module 502 configured to draw the first matting result on a preset canvas; wherein, a second matting result is drawn on the preset canvas, and the second matting result is in the second matting The matting result of the image to be processed in the mode;
  • the first determining module 503 is configured to determine a cutout effect map of the image to be processed based on the first cutout result and the second cutout result on the preset canvas.
  • the first cutout mode and the second cutout mode respectively belong to one of the preset automatic cutout mode, the preset manual cutout mode and the preset semi-automatic cutout mode A cutout mode, and the first cutout mode and the second cutout mode belong to different cutout modes.
  • the first cutout mode belongs to a preset semi-automatic cutout mode
  • the obtaining module includes:
  • the first acquisition submodule is configured to acquire the stroke area corresponding to the matting operation in response to the matting operation triggered for the image to be processed in the preset semi-automatic matting mode, and obtain the stroke area corresponding to the matting operation The previous matting result of ;
  • the processing sub-module is used to input the stroke area, the previous matting result and the image to be processed into a preset semi-automatic matting algorithm, and output the result after being processed by the preset semi-automatic matting algorithm.
  • the matting algorithm result map corresponding to the matting operation described above;
  • the obtaining sub-module is configured to obtain the matting result corresponding to the matting operation based on the matting algorithm result map corresponding to the matting operation.
  • the previous cutout result corresponding to the cutout operation is stored in a preset array, and the preset array is used to store each cutout in the preset semi-automatic cutout mode according to the order of execution.
  • Mapping results corresponding to the graph operations respectively; the device also includes:
  • a deletion module configured to delete the cutout result with a revocation flag in the preset array; wherein, the revocation mark is marked for the cutout result when the cutout operation corresponding to the cutout result is revoked.
  • the obtaining submodule includes:
  • the Gaussian sub-module is used to perform Gaussian blur processing on the matting algorithm result map corresponding to the matting operation to obtain a Gaussian blurred result map;
  • the binarization sub-module is configured to enlarge the Gaussian blur result image according to a preset multiple, and then perform binarization processing to obtain the image matting result corresponding to the matting operation.
  • the device further includes:
  • the second determination module is used to determine the transparency value of the pixel with the larger transparency value among the pixels having the same position coordinates in the first matting result and the drawn image on the preset canvas as the preset The transparency value of the pixel at the same position coordinates on the canvas; wherein, the drawn image includes the second matting result;
  • drawing module is specifically used for:
  • the matting result corresponding to the matting operation is obtained as the first matting Figure results. Then, the first matting result is drawn on a preset canvas, wherein a second matting result is drawn on the preset canvas, and the second matting result is the to-be-processed result in the second matting mode. The matting result of the image. Furthermore, based on the first matting result and the second matting result on the preset canvas, a matting effect map of the image to be processed is determined. In the embodiment of the present disclosure, by drawing the matting results of the same image to be processed in different matting modes on the same canvas, the function of matting the same image by using multiple matting modes at the same time is realized.
  • an embodiment of the present disclosure also provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are run on a terminal device, the terminal device realizes this The image processing method described in the embodiment is disclosed.
  • Embodiments of the present disclosure further provide a computer program product, including computer programs/instructions, wherein the computer program/instructions implement the image processing method described in the embodiments of the present disclosure when executed by a processor.
  • an embodiment of the present disclosure also provides an image processing device, as shown in FIG. 6 , which may include:
  • Processor 601 , memory 602 , input device 603 and output device 604 The number of processors 601 in the image processing device may be one or more, and one processor is taken as an example in FIG. 6 .
  • the processor 601 , the memory 602 , the input device 603 and the output device 604 may be connected through a bus or in other ways, wherein connection through a bus is taken as an example in FIG. 6 .
  • the memory 602 can be used to store software programs and modules, and the processor 601 executes various functional applications and data processing of the image processing device by running the software programs and modules stored in the memory 602 .
  • the memory 602 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function, and the like.
  • the memory 602 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage devices.
  • the input device 603 can be used to receive input digital or character information, and generate signal input related to user settings and function control of the image processing device.
  • the processor 601 will load the executable files corresponding to the processes of one or more application programs into the memory 602 according to the following instructions, and the processor 601 will run the executable files stored in the memory 602. application programs to realize various functions of the above-mentioned image processing device.

Landscapes

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

Abstract

本公开提供了一种图像处理方法、装置、设备及存储介质,所述方法包括:首先,在第一抠图模式下,当接收到针对待处理图像触发的抠图操作时,获取该抠图操作对应的抠图结果,作为第一抠图结果。然后,将该第一抠图结果绘制在预设画布上,其中,该预设画布上绘制有第二抠图结果,所述第二抠图结果是在第二抠图模式下所述待处理图像的抠图结果。进而,基于所述预设画布上的所述第一抠图结果和所述第二抠图结果,确定待处理图像的抠图效果图。本公开实施例通过将同一张待处理图像在不同抠图模式下的抠图结果绘制在同一张画布上,实现了同时利用多种抠图模式对同一张图像进行抠图处理的功能。

Description

一种图像处理方法、装置、设备及存储介质
本申请要求于2021年8月18日提交中国国家知识产权局、申请号为202110948815.2、申请名称为“一种图像处理方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本公开涉及数据处理领域,尤其涉及一种图像处理方法、装置、设备及存储介质。
背景技术
抠图是图像处理中常用的操作之一,具体是将原始图像中的一部分从原始图像中精确地分离出来,成为单独的图层,作为后续图像处理的重要基础。
目前,基于智能化程度可以将抠图模式划分为手动抠图模式、自动抠图模式和半自动抠图模式,而抠图用户只可以选择其中的一种抠图模式对原始图像进行抠图处理,无法同时利用多种抠图模式对同一张原始图像进行抠图处理。
实际应用中,不同抠图模式具有自身的优势,例如自动抠图模式的智能化程度较高,能够节省用户的抠图时间,而半自动抠图模式和手动抠图模式的抠图精细度较高,能够提高抠图质量。
因此,如何实现同时利用多种抠图模式对同一张原始图像进行抠图处理的功能,是目前亟需解决的技术问题。
发明内容
为了解决上述技术问题或者至少部分地解决上述技术问题,本公开提供了一种图像处理方法、装置、设备及存储介质,通过将不同抠图模式下的抠图结果绘制于同一张画布上,实现了同时利用多种抠图模式对同一张图像进行抠图处理的功能。
第一方面,本公开提供了一种图像处理方法,所述方法包括:
响应于第一抠图模式下针对待处理图像触发的抠图操作,获得所述抠图操 作对应的抠图结果,作为第一抠图结果;
将所述第一抠图结果绘制在预设画布上;其中,所述预设画布上绘制有第二抠图结果,所述第二抠图结果是在第二抠图模式下所述待处理图像的抠图结果;
基于所述预设画布上的所述第一抠图结果和所述第二抠图结果,确定所述待处理图像的抠图效果图。
一种可选的实施方式中,所述第一抠图模式和所述第二抠图模式分别属于预设自动抠图模式、预设手动抠图模式和预设半自动抠图模式中的其中一种抠图模式,且所述第一抠图模式和所述第二抠图模式属于不同的抠图模式。
一种可选的实施方式中,所述第一抠图模式属于预设半自动抠图模式,所述响应于第一抠图模式下针对待处理图像触发的抠图操作,获得所述抠图操作对应的抠图结果,作为第一抠图结果,包括:
响应于在所述预设半自动抠图模式下针对待处理图像触发的抠图操作,获取所述抠图操作对应的笔画区域,以及,获取所述抠图操作对应的前一次抠图结果;
基于所述笔画区域、所述前一次抠图结果和所述待处理图像,并根据预设半自动抠图算法,获取所述抠图操作对应的抠图算法结果图;
基于所述抠图算法结果图,获得所述抠图操作对应的抠图结果,作为第一抠图结果。
一种可选的实施方式中,所述抠图操作对应的前一次抠图结果存储于预设数组中,所述预设数组用于按照执行顺序存储所述预设半自动抠图模式中各个抠图操作分别对应的抠图结果;所述获取所述抠图操作对应的前一次抠图结果之前,还包括:
删除所述预设数组中具有撤销标识的抠图结果;其中,所述撤销标识为在所述抠图结果对应的抠图操作被撤销时为所述抠图结果标记的。
一种可选的实施方式中,所述基于所述抠图算法结果图,获得所述抠图操作对应的抠图结果,作为第一抠图结果,包括:
将所述抠图操作对应的抠图算法结果图进行高斯模糊处理,得到高斯模糊结果图;
将所述高斯模糊结果图按照预设倍数进行放大处理后,执行二值化处理,得到所述抠图操作对应的抠图结果,作为第一抠图结果。
一种可选的实施方式中,所述将所述第一抠图结果绘制在预设画布上之前,还包括:
将所述第一抠图结果与预设画布上的已绘制图像中具有相同位置坐标的像素点中透明度值较大的像素点的透明度值,确定为所述预设画布上处于所述相同位置坐标的像素点的透明度值,其中,所述已绘制图像包括所述第二抠图结果;
相应的,所述将所述第一抠图结果绘制在预设画布上,包括:
基于所述预设画布上的像素点的透明度值,在所述预设画布上绘制所述第一抠图结果。
第二方面,本公开提供了一种图像处理装置,所述装置包括:
获得模块,用于响应于第一抠图模式下针对待处理图像触发的抠图操作,获得所述抠图操作对应的抠图结果,作为第一抠图结果;
绘制模块,用于将所述第一抠图结果绘制在预设画布上;其中,所述预设画布上绘制有第二抠图结果,所述第二抠图结果是在第二抠图模式下所述待处理图像的抠图结果;
确定模块,用于基于所述预设画布上的所述第一抠图结果和所述第二抠图结果,确定所述待处理图像的抠图效果图。
第三方面,本公开提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述指令在终端设备上运行时,使得所述终端设备实现上述的方法。
第四方面,本公开提供了一种设备,包括:存储器,处理器,及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时,实现上述的方法。
第五方面,本公开提供了一种计算机程序产品,所述计算机程序产品包括计算机程序/指令,所述计算机程序/指令被处理器执行时实现上述的方法。
本公开实施例提供的技术方案与现有技术相比至少具有如下优点:
本公开实施例提供了一种图像处理方法,首先,在第一抠图模式下,当接收到针对待处理图像触发的抠图操作时,获取该抠图操作对应的抠图结果,作为第一抠图结果。然后,将第一抠图结果绘制在预设画布上;其中,预设画布上绘制有第二抠图结果,第二抠图结果是在第二抠图模式下待处理图像的抠图结果。进而,基于预设画布上的第一抠图结果和第二抠图结果,确定待处理图像的抠图效果图。本公开实施例通过将同一张待处理图像在不同抠图模式下的抠图结果绘制在同一张画布上,实现了同时利用多种抠图模式对同一张图像进行抠图处理的功能。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。
为了更清楚地说明本公开实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本公开实施例提供的一种图像处理方法的流程图;
图2为本公开实施例提供的一种在预设画布上绘制抠图结果的示意图;
图3为现有技术中的半自动抠图模式下的抠图结果示意图;
图4为本公开实施例提供的一种半自动抠图模式下的抠图结果示意图;
图5为本公开实施例提供的一种图像处理装置的结构示意图;
图6为本公开实施例提供的一种图像处理设备的结构示意图。
具体实施方式
为了能够更清楚地理解本公开的上述目的、特征和优点,下面将对本公开的方案进行进一步描述。需要说明的是,在不冲突的情况下,本公开的实施例及实施例中的特征可以相互组合。
在下面的描述中阐述了很多具体细节以便于充分理解本公开,但本公开还可以采用其他不同于在此描述的方式来实施;显然,说明书中的实施例只是本 公开的一部分实施例,而不是全部的实施例。
目前,基于智能化程度可以将抠图模式划分为手动抠图模式、自动抠图模式和半自动抠图模式。其中,手动抠图模式是指仅基于用户手动绘制的笔画区域生成抠图结果,智能化程度较低,但抠图精细度较高,用户可以手动选择感兴趣的抠图区域。自动抠图模式是指基于抠图模型或抠图算法等自动生成抠图结果,智能化程度较高,但抠图结果可能会不符合用户需求。半自动抠图模式是指用户手动绘制笔画区域后,基于笔画区域内的像素点与周围区域内的像素点的特征相关性,生成包含用户手动绘制的笔画区域的抠图结果。
实际应用中,由于不同的抠图模式具有自身的优势,为了提高抠图效率,同时也保证抠图质量,可以同时利用多种抠图模式对同一张图像进行抠图处理,进而得到符合用户需求的抠图结果。
为此,本公开实施例提供了一种图像处理方法,首先,在第一抠图模式下,当接收到针对待处理图像触发的抠图操作时,获取该抠图操作对应的抠图结果,作为第一抠图结果;然后,将所述第一抠图结果绘制在预设画布上;其中,所述预设画布上绘制有第二抠图结果,所述第二抠图结果是在第二抠图模式下所述待处理图像的抠图结果。进而,基于所述预设画布上的所述第一抠图结果和所述第二抠图结果,确定所述待处理图像的抠图效果图。本公开实施例通过将同一张待处理图像在不同抠图模式下的抠图结果绘制在同一张画布上,实现了同时利用多种抠图模式对同一张图像进行抠图处理的功能。
基于此,本公开实施例提供了一种图像处理方法,参考图1,为本公开实施例提供的一种图像处理方法的流程图,该方法包括:
S101:响应于第一抠图模式下针对待处理图像触发的抠图操作,获得所述抠图操作对应的抠图结果,作为第一抠图结果。
本公开实施例中,第一抠图模式可以为预设自动抠图模式、预设手动抠图模式和预设半自动抠图模式中的任意一种抠图模式。
实际应用中,在第一抠图模式下,如果接收到针对待处理图像触发的抠图 操作,则获得该抠图操作对应的抠图结果,作为第一抠图结果。
一种可选的实施方式中,如果第一抠图模式为预设自动抠图模式,则针对待处理图像触发的抠图操作可以包括诸如点击或触摸预设自动抠图按钮等的操作。相应的,当接收到针对待处理图像点击或触摸预设自动抠图按钮的操作后,对该待处理图像进行自动抠图处理,得到第一抠图结果。其中,本公开实施例对待处理图像进行自动抠图处理的方式不做限制。
另一种可选的实施方式中,如果第一抠图模式为预设手动抠图模式,则针对待处理图像触发的抠图操作可以为用户在待处理图像上绘制一个笔画的操作。相应的,当接收到在待处理图像上绘制一个笔画的操作后,基于该笔画的笔画区域进行抠图处理,得到第一抠图结果。其中,该第一抠图结果对应的区域与该笔画的笔画区域重合。
另一种可选的实施方式中,如果第一抠图模式为预设半自动抠图模式,则针对待处理图像触发的抠图操作也可以为用户在待处理图像上绘制一个笔画的操作。相应的,当接收到在待处理图像上绘制一个笔画的操作后,基于该笔画的笔画区域与周围区域内像素点之间的特征相关性,得到包含该笔画区域在内的抠图结果,作为第一抠图结果。其中,本公开实施例中的预设半自动抠图模式所采用的半自动抠图算法在此不做限制。
S102:将所述第一抠图结果绘制在预设画布上;其中,所述预设画布上绘制有第二抠图结果,所述第二抠图结果是在第二抠图模式下所述待处理图像的抠图结果。
本公开实施例中,在获得该抠图操作对应的第一抠图结果后,将该第一抠图结果绘制在预设画布上。
实际应用中,针对同一张待处理图像在不同抠图模式下的抠图结果均绘制于同一张画布上,即本公开实施例中的预设画布上,从而保证可以实现采用不同抠图模式对同一张待处理图像进行抠图处理的功能,满足了用户的多样化的抠图需求。
实际应用中,假设预设画布上包含有基于待处理图像在第二抠图模式下的 抠图结果绘制的图像,则获得第一抠图模式下针对该待处理模式下的第一抠图结果之后,将第一抠图模式下的第一抠图结果绘制在该预设画布上。
实际应用中,如果第一抠图模式下的第一抠图结果与预设画布上的已绘制图像具有重叠区域,则为了保证绘制效果,可以对绘制在预设画布上的重叠区域内的像素点的透明度值进行设置。具体的,可以将第一抠图模式下的第一抠图结果与预设画布上的已绘制图像中具有相同位置坐标的像素点中,透明度值较大的像素点的透明度值,确定为预设画布上处于该相同位置坐标的像素点的透明度值,以避免重叠区域的透明度低于其他区域的透明度,影响抠图结果的显示效果。
例如,假设第一抠图模式下的第一抠图结果中的第一像素点,与预设画布上的已绘制图像中的第二像素点具有相同位置坐标,则确定第一像素点和第二像素点的透明度值中较大的透明度值,作为预设画布上处于该相同位置坐标的像素点的透明度值。然后,基于所述预设画布上的像素点的透明度值,在所述预设画布上绘制所述第一抠图结果。
如图2所示,为本公开实施例提供的一种在预设画布上绘制抠图结果的示意图,其中,针对预设自动抠图模式、预设手动抠图模式和预设半自动抠图模式的抠图结果,均可以输出至同一张预设画布上,从而保证基于该预设画布显示的待处理图像的抠图效果图,为同时采用多种抠图模式的抠图效果图,提高了抠图用户的使用体验。
S103:基于所述预设画布上的所述第一抠图结果和所述第二抠图结果,确定所述待处理图像的抠图效果图。
本公开实施例中,在将不同抠图模式下针对同一张待处理图像的抠图结果绘制在预设画布上之后,基于该预设画布上绘制的图像,显示该待处理图像的抠图效果图。由于该预设画布上绘制的图像包含各个抠图模式下针对同一张待处理图像的抠图结果,因此,本公开实施例能够实现同时利用多种抠图模式对同一张图像进行抠图处理的功能。
本公开实施例提供的图像处理方法中,首先,在第一抠图模式下,当接收 到针对待处理图像触发的抠图操作时,获取该抠图操作对应的抠图结果,作为第一抠图结果。然后,将该第一抠图结果绘制在预设画布上,其中,该预设画布上绘制有第二抠图结果,所述第二抠图结果是在第二抠图模式下所述待处理图像的抠图结果。进而,基于所述预设画布上的所述第一抠图结果和所述第二抠图结果,确定待处理图像的抠图效果图。本公开实施例通过将同一张待处理图像在不同抠图模式下的抠图结果绘制在同一张画布上,实现了同时利用多种抠图模式对同一张图像进行抠图处理的功能。
基于上述方法实施例,本公开实施例提供了一种预设半自动抠图模式下的抠图结果获取方法,具体的,在预设半自动抠图模式下,当前的抠图操作对应的抠图结果的确定不仅与本次用户绘制的笔画区域有关,还与当前的抠图操作对应的前一次抠图结果有关。
如图3所示,为现有技术中的半自动抠图模式下的抠图结果示意图,其中,半自动抠图模式对应于图3中的“快速抠图”按钮。当前的抠图操作对应的前一次抠图结果与当前的抠图操作对应的第一抠图结果中存在缝隙,如图3中所示。通常,由于用户操作精细度的限制,导致图3中的缝隙未被绘制,而事实上图3中的缝隙属于抠图用户的感兴趣抠图区域,为此,在半自动抠图模式下可以自动将该缝隙识别为包含于当前的抠图操作对应的抠图结果中。
为了实现上述功能,本公开实施例在预设半自动抠图模式下至少需要存储当前的抠图操作对应的前一次抠图结果。在接收到预设半自动抠图模式下针对待处理图像触发的抠图操作,获取所述抠图操作对应的笔画区域,以及,获取所述抠图操作对应的前一次抠图结果。然后,将所述笔画区域、所述前一次抠图结果和所述待处理图像作为预设半自动抠图算法的输入参数,根据预设半自动抠图算法进行处理后,得到所述抠图操作对应的抠图算法结果图。
值得注意的是,本公开实施例对于预设半自动抠图算法的实现方式不做限制,预设半自动抠图算法用于基于当前的抠图操作对应的笔画区域、前一次抠图结果和待处理对象,确定该抠图操作对应的抠图算法结果图,其中,预设半 自动抠图算法可以将如图3所示的缝隙识别为包含于该抠图操作对应的抠图结果中。如图4所示,前一次抠图结果可以为用户点击“智能抠图”按钮进入自动抠图模式产生的抠图结果,也可以为用户点击“快速抠图”按钮进入半自动抠图模式产生的抠图结果,在用户再次点击“快速抠图”按钮进入预设半自动抠图模式后,获取用户本次绘制的笔画区域,并利用预设半自动抠图算法基于前一次抠图结果、该笔画区域和待处理对象确定抠图算法结果图。如图4所示,为经过本公开实施例处理后得到的半自动抠图模式下的抠图结果示意图,可见,在半自动抠图模式下可以自动将图3所示的缝隙识别为包含于当前的抠图操作对应的抠图结果中。
一种可选的实施方式中,在半自动抠图模式下,可以利用预设数组按照抠图操作的执行顺序,对每一步的抠图操作分别对应的抠图结果进行存储,以便用于确定半自动抠图模式下当前的抠图操作的抠图结果。
实际应用中,半自动抠图模式具有撤销操作(undo操作)的功能,如图4所示,undo操作对应于“向前回撤”标识。本公开实施例可以基于预设数组中按照执行顺序存储的各个抠图操作分别对应的抠图结果,实现撤销操作。具体的,在接收到针对任一抠图操作的撤销操作时,可以将预设数组中的该抠图操作对应的抠图结果标记为撤销标识,以表示该抠图结果已执行撤销操作。
实际应用中,在半自动抠图模式下,当接收到新增的笔画操作时,删除预设数组中具有撤销标识的抠图结果,并将该新增的笔画操作对应的抠图结果存储于该预设数组中,以保证再次执行撤销操作时,撤销至有效的抠图结果,而不是具有撤销标识的抠图结果。
另外,实际应用中,在半自动抠图模式下,预设半自动抠图算法输出的抠图算法结果图为小图,通常尺寸为小于512*512的图片,以节省系统计算资源。而绘制在预设画布上的抠图结果为大图,通常尺寸为2048*1080的图片。为此,在将抠图算法结果图绘制于预设画布上之前,首先将小图放大得到对应的大图。因此,本公开实施例在半自动抠图模式下可以在保证用户体验的前提下,节省 系统的计算资源。
具体的,为了减少抠图算法结果图(即小图)的锯齿,本公开实施例首先将所述抠图操作对应的抠图算法结果图进行高斯模糊处理,得到高斯模糊结果图。然后,将所述高斯模糊结果图按照预设倍数进行放大处理后,执行二值化处理,得到所述抠图操作对应的抠图结果。经过二值化处理后能够使得抠图结果的棱角分明,从而提高了待处理图像的抠图效果图的质量。
一种可选的实施方式中,可以利用算子(m,n)对抠图算法结果图执行1至3遍的高斯模糊处理,其中,m,n均属于3至5中的任意值。
另一种可选的实施方式中,可以利用0.6-0.8中的任意值作为二值化处理的阈值,从而得到棱角分明的抠图效果图。
本公开实施例提供的图像处理方法中,在半自动抠图模式下的预设半自动抠图算法输出的抠图算法结果图为小图,而在绘制到预设画布之前才将小图放大绘制,从而在保证用户体验的前提下,节省了系统的计算资源。
另外,本公开实施例还可以通过对抠图算法结果图进行高斯模糊处理,减少抠图算法结果图的锯齿,提高了待处理图像的抠图效果图的质量。
另外,本公开实施例还可以通过二值化处理得到棱角分明的抠图效果图,进一步提高了待处理图像的抠图效果图的质量。
基于上述方法实施例,本公开还提供了一种图像处理装置,参考图5,为本公开实施例提供的一种图像处理装置的结构示意图,所述装置包括:
获得模块501,用于响应于第一抠图模式下针对待处理图像触发的抠图操作,获得所述抠图操作对应的抠图结果,作为第一抠图结果;
绘制模块502,用于将所述第一抠图结果绘制在预设画布上;其中,所述预设画布上绘制有第二抠图结果,所述第二抠图结果是在第二抠图模式下所述待处理图像的抠图结果;
第一确定模块503,用于基于所述预设画布上的所述第一抠图结果和所述第二抠图结果,确定所述待处理图像的抠图效果图。
一种可选的实施方式中,所述第一抠图模式和所述第二抠图模式分别属于预设自动抠图模式、预设手动抠图模式和预设半自动抠图模式中的其中一种抠图模式,且所述第一抠图模式和所述第二抠图模式属于不同的抠图模式。
一种可选的实施方式中,所述第一抠图模式属于预设半自动抠图模式,所述获得模块,包括:
第一获取子模块,用于响应于在所述预设半自动抠图模式下针对待处理图像触发的抠图操作,获取所述抠图操作对应的笔画区域,以及,获取所述抠图操作对应的前一次抠图结果;
处理子模块,用于将所述笔画区域、所述前一次抠图结果和所述待处理图像输入至预设半自动抠图算法中,经过所述预设半自动抠图算法的处理后,输出所述抠图操作对应的抠图算法结果图;
获得子模块,用于基于所述抠图操作对应的抠图算法结果图,获得所述抠图操作对应的抠图结果。
一种可选的实施方式中,所述抠图操作对应的前一次抠图结果存储于预设数组中,所述预设数组用于按照执行顺序存储所述预设半自动抠图模式中各个抠图操作分别对应的抠图结果;所述装置还包括:
删除模块,用于删除所述预设数组中具有撤销标识的抠图结果;其中,所述撤销标识为在所述抠图结果对应的抠图操作被撤销时为所述抠图结果标记的。
一种可选的实施方式中,所述获得子模块,包括:
高斯子模块,用于将所述抠图操作对应的抠图算法结果图进行高斯模糊处理,得到高斯模糊结果图;
二值化子模块,用于将所述高斯模糊结果图按照预设倍数进行放大处理后,执行二值化处理,得到所述抠图操作对应的抠图结果。
一种可选的实施方式中,所述装置还包括:
第二确定模块,用于将所述第一抠图结果与预设画布上的已绘制图像中具有相同位置坐标的像素点中透明度值较大的像素点的透明度值,确定为所述预 设画布上处于所述相同位置坐标的像素点的透明度值;其中,所述已绘制图像包括所述第二抠图结果;
相应的,所述绘制模块,具体用于:
基于所述预设画布上的像素点的透明度值,在所述预设画布上绘制所述第一抠图结果。
本公开实施例提供的图像处理装置中,首先,在第一抠图模式下,当接收到针对待处理图像触发的抠图操作时,获取该抠图操作对应的抠图结果,作为第一抠图结果。然后,将该第一抠图结果绘制在预设画布上,其中,该预设画布上绘制有第二抠图结果,所述第二抠图结果是在第二抠图模式下所述待处理图像的抠图结果。进而,基于所述预设画布上的所述第一抠图结果和所述第二抠图结果,确定所述待处理图像的抠图效果图。本公开实施例通过将同一张待处理图像在不同抠图模式下的抠图结果绘制在同一张画布上,实现了同时利用多种抠图模式对同一张图像进行抠图处理的功能。
除了上述方法和装置以外,本公开实施例还提供了一种计算机可读存储介质,计算机可读存储介质中存储有指令,当所述指令在终端设备上运行时,使得所述终端设备实现本公开实施例所述的图像处理方法。
本公开实施例还提供了一种计算机程序产品,包括计算机程序/指令,其特征在于,该计算机程序/指令被处理器执行时实现本公开实施例所述的图像处理方法。
另外,本公开实施例还提供了一种图像处理设备,参见图6所示,可以包括:
处理器601、存储器602、输入装置603和输出装置604。图像处理设备中的处理器601的数量可以一个或多个,图6中以一个处理器为例。在本公开的一些实施例中,处理器601、存储器602、输入装置603和输出装置604可通过总线或其它方式连接,其中,图6中以通过总线连接为例。
存储器602可用于存储软件程序以及模块,处理器601通过运行存储在存储器602的软件程序以及模块,从而执行图像处理设备的各种功能应用以及数据处理。存储器602可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序等。此外,存储器602可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。输入装置603可用于接收输入的数字或字符信息,以及产生与图像处理设备的用户设置以及功能控制有关的信号输入。
具体在本实施例中,处理器601会按照如下的指令,将一个或一个以上的应用程序的进程对应的可执行文件加载到存储器602中,并由处理器601来运行存储在存储器602中的应用程序,从而实现上述图像处理设备的各种功能。
需要说明的是,在本文中,诸如“第一”和“第二”等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上所述仅是本公开的具体实施方式,使本领域技术人员能够理解或实现本公开。对这些实施例的多种修改对本领域的技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本公开的精神或范围的情况下,在其它实施例中实现。因此,本公开将不会被限制于本文所述的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。

Claims (10)

  1. 一种图像处理方法,其特征在于,所述方法包括:
    响应于第一抠图模式下针对待处理图像触发的抠图操作,获得所述抠图操作对应的抠图结果,作为第一抠图结果;
    将所述第一抠图结果绘制在预设画布上;其中,所述预设画布上绘制有第二抠图结果,所述第二抠图结果是在第二抠图模式下所述待处理图像的抠图结果;
    基于所述预设画布上的所述第一抠图结果和所述第二抠图结果,确定所述待处理图像的抠图效果图。
  2. 根据权利要求1所述的方法,其特征在于,所述第一抠图模式和所述第二抠图模式分别属于预设自动抠图模式、预设手动抠图模式和预设半自动抠图模式中的其中一种抠图模式,且所述第一抠图模式和所述第二抠图模式属于不同的抠图模式。
  3. 根据权利要求1所述的方法,其特征在于,所述第一抠图模式属于预设半自动抠图模式,所述响应于第一抠图模式下针对待处理图像触发的抠图操作,获得所述抠图操作对应的抠图结果,作为第一抠图结果,包括:
    响应于在所述预设半自动抠图模式下针对待处理图像触发的抠图操作,获取所述抠图操作对应的笔画区域,以及,获取所述抠图操作对应的前一次抠图结果;
    基于所述笔画区域、所述前一次抠图结果和所述待处理图像,并根据预设半自动抠图算法,获取所述抠图操作对应的抠图算法结果图;
    基于所述抠图算法结果图,获得所述抠图操作对应的抠图结果,作为第一抠图结果。
  4. 根据权利要求3所述的方法,其特征在于,所述抠图操作对应的前一次抠图结果存储于预设数组中,所述预设数组用于按照执行顺序存储所述预设半自动抠图模式中各个抠图操作分别对应的抠图结果;
    所述获取所述抠图操作对应的前一次抠图结果之前,还包括:
    删除所述预设数组中具有撤销标识的抠图结果;其中,所述撤销标识为在所述抠图结果对应的抠图操作被撤销时为所述抠图结果标记的。
  5. 根据权利要求3所述的方法,其特征在于,所述基于所述抠图算法结果图,获得所述抠图操作对应的抠图结果,作为第一抠图结果,包括:
    将所述抠图算法结果图进行高斯模糊处理,得到高斯模糊结果图;
    将所述高斯模糊结果图按照预设倍数进行放大处理后,执行二值化处理,得到所述抠图操作对应的抠图结果,作为第一抠图结果。
  6. 根据权利要求1所述的方法,其特征在于,所述将所述第一抠图结果绘制在预设画布上之前,还包括:
    将所述第一抠图结果与预设画布上的已绘制图像中具有相同位置坐标的像素点中透明度值较大的像素点的透明度值,确定为所述预设画布上处于所述相同位置坐标的像素点的透明度值;其中,所述已绘制图像包括所述第二抠图结果;
    相应的,所述将所述第一抠图结果绘制在预设画布上,包括:
    基于所述预设画布上的像素点的透明度值,在所述预设画布上绘制所述第一抠图结果。
  7. 一种图像处理装置,其特征在于,所述装置包括:
    获得模块,用于响应于第一抠图模式下针对待处理图像触发的抠图操作,获得所述抠图操作对应的抠图结果,作为第一抠图结果;
    绘制模块,用于将所述第一抠图结果绘制在预设画布上;其中,所述预设画布上绘制有第二抠图结果,所述第二抠图结果是在第二抠图模式下所述待处理图像的抠图结果;
    第一确定模块,用于基于所述预设画布上的所述第一抠图结果和所述第二抠图结果,确定所述待处理图像的抠图效果图。
  8. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有指令,当所述指令在终端设备上运行时,使得所述终端设备实现如权利要求1-6任一项所述的方法。
  9. 一种设备,其特征在于,包括:存储器,处理器,及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时,实现如权利要求1-6任一项所述的方法。
  10. 一种计算机程序产品,其特征在于,所述计算机程序产品包括计算机程序或者指令,所述计算机程序或者指令被处理器执行时实现如权利要求1-6任一项所述的方法。
PCT/CN2022/110798 2021-08-18 2022-08-08 一种图像处理方法、装置、设备及存储介质 WO2023020316A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
EP22857628.6A EP4369296A1 (en) 2021-08-18 2022-08-08 Image processing method and apparatus, and device and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110948815.2 2021-08-18
CN202110948815.2A CN115708126A (zh) 2021-08-18 2021-08-18 一种图像处理方法、装置、设备及存储介质

Publications (1)

Publication Number Publication Date
WO2023020316A1 true WO2023020316A1 (zh) 2023-02-23

Family

ID=85212495

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/110798 WO2023020316A1 (zh) 2021-08-18 2022-08-08 一种图像处理方法、装置、设备及存储介质

Country Status (3)

Country Link
EP (1) EP4369296A1 (zh)
CN (1) CN115708126A (zh)
WO (1) WO2023020316A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108460770A (zh) * 2016-12-13 2018-08-28 华为技术有限公司 抠图方法及装置
CN108596913A (zh) * 2018-03-28 2018-09-28 众安信息技术服务有限公司 一种抠图方法及装置
CN110751655A (zh) * 2019-09-16 2020-02-04 南京工程学院 一种基于语义分割和显著性分析的自动抠图方法
CN111179285A (zh) * 2019-12-31 2020-05-19 珠海方图智能科技有限公司 一种图像处理方法、系统及存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108460770A (zh) * 2016-12-13 2018-08-28 华为技术有限公司 抠图方法及装置
CN108596913A (zh) * 2018-03-28 2018-09-28 众安信息技术服务有限公司 一种抠图方法及装置
CN110751655A (zh) * 2019-09-16 2020-02-04 南京工程学院 一种基于语义分割和显著性分析的自动抠图方法
CN111179285A (zh) * 2019-12-31 2020-05-19 珠海方图智能科技有限公司 一种图像处理方法、系统及存储介质

Also Published As

Publication number Publication date
EP4369296A1 (en) 2024-05-15
CN115708126A (zh) 2023-02-21

Similar Documents

Publication Publication Date Title
JP7453471B2 (ja) ピクチャ処理方法、装置、デバイス及び記憶媒体
WO2016112619A1 (zh) 一种实现区域屏幕截图的方法、装置和终端
US10152213B2 (en) Techniques for selecting objects in images
CN107844953B (zh) 会议文件的管理方法、装置、终端和计算机可读存储介质
WO2022001648A1 (zh) 图像处理方法、装置、设备及介质
JP3725368B2 (ja) 画像の表示択方法、コンピュータ・システムおよび記録媒体
CN112055244B (zh) 图像获取方法、装置、服务器和电子设备
JP5704863B2 (ja) 画像処理装置、画像処理方法及び記憶媒体
WO2022206476A1 (zh) 水印处理方法、装置、电子设备及介质
WO2023273700A1 (zh) 一种交互窗口显示方法、装置、设备及存储介质
WO2023020316A1 (zh) 一种图像处理方法、装置、设备及存储介质
CN113538623A (zh) 确定目标图像的方法、装置、电子设备及存储介质
WO2022160946A1 (zh) 一种文字的阴影效果处理方法、装置、设备及存储介质
US20240355013A1 (en) Image processing method, apparatus, device and storage medium
CN110458202B (zh) 图片处理方法、装置、设备及计算机可读存储介质
CN112784541A (zh) 一种文档中图片的替换方法、装置、电子设备及存储介质
US20170017370A1 (en) Device and method for processing data
WO2017054637A1 (zh) 图像处理方法及系统
WO2022228373A1 (zh) 图片管理方法、装置、电子设备和可读存储介质
CN113452920B (zh) 一种对焦点确定方法、装置、设备及介质
CN112465931B (zh) 图像文本抹除方法、相关设备及可读存储介质
CN110427153B (zh) 书写内容显示方法、装置、设备及介质
CN114879897B (zh) 一种笔画处理方法、装置、设备及存储介质
CN111754487B (zh) 一种黑框区域裁剪方法、装置及电子设备
WO2023016310A1 (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: 22857628

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 18682400

Country of ref document: US

WWE Wipo information: entry into national phase

Ref document number: 2022857628

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2022857628

Country of ref document: EP

Effective date: 20240209

NENP Non-entry into the national phase

Ref country code: DE