CN114792285A - Image processing method and processing device, electronic device and readable storage medium - Google Patents
Image processing method and processing device, electronic device and readable storage medium Download PDFInfo
- Publication number
- CN114792285A CN114792285A CN202210420012.4A CN202210420012A CN114792285A CN 114792285 A CN114792285 A CN 114792285A CN 202210420012 A CN202210420012 A CN 202210420012A CN 114792285 A CN114792285 A CN 114792285A
- Authority
- CN
- China
- Prior art keywords
- image
- area
- target area
- erasing
- training
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/04—Context-preserving transformations, e.g. by using an importance map
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
- G06N3/084—Backpropagation, e.g. using gradient descent
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/77—Retouching; Inpainting; Scratch removal
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20084—Artificial neural networks [ANN]
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Editing Of Facsimile Originals (AREA)
- Processing Or Creating Images (AREA)
Abstract
本申请公开了一种图像处理方法和处理装置、电子设备和可读存储介质。图像处理方法,包括:在第一图像中定位目标区域,得到目标区域的位置信息;擦除第一图像中预设区域的图像信息,得到擦除后的第二图像,其中,第二图像的尺寸与第一图像相同,预设区域包括目标区域;根据位置信息,在第二图像中截取与目标区域对应的区域图像;根据区域图像和第一图像,生成处理后的目标图像。
The present application discloses an image processing method and processing device, an electronic device and a readable storage medium. The image processing method includes: locating a target area in a first image to obtain position information of the target area; erasing image information of a preset area in the first image to obtain an erased second image, wherein the second image is The size is the same as that of the first image, and the preset area includes the target area; according to the position information, an area image corresponding to the target area is intercepted in the second image; and a processed target image is generated according to the area image and the first image.
Description
技术领域technical field
本申请属于图像处理技术领域,具体涉及一种图像处理方法和处理装置、电子设备和可读存储介质。The present application belongs to the technical field of image processing, and in particular relates to an image processing method and processing device, an electronic device and a readable storage medium.
背景技术Background technique
在相关技术中,用户有时会有对图片中的特定内容进行抹除或隐藏的需求,如抹除图片中的文字。In the related art, users sometimes have a need to erase or hide specific content in the picture, such as erasing the text in the picture.
现有的处理方法,如通过图像修复的方式抹除特定的区域,其只利用了抹除区域的纹理信息,导致抹除效果差,会在图片上留下明显的修复痕迹。而如果使用深度学习的方式处理图片,能够减少修复痕迹,但是容易将图片中其他与特定区域内容相近的区域一并抹除,处理效果不好。Existing processing methods, such as erasing a specific area by means of image restoration, only utilizes the texture information of the erased area, resulting in poor erasing effect and leaving obvious restoration marks on the picture. If you use deep learning to process pictures, you can reduce the repair marks, but it is easy to erase other areas in the picture that are similar to the content of a specific area, and the processing effect is not good.
发明内容SUMMARY OF THE INVENTION
本申请实施例的目的是提供一种图像处理方法和处理装置、电子设备和可读存储介质,能够解决现有技术中抹除图像内容处理效果不好的问题。The purpose of the embodiments of the present application is to provide an image processing method and processing device, an electronic device and a readable storage medium, which can solve the problem of poor processing effect of erasing image content in the prior art.
第一方面,本申请实施例提供了一种图像处理方法,包括:In a first aspect, an embodiment of the present application provides an image processing method, including:
在第一图像中定位目标区域,得到目标区域的位置信息;Locate the target area in the first image, and obtain the location information of the target area;
通过图像处理模型,擦除第一图像中预设区域的图像信息,得到擦除后的第二图像,其中,第二图像的尺寸与第一图像相同,预设区域包括目标区域;By using the image processing model, the image information of the preset area in the first image is erased, and the erased second image is obtained, wherein the size of the second image is the same as that of the first image, and the preset area includes the target area;
根据位置信息,在第二图像中截取与目标区域对应的区域图像;According to the position information, intercept the area image corresponding to the target area in the second image;
根据区域图像和第一图像,生成处理后的目标图像。Based on the area image and the first image, a processed target image is generated.
第二方面,本申请实施例提供了一种图像处理装置,包括:In a second aspect, an embodiment of the present application provides an image processing apparatus, including:
定位模块,用于在第一图像中定位目标区域,得到目标区域的位置信息;a positioning module, used to locate the target area in the first image, and obtain the position information of the target area;
擦除模块,用于通过图像处理模型,擦除第一图像中预设区域的图像信息,得到擦除后的第二图像,其中,第二图像的尺寸与第一图像相同,预设区域包括目标区域;The erasing module is used for erasing the image information of the preset area in the first image through the image processing model to obtain the erased second image, wherein the size of the second image is the same as that of the first image, and the preset area includes target area;
截取模块,用于根据位置信息,在第二图像中截取与目标区域对应的区域图像;an interception module, configured to intercept an area image corresponding to the target area in the second image according to the position information;
处理模块,用于根据区域图像和第一图像,生成处理后的目标图像。The processing module is used for generating the processed target image according to the area image and the first image.
第三方面,本申请实施例提供了一种电子设备,包括处理器和存储器,存储器存储可在处理器上运行的程序或指令,程序或指令被处理器执行时实现如第一方面的方法的步骤。In a third aspect, embodiments of the present application provide an electronic device, including a processor and a memory, where the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the method of the first aspect is implemented step.
第四方面,本申请实施例提供了一种可读存储介质,该可读存储介质上存储程序或指令,该程序或指令被处理器执行时实现如第一方面的方法的步骤。In a fourth aspect, an embodiment of the present application provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or instruction is executed by a processor, the steps of the method of the first aspect are implemented.
第五方面,本申请实施例提供了一种芯片,该芯片包括处理器和通信接口,该通信接口和该处理器耦合,该处理器用于运行程序或指令,实现如第一方面的方法的步骤。In a fifth aspect, an embodiment of the present application provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to run a program or an instruction to implement the steps of the method of the first aspect .
第六方面,本申请实施例提供一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一个处理器执行以实现如第一方面所述的方法。In a sixth aspect, an embodiment of the present application provides a computer program product, where the program product is stored in a storage medium, and the program product is executed by at least one processor to implement the method according to the first aspect.
在本申请实施例中,首先对需要处理的图像区域进行定位,并记录位置信息。然后,通过对抗模型,对第一图像整体进行图像处理,该图像处理的步骤基于图像识别技术和深度学习技术,模型通过自动识别需要处理的部分,并根据第一图像的全局信息,对需要处理的预设区域进行擦除,保持擦除后的预设区域的图像,与整体图像保持协调一致。In the embodiment of the present application, the image area to be processed is firstly located, and the location information is recorded. Then, through the confrontation model, image processing is performed on the first image as a whole. The image processing steps are based on image recognition technology and deep learning technology. The model automatically identifies the part that needs to be processed, and according to the global information of the first image, it needs to be processed. The preset area is erased, and the image of the erased preset area is kept in harmony with the overall image.
在擦除完成后,根据标记好的目标区域的位置信息,在通过图像处理模型擦除后的第二图像中,截取相同位置的区域图像,并将该区域图像与原始的第一图像进行结合,即只选取第二图像中,用户需要消除的部分,来对原始图像进行处理,因此,最终得到的目标图像,在保留了整体图像的协调一致的情况下,对需要处理的目标区域的内容进行了擦除,同时保证图像中的其他相似区域不会被误擦除,提高了抹除图像中特定内容时的处理效率。After the erasing is completed, according to the position information of the marked target area, in the second image erased by the image processing model, intercept the area image of the same position, and combine the area image with the original first image , that is, only the part of the second image that the user needs to eliminate is selected to process the original image. Therefore, the final target image, on the condition that the coordination of the overall image is preserved, will not affect the content of the target area that needs to be processed. Erasing is carried out, while ensuring that other similar areas in the image will not be erased by mistake, which improves the processing efficiency when erasing specific content in the image.
附图说明Description of drawings
图1示出了根据本申请实施例的图像处理方法的流程图之一;FIG. 1 shows one of the flowcharts of the image processing method according to an embodiment of the present application;
图2示出了根据本申请实施例的图像处理方法的示意图之一;FIG. 2 shows one of the schematic diagrams of an image processing method according to an embodiment of the present application;
图3示出了根据本申请实施例的图像处理方法的示意图之二;FIG. 3 shows the second schematic diagram of an image processing method according to an embodiment of the present application;
图4示出了根据本申请实施例的图像处理方法的示意图之三;FIG. 4 shows a third schematic diagram of an image processing method according to an embodiment of the present application;
图5示出了根据本申请实施例的图像处理模型的结构示意图;FIG. 5 shows a schematic structural diagram of an image processing model according to an embodiment of the present application;
图6示出了根据本申请实施例的图像处理方法的流程图之二;FIG. 6 shows the second flowchart of the image processing method according to the embodiment of the present application;
图7示出了根据本申请实施例的图像处理装置的结构框图;FIG. 7 shows a structural block diagram of an image processing apparatus according to an embodiment of the present application;
图8示出了根据本申请实施例的电子设备的结构框图;FIG. 8 shows a structural block diagram of an electronic device according to an embodiment of the present application;
图9为实现本申请实施例的一种电子设备的硬件结构示意图。FIG. 9 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art fall within the protection scope of this application.
本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”,一般表示前后关联对象是一种“或”的关系。The terms "first", "second" and the like in the description and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances so that the embodiments of the present application can be practiced in sequences other than those illustrated or described herein, and distinguish between "first", "second", etc. The objects are usually of one type, and the number of objects is not limited. For example, the first object may be one or more than one. In addition, "and/or" in the description and claims indicates at least one of the connected objects, and the character "/" generally indicates that the associated objects are in an "or" relationship.
下面结合附图,通过具体的实施例及其应用场景对本申请实施例提供的图像处理方法和处理装置、电子设备和可读存储介质进行详细地说明。The image processing method and processing apparatus, electronic device, and readable storage medium provided by the embodiments of the present application will be described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios thereof.
在本申请的一些实施例中,提供了一种图像处理方法,图1示出了根据本申请实施例的图像处理方法的流程图之一,如图1所示,方法包括:In some embodiments of the present application, an image processing method is provided. FIG. 1 shows one of the flowcharts of the image processing method according to an embodiment of the present application. As shown in FIG. 1 , the method includes:
步骤102,在第一图像中定位目标区域,得到目标区域的位置信息;
步骤104,通过图像处理模型,擦除第一图像中预设区域的图像信息,得到擦除后的第二图像;
在步骤104中,第二图像的尺寸与第一图像相同,预设区域包括目标区域;In
步骤106,根据位置信息,在第二图像中截取与目标区域对应的区域图像;
步骤108,根据区域图像和第一图像,生成处理后的目标图像。Step 108: Generate a processed target image according to the area image and the first image.
在本申请实施例中,当用户希望对图像中的特定内容进行隐藏或抹除时,如用户希望隐藏图像中的文字内容时,首先,可以通过如文字识别算法等,对图像中的文字区域进行定位,并记录该区域对应的位置信息。其中,位置信息可以是坐标信息。In this embodiment of the present application, when the user wishes to hide or erase specific content in the image, for example, when the user wishes to hide the text content in the image, firstly, the text area in the image can be detected by a text recognition algorithm, etc. Perform positioning and record the location information corresponding to the area. The location information may be coordinate information.
在得到需要擦除的目标区域的位置信息后,将第一图像的原图整体输入到预设的图像处理模型中,具体地,该图像处理模型能够根据用户需要擦除的信息种类,在第一图像中自动识别出包含所要擦除的目标信息,并根据目标图像的全局信息,对第一图像的整体进行处理。After obtaining the location information of the target area to be erased, the entire original image of the first image is input into the preset image processing model. The target information to be erased is automatically identified in an image, and the whole of the first image is processed according to the global information of the target image.
具体地,图2示出了根据本申请实施例的图像处理方法的示意图之一,如图2所示,第一图像200中包括文字信息202,用户需要对文字信息202进行擦除。首先,通过如光学字符识别(Optical Character Recognition,OCR)等手段,在第一图像200中,标注出文字信息202所在的区域,也即目标区域204,同时记录目标区域204的坐标信息,从而记录目标区域204的位置信息。Specifically, FIG. 2 shows one schematic diagram of an image processing method according to an embodiment of the present application. As shown in FIG. 2 , the
在得到目标区域的位置信息后,将第一图像输入至预设的图像处理模型。图像处理模型能够自动识别出用户所要擦除的图像信息内容,如文字信息,并基于目标图像的全局信息,包括色彩信息、像素信息等进行擦除。After obtaining the position information of the target area, the first image is input into a preset image processing model. The image processing model can automatically identify the content of the image information that the user wants to erase, such as text information, and erase it based on the global information of the target image, including color information, pixel information, and so on.
图3示出了根据本申请实施例的图像处理方法的示意图之二,如图3所示,图像处理模型对第一图像300的整体进行处理,并将其中被识别为包含文字的若干个预设区域均进行抹除处理。如图3所示,图像处理模型对2个预设区域均进行了抹除处理,其中,第一预设区域302中包含了用户需要擦除的文字信息,而第二预设区域304中包含了二维码信息,由于二维码信息和文字信息的特征接近,导致该二维码信息被误识别为文字而被擦除。FIG. 3 shows the second schematic diagram of the image processing method according to the embodiment of the present application. As shown in FIG. 3 , the image processing model processes the whole of the
进一步地,在图像处理模型输出第二图像之后,根据识别出的目标区域的位置信息,在第二图像中,根据相同的坐标,截取出对应的区域图像,将该区域图像按照目标区域的坐标,叠加至第一图像的原图上,从而覆盖第一图像的目标区域,从而生成目标图像。Further, after the image processing model outputs the second image, according to the position information of the identified target area, in the second image, according to the same coordinates, the corresponding area image is cut out, and the area image is based on the coordinates of the target area. , superimposed on the original image of the first image, so as to cover the target area of the first image, thereby generating the target image.
图4示出了根据本申请实施例的图像处理方法的示意图之三,如图4所示,目标图像400上,目标区域402中的文字信息被抹除,而二维码404得以保留。FIG. 4 shows the third schematic diagram of the image processing method according to the embodiment of the present application. As shown in FIG. 4 , on the
本申请实施例根据标记好的目标区域的位置信息,在通过图像处理模型擦除后的第二图像中,截取相同位置的区域图像,并将该区域图像与原始的第一图像进行结合,即只选取第二图像中,用户需要消除的部分,来对原始图像进行处理,因此,最终得到的目标图像,在保留了整体图像的协调一致的情况下,对需要处理的目标区域的内容进行了擦除,同时保证图像中的其他相似区域不会被误擦除,提高了抹除图像中特定内容时的处理效率。In the embodiment of the present application, according to the position information of the marked target area, in the second image erased by the image processing model, the area image of the same position is intercepted, and the area image is combined with the original first image, that is, Only the part of the second image that the user needs to eliminate is selected to process the original image. Therefore, the final target image, under the condition of keeping the coordination of the overall image, is processed on the content of the target area that needs to be processed. Erasing, while ensuring that other similar areas in the image will not be erased by mistake, improving the processing efficiency when erasing specific content in the image.
在本申请的一些实施例中,根据区域图像和第一图像,生成处理后的目标图像,包括:根据位置信息,将区域图像覆盖于目标区域,得到目标图像。In some embodiments of the present application, generating the processed target image according to the area image and the first image includes: covering the area image on the target area according to the position information to obtain the target image.
在本申请实施例中,在通过图像处理模型,得到第二图像后,根据目标区域的位置信息,如坐标信息,在第二图像中截取出于目标区域位置相对应的区域图像。In the embodiment of the present application, after the second image is obtained through the image processing model, an area image corresponding to the position of the target area is cut out from the second image according to the location information of the target area, such as coordinate information.
在得到区域图像后,同样根据目标区域的坐标信息,将截取得到的,通过图像处理模型处理后的区域图像,覆盖到原始的第一图像上,从而使目标区域内的图像内容,完全替换为区域图像,从而使替换后的目标图像中,仅有需要擦除的区域被处理后的图像所替代,在保留了整体图像的协调一致的情况下,对需要处理的目标区域的内容进行了擦除,同时保证图像中的其他相似区域不会被误擦除,提高了抹除图像中特定内容时的处理效率。After obtaining the area image, also according to the coordinate information of the target area, the obtained area image processed by the image processing model is overlaid on the original first image, so that the image content in the target area is completely replaced by area image, so that in the replaced target image, only the area that needs to be erased is replaced by the processed image, and the content of the target area that needs to be processed is erased under the condition that the coordination of the overall image is preserved. At the same time, it is ensured that other similar areas in the image will not be erased by mistake, which improves the processing efficiency when erasing specific content in the image.
在本申请的一些实施例中,在擦除第一图像中预设区域的图像信息之前,方法还包括:In some embodiments of the present application, before erasing the image information of the preset area in the first image, the method further includes:
获取第一训练图像和第二训练图像,其中,第二训练图像是在第一训练图像中,去除预设图像信息后得到的图像;Obtaining a first training image and a second training image, wherein the second training image is an image obtained after removing preset image information in the first training image;
通过第一训练图像和第二训练图像,训练预设模型,得到训练后的图像处理模型,图像处理模型包括第一网络和第二网络;Through the first training image and the second training image, the preset model is trained to obtain a trained image processing model, and the image processing model includes a first network and a second network;
擦除第一图像中预设区域的图像信息,包括:Erase the image information of the preset area in the first image, including:
通过第一网络对第一图像进行擦除处理,得到处理后的第三图像;Erasing the first image through the first network to obtain a processed third image;
对第三图像进行下采样处理,得到第四图像;Perform down-sampling processing on the third image to obtain a fourth image;
通过第二网络对第四图像进行擦除处理,得到处理后的第五图像;Erasing the fourth image through the second network to obtain the processed fifth image;
对第五图像进行上采样处理,得到第二图像。Up-sampling processing is performed on the fifth image to obtain a second image.
在本申请实施例中,对预设的对抗模型进行训练,从而得到训练好的图像处理模型。具体地,首先采集收集第一图像,并对第一图像进行手动处理,生成第二图像。其中,第一图像是原始图像,第二图像是通过图像编辑或图像修改等软件,对文字内容等预设区域进行擦除后,得到的第二图像。In the embodiment of the present application, a preset confrontation model is trained to obtain a trained image processing model. Specifically, the first image is collected first, and the first image is manually processed to generate the second image. The first image is an original image, and the second image is a second image obtained by erasing a preset area such as text content through software such as image editing or image modification.
根据第一图像和第二图像,作为训练集,训练预设的生成对抗网络,用来进行端到端整图文字的擦除。具体做法是搭建网络模型,对于生成网络采用unet的网络结构,先对图像进行下采样获取图像语义信息,再对图像上采样恢复到原始尺寸以获取图像输出,考虑到对于复杂场景经过一次模型的优化并不能得到好的结果,因此在unet(一种稠密预测分割的U型网络)结构后,再接一层轻量化后的unet结果做进一步的处理,得到最终的处理结果。According to the first image and the second image, as a training set, a preset generative adversarial network is trained to perform end-to-end erasure of the entire image text. The specific method is to build a network model. For the generation network, the network structure of unet is used. First, the image is down-sampled to obtain the semantic information of the image, and then the image is up-sampled and restored to the original size to obtain the image output. The optimization can not get good results, so after the unet (a U-shaped network for dense prediction and segmentation) structure, a layer of lightweight unet results are added for further processing to obtain the final processing results.
进一步地,构建判别网络,判别网络包括一个双尺度的网络,其中第一个尺度网络包括几个级联的卷积,其中卷积的步长可以设置为1,并不引入池化层,保证图片的分辨率不下降。Further, a discriminant network is constructed. The discriminant network includes a double-scale network, where the first scale network includes several concatenated convolutions, where the convolution stride can be set to 1, and no pooling layer is introduced to ensure that The resolution of the pictures does not drop.
之后在第一个尺度网络后,再加一层相同的尺度网络,但是第二层尺度网络的输入是第一层网络的输出下采样一倍之后得到。双尺度网络的真值(ground truth)分别由擦除后的图片,和擦除后图片下采样一倍的图片得到。Then, after the first scale network, add another layer of the same scale network, but the input of the second layer scale network is obtained after downsampling the output of the first layer network. The ground truth of the dual-scale network is obtained from the erased image and the image with double downsampling of the erased image, respectively.
将生成网络输出结果输入到判别网络,通过判别网络判断当前生成的擦除后的图片,和原始标注的擦除图片(也即第二图像)之间的差异,并作为损失(loss)反向传播优化网络参数,最终得到经过优化后的网络结构。Input the output result of the generation network into the discriminant network, and judge the difference between the currently generated erased image and the original annotated erased image (ie, the second image) through the discriminant network, and use it as a loss (loss) reverse The optimized network parameters are propagated, and finally the optimized network structure is obtained.
在这个优化后的网络结构中,去除判别网络后得到的模型,即上述图像处理模型。图5示出了根据本申请实施例的图像处理模型的结构示意图,如图5所以,图像处理模型500包括的2层unet网络结构,即第一网络502和第二网络504。In this optimized network structure, the model obtained after removing the discriminant network is the above-mentioned image processing model. FIG. 5 shows a schematic structural diagram of an image processing model according to an embodiment of the present application. As shown in FIG. 5 , the
在通过图像处理模型500,对第一图像506中的特定内容进行擦除时,首先,将待处理的第一图像506输入至第一网络502中,通过第一网络502对其中的特定信息进行擦除。When using the
擦除后得到处理后的第三图像508,对第三图像508进行下采样处理,得到分辨率降低的第四图像510,从而获取图像语义定义,将下采样得到的第四图像510作为第二层网络,也即第二网络504的输入。After erasing, the processed
最终第二网络504输出的第五图像512,经过上采样恢复为原始尺寸后得到最终的第二图像514。Finally, the
能够理解的是,第一图像中包含的内容,即用户需要擦除的内容。如用户需要擦除图像中的文字信息,则第一图像中包含文字信息。如用户需要擦除人脸,则第一图像中包含人脸信息。It can be understood that the content contained in the first image is the content that the user needs to erase. If the user needs to erase the text information in the image, the first image contains the text information. If the user needs to erase the face, the first image contains the face information.
本申请通过对图像识别模型进行训练,从而使图像识别模型能够根据训练集中的图像内容,对第一图像中对应的内容区域进行擦除,并能够使擦除后的图像保持整体图像的协调一致,提高图像处理效率。The present application trains the image recognition model, so that the image recognition model can erase the corresponding content area in the first image according to the image content in the training set, and can keep the erased image in harmony with the overall image , to improve image processing efficiency.
在本申请的一些实施例中,目标区域为字符图像区域,在第一图像中定位目标区域,包括:In some embodiments of the present application, the target area is a character image area, and locating the target area in the first image includes:
对第一图像进行光学字符识别,在第一图像中获取字符检测框;performing optical character recognition on the first image, and obtaining a character detection frame in the first image;
根据字符检测框的坐标信息,在第一图像中定位目标区域。The target area is located in the first image according to the coordinate information of the character detection frame.
在本申请实施例中,目标区域具体包括字符图像区域,也就是说,用户需要对第一图像中的字符区域进行擦除。具体地,首先对第一图像进行光学字符(OCR)识别,从而在第一图像中,检测出字符所在位置,同时根据这些字符的位置,形成为字符检测框。In this embodiment of the present application, the target area specifically includes a character image area, that is, the user needs to erase the character area in the first image. Specifically, optical character (OCR) recognition is first performed on the first image, so that in the first image, the positions of characters are detected, and at the same time, a character detection frame is formed according to the positions of these characters.
具体地,首先对第一图像进行预处理,在一些实施例中,采用去噪算法,将第一图像上的噪声去除。之后,根据训练好的OCR检测模型,并通过OCR检测算法获取到文本或字符,并定位坐标信息,该OCR检测算法可以获取到水平、垂直、弯曲等各种场景下的字符检测框。Specifically, the first image is preprocessed first, and in some embodiments, a denoising algorithm is used to remove noise on the first image. After that, according to the trained OCR detection model, the text or characters are obtained through the OCR detection algorithm, and the coordinate information is located. The OCR detection algorithm can obtain the character detection frame in various scenarios such as horizontal, vertical, and curved.
对于水平、垂直的规则字符检测框,可以采用四点坐标框来表示;而对于弯曲的不规则字符检测框,则可以采用八点坐标框表示。若当前图片中没有文字信息或字符信息,则返回空的字符坐标框。For the horizontal and vertical regular character detection frame, it can be represented by a four-point coordinate frame; while for the curved irregular character detection frame, it can be represented by an eight-point coordinate frame. If there is no text information or character information in the current picture, an empty character coordinate box is returned.
该字符检测框标注有坐标信息,该坐标信息指的是字符检测框在第一图像中的坐标。通过字符检测框的坐标信息,在第一图像中定位目标区域,从而在通过图像处理模型得到第二图像后,根据该坐标信息,将处理后的区域图像覆盖到目标区域上,从而使生成的目标图像中,既保证了整体图像的协调一致,又对需要处理的目标区域的内容进行了有效擦除,同时保证图像中的其他相似区域不会被误擦除,提高了抹除图像中特定内容时的处理效率。The character detection frame is marked with coordinate information, and the coordinate information refers to the coordinates of the character detection frame in the first image. According to the coordinate information of the character detection frame, the target area is located in the first image, so that after obtaining the second image through the image processing model, the processed area image is covered on the target area according to the coordinate information, so that the generated image In the target image, it not only ensures the coordination of the overall image, but also effectively erases the content of the target area that needs to be processed. Content processing efficiency.
在本申请的一些实施例中,图6示出了根据本申请实施例的图像处理方法的流程图之二,如图6所示,方法包括:In some embodiments of the present application, FIG. 6 shows the second flowchart of an image processing method according to an embodiment of the present application. As shown in FIG. 6 , the method includes:
步骤602,对原始图片进行文本定位,记录原始图片中的文字坐标信息;
在步骤602中,首先对图像进行预处理,采用去噪算法将图像上的噪声去除。之后训练ocr检测模型,并通过ocr检测算法获取到文本定位信息,该ocr检测算法可以获取到水平、垂直、弯曲等各种场景下的文本检测框。对于水平、垂直文本框采用四点坐标框来表示,而对于弯曲文本框则采用八点坐标框表示。若当前图片中没有文字信息,则返回空的文本坐标框。In
步骤604,采集成对数据,训练生成对抗网络用来进行文字擦除;
在步骤604中,采集成对的<原始图片,文字擦除图片>,并采用生成对抗方式进行模型训练,得到图片处理模型。In
具体地,首先采集获取到原始图片,并通过PS获取到对应的文字擦除图片,从而获取到成对的<原始图片,文字擦除图片>。Specifically, the original picture is first collected and obtained, and the corresponding text-erased picture is obtained through PS, so as to obtain pairs of <original picture, text-erased picture>.
之后训练一个生成对抗网络用来进行端到端整图文字的擦除;具体做法是搭建网络模型,对于生成网络采用unet的网络结构,先对图像进行下采样获取图像语义信息,再对图像上采样恢复到原始尺寸以获取图像输出,考虑到对于复杂场景经过一次模型的优化并不能得到好的结果,因此在unet结构后面再接一层轻量化后的unet做进一步的处理得到最终的处理结果。构建判别网络,判别网络由一个双尺度的网络组成,其中第一个尺度网络由几个卷积级联组成,卷积的步长设置为1,并不引入池化层,保证图片的分辨率不下降,之后在第一个尺度网络后面再加一层相同的尺度网络,但是第二层尺度网络的输入是第一层网络的输出下采样一倍得到。双尺度网络的ground truth分别由擦除后的图片以及擦除后图片下采样一倍的图片得到。Then train a generative adversarial network for end-to-end erasure of the whole image text; the specific method is to build a network model, use the unet network structure for the generation network, first downsample the image to obtain image semantic information, and then upsample the image Return to the original size to obtain the image output. Considering that the optimization of the model for complex scenes cannot get good results, a layer of lightweight unet is added after the unet structure for further processing to obtain the final processing result. Build a discriminant network. The discriminant network consists of a double-scale network. The first scale network consists of several convolution cascades. The step size of the convolution is set to 1, and the pooling layer is not introduced to ensure the resolution of the image. Do not drop, and then add a layer of the same scale network after the first scale network, but the input of the second layer scale network is obtained by downsampling the output of the first layer network. The ground truth of the dual-scale network is obtained from the erased image and the image with double downsampling of the erased image, respectively.
将生成网络输出结果输入到判别网络判断当前生成的擦除后的图片和原始标注的擦除图片之间的差异,并作为loss反向传播优化网络参数,最终得到经过优化后的网络结构。The output of the generation network is input to the discriminant network to judge the difference between the currently generated erased image and the original annotated erased image, and it is used as the loss backpropagation to optimize the network parameters, and finally the optimized network structure is obtained.
步骤606,采用优化后的模型对原始图片进行推理得到擦除后的图片结果;
在步骤606中,采用优化后的生成对抗模型对原始图片进行推理得到擦除后的图片结果,具体做法是将原始图片输入经过训练后的模型,这时需要将判别器去除,只保留生成器即可,经过生成器后得到的输出图即为经过擦除后的图片结果。In
步骤608,将获取到的文字坐标信息映射到擦除后的图片上,从中裁剪出文本坐标所在的擦除区域;Step 608: Map the obtained text coordinate information to the erased picture, and cut out the erased area where the text coordinates are located;
在步骤608中,将步获取到的文字坐标信息映射到获取的擦除后的图片结果上,并从中裁剪出文本坐标所在的擦除区域;考虑到有些和文字很相似的区域比如栅栏、纹路、花草等容易被当做文字擦除,因此为了保证这些信息不被误涂,需要将从原始图片记录到的文字坐标信息映射至经获取到的擦除图片上,因为坐标是非矩形框,因此需要设置一个和输入图片一样大的掩码图片,掩码图片原始为纯黑,将坐标框所在区域置为白色,即可得到需要裁剪出的文本坐标所在的擦除区域。In
步骤610,将擦除区域贴回到原图,得到最终的文字擦除图片。Step 610: Paste the erased area back to the original image to obtain the final text erased image.
在步骤610中,将裁剪出来的擦除区域贴回到原图,即可得到最终的文字擦除图片。In
具体做法是在已经得到需要擦除文字区域所对应的掩码图片,这时只需要将掩码图片中的纯白区域对应的擦除区域贴回到原图即可,这样就能得到最后所需要的文字擦除图片,从而避免了和文字很相似区域的误涂。The specific method is that when the mask image corresponding to the text area that needs to be erased has been obtained, you only need to paste the erase area corresponding to the pure white area in the mask image back to the original image, so that the final image can be obtained. The required text erases the picture, thereby avoiding mispainting of areas that are very similar to the text.
在本申请的一些实施例中,提供了一种图像处理装置,图7示出了根据本申请实施例的图像处理装置的结构框图,如图7所示,图像处理装置700包括:In some embodiments of the present application, an image processing apparatus is provided. FIG. 7 shows a structural block diagram of an image processing apparatus according to an embodiment of the present application. As shown in FIG. 7 , the
定位模块702,用于在第一图像中定位目标区域,得到目标区域的位置信息;A
擦除模块704,用于通过图像处理模型,擦除第一图像中预设区域的图像信息,得到擦除后的第二图像,其中,第二图像的尺寸与第一图像相同,预设区域包括目标区域;The erasing
截取模块706,用于根据位置信息,在第二图像中截取与目标区域对应的区域图像;The
处理模块708,用于根据区域图像和第一图像,生成处理后的目标图像。The
本申请实施例根据标记好的目标区域的位置信息,在通过图像处理模型擦除后的第二图像中,截取相同位置的区域图像,并将该区域图像与原始的第一图像进行结合,即只选取第二图像中,用户需要消除的部分,来对原始图像进行处理,因此,最终得到的目标图像,在保留了整体图像的协调一致的情况下,对需要处理的目标区域的内容进行了擦除,同时保证图像中的其他相似区域不会被误擦除,提高了抹除图像中特定内容时的处理效率。In the embodiment of the present application, according to the position information of the marked target area, in the second image erased by the image processing model, the area image of the same position is intercepted, and the area image is combined with the original first image, that is, Only the part of the second image that the user needs to eliminate is selected to process the original image. Therefore, the final target image, under the condition of keeping the coordination of the overall image, is processed on the content of the target area that needs to be processed. Erasing, while ensuring that other similar areas in the image will not be erased by mistake, improving the processing efficiency when erasing specific content in the image.
在本申请的一些实施例中,图像处理装置还包括:覆盖模块,用于根据位置信息,将区域图像覆盖于目标区域,得到目标图像。In some embodiments of the present application, the image processing apparatus further includes: an overlay module, configured to overlay the area image on the target area according to the location information to obtain the target image.
本申请实施例在得到区域图像后,同样根据目标区域的坐标信息,将截取得到的,通过图像处理模型处理后的区域图像,覆盖到原始的第一图像上,从而使目标区域内的图像内容,完全替换为区域图像,从而使替换后的目标图像中,仅有需要擦除的区域被处理后的图像所替代,在保留了整体图像的协调一致的情况下,对需要处理的目标区域的内容进行了擦除,同时保证图像中的其他相似区域不会被误擦除,提高了抹除图像中特定内容时的处理效率。After the region image is obtained in the embodiment of the present application, the captured region image processed by the image processing model is also overlaid on the original first image according to the coordinate information of the target region, so that the content of the image in the target region is changed. , completely replaced with the area image, so that in the replaced target image, only the area that needs to be erased is replaced by the processed image. Under the condition that the coordination of the overall image is preserved, the target area that needs to be processed The content is erased, while ensuring that other similar areas in the image will not be erased by mistake, which improves the processing efficiency when erasing specific content in the image.
在本申请的一些实施例中,处理装置还包括:In some embodiments of the present application, the processing device further includes:
获取模块,用于获取第一训练图像和第二训练图像,其中,第二训练图像是在第一训练图像中,去除预设图像信息后得到的图像;an acquisition module for acquiring a first training image and a second training image, wherein the second training image is an image obtained after removing preset image information in the first training image;
训练模块,用于通过第一训练图像和第二训练图像,训练预设模型,得到训练后的图像处理模型,图像处理模型包括第一网络和第二网络;a training module for training a preset model through the first training image and the second training image to obtain a trained image processing model, the image processing model including a first network and a second network;
擦除模块,还用于通过第一网络对第一图像进行擦除处理,得到处理后的第三图像;The erasing module is also used for erasing the first image through the first network to obtain the processed third image;
采样模块,用于对第三图像进行下采样处理,得到第四图像;a sampling module for down-sampling the third image to obtain a fourth image;
擦除模块,还用于通过第二网络对第四图像进行擦除处理,得到处理后的第五图像;The erasing module is also used for erasing the fourth image through the second network to obtain the processed fifth image;
采样模块,还用于对第五图像进行上采样处理,得到第二图像。The sampling module is further configured to perform up-sampling processing on the fifth image to obtain the second image.
本申请通过对图像识别模型进行训练,从而使图像识别模型能够根据训练集中的图像内容,对第一图像中对应的内容区域进行擦除,并能够使擦除后的图像保持整体图像的协调一致,提高图像处理效率。In the present application, the image recognition model is trained, so that the image recognition model can erase the corresponding content area in the first image according to the image content in the training set, and the erased image can keep the coordination of the overall image. , to improve image processing efficiency.
在本申请的一些实施例中,目标区域为字符图像区域,处理装置还包括:In some embodiments of the present application, the target area is a character image area, and the processing device further includes:
识别模块,用于对第一图像进行光学字符识别,在第一图像中获取字符检测框;a recognition module for performing optical character recognition on the first image, and obtaining a character detection frame in the first image;
定位模块,还用于根据字符检测框的坐标信息,在第一图像中定位目标区域。The positioning module is further configured to locate the target area in the first image according to the coordinate information of the character detection frame.
本申请实施例在第一图像中定位目标区域,从而在通过图像处理模型得到第二图像后,根据该坐标信息,将处理后的区域图像覆盖到目标区域上,从而使生成的目标图像中,既保证了整体图像的协调一致,又对需要处理的目标区域的内容进行了有效擦除,同时保证图像中的其他相似区域不会被误擦除,提高了抹除图像中特定内容时的处理效率。In this embodiment of the present application, the target area is located in the first image, so that after obtaining the second image through the image processing model, the processed area image is covered on the target area according to the coordinate information, so that in the generated target image, It not only ensures the coordination of the overall image, but also effectively erases the content of the target area that needs to be processed. At the same time, it ensures that other similar areas in the image will not be erased by mistake, which improves the processing of erasing specific content in the image. efficiency.
本申请实施例中的图像处理装置可以是电子设备,也可以是电子设备中的部件,例如集成电路或芯片。该电子设备可以是终端,也可以为除终端之外的其他设备。示例性的,电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、移动上网装置(Mobile Internet Device,MID)、增强现实(augmented reality,AR)/虚拟现实(virtualreality,VR)设备、机器人、可穿戴设备、超级移动个人计算机(ultra-mobile personalcomputer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等,还可以为服务器、网络附属存储器(Network Attached Storage,NAS)、个人计算机(personalcomputer,PC)、电视机(television,TV)、柜员机或者自助机等,本申请实施例不作具体限定。The image processing apparatus in this embodiment of the present application may be an electronic device, or may be a component in the electronic device, such as an integrated circuit or a chip. The electronic device may be a terminal, or may be other devices other than the terminal. Exemplarily, the electronic device may be a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a vehicle-mounted electronic device, a Mobile Internet Device (MID), an augmented reality (AR)/virtual reality (VR) Devices, robots, wearable devices, ultra-mobile personal computers (UMPCs), netbooks or personal digital assistants (PDAs), etc., and can also be servers, network attached storages (NAS) , a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which are not specifically limited in the embodiments of the present application.
本申请实施例中的图像处理装置可以为具有操作系统的装置。该操作系统可以为安卓(Android)操作系统,可以为iOS操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。The image processing apparatus in this embodiment of the present application may be an apparatus having an operating system. The operating system may be an Android (Android) operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiments of the present application.
本申请实施例提供的图像处理装置能够实现上述方法实施例实现的各个过程,为避免重复,这里不再赘述。The image processing apparatus provided in this embodiment of the present application can implement each process implemented by the foregoing method embodiment, and to avoid repetition, details are not repeated here.
可选地,本申请实施例还提供一种电子设备,图8示出了根据本申请实施例的电子设备的结构框图,如图8所示,电子设备800包括处理器802,存储器804,存储在存储器804上并可在所述处理器802上运行的程序或指令,该程序或指令被处理器802执行时实现上述方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Optionally, an embodiment of the present application further provides an electronic device. FIG. 8 shows a structural block diagram of an electronic device according to an embodiment of the present application. As shown in FIG. 8 , the
需要说明的是,本申请实施例中的电子设备包括上述所述的移动电子设备和非移动电子设备。It should be noted that the electronic devices in the embodiments of the present application include the aforementioned mobile electronic devices and non-mobile electronic devices.
图9为实现本申请实施例的一种电子设备的硬件结构示意图。FIG. 9 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
该电子设备900包括但不限于:射频单元901、网络模块902、音频输出单元903、输入单元904、传感器905、显示单元906、用户输入单元907、接口单元908、存储器909以及处理器910等部件。The
本领域技术人员可以理解,电子设备900还可以包括给各个部件供电的电源(比如电池),电源可以通过电源管理系统与处理器910逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。图9中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置,在此不再赘述。Those skilled in the art can understand that the
其中,处理器910用于在第一图像中定位目标区域,得到目标区域的位置信息;Wherein, the
通过图像处理模型,擦除第一图像中预设区域的图像信息,得到擦除后的第二图像,其中,第二图像的尺寸与第一图像相同,预设区域包括目标区域;By using the image processing model, the image information of the preset area in the first image is erased, and the erased second image is obtained, wherein the size of the second image is the same as that of the first image, and the preset area includes the target area;
根据位置信息,在第二图像中截取与目标区域对应的区域图像;According to the position information, intercept the area image corresponding to the target area in the second image;
根据区域图像和第一图像,生成处理后的目标图像。Based on the area image and the first image, a processed target image is generated.
本申请实施例根据标记好的目标区域的位置信息,在通过图像处理模型擦除后的第二图像中,截取相同位置的区域图像,并将该区域图像与原始的第一图像进行结合,即只选取第二图像中,用户需要消除的部分,来对原始图像进行处理,因此,最终得到的目标图像,在保留了整体图像的协调一致的情况下,对需要处理的目标区域的内容进行了擦除,同时保证图像中的其他相似区域不会被误擦除,提高了抹除图像中特定内容时的处理效率。In the embodiment of the present application, according to the position information of the marked target area, in the second image erased by the image processing model, the area image of the same position is intercepted, and the area image is combined with the original first image, that is, Only the part of the second image that the user needs to eliminate is selected to process the original image. Therefore, the final target image, under the condition of keeping the coordination of the overall image, is processed on the content of the target area that needs to be processed. Erasing, while ensuring that other similar areas in the image will not be erased by mistake, improving the processing efficiency when erasing specific content in the image.
可选地,处理器910还用于根据位置信息,将区域图像覆盖于目标区域,得到目标图像。Optionally, the
本申请实施例在得到区域图像后,同样根据目标区域的坐标信息,将截取得到的,通过图像处理模型处理后的区域图像,覆盖到原始的第一图像上,从而使目标区域内的图像内容,完全替换为区域图像,从而使替换后的目标图像中,仅有需要擦除的区域被处理后的图像所替代,在保留了整体图像的协调一致的情况下,对需要处理的目标区域的内容进行了擦除,同时保证图像中的其他相似区域不会被误擦除,提高了抹除图像中特定内容时的处理效率。After the region image is obtained in the embodiment of the present application, the captured region image processed by the image processing model is also overlaid on the original first image according to the coordinate information of the target region, so that the content of the image in the target region is changed. , completely replaced with the area image, so that in the replaced target image, only the area that needs to be erased is replaced by the processed image. Under the condition that the coordination of the overall image is preserved, the target area that needs to be processed The content is erased, while ensuring that other similar areas in the image will not be erased by mistake, which improves the processing efficiency when erasing specific content in the image.
可选地,处理器910还用于获取第一训练图像和第二训练图像,其中,第二训练图像是擦除第一训练图像中的预设区域后得到的图像数据;Optionally, the
通过第一训练图像和第二训练图像,训练预设模型,得到训练后的图像处理模型,图像处理模型包括第一网络和第二网络;Through the first training image and the second training image, the preset model is trained to obtain a trained image processing model, and the image processing model includes a first network and a second network;
擦除第一图像中预设区域的图像信息,包括:Erase the image information of the preset area in the first image, including:
通过第一网络对第一图像进行擦除处理,得到处理后的第三图像;Erasing the first image through the first network to obtain a processed third image;
对第三图像进行下采样处理,得到第四图像;Perform down-sampling processing on the third image to obtain a fourth image;
通过第二网络对第四图像进行擦除处理,得到处理后的第五图像;Erasing the fourth image through the second network to obtain the processed fifth image;
对第五图像进行上采样处理,得到第二图像。Up-sampling processing is performed on the fifth image to obtain a second image.
本申请通过对图像识别模型进行训练,从而使图像识别模型能够根据训练集中的图像内容,对第一图像中对应的内容区域进行擦除,并能够使擦除后的图像保持整体图像的协调一致,提高图像处理效率。In the present application, the image recognition model is trained, so that the image recognition model can erase the corresponding content area in the first image according to the image content in the training set, and the erased image can keep the coordination of the overall image. , to improve image processing efficiency.
可选地,目标区域为字符图像区域,处理器910还用于对第一图像进行光学字符识别,在第一图像中获取字符检测框;Optionally, the target area is a character image area, and the
根据字符检测框的坐标信息,在第一图像中定位目标区域。The target area is located in the first image according to the coordinate information of the character detection frame.
本申请实施例在第一图像中定位目标区域,从而在通过图像处理模型得到第二图像后,根据该坐标信息,将处理后的区域图像覆盖到目标区域上,从而使生成的目标图像中,既保证了整体图像的协调一致,又对需要处理的目标区域的内容进行了有效擦除,同时保证图像中的其他相似区域不会被误擦除,提高了抹除图像中特定内容时的处理效率。In this embodiment of the present application, the target area is located in the first image, so that after obtaining the second image through the image processing model, the processed area image is covered on the target area according to the coordinate information, so that in the generated target image, It not only ensures the coordination of the overall image, but also effectively erases the content of the target area that needs to be processed. At the same time, it ensures that other similar areas in the image will not be erased by mistake, which improves the processing of erasing specific content in the image. efficiency.
应理解的是,本申请实施例中,输入单元904可以包括图形处理器(GraphicsProcessing Unit,GPU)9041和麦克风9042,图形处理器9041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。显示单元906可包括显示面板9061,可以采用液晶显示器、有机发光二极管等形式来配置显示面板9061。用户输入单元907包括触控面板9071以及其他输入设备9072中的至少一种。触控面板9071,也称为触摸屏。触控面板9071可包括触摸检测装置和触摸控制器两个部分。其他输入设备9072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。It should be understood that, in this embodiment of the present application, the
存储器909可用于存储软件程序以及各种数据。存储器909可主要包括存储程序或指令的第一存储区和存储数据的第二存储区,其中,第一存储区可存储操作系统、至少一个功能所需的应用程序或指令(比如声音播放功能、图像播放功能等)等。此外,存储器909可以包括易失性存储器或非易失性存储器,或者,存储器909可以包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synch link DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本申请实施例中的存储器909包括但不限于这些和任意其它适合类型的存储器。The
处理器910可包括一个或多个处理单元;可选的,处理器910集成应用处理器和调制解调处理器,其中,应用处理器主要处理涉及操作系统、用户界面和应用程序等的操作,调制解调处理器主要处理无线通信信号,如基带处理器。可以理解的是,上述调制解调处理器也可以不集成到处理器910中。The
本申请实施例还提供一种可读存储介质,所述可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Embodiments of the present application further provide a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or instruction is executed by a processor, each process of the foregoing method embodiments can be implemented, and the same technology can be achieved The effect, in order to avoid repetition, is not repeated here.
其中,所述处理器为上述实施例中所述的电子设备中的处理器。所述可读存储介质,包括计算机可读存储介质,如计算机只读存储器(Read-OnlyMemory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等。Wherein, the processor is the processor in the electronic device described in the foregoing embodiments. The readable storage medium includes a computer-readable storage medium, such as a computer read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and the like.
本申请实施例另提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现上述方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。An embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to run a program or an instruction to implement each process of the foregoing method embodiments , and can achieve the same technical effect, in order to avoid repetition, it is not repeated here.
应理解,本申请实施例提到的芯片还可以称为系统级芯片、系统芯片、芯片系统或片上系统芯片等。It should be understood that the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, a system-on-chip, a system-on-a-chip, or a system-on-a-chip, or the like.
本申请实施例提供一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一个处理器执行以实现如上述方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。The embodiments of the present application provide a computer program product, the program product is stored in a storage medium, and the program product is executed by at least one processor to implement the various processes in the above method embodiments, and can achieve the same technical effect, which is To avoid repetition, we will not repeat them here.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。It should be noted that, herein, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements, It also includes other elements not expressly listed or inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element. Furthermore, it should be noted that the scope of the methods and apparatus in the embodiments of the present application is not limited to performing the functions in the order shown or discussed, but may also include performing the functions in a substantially simultaneous manner or in the reverse order depending on the functions involved. To perform functions, for example, the described methods may be performed in an order different from that described, and various steps may also be added, omitted, or combined. Additionally, features described with reference to some examples may be combined in other examples.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以计算机软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the method of the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is better implementation. Based on this understanding, the technical solutions of the present application can be embodied in the form of computer software products, which are essentially or contribute to the prior art. The computer software products are stored in a storage medium (such as ROM/RAM, magnetic disk , CD-ROM), including several instructions to make a terminal (which may be a mobile phone, a computer, a server, or a network device, etc.) execute the methods described in the various embodiments of the present application.
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。The embodiments of the present application have been described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific embodiments, which are merely illustrative rather than restrictive. Under the inspiration of this application, without departing from the scope of protection of the purpose of this application and the claims, many forms can be made, which all fall within the protection of this application.
Claims (10)
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210420012.4A CN114792285B (en) | 2022-04-21 | 2022-04-21 | Image processing method and processing device, electronic device and readable storage medium |
| PCT/CN2023/088947 WO2023202570A1 (en) | 2022-04-21 | 2023-04-18 | Image processing method and processing apparatus, electronic device and readable storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210420012.4A CN114792285B (en) | 2022-04-21 | 2022-04-21 | Image processing method and processing device, electronic device and readable storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN114792285A true CN114792285A (en) | 2022-07-26 |
| CN114792285B CN114792285B (en) | 2025-08-08 |
Family
ID=82461312
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210420012.4A Active CN114792285B (en) | 2022-04-21 | 2022-04-21 | Image processing method and processing device, electronic device and readable storage medium |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN114792285B (en) |
| WO (1) | WO2023202570A1 (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115797783A (en) * | 2023-02-01 | 2023-03-14 | 北京有竹居网络技术有限公司 | Method and device for generating barrier-free information, electronic equipment and storage medium |
| WO2023202570A1 (en) * | 2022-04-21 | 2023-10-26 | 维沃移动通信有限公司 | Image processing method and processing apparatus, electronic device and readable storage medium |
Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2016007770A (en) * | 2014-06-24 | 2016-01-18 | 大日本印刷株式会社 | Scratch label |
| EP3226204A1 (en) * | 2016-03-31 | 2017-10-04 | Beijing Xiaomi Mobile Software Co., Ltd. | Method and apparatus for intelligently capturing image |
| CN111724455A (en) * | 2020-06-15 | 2020-09-29 | 维沃移动通信有限公司 | Image processing method and electronic device |
| CN113538273A (en) * | 2021-07-13 | 2021-10-22 | 荣耀终端有限公司 | Image processing method and image processing device |
| CN113792789A (en) * | 2021-09-14 | 2021-12-14 | 中国科学技术大学 | Image tampering detection and positioning method and system based on class activation thermodynamic diagram |
| CN114049280A (en) * | 2021-11-25 | 2022-02-15 | 广州华多网络科技有限公司 | Image removal and restoration method and its device, equipment, medium and product |
| CN114255242A (en) * | 2021-11-17 | 2022-03-29 | 科大讯飞股份有限公司 | Image processing method, image processing device, electronic equipment and storage medium |
Family Cites Families (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108805789B (en) * | 2018-05-29 | 2022-06-03 | 厦门市美亚柏科信息股份有限公司 | Method, device and equipment for removing watermark based on antagonistic neural network and readable medium |
| CN109035147B (en) * | 2018-08-10 | 2023-12-12 | Oppo广东移动通信有限公司 | Image processing method and device, electronic device, storage medium and computer equipment |
| CN111260757A (en) * | 2018-12-03 | 2020-06-09 | 马上消费金融股份有限公司 | Image processing method and device and terminal equipment |
| CN110163194B (en) * | 2019-05-08 | 2024-08-27 | 腾讯科技(深圳)有限公司 | Image processing method, device and storage medium |
| CN111062854B (en) * | 2019-12-26 | 2023-08-25 | Oppo广东移动通信有限公司 | Method, device, terminal and storage medium for detecting watermark |
| CN114792285B (en) * | 2022-04-21 | 2025-08-08 | 维沃移动通信有限公司 | Image processing method and processing device, electronic device and readable storage medium |
-
2022
- 2022-04-21 CN CN202210420012.4A patent/CN114792285B/en active Active
-
2023
- 2023-04-18 WO PCT/CN2023/088947 patent/WO2023202570A1/en not_active Ceased
Patent Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2016007770A (en) * | 2014-06-24 | 2016-01-18 | 大日本印刷株式会社 | Scratch label |
| EP3226204A1 (en) * | 2016-03-31 | 2017-10-04 | Beijing Xiaomi Mobile Software Co., Ltd. | Method and apparatus for intelligently capturing image |
| CN111724455A (en) * | 2020-06-15 | 2020-09-29 | 维沃移动通信有限公司 | Image processing method and electronic device |
| CN113538273A (en) * | 2021-07-13 | 2021-10-22 | 荣耀终端有限公司 | Image processing method and image processing device |
| CN113792789A (en) * | 2021-09-14 | 2021-12-14 | 中国科学技术大学 | Image tampering detection and positioning method and system based on class activation thermodynamic diagram |
| CN114255242A (en) * | 2021-11-17 | 2022-03-29 | 科大讯飞股份有限公司 | Image processing method, image processing device, electronic equipment and storage medium |
| CN114049280A (en) * | 2021-11-25 | 2022-02-15 | 广州华多网络科技有限公司 | Image removal and restoration method and its device, equipment, medium and product |
Non-Patent Citations (1)
| Title |
|---|
| 胡敏;李良福;: "基于生成式对抗网络的裂缝图像修复方法", 计算机应用与软件, no. 06, 12 June 2019 (2019-06-12) * |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2023202570A1 (en) * | 2022-04-21 | 2023-10-26 | 维沃移动通信有限公司 | Image processing method and processing apparatus, electronic device and readable storage medium |
| CN115797783A (en) * | 2023-02-01 | 2023-03-14 | 北京有竹居网络技术有限公司 | Method and device for generating barrier-free information, electronic equipment and storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| WO2023202570A1 (en) | 2023-10-26 |
| CN114792285B (en) | 2025-08-08 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10678410B2 (en) | Browser-based image processing | |
| CN108259810A (en) | A kind of method of video calling, equipment and computer storage media | |
| WO2023202570A1 (en) | Image processing method and processing apparatus, electronic device and readable storage medium | |
| JP2020127194A (en) | Computer system and program | |
| US12131447B2 (en) | System and process for repainting of planar objects in video | |
| CN117011156A (en) | Image processing method, device, equipment and storage medium | |
| CN116433806A (en) | Image synthesis method, device, terminal, storage medium and product | |
| CN116704200A (en) | Image feature extraction, image noise reduction method and related device | |
| CN110688511A (en) | Fine-grained image retrieval method and device, computer equipment and storage medium | |
| US20160026613A1 (en) | Processing image to identify object for insertion into document | |
| CN118115624A (en) | Image layering generation system, method and device based on stable diffusion model | |
| CN117135445A (en) | Image processing methods and devices | |
| CN115861579A (en) | Display method and device thereof | |
| CN116156079A (en) | Video processing method, device, device and storage medium | |
| CN113506306B (en) | Multi-person cutout method, system, device and storage medium | |
| CN116051695A (en) | Image processing method and device thereof | |
| CN112488284B (en) | Model training method, character image completion method, device and electronic equipment | |
| WO2024055194A1 (en) | Virtual object generation method, and codec training method and apparatus thereof | |
| JP2023059243A (en) | Image translation method and system | |
| CN114049473A (en) | Image processing method and device | |
| CN114529558A (en) | Image processing method and device, electronic equipment and readable storage medium | |
| CN115035387B (en) | Network model training method and device | |
| CN120260049A (en) | Video data processing method, device, readable storage medium and program product | |
| CN119991854A (en) | Image generation method, device, equipment and medium | |
| CN119417946A (en) | Image processing method and device, electronic device and readable storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |
