WO2020233083A1 - Image restoration method and apparatus, storage medium, and terminal device - Google Patents

Image restoration method and apparatus, storage medium, and terminal device Download PDF

Info

Publication number
WO2020233083A1
WO2020233083A1 PCT/CN2019/122568 CN2019122568W WO2020233083A1 WO 2020233083 A1 WO2020233083 A1 WO 2020233083A1 CN 2019122568 W CN2019122568 W CN 2019122568W WO 2020233083 A1 WO2020233083 A1 WO 2020233083A1
Authority
WO
WIPO (PCT)
Prior art keywords
block
preset
new
repair
group
Prior art date
Application number
PCT/CN2019/122568
Other languages
French (fr)
Chinese (zh)
Inventor
杜艳艳
Original Assignee
深圳壹账通智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳壹账通智能科技有限公司 filed Critical 深圳壹账通智能科技有限公司
Publication of WO2020233083A1 publication Critical patent/WO2020233083A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation

Abstract

The present application relates to the technical field of image processing, and in particular relates to an image restoration method and apparatus, a storage medium, and a terminal device. The method comprises: determining a target region to be restored and a known source region in an original image, and obtaining boundary pixel points of the target region; constructing a plurality of restoration blocks having a preset size by using each boundary pixel point as a center point; calculating the priority level of each restoration block, and selecting the first restoration block according to the priority level; using a preset shuffled frog leaping algorithm to search for the best matching block in the source region that is the most similar to the first restoration block; restoring a corresponding pixel point of the first restoration block by using a sample pixel point corresponding to the best matching block; demarcating the restored first restoration block to the source region, and updating the boundary pixel points of the target region; if the number of boundary pixel points is greater than a set threshold, performing again the step of constructing a plurality of restoration blocks that have a preset size by using each boundary pixel point as a center point and the subsequent steps, so that searching and matching are performed by means of using the preset shuffled frog leaping algorithm, and the search duration is reduced.

Description

一种图像修复方法、装置、存储介质及终端设备Image restoration method, device, storage medium and terminal equipment
本申请要求于2019年05月21日提交中国专利局、申请号为201910422744.5、发明名称为“一种图像修复方法、装置、存储介质及终端设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office, the application number is 201910422744.5, and the invention title is "an image restoration method, device, storage medium and terminal equipment" on May 21, 2019. The entire content of the application is approved The reference is incorporated in this application.
技术领域Technical field
本申请涉及图像处理技术领域,尤其涉及一种图像修复方法、装置、计算机可读存储介质及终端设备。This application relates to the field of image processing technology, and in particular to an image restoration method, device, computer-readable storage medium, and terminal equipment.
背景技术Background technique
图像修复是一种利用图像中的已知信息来对图像中的受损区域进行恢复的技术,以使得图像修复效果满足人的视觉需求,从而让观察者觉察不出图像曾经破损。目前,一般采用基于Criminisi算法的图像修复方法来进行图像的修复,Criminisi算法在进行图像修复时,采用的是基于SSD匹配原则的全局搜索,即在计算出待修复像素点与各已知像素点差值的平方和后,通过SSD匹配原则进行全局搜索来得到最小平方和,以根据最小平方和确定最佳匹配块来进行图像修复,这种基于全局搜索的图像修复方法可适用于小面积的待修复图像,而对于大面积的待修复图像使用这种基于全局搜索的图像修复方法,将会导致搜索匹配占用时间较长,极大地增加了算法的时间复杂度,从而使得图像修复速度较慢以及效率较低。Image restoration is a technology that uses the known information in the image to restore the damaged area in the image, so that the image restoration effect meets the visual needs of people, so that the observer cannot perceive that the image has been damaged. At present, the image restoration method based on Criminisi algorithm is generally used to repair the image. When the Criminisi algorithm performs image restoration, it uses a global search based on the SSD matching principle, that is, after calculating the pixel to be repaired and each known pixel After the sum of squares of the difference, a global search is performed through the SSD matching principle to obtain the least square sum, and the best matching block is determined according to the least square sum for image restoration. This global search-based image restoration method can be applied to small areas Image to be repaired, and using this global search-based image repair method for a large area of image to be repaired will lead to a longer search matching time, which greatly increases the time complexity of the algorithm, and makes the image repair speed slower And the efficiency is lower.
技术问题technical problem
本申请实施例提供了一种图像修复方法、装置、计算机可读存储介质及终端设备,能够降低图像修复中最佳匹配块搜索匹配的时间复杂度,减少搜索匹配的占用时长,提高图像修复的修复速度和修复效率。The embodiments of the present application provide an image restoration method, device, computer readable storage medium, and terminal equipment, which can reduce the time complexity of searching and matching for the best matching block in image restoration, reduce the time taken for search and matching, and improve image restoration Repair speed and repair efficiency.
技术解决方案Technical solutions
本申请实施例的第一方面,提供了一种图像修复方法,包括:The first aspect of the embodiments of the present application provides an image restoration method, including:
确定原始图像中待修复的目标区域和已知的源区域,并获取所述目标区域的边界像素点,其中,已知的源区域为所述原始图像中除所述目标区域以外的区域;Determine a target area to be repaired and a known source area in the original image, and obtain boundary pixels of the target area, where the known source area is an area in the original image excluding the target area;
以各边界像素点为中心点,构建预设大小的多个修复块,其中,所构建的修复块的数量与边界像素点的数量对应;Using each boundary pixel as a center point, construct multiple repair blocks of a preset size, wherein the number of constructed repair blocks corresponds to the number of boundary pixels;
根据各修复块中样本像素点的个数和各修复块的结构信息计算各修复块的优先权,并根据所述优先权选择最先修复块;Calculate the priority of each repair block according to the number of sample pixels in each repair block and the structure information of each repair block, and select the first repair block according to the priority;
利用预设蛙跳算法寻找所述源区域中与所述最先修复块最相似的最佳匹配块;Searching for the best matching block that is most similar to the first repaired block in the source area by using a preset leapfrog algorithm;
采用所述最佳匹配块对应的样本像素点修复所述最先修复块的对应像素点;Repairing the corresponding pixel of the first repaired block by using the sample pixel corresponding to the best matching block;
将已修复的所述最先修复块划分至所述源区域,并更新所述目标区域的边界像素点;Dividing the repaired first repair block into the source area, and updating boundary pixels of the target area;
若更新后的边界像素点的个数大于设定阈值,则返回执行以各边界像素点为中心点,构建预设大小的多个修复块的步骤以及后续步骤,直到更新后的边界像素点的个数小于或者等于所述设定阈值时,确定所述原始图像修复完成并获取更新后的所述源区域。If the number of updated boundary pixels is greater than the set threshold, return to the step of constructing multiple repair blocks of preset sizes with each boundary pixel as the center point and subsequent steps until the updated boundary pixel is completed When the number is less than or equal to the set threshold, it is determined that the original image restoration is completed and the updated source area is obtained.
本申请实施例的第二方面,提供了一种图像修复装置,包括:The second aspect of the embodiments of the present application provides an image restoration device, including:
边界点获取模块,用于确定原始图像中待修复的目标区域和已知的源区域,并获取所述目标区域的边界像素点,其中,已知的源区域为所述原始图像中除所述目标区域以外的区域;The boundary point acquisition module is used to determine the target area to be repaired in the original image and the known source area, and obtain boundary pixels of the target area, where the known source area is the original image divided by the Area outside the target area;
修复块构建模块,用于以各边界像素点为中心点,构建预设大小的多个修复块,其中,所构建的修复块的数量与边界像素点的数量对应;The repair block building module is used to construct multiple repair blocks of preset size with each boundary pixel as the center point, wherein the number of the constructed repair block corresponds to the number of the boundary pixel;
优先权计算模块,用于根据各修复块中样本像素点的个数和各修复块的结构信息计算各修复块的优先权,并根据所述优先权选择最先修复块;The priority calculation module is used to calculate the priority of each repair block according to the number of sample pixels in each repair block and the structure information of each repair block, and select the first repair block according to the priority;
匹配块寻找模块,用于利用预设蛙跳算法寻找所述源区域中与所述最先修复块最相似的最佳匹配块;A matching block searching module, configured to use a preset leapfrog algorithm to find the best matching block most similar to the first repaired block in the source area;
修复块修复模块,用于采用所述最佳匹配块对应的样本像素点修复所述最先修复块的 对应像素点;A repair block repair module, configured to use the sample pixels corresponding to the best matching block to repair the corresponding pixels of the first repair block;
边界点更新模块,用于将已修复的所述最先修复块划分至所述源区域,并更新所述目标区域的边界像素点;A boundary point update module, configured to divide the repaired first repair block into the source area and update the boundary pixels of the target area;
修复完成确定模块,用于若更新后的边界像素点的个数大于设定阈值,则返回执行以各边界像素点为中心点,构建预设大小的多个修复块的步骤以及后续步骤,直到更新后的边界像素点的个数小于或者等于所述设定阈值时,确定所述原始图像修复完成并获取更新后的所述源区域。The repair completion determining module is used for if the number of updated boundary pixels is greater than the set threshold, return to execute the steps of constructing multiple repair blocks of preset size with each boundary pixel as the center point and subsequent steps until When the number of updated boundary pixels is less than or equal to the set threshold, it is determined that the original image repair is completed and the updated source area is obtained.
本申请实施例的第三方面,提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,所述计算机可读指令被处理器执行时实现如前述第一方面所述图像修复方法的步骤。A third aspect of the embodiments of the present application provides a computer-readable storage medium, the computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the foregoing first aspect is implemented The steps of the image restoration method.
本申请实施例的第四方面,提供了一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:The fourth aspect of the embodiments of the present application provides a terminal device, including a memory, a processor, and computer-readable instructions stored in the memory and running on the processor, and the processor executes the The following steps are implemented when computer-readable instructions:
确定原始图像中待修复的目标区域和已知的源区域,并获取所述目标区域的边界像素点,其中,已知的源区域为所述原始图像中除所述目标区域以外的区域;Determine a target area to be repaired and a known source area in the original image, and obtain boundary pixels of the target area, where the known source area is an area in the original image excluding the target area;
以各边界像素点为中心点,构建预设大小的多个修复块,其中,所构建的修复块的数量与边界像素点的数量对应;Using each boundary pixel as a center point, construct multiple repair blocks of a preset size, wherein the number of constructed repair blocks corresponds to the number of boundary pixels;
根据各修复块中样本像素点的个数和各修复块的结构信息计算各修复块的优先权,并根据所述优先权选择最先修复块;Calculate the priority of each repair block according to the number of sample pixels in each repair block and the structure information of each repair block, and select the first repair block according to the priority;
利用预设蛙跳算法寻找所述源区域中与所述最先修复块最相似的最佳匹配块;Searching for the best matching block that is most similar to the first repaired block in the source area by using a preset leapfrog algorithm;
采用所述最佳匹配块对应的样本像素点修复所述最先修复块的对应像素点;Repairing the corresponding pixel of the first repaired block by using the sample pixel corresponding to the best matching block;
将已修复的所述最先修复块划分至所述源区域,并更新所述目标区域的边界像素点;Dividing the repaired first repair block into the source area, and updating boundary pixels of the target area;
若更新后的边界像素点的个数大于设定阈值,则返回执行以各边界像素点为中心点,构建预设大小的多个修复块的步骤以及后续步骤,直到更新后的边界像素点的个数小于或者等于所述设定阈值时,确定所述原始图像修复完成并获取更新后的所述源区域。If the number of updated boundary pixels is greater than the set threshold, return to the step of constructing multiple repair blocks of preset sizes with each boundary pixel as the center point and subsequent steps until the updated boundary pixel is completed When the number is less than or equal to the set threshold, it is determined that the original image restoration is completed and the updated source area is obtained.
有益效果Beneficial effect
本申请实施例中,在确定出待修复的原始图像的最先修复块后,可通过预设蛙跳算法来寻找源区域中与该最先修复块最相似的最佳匹配块,从而利用最佳匹配块的样本像素点来对最先修复块进行修复,即通过预设蛙跳算法的快速局部搜索和全局搜索来进行最佳匹配块的搜索匹配,可降低最佳匹配块搜索匹配的时间复杂度,减少搜索匹配的占用时长,从而极大地提高了图像修复的修复速度和修复效率。In the embodiment of the present application, after the first repaired block of the original image to be repaired is determined, a preset leaping algorithm can be used to find the best matching block most similar to the first repaired block in the source area, so as to use the most The sample pixels of the best matching block are used to repair the first repaired block, that is, the search and matching of the best matching block can be performed through the fast local search and global search of the preset frog leaping algorithm, which can reduce the search and matching time of the best matching block Complexity, reducing the time occupied by search matching, thereby greatly improving the repair speed and efficiency of image repair.
附图说明Description of the drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only of the present application. For some embodiments, for those of ordinary skill in the art, other drawings can be obtained from these drawings without creative labor.
图1为本申请实施例中一种图像修复方法的一个实施例流程图;FIG. 1 is a flowchart of an embodiment of an image restoration method in an embodiment of the application;
图2为本申请实施例中一种图像修复方法在一个应用场景下寻找最佳匹配块的流程示意图;FIG. 2 is a schematic flowchart of an image restoration method in an embodiment of the application for finding the best matching block in an application scenario;
图3为本申请实施例中一种图像修复方法在一个应用场景下更新青蛙个体的流程示意图;FIG. 3 is a schematic flowchart of an image restoration method in an application scenario for updating an individual frog in an embodiment of the application;
图4为本申请实施例中一种图像修复装置的一个实施例结构图;4 is a structural diagram of an embodiment of an image restoration device in an embodiment of the application;
图5为本申请一实施例提供的一种终端设备的示意图。FIG. 5 is a schematic diagram of a terminal device provided by an embodiment of this application.
本发明的实施方式Embodiments of the invention
本申请实施例提供了一种图像修复方法、装置、计算机可读存储介质及终端设备,用于降低图像修复中最佳匹配块搜索匹配的时间复杂度,减少搜索匹配的占用时长,提高图像修复的修复速度和修复效率。The embodiments of the application provide an image restoration method, device, computer-readable storage medium, and terminal equipment, which are used to reduce the time complexity of searching and matching for the best matching block in image restoration, reduce the time taken for search and matching, and improve image restoration The repair speed and repair efficiency.
为使得本申请的发明目的、特征能够更加的明显和易懂,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,下面所描述的实施例仅仅是本申请一部分实施例,而非全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本申请保护的范围。In order to make the purpose and features of this application more obvious and understandable, the technical solutions in the embodiments of this application will be described clearly and completely in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the following description The embodiments are only a part of the embodiments of the present application, but not all the embodiments. Based on the embodiments in this application, all other embodiments obtained by a person of ordinary skill in the art without creative work shall fall within the protection scope of this application.
请参阅图1,本申请实施例提供了一种图像修复方法,所述图像修复方法包括:Referring to FIG. 1, an embodiment of the present application provides an image restoration method, and the image restoration method includes:
步骤S101、确定原始图像中待修复的目标区域和已知的源区域,并获取所述目标区域的边界像素点,其中,已知的源区域为所述原始图像中除所述目标区域以外的区域;Step S101: Determine the target area to be repaired and the known source area in the original image, and obtain boundary pixels of the target area, where the known source area is the original image excluding the target area area;
本申请实施例的执行主体为终端设备,该终端设备包括但不限于:服务器、计算机、智能手机以及平板电脑等设备。当某一原始图像存在破损需要对其进行修复时,可由相关人员自行标记出待修复的区域,并将标记后的原始图像输入至该终端设备中,该终端设备在接收到该原始图像后,即可根据标记确定出该原始图像中待修复的目标区域,并将该原始图像中除目标区域以外的区域确定为完好已知的源区域,同时确定出目标区域与源区域之间的边界,并获取边界处的边界像素点。The execution subject of the embodiments of the present application is a terminal device, which includes but is not limited to: servers, computers, smart phones, and tablet computers. When an original image is damaged and needs to be repaired, the relevant personnel can mark the area to be repaired by themselves, and input the marked original image into the terminal device. After the terminal device receives the original image, That is, the target area to be repaired in the original image can be determined according to the mark, and the area other than the target area in the original image can be determined as a well-known source area, and the boundary between the target area and the source area can be determined at the same time, And get the boundary pixels at the boundary.
可以理解的是,本申请实施例中,也可以在该终端设备中集成识别算法来自动识别原始图像中的破损区域,即当需要进行图像修复时,可直接将待修复的原始图像输入至该终端设备中,由该终端设备自行识别出该原始图像中待修复的区域,以确定出目标区域和源区域,从而省去人工标记过程,避免人工参与,提高图像修复的准确性和修复效率。It is understandable that in this embodiment of the application, a recognition algorithm can also be integrated in the terminal device to automatically identify the damaged area in the original image, that is, when image repair is required, the original image to be repaired can be directly input to the In the terminal device, the terminal device automatically recognizes the area to be repaired in the original image to determine the target area and the source area, thereby eliminating the manual marking process, avoiding manual participation, and improving the accuracy and efficiency of image repair.
步骤S102、以各边界像素点为中心点,构建预设大小的多个修复块,其中,所构建的修复块的数量与边界像素点的数量对应;Step S102, using each boundary pixel as a center point to construct multiple repair blocks of a preset size, wherein the number of the constructed repair blocks corresponds to the number of boundary pixels;
本申请实施例中,在获取到所述目标区域中的边界像素点后,则可以各边界像素点为中心点,构建出多个预设大小的修复块,如构建出多个m×n像素的修复块。其中,所述预设大小可以根据实际需要进行选取,而所构建的修复块的数量则与边界像素点的数量对应。In the embodiment of the present application, after the boundary pixels in the target area are acquired, each boundary pixel can be used as the center point to construct multiple repair blocks of preset sizes, such as multiple m×n pixels. Repair block. Wherein, the preset size can be selected according to actual needs, and the number of repair blocks to be constructed corresponds to the number of boundary pixels.
步骤S103、根据各修复块中样本像素点的个数和各修复块的结构信息计算各修复块的优先权,并根据所述优先权选择最先修复块;Step S103: Calculate the priority of each repair block according to the number of sample pixels in each repair block and the structure information of each repair block, and select the first repair block according to the priority;
在此,在构建出多个预设大小的修复块后,可根据下述公式计算各修复块的优先权,并可将具有最高优先权的修复块确定为最先修复块,以进行首先修复:Here, after constructing multiple repair blocks with preset sizes, the priority of each repair block can be calculated according to the following formula, and the repair block with the highest priority can be determined as the first repair block to perform the first repair :
Priority(p)=Credit(p)*Data(p)Priority(p)=Credit(p)*Data(p)
Figure PCTCN2019122568-appb-000001
Figure PCTCN2019122568-appb-000001
其中,Priority(p)为修复块p的优先权,Credit(p)为修复块p的置信度,表示修复块p中包含的样本像素点的个数,Data(p)为修复块p的数据项,表示修复块p的结构信息,
Figure PCTCN2019122568-appb-000002
Ω为目标区域,
Figure PCTCN2019122568-appb-000003
为源区域,|Ψp|为修复块p的待修复像素点的个数,n p为修复块p的边缘像素点p的法向量,
Figure PCTCN2019122568-appb-000004
为边缘像素点p处的等辐照线的方向和强度,α为归一化参数。
Among them, Priority(p) is the priority of repairing block p, Credit(p) is the confidence of repairing block p, indicating the number of sample pixels included in repairing block p, and Data(p) is the data of repairing block p Item, representing the structure information of the repair block p,
Figure PCTCN2019122568-appb-000002
Ω is the target area,
Figure PCTCN2019122568-appb-000003
Is the source area, |Ψp| is the number of pixels to be repaired in the repair block p, n p is the normal vector of the edge pixel p of the repair block p,
Figure PCTCN2019122568-appb-000004
Is the direction and intensity of the isoirradiation line at the edge pixel point p, and α is the normalized parameter.
可以理解的是,归一化参数α可以为255,|n p|=1。当修复块中位于源区域的样本像素点多,或者已填充好的像素点多,表明在修复过程中该修复块能提供更可靠的信息,因此置信度就会比较高,应优先修复。
Figure PCTCN2019122568-appb-000005
具体表示边缘像素点p梯度方向的垂直方向,其中,
Figure PCTCN2019122568-appb-000006
可通过偏微分方式来求取,如可根据
Figure PCTCN2019122568-appb-000007
I x、I y为边缘像素点在x、y方向上的偏微分来求取。由于图像在一个像素点上梯度值较大时,该点附近图像的纹理较为丰富、线性结构信息较多,而通过优先修复纹理较为丰富、线性结构信息较多的像素点,可使得图像的边缘结构更加平滑,进而使得修复效率和修复效果更好。因此,在图像修复过程中,图像的边缘部分,即纹理较为复杂、线性结构信息比较多的区域应优先得到修复,以使得图像在纹理 修复的同时能扩散图像的结构信息,从而提高图像修复效率和修复效果。
It is understandable that the normalization parameter α can be 255, and |n p |=1. When there are many sample pixels located in the source area in the repair block, or there are many filled pixels, it indicates that the repair block can provide more reliable information during the repair process, so the confidence level will be higher and the repair should be given priority.
Figure PCTCN2019122568-appb-000005
Specifically, it represents the vertical direction of the edge pixel point p gradient direction, where
Figure PCTCN2019122568-appb-000006
It can be obtained by partial differentiation, such as
Figure PCTCN2019122568-appb-000007
I x and I y are the partial differentials of the edge pixels in the x and y directions. Since the image has a large gradient value on a pixel point, the texture of the image near that point is richer and the linear structure information is more. By priority repairing the pixels with richer texture and more linear structure information, the edge of the image The structure is smoother, which in turn makes the repair efficiency and repair effect better. Therefore, in the image restoration process, the edge of the image, that is, the area with more complex texture and more linear structure information, should be restored first, so that the image can diffuse the structural information of the image while the texture is restored, thereby improving the efficiency of image restoration And repair effect.
步骤S104、利用预设蛙跳算法寻找所述源区域中与所述最先修复块最相似的最佳匹配块;Step S104, using a preset leapfrog algorithm to find the best matching block that is most similar to the first repaired block in the source area;
本申请实施例中,在确定出最先修复块后,则可以利用预设蛙跳算法来寻找完好的源区域中与所述最先修复块最相似的最佳匹配块,以通过所述最佳匹配块来进行所述最先修复块的修复。具体地,如图2所示,所述利用预设蛙跳算法寻找所述源区域中与所述最先修复块最相似的最佳匹配块,可以包括:In the embodiment of the present application, after the first repaired block is determined, the preset leapfrog algorithm can be used to find the best matching block most similar to the first repaired block in the intact source area, so as to pass the most Best matching block to repair the first repair block. Specifically, as shown in FIG. 2, using a preset leapfrog algorithm to find the best matching block most similar to the first repaired block in the source area may include:
步骤S201、获取所述源区域的样本像素点,并以所述样本像素点为中心点在所述源区域中构建所述预设大小的多个样本块;Step S201: Obtain sample pixel points of the source area, and construct a plurality of sample blocks of the preset size in the source area with the sample pixel points as the center point;
可以理解的是,在利用预设蛙跳算法寻找所述源区域中与所述最先修复块最相似的最佳匹配块时,可首先在所述源区域中构建与所述最先修复块大小相同的多个样本块,以使得可利用样本块的样本像素点来对最先待修复块进行修复。具体地,可首先获取所述源区域的各样本像素点,随后以各样本像素点为中心点在所述源区域中构建出所述预设大小的样本块,如若修复块的大小为4×3像素的话,则所构建的各样本块的大小也为4×3像素。It is understandable that when using a preset leapfrog algorithm to find the best matching block in the source area that is most similar to the first repaired block, the first repaired block can be constructed in the source area first. Multiple sample blocks with the same size, so that the sample pixels of the sample blocks can be used to repair the first block to be repaired. Specifically, each sample pixel of the source area may be obtained first, and then the sample block of the preset size is constructed in the source area with each sample pixel as the center point, if the size of the repair block is 4× With 3 pixels, the size of each sample block constructed is also 4×3 pixels.
步骤S202、将各所述样本块确定为一青蛙个体,得到所述预设蛙跳算法的初始群体;Step S202: Determine each of the sample blocks as an individual frog, and obtain the initial population of the preset frog leaping algorithm;
本申请实施例中,在所述源区域中构建出各样本块后,则可将各样本块设置为一青蛙个体,从而得到所述预设蛙跳算法的初始群体。可以理解的是,本申请实施例中,还可事先在该终端设备中进行预设蛙跳算法的初始化,即可预先设置所述预设蛙跳算法的族群数Q、族群内最大迭代次数J、群体最大迭代次数G、青蛙个体在改变位置时能够允许的最大变量Dmax等等。In the embodiment of the present application, after each sample block is constructed in the source area, each sample block can be set as an individual frog, so as to obtain the initial population of the preset leapfrog algorithm. It is understandable that, in the embodiment of the present application, the preset leaping algorithm can also be initialized in the terminal device in advance, and the number of groups Q of the preset leaping algorithm and the maximum number of iterations within the group J can be preset. , The maximum number of iterations of the group G, the maximum variable Dmax that an individual frog can allow when changing positions, etc.
步骤S203、采用预设适应度值计算方式计算所述初始群体中各青蛙个体的适应度值,并根据所述适应度值将所述初始群体划分为多个初始族群;Step S203: Calculate the fitness value of each frog individual in the initial group by using a preset fitness value calculation method, and divide the initial group into multiple initial groups according to the fitness value;
可以理解的是,在确定出所述预设蛙跳算法的初始群体后,可采用预设适应度值计算方式计算所述初始群体中各青蛙个体的适应度值,如可采用下述适应度值计算公式计算各青蛙个体的适应度值:It is understandable that after the initial population of the preset frog leaping algorithm is determined, the preset fitness value calculation method may be used to calculate the fitness value of each individual frog in the initial population, for example, the following fitness may be used The value calculation formula calculates the fitness value of each individual frog:
Figure PCTCN2019122568-appb-000008
Figure PCTCN2019122568-appb-000008
其中,F(X i)为样本块i对应的青蛙个体i的适应度值,a j为最先修复块中的第j个待修复像素点对应的灰度值,X ij为样本块i中的第j个样本像素点对应的灰度值,n为样本块i中像素点的总个数。 Among them, F(X i ) is the fitness value of the frog individual i corresponding to the sample block i, a j is the gray value corresponding to the j-th pixel to be repaired in the first repair block, and X ij is the sample block i The gray value corresponding to the j-th sample pixel, n is the total number of pixels in the sample block i.
本申请实施例中,优选采用样本块与最先修复块之间的像素差值的平方和来作为对应青蛙个体的适应度值,从而可通过适应度值初步反映出各样本块与最先修复块之间的匹配程度。In the embodiment of this application, it is preferable to use the square sum of the pixel difference between the sample block and the first repaired block as the fitness value of the corresponding frog individual, so that the fitness value of each sample block and the first repaired The degree of matching between blocks.
在此,在计算得到各青蛙个体的适应度值后,则可根据适应度值对各青蛙个体进行族群划分,以将所述初始群体划分为多个初始族群,其中,初始族群的族群数则可为所述预设蛙跳算法中初始化的族群数Q,即可将所述初始群体划分为Q个初始族群。其中,划分过程具体可以为:首先按照适应度值的大小对所有青蛙个体进行升序排列,然后,可将排名第1的青蛙个体划分至第1族群、将排名第2的青蛙个体划分至第2族群、……、将排名第q的青蛙个体划分至第Q族群,即首先将第1只青蛙个体-第q只青蛙个体分别划分至第1族群至第Q族群,再将第q+1只青蛙个体再次划分至第1族群,依次类推,直至将所有的青蛙个体划分完毕。Here, after the fitness value of each frog individual is calculated, each frog individual can be divided into groups according to the fitness value, so as to divide the initial group into multiple initial groups, where the number of initial groups is It can be the number of groups Q initialized in the preset frog leaping algorithm, and the initial group can be divided into Q initial groups. Among them, the division process can be specifically as follows: first, all frog individuals are arranged in ascending order according to the fitness value, and then the first frog individual can be divided into the first group, and the second frog individual can be divided into the second group. Ethnic group..., divide the q-th frog individual into the Q-th ethnic group, that is, first divide the first frog individual-the q-th frog individual into the first ethnic group to the Q-th ethnic group, and then divide the q+1 frog individual The frog individuals are again divided into the first group, and so on, until all the frog individuals are divided.
步骤S204、获取各初始族群中适应度值最大的最差青蛙个体,并按照预设更新方式对各最差青蛙个体进行更新,得到更新后的新族群;Step S204: Obtain the worst frog individual with the largest fitness value in each initial population, and update each worst frog individual according to a preset update method to obtain an updated new population;
在完成所有青蛙个体的划分,得到Q个初始族群后,可获取各初始族群内的最差青蛙个体,并可按照预设更新方式对各最差青蛙个体进行更新,如可采用基于收缩因子的更新方 式分别对各初始族群内的最差青蛙个体进行更新,以得到更新后的各新族群,其中,所述最差青蛙个体是指各初始族群或者新族群内适应度值最大的青蛙个体,相应地,最优青蛙个体则是指各初始族群或者新族群内适应度值最小的青蛙个体。本申请实施例中,基于收缩因子ε的位置更新方式具体可以为:After completing the division of all frog individuals and obtaining Q initial populations, the worst frog individuals in each initial population can be obtained, and the worst frog individuals can be updated according to a preset update method, such as shrinkage factor-based The update method updates the worst frog individuals in each initial group to obtain each new group after the update, wherein the worst frog individual refers to the frog individual with the largest fitness value in each initial group or new group, Correspondingly, the optimal frog individual refers to the frog individual with the smallest fitness value in each initial group or new group. In the embodiment of the present application, the location update method based on the shrinkage factor ε may specifically be:
newX i=ε*(X i+D) newX i =ε*(X i +D)
Figure PCTCN2019122568-appb-000009
Figure PCTCN2019122568-appb-000009
phi=4*rand(i)phi=4*rand(i)
其中,newX i为样本块i对应的青蛙个体i更新后的灰度值,ε为收缩因子,X i为青蛙个体i更新之前的灰度值,D为青蛙个体的更新步长系数。在此,更新步长系数可根据实际情况进行具体设定。 Wherein, newX i i sample blocks corresponding to individual i frog gradation value updated, ε is the shrinkage factor, X i is the grayscale value before the update frog individual i, D is the coefficient update step size frog subject. Here, the update step coefficient can be specifically set according to actual conditions.
进一步地,如图3所示,所述按照预设更新方式对各最差青蛙个体进行更新,得到更新后的新族群,可以包括Further, as shown in FIG. 3, the worst frog individuals are updated according to the preset update method to obtain the updated new group, which may include
步骤S301、按照预设更新方式对各最差青蛙个体进行更新,得到更新后的最差青蛙个体;Step S301: Update each worst frog individual according to a preset update method to obtain the updated worst frog individual;
步骤S302、计算更新后的最差青蛙个体的新适应度值;Step S302: Calculate the updated new fitness value of the worst frog individual;
步骤S303、判断所述新适应度值是否满足预设条件;Step S303: Determine whether the new fitness value meets a preset condition;
步骤S304、若所述新适应度值满足所述预设条件,则得到更新后的新族群;Step S304: If the new fitness value meets the preset condition, obtain an updated new ethnic group;
步骤S305、若所述新适应度值不满足所述预设条件,则随机生成一新青蛙个体,并利用所述新青蛙个体替换所述最差青蛙个体,得到更新后的新族群。Step S305: If the new fitness value does not meet the preset condition, randomly generate a new frog individual, and replace the worst frog individual with the new frog individual to obtain an updated new population.
对于上述步骤S301至步骤S305,可以理解的是,在采用基于收缩因子ε的更新方式对各最差青蛙个体进行更新后,可计算更新后的各最差青蛙个体的新适应度值,并可判断所述新适应度值是否满足预设条件,如可判断所述新适应度值是否小于该最差青蛙个体更新前的适应度值,若所述新适应度值满足所述预设条件,如所述新适应度值小于该最差青蛙个体更新前的适应度值的话,则在初始族群中保留更新后的最差青蛙个体,并将保留后的初始族群确定为更新后的新族群;若所述新适应度值不满足所述预设条件,如所述新适应度值大于或者等于该最差青蛙个体更新前的适应度值的话,则可随机生成一新青蛙个体,并可以利用所生成的新青蛙个体来替换该最差青蛙个体,以得到更新后的新族群。For the above steps S301 to S305, it can be understood that after the worst frog individual is updated by the update method based on the shrinkage factor ε, the updated fitness value of each worst frog individual can be calculated, and Determine whether the new fitness value meets a preset condition, for example, it can be determined whether the new fitness value is less than the fitness value of the worst frog individual before the update, if the new fitness value meets the preset condition, If the new fitness value is less than the fitness value of the worst frog individual before the update, then the updated worst frog individual is retained in the initial population, and the retained initial population is determined as the new updated population; If the new fitness value does not meet the preset condition, if the new fitness value is greater than or equal to the fitness value of the worst frog individual before the update, a new frog individual can be randomly generated and used The generated new frog individual replaces the worst frog individual to obtain the updated new population.
也就是说,当某一初始族群中的最差青蛙个体,在采用基于收缩因子ε的更新方式进行更新后,并未得到优化时,则可通过随机产生一个全新的青蛙个体作为该初始族群中的青蛙个体,以替换未优化的最差青蛙个体来得到对应的新族群,从而提高所述预设蛙跳算法的收敛速度,进而提高图像修复效率。That is to say, when the worst frog individual in a certain initial population is not optimized after the update method based on contraction factor ε is used, a brand new frog individual can be randomly generated as the initial population To replace the worst frog individuals that have not been optimized to obtain the corresponding new populations, thereby increasing the convergence speed of the preset frog leaping algorithm, thereby increasing the efficiency of image restoration.
步骤S205、判断所述新族群是否满足第一预设终止条件;Step S205: Determine whether the new ethnic group meets a first preset termination condition;
步骤S206、若所述新族群不满足所述第一预设终止条件,则将所述新族群确定为初始族群,并返回执行获取各初始族群中适应度值最大的最差青蛙个体的步骤以及后续步骤;Step S206: If the new ethnic group does not meet the first preset termination condition, determine the new ethnic group as the initial ethnic group, and return to the step of obtaining the worst frog individual with the largest fitness value among the initial ethnic groups; and Next steps
步骤S207、若所述新族群满足所述第一预设终止条件,则对各所述新族群进行混合,得到新群体;Step S207: If the new ethnic group meets the first preset termination condition, mix each of the new ethnic groups to obtain a new group;
对于上述步骤S205至步骤S207,可以理解的是,在得到各初始族群的每一代新族群后,可判断所述新族群是否满足第一预设终止条件,其中,所述第一预设终止条件可以为各族群的迭代次数是否达到预先设置的族群内最大迭代次数J,如当族群内最大迭代次数J设置为5次时,则表明对各族群需进行5次最差青蛙个体的更新,因此,在得到各初始族群的每一代新族群后,可判断各新族群的迭代次数是否达到5次,若未达到5次的话,则可确定新族群不满足所述第一预设终止条件,则可以在各新族群内重新计算各青蛙个体的适应度值,然后再次获取适应度值最大的最差青蛙个体,并对再次获取的各最差青蛙个体重新进行更新操作,直到各新族群中的迭代次数达到5次为止,即直到在各族群中进行了5次最差青蛙个体的更新时,停止迭代操作,然后对停止迭代后的所有新族群进行混合处理,以得到新群体。For the above steps S205 to S207, it can be understood that after each new generation of each initial ethnic group is obtained, it can be determined whether the new ethnic group meets the first preset termination condition, wherein the first preset termination condition It can be whether the number of iterations of each ethnic group reaches the preset maximum number of iterations J within the ethnic group. For example, when the maximum number of iterations J within the ethnic group is set to 5 times, it means that 5 times the worst frog individual update is required for each ethnic group, so After obtaining each new generation of the initial ethnic groups, it can be judged whether the number of iterations of each new ethnic group reaches 5 times. If it does not reach 5 times, it can be determined that the new ethnic group does not meet the first preset termination condition, then The fitness value of each frog individual can be recalculated in each new population, and then the worst frog individual with the largest fitness value can be obtained again, and the worst frog individual obtained again can be updated again until the value in each new population The number of iterations reaches 5, that is, until the update of the worst frog individuals in each group is performed 5 times, the iterative operation is stopped, and then all new groups after the iteration are stopped are mixed to obtain a new group.
可以理解的是,本申请实施例中,所述第一预设终止条件也可以为各族群中的最优青蛙个体连续相同的代数是否达到第一预设代数值,即可在族群的更新过程中实时统计最优青蛙个体连续相同的代数,当连续相同的代数达到预先设定的第一预设代数值时,则停止迭代操作,然后对停止迭代后的所有新族群进行混合处理,以得到新群体。It is understandable that, in the embodiment of the present application, the first preset termination condition may also be whether the optimal frog individuals in each ethnic group have the same algebra continuously reach the first preset algebra value, which can be used in the update process of the ethnic group. In real-time statistics, the optimal frog individual has the same continuous algebra. When the continuous same algebra reaches the first preset algebra value, the iterative operation is stopped, and then all the new populations after the iteration are stopped are mixed to obtain New groups.
步骤S208、判断所述新群体是否满足第二预设终止条件;Step S208: Determine whether the new group meets a second preset termination condition;
步骤S209、若所述新群体满足所述第二预设终止条件,则获取所述新群体的最优青蛙个体,并将所述最优青蛙个体对应的样本块确定为与所述最先修复块最相似的最佳匹配块;Step S209: If the new group satisfies the second preset termination condition, obtain the optimal frog individual of the new group, and determine the sample block corresponding to the optimal frog individual as the first restoration The best matching block with the most similar blocks;
步骤S210、若所述新群体不满足所述第二预设终止条件,则将所述新群体确定为初始群体,并返回执行采用预设适应度值计算方式计算所述初始群体中各青蛙个体的适应度值的步骤以及后续步骤。Step S210: If the new group does not meet the second preset termination condition, determine the new group as the initial group, and return to execute the calculation of each frog individual in the initial group using a preset fitness value calculation method The fitness value of the steps and subsequent steps.
对于上述步骤S208至步骤S210,可以理解的是,在得到混合后的新群体之后,可进一步判断所述新群体是否满足第二预设终止条件,其中,所述第二预设终止条件可以为群体的迭代次数是否达到预先设置的群体最大迭代次数G,如当群体最大迭代次数G设置为10次时,则在得到混合后的新群体后,判断所述新群体的迭代次数是否达到10次,若未达到10次的话,则可确定新群体不满足所述第二预设条件,并对所述新群体的各青蛙个体重新进行适应度值的计算,然后按照新计算的适应度值重新进行族群的划分,并重新进行最差青蛙个体的更新,直到新群体的迭代次数达到10次时,停止迭代操作,并将所述新群体此时的最优青蛙个体所表示的样本块确定为与所述最先修复块最相似的最佳匹配块。For the above steps S208 to S210, it can be understood that after the new mixed group is obtained, it can be further determined whether the new group meets the second preset termination condition, where the second preset termination condition may be Whether the number of iterations of the group reaches the preset maximum number of iterations of the group G, for example, when the maximum number of iterations of the group G is set to 10 times, after a new mixed group is obtained, judge whether the number of iterations of the new group reaches 10 times If it has not reached 10 times, it can be determined that the new group does not meet the second preset condition, and the fitness value of each frog individual in the new group is recalculated, and then the fitness value is recalculated according to the newly calculated fitness value. Divide the group and re-update the worst frog individual until the number of iterations of the new group reaches 10, stop the iterative operation, and determine the sample block represented by the best frog individual of the new group at this time as The best matching block most similar to the first repaired block.
可以理解的是,所述第二预设终止条件也可以为群体中的最优青蛙个体连续相同的代数是否达到第二预设代数值,即可在群体迭代过程中实时统计最优青蛙个体连续相同的代数,当连续相同的代数达到预先设定的第二预设代数值时,则停止迭代操作,并将当前新群体的最优青蛙个体所表示的样本块确定为与所述最先修复块最相似的最佳匹配块。It is understandable that the second preset termination condition may also be whether the optimal frog individuals in the group have reached the second preset algebraic value for the same number of consecutive algebras, that is, real-time statistics of the optimal frog individuals in the group iteration process For the same algebra, when the same consecutive algebra reaches the preset second preset algebra value, the iterative operation is stopped, and the sample block represented by the optimal frog individual of the current new population is determined to be the same as the first restoration The best matching block with the most similar blocks.
步骤S105、采用所述最佳匹配块对应的样本像素点修复所述最先修复块的对应像素点;Step S105, using the sample pixels corresponding to the best matching block to repair the corresponding pixels of the first repaired block;
本申请实施例中,在得到与所述最先修复块最相似的最佳匹配块后,可采用所述最佳匹配块对应的样本像素点来填充所述最先修复块中待修复的对应像素点,以对所述最先修复块进行修复。In the embodiment of the present application, after the best matching block that is most similar to the first repaired block is obtained, the sample pixels corresponding to the best matching block can be used to fill the corresponding to-be-repaired in the first repaired block Pixel points to repair the first repair block.
步骤S106、将已修复的所述最先修复块划分至所述源区域,并更新所述目标区域的边界像素点;Step S106, dividing the first repaired block that has been repaired into the source area, and updating the boundary pixels of the target area;
步骤S107、判断更新后的边界像素点的个数是否大于设定阈值;Step S107: Determine whether the number of updated boundary pixels is greater than a set threshold;
步骤S108、若更新后的边界像素点的个数小于或者等于所述设定阈值,则确定所述原始图像修复完成并获取更新后的所述源区域;若更新后的边界像素点的个数大于所述设定阈值,则返回执行以各边界像素点为中心点,构建预设大小的多个修复块的步骤以及后续步骤。Step S108: If the number of updated boundary pixels is less than or equal to the set threshold, it is determined that the original image restoration is completed and the updated source area is obtained; if the number of updated boundary pixels is If it is greater than the set threshold, return to the execution of the step of constructing multiple repair blocks of preset size with each boundary pixel as the center point and subsequent steps.
对于上述步骤S106至步骤S108,可以理解的是,在每一次完成最先修复块的修复之后,可将修复完成的最先修复块划分至所述源区域,并将修复完成的最先修复块所对应的边界像素点确定已知的样本像素点来更新所述目标区域的边界像素点,边界像素点更新完成后,可对所述目标区域进行检测,以判断所述原始图像是否修复完成,即检测所述目标区域的边界像素点的个数是否大于设定阈值,其中,所述设定阈值可以设置为0,也就是说,检测所述目标区域是否为空,若所述目标区域的边界像素点的个数大于设定阈值,如大于0的话,则表明还存在未修复的目标区域,即所述原始图像未修复完成,此时则可根据更新后的边界像素点重新构建修复块,并重新计算所新构建的各修复块的优先权来进行下一个最先修复块的确定与修复,直到所述目标区域的边界像素点的个数小于或者等于设定阈值时,如所述目标区域的边界像素点的个数等于0时,则确定所述原始图像修复完成,并获取修复完成的修复图像。For the above steps S106 to S108, it can be understood that after each repair of the first repaired block is completed, the repaired first repaired block can be divided into the source area, and the repaired first repaired block The corresponding boundary pixels determine the known sample pixels to update the boundary pixels of the target area. After the boundary pixels are updated, the target area can be detected to determine whether the original image has been repaired, That is, it is detected whether the number of boundary pixels of the target area is greater than a set threshold, where the set threshold can be set to 0, that is, it is detected whether the target area is empty. The number of boundary pixels is greater than the set threshold. If it is greater than 0, it indicates that there is an unrepaired target area, that is, the original image has not been repaired. At this time, the repair block can be reconstructed based on the updated boundary pixels. , And recalculate the priority of each newly constructed repair block to determine and repair the next first repair block until the number of boundary pixels in the target area is less than or equal to the set threshold, as described When the number of boundary pixels of the target area is equal to 0, it is determined that the restoration of the original image is completed, and the restored restoration image is obtained.
本申请实施例中,在确定出待修复的原始图像的最先修复块后,可通过预设蛙跳算法来寻找源区域中与该最先修复块最相似的最佳匹配块,从而利用最佳匹配块的样本像素点来对最先修复块进行修复,即通过预设蛙跳算法的快速局部搜索和全局搜索来进行最佳匹配块 的搜索匹配,可降低最佳匹配块搜索匹配的时间复杂度,减少搜索匹配的占用时长,从而及大地提高了图像修复的修复速度和修复效率。In the embodiment of the present application, after the first repaired block of the original image to be repaired is determined, a preset leaping algorithm can be used to find the best matching block most similar to the first repaired block in the source area, so as to use the most The sample pixels of the best matching block are used to repair the first repaired block, that is, the search and matching of the best matching block can be performed through the fast local search and global search of the preset frog leaping algorithm, which can reduce the search and matching time of the best matching block Complexity, reducing the time occupied by search and matching, thereby greatly improving the repair speed and efficiency of image repair.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the sequence number of each step in the foregoing embodiment does not mean the order of execution. The execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiment of the present application.
上面主要描述了一种图像修复方法,下面将对一种图像修复装置进行详细描述。The above mainly describes an image restoration method, and an image restoration device will be described in detail below.
如图4所示,本申请实施例提供了一种图像修复装置,所述图像修复装置包括:As shown in FIG. 4, an embodiment of the present application provides an image restoration device, and the image restoration device includes:
边界点获取模块401,用于确定原始图像中待修复的目标区域和已知的源区域,并获取所述目标区域的边界像素点,其中,已知的源区域为所述原始图像中除所述目标区域以外的区域;The boundary point acquisition module 401 is used to determine the target area to be repaired and the known source area in the original image, and to acquire boundary pixels of the target area, where the known source area is the original image The area outside the target area;
修复块构建模块402,用于以各边界像素点为中心点,构建预设大小的多个修复块,其中,所构建的修复块的数量与边界像素点的数量对应;The repair block construction module 402 is used to construct multiple repair blocks of a preset size with each boundary pixel as a center point, wherein the number of the constructed repair block corresponds to the number of the boundary pixel;
优先权计算模块403,用于根据各修复块中样本像素点的个数和各修复块的结构信息计算各修复块的优先权,并根据所述优先权选择最先修复块;The priority calculation module 403 is configured to calculate the priority of each repair block according to the number of sample pixels in each repair block and the structure information of each repair block, and select the first repair block according to the priority;
匹配块寻找模块404,用于利用预设蛙跳算法寻找所述源区域中与所述最先修复块最相似的最佳匹配块;A matching block searching module 404, configured to search for the best matching block that is most similar to the first repaired block in the source area by using a preset leapfrog algorithm;
修复块修复模块405,用于采用所述最佳匹配块对应的样本像素点修复所述最先修复块的对应像素点;A repair block repair module 405, configured to use the sample pixels corresponding to the best matching block to repair the corresponding pixels of the first repair block;
边界点更新模块406,用于将已修复的所述最先修复块划分至所述源区域,并更新所述目标区域的边界像素点;A boundary point update module 406, configured to divide the first repaired block that has been repaired into the source area, and update the boundary pixels of the target area;
修复完成确定模块407,用于若更新后的边界像素点的个数大于设定阈值,则返回执行以各边界像素点为中心点,构建预设大小的多个修复块的步骤以及后续步骤,直到更新后的边界像素点的个数小于或者等于所述设定阈值时,确定所述原始图像修复完成并获取更新后的所述源区域。The repair completion determination module 407 is configured to return to the execution of the step of constructing multiple repair blocks of preset size with each boundary pixel as the center point and subsequent steps if the number of updated boundary pixels is greater than the set threshold. Until the number of updated boundary pixels is less than or equal to the set threshold, it is determined that the original image is repaired and the updated source area is acquired.
进一步地,所述匹配块寻找模块404,可以包括:Further, the matching block searching module 404 may include:
样本块构建单元,用于获取所述源区域的样本像素点,并以所述样本像素点为中心点在所述源区域中构建所述预设大小的多个样本块;A sample block construction unit, configured to obtain sample pixels of the source area, and construct a plurality of sample blocks of the preset size in the source area with the sample pixel as a center point;
初始群体获取单元,用于将各所述样本块确定为一青蛙个体,得到所述预设蛙跳算法的初始群体;An initial population acquisition unit, configured to determine each of the sample blocks as an individual frog, and obtain the initial population of the preset frog leaping algorithm;
初始族群划分单元,用于采用预设适应度值计算方式计算所述初始群体中各青蛙个体的适应度值,并根据所述适应度值将所述初始群体划分为多个初始族群;The initial ethnic group division unit is configured to calculate the fitness value of each frog individual in the initial group using a preset fitness value calculation method, and divide the initial group into multiple initial ethnic groups according to the fitness value;
新族群获取单元,用于获取各初始族群中适应度值最大的最差青蛙个体,并按照预设更新方式对各最差青蛙个体进行更新,得到更新后的新族群;The new ethnic group acquisition unit is used to acquire the worst frog individual with the largest fitness value in each initial ethnic group, and update each worst frog individual according to the preset update method to obtain the updated new ethnic group;
新族群判断单元,用于判断所述新族群是否满足第一预设终止条件;A new ethnic group judging unit, configured to determine whether the new ethnic group meets the first preset termination condition;
初始族群确定单元,用于若所述新族群不满足所述第一预设终止条件,则将所述新族群确定为初始族群,并返回执行获取各初始族群中适应度值最大的最差青蛙个体的步骤以及后续步骤;The initial ethnic group determination unit is configured to determine the new ethnic group as the initial ethnic group if the new ethnic group does not meet the first preset termination condition, and return to execute the process of obtaining the worst frog with the largest fitness value among the initial ethnic groups Individual steps and subsequent steps;
新群体获取单元,用于若所述新族群满足所述第一预设终止条件,则对各所述新族群进行混合,得到新群体;A new group obtaining unit, configured to mix each of the new groups to obtain a new group if the new group meets the first preset termination condition;
新群体判断单元,用于判断所述新群体是否满足第二预设终止条件;The new group judgment unit is used to judge whether the new group meets the second preset termination condition;
匹配块确定单元,用于若所述新群体满足所述第二预设终止条件,则获取所述新群体的最优青蛙个体,并将所述最优青蛙个体对应的样本块确定为与所述最先修复块最相似的最佳匹配块;The matching block determination unit is configured to, if the new group meets the second preset termination condition, obtain the optimal frog individual of the new group, and determine the sample block corresponding to the optimal frog individual as the The best matching block that is the most similar to the first repaired block;
初始群体确定单元,用于若所述新群体不满足所述第二预设终止条件,则将所述新群体确定为初始群体,并返回执行采用预设适应度值计算方式计算所述初始群体中各青蛙个体的适应度值的步骤以及后续步骤。The initial group determining unit is configured to determine the new group as the initial group if the new group does not meet the second preset termination condition, and return to execute the calculation of the initial group using a preset fitness value calculation method The steps in the fitness value of each frog individual and subsequent steps.
优选地,所述预设适应度值计算方式为:Preferably, the preset fitness value calculation method is:
Figure PCTCN2019122568-appb-000010
Figure PCTCN2019122568-appb-000010
其中,F(X i)为样本块i对应的青蛙个体i的适应度值,a j为最先修复块中的第j个待修复像素点对应的灰度值,X ij为样本块i中的第j个样本像素点对应的灰度值,n为样本块i中像素点的总个数。 Among them, F(X i ) is the fitness value of the frog individual i corresponding to the sample block i, a j is the gray value corresponding to the j-th pixel to be repaired in the first repair block, and X ij is the sample block i The gray value corresponding to the j-th sample pixel, n is the total number of pixels in the sample block i.
可选地,所述新族群获取单元,具体用于根据下述更新公式对各最差青蛙个体进行更新:Optionally, the new ethnic group acquiring unit is specifically configured to update each worst frog individual according to the following update formula:
newX i=ε*(X i+D) newX i =ε*(X i +D)
Figure PCTCN2019122568-appb-000011
Figure PCTCN2019122568-appb-000011
phi=4*rand(i)phi=4*rand(i)
其中,newX i为样本块i对应的青蛙个体i更新后的灰度值,X i为青蛙个体i更新之前的灰度值,D为青蛙个体的更新步长系数。 Wherein, newX i i sample blocks corresponding to individual i frog gradation value updated, X i is the grayscale value before the update frog individual i, D is the coefficient update step size frog subject.
进一步地,所述新族群获取单元,可以包括:Further, the new ethnic group acquiring unit may include:
更新子单元,用于按照预设更新方式对各最差青蛙个体进行更新,得到更新后的最差青蛙个体;The update subunit is used to update each worst frog individual according to a preset update method to obtain the updated worst frog individual;
新适应度值计算子单元,用于计算更新后的最差青蛙个体的新适应度值;The new fitness value calculation subunit is used to calculate the updated new fitness value of the worst frog individual;
新适应度值判断子单元,用于判断所述新适应度值是否满足预设条件;The new fitness value judgment subunit is used to judge whether the new fitness value meets a preset condition;
个体随机生成子单元,用于若所述新适应度值不满足所述预设条件,则随机生成一新青蛙个体,并利用所述新青蛙个体替换所述最差青蛙个体,得到更新后的新族群。The individual random generation subunit is used to randomly generate a new frog individual if the new fitness value does not meet the preset condition, and replace the worst frog individual with the new frog individual to obtain the updated frog individual New ethnic group.
优选地,所述优先权计算模块403,具体用于根据下述公式计算各修复块的优先权:Preferably, the priority calculation module 403 is specifically configured to calculate the priority of each repair block according to the following formula:
Priority(p)=Credit(p)*Data(p)Priority(p)=Credit(p)*Data(p)
Figure PCTCN2019122568-appb-000012
Figure PCTCN2019122568-appb-000012
Figure PCTCN2019122568-appb-000013
Figure PCTCN2019122568-appb-000013
其中,Priority(p)为修复块p的优先权,Credit(p)为修复块p的置信度,表示修复块p中包含的样本像素点的个数,Data(p)为修复块p的数据项,表示修复块p的结构信息,
Figure PCTCN2019122568-appb-000014
Ω为目标区域,
Figure PCTCN2019122568-appb-000015
为源区域,|Ψp|为修复块p的待修复像素点的个数,n p为修复块p的边缘像素点p的法向量,
Figure PCTCN2019122568-appb-000016
为边缘像素点p处的等辐照线的方向和强度,α为归一化参数。
Among them, Priority(p) is the priority of repairing block p, Credit(p) is the confidence of repairing block p, indicating the number of sample pixels included in repairing block p, and Data(p) is the data of repairing block p Item, representing the structure information of the repair block p,
Figure PCTCN2019122568-appb-000014
Ω is the target area,
Figure PCTCN2019122568-appb-000015
Is the source area, |Ψp| is the number of pixels to be repaired in the repair block p, n p is the normal vector of the edge pixel p of the repair block p,
Figure PCTCN2019122568-appb-000016
Is the direction and intensity of the isoirradiation line at the edge pixel point p, and α is the normalized parameter.
图5是本申请一实施例提供的一种终端设备的示意图。如图5所示,该实施例的一种终端设备5包括:处理器50、存储器51以及存储在所述存储器51中并可在所述处理器50上运行的计算机可读指令52,例如图像修复程序。所述处理器50执行所述计算机可读指令52时实现上述各个图像修复方法实施例中的步骤,例如图1所示的步骤S101至步骤S108。或者,所述处理器50执行所述计算机可读指令52时实现上述各装置实施例中各模块/单元的功能,例如图4所示的模块401至模块407的功能。Fig. 5 is a schematic diagram of a terminal device provided by an embodiment of the present application. As shown in FIG. 5, a terminal device 5 of this embodiment includes: a processor 50, a memory 51, and computer-readable instructions 52 stored in the memory 51 and executable on the processor 50, such as an image Repair procedures. When the processor 50 executes the computer-readable instructions 52, the steps in the foregoing image restoration method embodiments, such as steps S101 to S108 shown in FIG. 1, are implemented. Alternatively, when the processor 50 executes the computer-readable instructions 52, the functions of the modules/units in the foregoing device embodiments, such as the functions of the modules 401 to 407 shown in FIG. 4, are realized.
示例性的,所述计算机可读指令52可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器51中,并由所述处理器50执行,以完成本申请。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机可读指令段,该指令段用于描述所述计算机可读指令52在所述终端设备5中的执行过程。Exemplarily, the computer-readable instruction 52 may be divided into one or more modules/units, and the one or more modules/units are stored in the memory 51 and executed by the processor 50, To complete this application. The one or more modules/units may be a series of computer-readable instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer-readable instructions 52 in the terminal device 5.
所述终端设备5可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述终端设备可包括,但不仅限于,处理器50、存储器51。本领域技术人员可以理解,图5仅仅是终端设备5的示例,并不构成对终端设备5的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述终端设备还可以包括输入输出设备、网 络接入设备、总线等。The terminal device 5 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server. The terminal device may include, but is not limited to, a processor 50 and a memory 51. Those skilled in the art can understand that FIG. 5 is only an example of the terminal device 5, and does not constitute a limitation on the terminal device 5. It may include more or less components than shown in the figure, or a combination of certain components, or different components. For example, the terminal device may also include input and output devices, network access devices, buses, etc.
所述处理器50可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The processor 50 may be a central processing unit (Central Processing Unit, CPU), other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), Ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
所述存储器51可以是所述终端设备5的内部存储单元,例如终端设备5的硬盘或内存。所述存储器51也可以是所述终端设备5的外部存储设备,例如所述终端设备5上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器51还可以既包括所述终端设备6的内部存储单元也包括外部存储设备。所述存储器51用于存储所述计算机可读指令以及所述终端设备所需的其他程序和数据。所述存储器51还可以用于暂时地存储已经输出或者将要输出的数据。The memory 51 may be an internal storage unit of the terminal device 5, such as a hard disk or a memory of the terminal device 5. The memory 51 may also be an external storage device of the terminal device 5, for example, a plug-in hard disk equipped on the terminal device 5, a smart memory card (Smart Media Card, SMC), and a Secure Digital (SD) Card, Flash Card, etc. Further, the memory 51 may also include both an internal storage unit of the terminal device 6 and an external storage device. The memory 51 is used to store the computer readable instructions and other programs and data required by the terminal device. The memory 51 can also be used to temporarily store data that has been output or will be output.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, the functional units in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一计算机非易失性可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing relevant hardware through computer-readable instructions. The computer-readable instructions can be stored in a non-volatile computer. In a readable storage medium, when the computer-readable instructions are executed, they may include the processes of the above-mentioned method embodiments. Wherein, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and/or volatile memory. Non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not a limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Channel (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。As mentioned above, the above embodiments are only used to illustrate the technical solutions of the present application, not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, a person of ordinary skill in the art should understand that: The technical solutions recorded in the embodiments are modified, or some of the technical features are equivalently replaced; these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (20)

  1. 一种图像修复方法,其特征在于,包括:An image restoration method, characterized in that it comprises:
    确定原始图像中待修复的目标区域和已知的源区域,并获取所述目标区域的边界像素点,其中,已知的源区域为所述原始图像中除所述目标区域以外的区域;Determine a target area to be repaired and a known source area in the original image, and obtain boundary pixels of the target area, where the known source area is an area in the original image excluding the target area;
    以各边界像素点为中心点,构建预设大小的多个修复块,其中,所构建的修复块的数量与边界像素点的数量对应;Using each boundary pixel as a center point, construct multiple repair blocks of a preset size, wherein the number of constructed repair blocks corresponds to the number of boundary pixels;
    根据各修复块中样本像素点的个数和各修复块的结构信息计算各修复块的优先权,并根据所述优先权选择最先修复块;Calculate the priority of each repair block according to the number of sample pixels in each repair block and the structure information of each repair block, and select the first repair block according to the priority;
    利用预设蛙跳算法寻找所述源区域中与所述最先修复块最相似的最佳匹配块;Searching for the best matching block that is most similar to the first repaired block in the source area by using a preset leapfrog algorithm;
    采用所述最佳匹配块对应的样本像素点修复所述最先修复块的对应像素点;Repairing the corresponding pixel of the first repaired block by using the sample pixel corresponding to the best matching block;
    将已修复的所述最先修复块划分至所述源区域,并更新所述目标区域的边界像素点;Dividing the repaired first repair block into the source area, and updating boundary pixels of the target area;
    若更新后的边界像素点的个数大于设定阈值,则返回执行以各边界像素点为中心点,构建预设大小的多个修复块的步骤以及后续步骤,直到更新后的边界像素点的个数小于或者等于所述设定阈值时,确定所述原始图像修复完成并获取更新后的所述源区域。If the number of updated boundary pixels is greater than the set threshold, return to the step of constructing multiple repair blocks of preset sizes with each boundary pixel as the center point and subsequent steps until the updated boundary pixel is completed When the number is less than or equal to the set threshold, it is determined that the original image restoration is completed and the updated source area is obtained.
  2. 根据权利要求1所述的图像修复方法,其特征在于,所述利用预设蛙跳算法寻找所述源区域中与所述最先修复块最相似的最佳匹配块,包括:The image restoration method according to claim 1, wherein said using a preset leapfrog algorithm to find the best matching block most similar to the first restoration block in the source region comprises:
    获取所述源区域的样本像素点,并以所述样本像素点为中心点在所述源区域中构建所述预设大小的多个样本块;Acquiring sample pixels of the source area, and constructing a plurality of sample blocks of the preset size in the source area with the sample pixel as a center point;
    将各所述样本块确定为一青蛙个体,得到所述预设蛙跳算法的初始群体;Determining each of the sample blocks as an individual frog, and obtaining the initial population of the preset frog leaping algorithm;
    采用预设适应度值计算方式计算所述初始群体中各青蛙个体的适应度值,并根据所述适应度值将所述初始群体划分为多个初始族群;Calculating the fitness value of each frog individual in the initial group by using a preset fitness value calculation method, and dividing the initial group into multiple initial groups according to the fitness value;
    获取各初始族群中适应度值最大的最差青蛙个体,并按照预设更新方式对各最差青蛙个体进行更新,得到更新后的新族群;Obtain the worst frog individual with the largest fitness value in each initial population, and update each worst frog individual according to the preset update method to obtain the updated new population;
    判断所述新族群是否满足第一预设终止条件;Determine whether the new ethnic group meets the first preset termination condition;
    若所述新族群不满足所述第一预设终止条件,则将所述新族群确定为初始族群,并返回执行获取各初始族群中适应度值最大的最差青蛙个体的步骤以及后续步骤;If the new ethnic group does not meet the first preset termination condition, determine the new ethnic group as the initial ethnic group, and return to execute the step of obtaining the worst frog individual with the largest fitness value in each initial ethnic group and subsequent steps;
    若所述新族群满足所述第一预设终止条件,则对各所述新族群进行混合,得到新群体;If the new ethnic group meets the first preset termination condition, mixing each of the new ethnic groups to obtain a new group;
    判断所述新群体是否满足第二预设终止条件;Determine whether the new group meets the second preset termination condition;
    若所述新群体满足所述第二预设终止条件,则获取所述新群体的最优青蛙个体,并将所述最优青蛙个体对应的样本块确定为与所述最先修复块最相似的最佳匹配块;If the new group satisfies the second preset termination condition, obtain the optimal frog individual of the new group, and determine the sample block corresponding to the optimal frog individual as the most similar to the first repaired block The best matching block;
    若所述新群体不满足所述第二预设终止条件,则将所述新群体确定为初始群体,并返回执行采用预设适应度值计算方式计算所述初始群体中各青蛙个体的适应度值的步骤以及后续步骤。If the new group does not meet the second preset termination condition, determine the new group as the initial group, and return to the execution of calculating the fitness of each frog individual in the initial group using a preset fitness value calculation method Value steps and subsequent steps.
  3. 根据权利要求2所述的图像修复方法,其特征在于,所述预设适应度值计算方式为:The image restoration method according to claim 2, wherein the preset fitness value calculation method is:
    Figure PCTCN2019122568-appb-100001
    Figure PCTCN2019122568-appb-100001
    其中,F(X i)为样本块i对应的青蛙个体i的适应度值,a j为最先修复块中的第j个待修复像素点对应的灰度值,X ij为样本块i中的第j个样本像素点对应的灰度值,n为样本块i中像素点的总个数。 Among them, F(X i ) is the fitness value of the frog individual i corresponding to the sample block i, a j is the gray value corresponding to the j-th pixel to be repaired in the first repair block, and X ij is the sample block i The gray value corresponding to the j-th sample pixel, n is the total number of pixels in the sample block i.
  4. 根据权利要求2所述的图像修复方法,其特征在于,所述按照预设更新方式对各最差青蛙个体进行更新,包括:The image restoration method according to claim 2, wherein said updating each worst frog individual according to a preset updating method comprises:
    根据下述更新公式对各最差青蛙个体进行更新:Update each worst frog individual according to the following update formula:
    newX i=ε*(X i+D) newX i =ε*(X i +D)
    Figure PCTCN2019122568-appb-100002
    Figure PCTCN2019122568-appb-100002
    其中,newX i为样本块i对应的青蛙个体i更新后的灰度值,X i为青蛙个体i更新之前的灰度值,D为青蛙个体的更新步长系数。 Wherein, newX i i sample blocks corresponding to individual i frog gradation value updated, X i is the grayscale value before the update frog individual i, D is the coefficient update step size frog subject.
  5. 根据权利要求2所述的图像修复方法,其特征在于,所述按照预设更新方式对各最差青蛙个体进行更新,得到更新后的新族群,包括:The image restoration method according to claim 2, wherein said updating each worst frog individual according to a preset updating method to obtain the updated new group comprises:
    按照预设更新方式对各最差青蛙个体进行更新,得到更新后的最差青蛙个体;Update each worst frog individual according to the preset update method, and obtain the updated worst frog individual;
    计算更新后的最差青蛙个体的新适应度值;Calculate the updated fitness value of the worst frog individual;
    判断所述新适应度值是否满足预设条件;Determine whether the new fitness value meets a preset condition;
    若所述新适应度值不满足所述预设条件,则随机生成一新青蛙个体,并利用所述新青蛙个体替换所述最差青蛙个体,得到更新后的新族群。If the new fitness value does not meet the preset condition, a new frog individual is randomly generated, and the worst frog individual is replaced with the new frog individual to obtain an updated new population.
  6. 根据权利要求1至5中任一项所述的图像修复方法,其特征在于,所述根据各修复块中样本像素点的个数和各修复块的结构信息计算各修复块的优先权,包括:The image restoration method according to any one of claims 1 to 5, wherein the calculation of the priority of each restoration block according to the number of sample pixels in each restoration block and the structure information of each restoration block includes :
    根据下述公式计算各修复块的优先权:Calculate the priority of each repair block according to the following formula:
    Priority(p)=Credit(p)*Data(p)Priority(p)=Credit(p)*Data(p)
    Figure PCTCN2019122568-appb-100003
    Figure PCTCN2019122568-appb-100003
    Figure PCTCN2019122568-appb-100004
    Figure PCTCN2019122568-appb-100004
    其中,Priority(p)为修复块p的优先权,Credit(p)为修复块p的置信度,表示修复块p中包含的样本像素点的个数,Data(p)为修复块p的数据项,表示修复块p的结构信息,
    Figure PCTCN2019122568-appb-100005
    Ω为目标区域,
    Figure PCTCN2019122568-appb-100006
    为源区域,|Ψp|为修复块p的待修复像素点的个数,n p为修复块p的边缘像素点p的法向量,
    Figure PCTCN2019122568-appb-100007
    为边缘像素点p处的等辐照线的方向和强度,α为归一化参数。
    Among them, Priority(p) is the priority of repairing block p, Credit(p) is the confidence of repairing block p, indicating the number of sample pixels included in repairing block p, and Data(p) is the data of repairing block p Item, representing the structure information of the repair block p,
    Figure PCTCN2019122568-appb-100005
    Ω is the target area,
    Figure PCTCN2019122568-appb-100006
    Is the source area, |Ψp| is the number of pixels to be repaired in the repair block p, n p is the normal vector of the edge pixel p of the repair block p,
    Figure PCTCN2019122568-appb-100007
    Is the direction and intensity of the isoirradiation line at the edge pixel point p, and α is the normalized parameter.
  7. 一种图像修复装置,其特征在于,包括:An image restoration device, characterized by comprising:
    边界点获取模块,用于确定原始图像中待修复的目标区域和已知的源区域,并获取所述目标区域的边界像素点,其中,已知的源区域为所述原始图像中除所述目标区域以外的区域;The boundary point acquisition module is used to determine the target area to be repaired in the original image and the known source area, and obtain boundary pixels of the target area, where the known source area is the original image divided by the Area outside the target area;
    修复块构建模块,用于以各边界像素点为中心点,构建预设大小的多个修复块,其中,所构建的修复块的数量与边界像素点的数量对应;The repair block building module is used to construct multiple repair blocks of preset size with each boundary pixel as the center point, wherein the number of the constructed repair block corresponds to the number of the boundary pixel;
    优先权计算模块,用于根据各修复块中样本像素点的个数和各修复块的结构信息计算各修复块的优先权,并根据所述优先权选择最先修复块;The priority calculation module is used to calculate the priority of each repair block according to the number of sample pixels in each repair block and the structure information of each repair block, and select the first repair block according to the priority;
    匹配块寻找模块,用于利用预设蛙跳算法寻找所述源区域中与所述最先修复块最相似的最佳匹配块;A matching block searching module, configured to use a preset leapfrog algorithm to find the best matching block most similar to the first repaired block in the source area;
    修复块修复模块,用于采用所述最佳匹配块对应的样本像素点修复所述最先修复块的对应像素点;A repair block repair module, configured to use the sample pixels corresponding to the best matching block to repair the corresponding pixels of the first repair block;
    边界点更新模块,用于将已修复的所述最先修复块划分至所述源区域,并更新所述目标区域的边界像素点;A boundary point update module, configured to divide the repaired first repair block into the source area and update the boundary pixels of the target area;
    修复完成确定模块,用于若更新后的边界像素点的个数大于设定阈值,则返回执行以各边界像素点为中心点,构建预设大小的多个修复块的步骤以及后续步骤,直到更新后的边界像素点的个数小于或者等于所述设定阈值时,确定所述原始图像修复完成并获取更新后的所述源区域。The repair completion determining module is used for if the number of updated boundary pixels is greater than the set threshold, return to execute the steps of constructing multiple repair blocks of preset size with each boundary pixel as the center point and subsequent steps until When the number of updated boundary pixels is less than or equal to the set threshold, it is determined that the original image repair is completed and the updated source area is obtained.
  8. 根据权利要求7所述的图像修复装置,其特征在于,所述匹配块寻找模块,包括:8. The image restoration device according to claim 7, wherein the matching block searching module comprises:
    样本块构建单元,用于获取所述源区域的样本像素点,并以所述样本像素点为中心点在所述源区域中构建所述预设大小的多个样本块;A sample block construction unit, configured to obtain sample pixels of the source area, and construct a plurality of sample blocks of the preset size in the source area with the sample pixel as a center point;
    初始群体获取单元,用于将各所述样本块确定为一青蛙个体,得到所述预设蛙跳算法的初始群体;An initial population acquisition unit, configured to determine each of the sample blocks as an individual frog, and obtain the initial population of the preset frog leaping algorithm;
    初始族群划分单元,用于采用预设适应度值计算方式计算所述初始群体中各青蛙个体的适应度值,并根据所述适应度值将所述初始群体划分为多个初始族群;The initial ethnic group division unit is configured to calculate the fitness value of each frog individual in the initial group using a preset fitness value calculation method, and divide the initial group into multiple initial ethnic groups according to the fitness value;
    新族群获取单元,用于获取各初始族群中适应度值最大的最差青蛙个体,并按照预设更新方式对各最差青蛙个体进行更新,得到更新后的新族群;The new ethnic group acquisition unit is used to acquire the worst frog individual with the largest fitness value in each initial ethnic group, and update each worst frog individual according to the preset update method to obtain the updated new ethnic group;
    新族群判断单元,用于判断所述新族群是否满足第一预设终止条件;A new ethnic group judging unit, configured to determine whether the new ethnic group meets the first preset termination condition;
    初始族群确定单元,用于若所述新族群不满足所述第一预设终止条件,则将所述新族群确定为初始族群,并返回执行获取各初始族群中适应度值最大的最差青蛙个体的步骤以及后续步骤;The initial ethnic group determination unit is configured to determine the new ethnic group as the initial ethnic group if the new ethnic group does not meet the first preset termination condition, and return to execute the process of obtaining the worst frog with the largest fitness value among the initial ethnic groups Individual steps and subsequent steps;
    新群体获取单元,用于若所述新族群满足所述第一预设终止条件,则对各所述新族群进行混合,得到新群体;A new group obtaining unit, configured to mix each of the new groups to obtain a new group if the new group meets the first preset termination condition;
    新群体判断单元,用于判断所述新群体是否满足第二预设终止条件;The new group judgment unit is used to judge whether the new group meets the second preset termination condition;
    匹配块确定单元,用于若所述新群体满足所述第二预设终止条件,则获取所述新群体的最优青蛙个体,并将所述最优青蛙个体对应的样本块确定为与所述最先修复块最相似的最佳匹配块;The matching block determination unit is configured to, if the new group meets the second preset termination condition, obtain the optimal frog individual of the new group, and determine the sample block corresponding to the optimal frog individual as the The best matching block that is the most similar to the first repaired block;
    初始群体确定单元,用于若所述新群体不满足所述第二预设终止条件,则将所述新群体确定为初始群体,并返回执行采用预设适应度值计算方式计算所述初始群体中各青蛙个体的适应度值的步骤以及后续步骤。The initial group determining unit is configured to determine the new group as the initial group if the new group does not meet the second preset termination condition, and return to execute the calculation of the initial group using a preset fitness value calculation method The steps in the fitness value of each frog individual and subsequent steps.
  9. 根据权利要求8所述的图像修复装置,其特征在于,所述预设适应度值计算方式为:The image restoration device according to claim 8, wherein the preset fitness value calculation method is:
    Figure PCTCN2019122568-appb-100008
    Figure PCTCN2019122568-appb-100008
    其中,F(X i)为样本块i对应的青蛙个体i的适应度值,a j为最先修复块中的第j个待修复像素点对应的灰度值,X ij为样本块i中的第j个样本像素点对应的灰度值,n为样本块i中像素点的总个数。 Among them, F(X i ) is the fitness value of the frog individual i corresponding to the sample block i, a j is the gray value corresponding to the j-th pixel to be repaired in the first repair block, and X ij is the sample block i The gray value corresponding to the j-th sample pixel, n is the total number of pixels in the sample block i.
  10. 根据权利要求8所述的图像修复装置,其特征在于,所述新族群获取单元,具体用于根据下述更新公式对各最差青蛙个体进行更新:8. The image restoration device according to claim 8, wherein the new group acquisition unit is specifically configured to update each worst frog individual according to the following update formula:
    newX i=ε*(X i+D) newX i =ε*(X i +D)
    Figure PCTCN2019122568-appb-100009
    Figure PCTCN2019122568-appb-100009
    其中,newX i为样本块i对应的青蛙个体i更新后的灰度值,X i为青蛙个体i更新之前的灰度值,D为青蛙个体的更新步长系数。 Wherein, newX i i sample blocks corresponding to individual i frog gradation value updated, X i is the grayscale value before the update frog individual i, D is the coefficient update step size frog subject.
  11. 根据权利要求8所述的图像修复装置,其特征在于,所述新族群获取单元,包括:8. The image restoration device according to claim 8, wherein the new ethnic group acquisition unit comprises:
    更新子单元,用于按照预设更新方式对各最差青蛙个体进行更新,得到更新后的最差青蛙个体;The update subunit is used to update each worst frog individual according to a preset update method to obtain the updated worst frog individual;
    新适应度值计算子单元,用于计算更新后的最差青蛙个体的新适应度值;The new fitness value calculation subunit is used to calculate the updated new fitness value of the worst frog individual;
    新适应度值判断子单元,用于判断所述新适应度值是否满足预设条件;The new fitness value judgment subunit is used to judge whether the new fitness value meets a preset condition;
    个体随机生成子单元,用于若所述新适应度值不满足所述预设条件,则随机生成一新青蛙个体,并利用所述新青蛙个体替换所述最差青蛙个体,得到更新后的新族群。The individual random generation subunit is used to randomly generate a new frog individual if the new fitness value does not meet the preset condition, and replace the worst frog individual with the new frog individual to obtain the updated frog individual New ethnic group.
  12. 根据权利要求7至11中任一项所述的图像修复装置,其特征在于,所述优先权计算模块,具体用于根据下述公式计算各修复块的优先权:The image restoration device according to any one of claims 7 to 11, wherein the priority calculation module is specifically configured to calculate the priority of each repair block according to the following formula:
    Priority(p)=Credit(p)*Data(p)Priority(p)=Credit(p)*Data(p)
    Figure PCTCN2019122568-appb-100010
    Figure PCTCN2019122568-appb-100010
    Figure PCTCN2019122568-appb-100011
    Figure PCTCN2019122568-appb-100011
    其中,Priority(p)为修复块p的优先权,Credit(p)为修复块p的置信度,表示修复块p中包含的样本像素点的个数,Data(p)为修复块p的数据项,表示修复块p的结构信息,
    Figure PCTCN2019122568-appb-100012
    Ω为目标区域,
    Figure PCTCN2019122568-appb-100013
    为源区域,|Ψp|为修复块p的待修复像素点的个数,n p为修复块p的边缘像素点p的法向量,
    Figure PCTCN2019122568-appb-100014
    为边缘像素点p处的等辐照线的方向和强度,α为归一化参数。
    Among them, Priority(p) is the priority of repairing block p, Credit(p) is the confidence of repairing block p, indicating the number of sample pixels included in repairing block p, and Data(p) is the data of repairing block p Item, representing the structure information of the repair block p,
    Figure PCTCN2019122568-appb-100012
    Ω is the target area,
    Figure PCTCN2019122568-appb-100013
    Is the source area, |Ψp| is the number of pixels to be repaired in the repair block p, n p is the normal vector of the edge pixel p of the repair block p,
    Figure PCTCN2019122568-appb-100014
    Is the direction and intensity of the isoirradiation line at the edge pixel point p, and α is the normalized parameter.
  13. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现如下步骤:A computer-readable storage medium that stores computer-readable instructions, wherein the computer-readable instructions implement the following steps when executed by a processor:
    确定原始图像中待修复的目标区域和已知的源区域,并获取所述目标区域的边界像素点,其中,已知的源区域为所述原始图像中除所述目标区域以外的区域;Determine a target area to be repaired and a known source area in the original image, and obtain boundary pixels of the target area, where the known source area is an area in the original image excluding the target area;
    以各边界像素点为中心点,构建预设大小的多个修复块,其中,所构建的修复块的数量与边界像素点的数量对应;Using each boundary pixel as a center point, construct multiple repair blocks of a preset size, wherein the number of constructed repair blocks corresponds to the number of boundary pixels;
    根据各修复块中样本像素点的个数和各修复块的结构信息计算各修复块的优先权,并根据所述优先权选择最先修复块;Calculate the priority of each repair block according to the number of sample pixels in each repair block and the structure information of each repair block, and select the first repair block according to the priority;
    利用预设蛙跳算法寻找所述源区域中与所述最先修复块最相似的最佳匹配块;Searching for the best matching block that is most similar to the first repaired block in the source area by using a preset leapfrog algorithm;
    采用所述最佳匹配块对应的样本像素点修复所述最先修复块的对应像素点;Repairing the corresponding pixel of the first repaired block by using the sample pixel corresponding to the best matching block;
    将已修复的所述最先修复块划分至所述源区域,并更新所述目标区域的边界像素点;Dividing the repaired first repair block into the source area, and updating boundary pixels of the target area;
    若更新后的边界像素点的个数大于设定阈值,则返回执行以各边界像素点为中心点,构建预设大小的多个修复块的步骤以及后续步骤,直到更新后的边界像素点的个数小于或者等于所述设定阈值时,确定所述原始图像修复完成并获取更新后的所述源区域。If the number of updated boundary pixels is greater than the set threshold, return to the step of constructing multiple repair blocks of preset sizes with each boundary pixel as the center point and subsequent steps until the updated boundary pixel is completed When the number is less than or equal to the set threshold, it is determined that the original image restoration is completed and the updated source area is obtained.
  14. 根据权利要求13所述的计算机可读存储介质,其特征在于,所述利用预设蛙跳算法寻找所述源区域中与所述最先修复块最相似的最佳匹配块,包括:The computer-readable storage medium according to claim 13, wherein the searching for the best matching block in the source area that is most similar to the first repaired block by using a preset leaping frog algorithm comprises:
    获取所述源区域的样本像素点,并以所述样本像素点为中心点在所述源区域中构建所述预设大小的多个样本块;Acquiring sample pixels of the source area, and constructing a plurality of sample blocks of the preset size in the source area with the sample pixel as a center point;
    将各所述样本块确定为一青蛙个体,得到所述预设蛙跳算法的初始群体;Determining each of the sample blocks as an individual frog, and obtaining the initial population of the preset frog leaping algorithm;
    采用预设适应度值计算方式计算所述初始群体中各青蛙个体的适应度值,并根据所述适应度值将所述初始群体划分为多个初始族群;Calculating the fitness value of each frog individual in the initial group by using a preset fitness value calculation method, and dividing the initial group into multiple initial groups according to the fitness value;
    获取各初始族群中适应度值最大的最差青蛙个体,并按照预设更新方式对各最差青蛙个体进行更新,得到更新后的新族群;Obtain the worst frog individual with the largest fitness value in each initial population, and update each worst frog individual according to the preset update method to obtain the updated new population;
    判断所述新族群是否满足第一预设终止条件;Determine whether the new ethnic group meets the first preset termination condition;
    若所述新族群不满足所述第一预设终止条件,则将所述新族群确定为初始族群,并返回执行获取各初始族群中适应度值最大的最差青蛙个体的步骤以及后续步骤;If the new ethnic group does not meet the first preset termination condition, determine the new ethnic group as the initial ethnic group, and return to execute the step of obtaining the worst frog individual with the largest fitness value in each initial ethnic group and subsequent steps;
    若所述新族群满足所述第一预设终止条件,则对各所述新族群进行混合,得到新群体;If the new ethnic group meets the first preset termination condition, mixing each of the new ethnic groups to obtain a new group;
    判断所述新群体是否满足第二预设终止条件;Determine whether the new group meets the second preset termination condition;
    若所述新群体满足所述第二预设终止条件,则获取所述新群体的最优青蛙个体,并将所述最优青蛙个体对应的样本块确定为与所述最先修复块最相似的最佳匹配块;If the new group satisfies the second preset termination condition, obtain the optimal frog individual of the new group, and determine the sample block corresponding to the optimal frog individual as the most similar to the first repaired block The best matching block;
    若所述新群体不满足所述第二预设终止条件,则将所述新群体确定为初始群体,并返回执行采用预设适应度值计算方式计算所述初始群体中各青蛙个体的适应度值的步骤以及后续步骤。If the new group does not meet the second preset termination condition, determine the new group as the initial group, and return to the execution of calculating the fitness of each frog individual in the initial group using a preset fitness value calculation method Value steps and subsequent steps.
  15. 一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现如下步骤:A terminal device, comprising a memory, a processor, and computer-readable instructions stored in the memory and capable of running on the processor, wherein the processor executes the computer-readable instructions as follows step:
    确定原始图像中待修复的目标区域和已知的源区域,并获取所述目标区域的边界像素点,其中,已知的源区域为所述原始图像中除所述目标区域以外的区域;Determine a target area to be repaired and a known source area in the original image, and obtain boundary pixels of the target area, where the known source area is an area in the original image excluding the target area;
    以各边界像素点为中心点,构建预设大小的多个修复块,其中,所构建的修复块的数 量与边界像素点的数量对应;Taking each boundary pixel as the center point, construct multiple repair blocks of preset size, wherein the number of constructed repair blocks corresponds to the number of boundary pixels;
    根据各修复块中样本像素点的个数和各修复块的结构信息计算各修复块的优先权,并根据所述优先权选择最先修复块;Calculate the priority of each repair block according to the number of sample pixels in each repair block and the structure information of each repair block, and select the first repair block according to the priority;
    利用预设蛙跳算法寻找所述源区域中与所述最先修复块最相似的最佳匹配块;Searching for the best matching block that is most similar to the first repaired block in the source area by using a preset leapfrog algorithm;
    采用所述最佳匹配块对应的样本像素点修复所述最先修复块的对应像素点;Repairing the corresponding pixel of the first repaired block by using the sample pixel corresponding to the best matching block;
    将已修复的所述最先修复块划分至所述源区域,并更新所述目标区域的边界像素点;Dividing the repaired first repair block into the source area, and updating boundary pixels of the target area;
    若更新后的边界像素点的个数大于设定阈值,则返回执行以各边界像素点为中心点,构建预设大小的多个修复块的步骤以及后续步骤,直到更新后的边界像素点的个数小于或者等于所述设定阈值时,确定所述原始图像修复完成并获取更新后的所述源区域。If the number of updated boundary pixels is greater than the set threshold, return to the step of constructing multiple repair blocks of preset sizes with each boundary pixel as the center point and subsequent steps until the updated boundary pixel is completed When the number is less than or equal to the set threshold, it is determined that the original image restoration is completed and the updated source area is obtained.
  16. 根据权利要求15所述的终端设备,其特征在于,所述利用预设蛙跳算法寻找所述源区域中与所述最先修复块最相似的最佳匹配块,包括:The terminal device according to claim 15, wherein said using a preset leapfrog algorithm to find the best matching block most similar to the first repaired block in the source area comprises:
    获取所述源区域的样本像素点,并以所述样本像素点为中心点在所述源区域中构建所述预设大小的多个样本块;Acquiring sample pixels of the source area, and constructing a plurality of sample blocks of the preset size in the source area with the sample pixel as a center point;
    将各所述样本块确定为一青蛙个体,得到所述预设蛙跳算法的初始群体;Determining each of the sample blocks as an individual frog, and obtaining the initial population of the preset frog leaping algorithm;
    采用预设适应度值计算方式计算所述初始群体中各青蛙个体的适应度值,并根据所述适应度值将所述初始群体划分为多个初始族群;Calculating the fitness value of each frog individual in the initial group by using a preset fitness value calculation method, and dividing the initial group into multiple initial groups according to the fitness value;
    获取各初始族群中适应度值最大的最差青蛙个体,并按照预设更新方式对各最差青蛙个体进行更新,得到更新后的新族群;Obtain the worst frog individual with the largest fitness value in each initial population, and update each worst frog individual according to the preset update method to obtain the updated new population;
    判断所述新族群是否满足第一预设终止条件;Determine whether the new ethnic group meets the first preset termination condition;
    若所述新族群不满足所述第一预设终止条件,则将所述新族群确定为初始族群,并返回执行获取各初始族群中适应度值最大的最差青蛙个体的步骤以及后续步骤;If the new ethnic group does not meet the first preset termination condition, determine the new ethnic group as the initial ethnic group, and return to execute the step of obtaining the worst frog individual with the largest fitness value in each initial ethnic group and subsequent steps;
    若所述新族群满足所述第一预设终止条件,则对各所述新族群进行混合,得到新群体;If the new ethnic group meets the first preset termination condition, mixing each of the new ethnic groups to obtain a new group;
    判断所述新群体是否满足第二预设终止条件;Determine whether the new group meets the second preset termination condition;
    若所述新群体满足所述第二预设终止条件,则获取所述新群体的最优青蛙个体,并将所述最优青蛙个体对应的样本块确定为与所述最先修复块最相似的最佳匹配块;If the new group satisfies the second preset termination condition, obtain the optimal frog individual of the new group, and determine the sample block corresponding to the optimal frog individual as the most similar to the first repaired block The best matching block;
    若所述新群体不满足所述第二预设终止条件,则将所述新群体确定为初始群体,并返回执行采用预设适应度值计算方式计算所述初始群体中各青蛙个体的适应度值的步骤以及后续步骤。If the new group does not meet the second preset termination condition, determine the new group as the initial group, and return to the execution of calculating the fitness of each frog individual in the initial group using a preset fitness value calculation method Value steps and subsequent steps.
  17. 根据权利要求16所述的终端设备,其特征在于,所述预设适应度值计算方式为:The terminal device according to claim 16, wherein the preset fitness value calculation method is:
    Figure PCTCN2019122568-appb-100015
    Figure PCTCN2019122568-appb-100015
    其中,F(X i)为样本块i对应的青蛙个体i的适应度值,a j为最先修复块中的第j个待修复像素点对应的灰度值,X ij为样本块i中的第j个样本像素点对应的灰度值,n为样本块i中像素点的总个数。 Among them, F(X i ) is the fitness value of the frog individual i corresponding to the sample block i, a j is the gray value corresponding to the j-th pixel to be repaired in the first repair block, and X ij is the sample block i The gray value corresponding to the j-th sample pixel, n is the total number of pixels in the sample block i.
  18. 根据权利要求16所述的终端设备,其特征在于,所述按照预设更新方式对各最差青蛙个体进行更新,包括:The terminal device according to claim 16, wherein said updating each worst frog individual according to a preset updating method comprises:
    根据下述更新公式对各最差青蛙个体进行更新:Update each worst frog individual according to the following update formula:
    newX i=ε*(X i+D) newX i =ε*(X i +D)
    Figure PCTCN2019122568-appb-100016
    Figure PCTCN2019122568-appb-100016
    其中,newX i为样本块i对应的青蛙个体i更新后的灰度值,X i为青蛙个体i更新之前的灰度值,D为青蛙个体的更新步长系数。 Wherein, newX i i sample blocks corresponding to individual i frog gradation value updated, X i is the grayscale value before the update frog individual i, D is the coefficient update step size frog subject.
  19. 根据权利要求16所述的终端设备,其特征在于,所述按照预设更新方式对各最差青蛙个体进行更新,得到更新后的新族群,包括:The terminal device according to claim 16, wherein said updating each worst frog individual according to a preset updating method to obtain the updated new group comprises:
    按照预设更新方式对各最差青蛙个体进行更新,得到更新后的最差青蛙个体;Update each worst frog individual according to the preset update method, and obtain the updated worst frog individual;
    计算更新后的最差青蛙个体的新适应度值;Calculate the updated fitness value of the worst frog individual;
    判断所述新适应度值是否满足预设条件;Determine whether the new fitness value meets a preset condition;
    若所述新适应度值不满足所述预设条件,则随机生成一新青蛙个体,并利用所述新青蛙个体替换所述最差青蛙个体,得到更新后的新族群。If the new fitness value does not meet the preset condition, a new frog individual is randomly generated, and the worst frog individual is replaced with the new frog individual to obtain an updated new population.
  20. 根据权利要求15至19中任一项所述的终端设备,其特征在于,所述根据各修复块中样本像素点的个数和各修复块的结构信息计算各修复块的优先权,包括:The terminal device according to any one of claims 15 to 19, wherein the calculating the priority of each repair block according to the number of sample pixels in each repair block and the structure information of each repair block comprises:
    根据下述公式计算各修复块的优先权:Calculate the priority of each repair block according to the following formula:
    Priority(p)=Credit(p)*Data(p)Priority(p)=Credit(p)*Data(p)
    Figure PCTCN2019122568-appb-100017
    Figure PCTCN2019122568-appb-100017
    Figure PCTCN2019122568-appb-100018
    Figure PCTCN2019122568-appb-100018
    其中,Priority(p)为修复块p的优先权,Credit(p)为修复块p的置信度,表示修复块p中包含的样本像素点的个数,Data(p)为修复块p的数据项,表示修复块p的结构信息,
    Figure PCTCN2019122568-appb-100019
    Ω为目标区域,
    Figure PCTCN2019122568-appb-100020
    为源区域,|Ψp|为修复块p的待修复像素点的个数,n p为修复块p的边缘像素点p的法向量,
    Figure PCTCN2019122568-appb-100021
    为边缘像素点p处的等辐照线的方向和强度,α为归一化参数。
    Among them, Priority(p) is the priority of repairing block p, Credit(p) is the confidence of repairing block p, indicating the number of sample pixels included in repairing block p, and Data(p) is the data of repairing block p Item, representing the structure information of the repair block p,
    Figure PCTCN2019122568-appb-100019
    Ω is the target area,
    Figure PCTCN2019122568-appb-100020
    Is the source area, |Ψp| is the number of pixels to be repaired in the repair block p, n p is the normal vector of the edge pixel p of the repair block p,
    Figure PCTCN2019122568-appb-100021
    Is the direction and intensity of the isoirradiation line at the edge pixel point p, and α is the normalized parameter.
PCT/CN2019/122568 2019-05-21 2019-12-03 Image restoration method and apparatus, storage medium, and terminal device WO2020233083A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910422744.5A CN110246095B (en) 2019-05-21 2019-05-21 Image restoration method and device, storage medium and terminal equipment
CN201910422744.5 2019-05-21

Publications (1)

Publication Number Publication Date
WO2020233083A1 true WO2020233083A1 (en) 2020-11-26

Family

ID=67884666

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/122568 WO2020233083A1 (en) 2019-05-21 2019-12-03 Image restoration method and apparatus, storage medium, and terminal device

Country Status (2)

Country Link
CN (1) CN110246095B (en)
WO (1) WO2020233083A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112561830A (en) * 2020-12-23 2021-03-26 安徽大学 Endoscope image highlight repair method and device
CN113313651A (en) * 2021-06-11 2021-08-27 中交三航(上海)新能源工程有限公司 Method for repairing side-scan sonar image texture distortion area based on peripheral change
CN113763409A (en) * 2021-08-27 2021-12-07 南通大学 Gauss filtering-based multi-threshold segmentation method for high-dimensional brain nuclear magnetic image

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110246095B (en) * 2019-05-21 2022-04-12 深圳壹账通智能科技有限公司 Image restoration method and device, storage medium and terminal equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102760285A (en) * 2012-05-31 2012-10-31 河海大学 Image restoration method
CN103279914A (en) * 2013-05-27 2013-09-04 深圳大学 Image compression sensing steganography method and device based on frog-leaping optimization
CN103955906A (en) * 2014-05-21 2014-07-30 武汉科技大学 Criminisi image restoration method based on bat algorithm
CN106056546A (en) * 2016-05-25 2016-10-26 广东工业大学 Image restoration method and device based on sample block matching
US20160379344A1 (en) * 2006-11-27 2016-12-29 Google Inc. Method for sliced inpainting
CN108510050A (en) * 2018-03-28 2018-09-07 天津大学 It is a kind of based on shuffling the feature selection approach to leapfrog
CN110246095A (en) * 2019-05-21 2019-09-17 深圳壹账通智能科技有限公司 A kind of image repair method, device, storage medium and terminal device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8488883B2 (en) * 2009-12-28 2013-07-16 Picscout (Israel) Ltd. Robust and efficient image identification
CN102999887B (en) * 2012-11-12 2015-07-01 中国科学院研究生院 Sample based image repairing method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160379344A1 (en) * 2006-11-27 2016-12-29 Google Inc. Method for sliced inpainting
CN102760285A (en) * 2012-05-31 2012-10-31 河海大学 Image restoration method
CN103279914A (en) * 2013-05-27 2013-09-04 深圳大学 Image compression sensing steganography method and device based on frog-leaping optimization
CN103955906A (en) * 2014-05-21 2014-07-30 武汉科技大学 Criminisi image restoration method based on bat algorithm
CN106056546A (en) * 2016-05-25 2016-10-26 广东工业大学 Image restoration method and device based on sample block matching
CN108510050A (en) * 2018-03-28 2018-09-07 天津大学 It is a kind of based on shuffling the feature selection approach to leapfrog
CN110246095A (en) * 2019-05-21 2019-09-17 深圳壹账通智能科技有限公司 A kind of image repair method, device, storage medium and terminal device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112561830A (en) * 2020-12-23 2021-03-26 安徽大学 Endoscope image highlight repair method and device
CN112561830B (en) * 2020-12-23 2022-11-18 安徽大学 Endoscope image highlight repair method and device
CN113313651A (en) * 2021-06-11 2021-08-27 中交三航(上海)新能源工程有限公司 Method for repairing side-scan sonar image texture distortion area based on peripheral change
CN113313651B (en) * 2021-06-11 2024-03-29 中交三航(上海)新能源工程有限公司 Method for repairing texture distortion area of side-scan sonar image based on surrounding variation
CN113763409A (en) * 2021-08-27 2021-12-07 南通大学 Gauss filtering-based multi-threshold segmentation method for high-dimensional brain nuclear magnetic image

Also Published As

Publication number Publication date
CN110246095A (en) 2019-09-17
CN110246095B (en) 2022-04-12

Similar Documents

Publication Publication Date Title
WO2020233083A1 (en) Image restoration method and apparatus, storage medium, and terminal device
WO2020233084A1 (en) Image segmentation method and apparatus, and storage medium and terminal device
CN109886997B (en) Identification frame determining method and device based on target detection and terminal equipment
WO2021217851A1 (en) Abnormal cell automatic labeling method and apparatus, electronic device, and storage medium
WO2021218314A1 (en) Event identification method and apparatus based on position locating, and device and storage medium
CN109493417B (en) Three-dimensional object reconstruction method, device, equipment and storage medium
WO2021189912A1 (en) Method and apparatus for detecting target object in image, and electronic device and storage medium
WO2021217857A1 (en) Slice defect detection method and apparatus, and electronic device and readable storage medium
CN112800915B (en) Building change detection method, device, electronic equipment and storage medium
WO2021129788A1 (en) Map rendering method and apparatus, computer device, and storage medium
CN113744144B (en) Remote sensing image building boundary optimization method, system, equipment and storage medium
CN111368638A (en) Spreadsheet creation method and device, computer equipment and storage medium
WO2023087893A1 (en) Object processing method and apparatus, computer device, storage medium and program product
CN114677565A (en) Training method of feature extraction network and image processing method and device
US20120328167A1 (en) Merging face clusters
CN114359563A (en) Model training method and device, computer equipment and storage medium
CN110673146A (en) Weather prediction image detection method and device, computer equipment and readable storage medium
CN112541902A (en) Similar area searching method, similar area searching device, electronic equipment and medium
WO2022257433A1 (en) Processing method and apparatus for feature map of image, storage medium, and terminal
CN110717405A (en) Face feature point positioning method, device, medium and electronic equipment
CN115205202A (en) Video detection method, device, equipment and storage medium
CN114596533A (en) Fall posture detection method and device, electronic equipment and readable storage medium
US9208535B2 (en) Method and apparatus for graphical processing unit (GPU) accelerated large-scale web community detection
CN108731648B (en) 2000 independent coordinate system parameter obtaining method, device and computer readable storage medium
CN115994898B (en) Mediastinum space-occupying lesion image detection method, device, equipment and storage medium

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: 19929494

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19929494

Country of ref document: EP

Kind code of ref document: A1

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

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

122 Ep: pct application non-entry in european phase

Ref document number: 19929494

Country of ref document: EP

Kind code of ref document: A1