WO2020233083A1 - 一种图像修复方法、装置、存储介质及终端设备 - Google Patents
一种图像修复方法、装置、存储介质及终端设备 Download PDFInfo
- 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
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/11—Region-based segmentation
Definitions
- 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.
- 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.
- the image restoration method based on Criminisi algorithm is generally used to repair the image.
- the Criminisi algorithm 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.
- 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.
- the first aspect of the embodiments of the present application provides an image restoration method, including:
- 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;
- 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:
- 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;
- 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.
- FIG. 1 is a flowchart of an embodiment of an image restoration method in an embodiment of the application
- 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
- 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;
- FIG. 4 is a structural diagram of an embodiment of an image restoration device in an embodiment of the application.
- FIG. 5 is a schematic diagram of a terminal device provided by an embodiment of this application.
- 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.
- an embodiment of the present application provides an image restoration method, and the image restoration method includes:
- 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.
- a terminal device which includes but is not limited to: servers, computers, smart phones, and tablet computers.
- the relevant personnel can mark the area to be repaired by themselves, and input the marked original image into the terminal device.
- 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.
- 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.
- 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;
- 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.
- 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.
- 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;
- 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) 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
- Data(p) is the data of repairing block p Item, representing the structure information of the repair block p
- ⁇ is the target area
- 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
- ⁇ is the normalized parameter.
- the normalization parameter ⁇ can be 255, and
- 1.
- 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.
- it represents the vertical direction of the edge pixel point p gradient direction, where It can be obtained by partial differentiation, such as 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.
- the edge of the image 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.
- 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;
- 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.
- using a preset leapfrog algorithm to find the best matching block most similar to the first repaired block in the source area may include:
- 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;
- 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.
- 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.
- Step S202 Determine each of the sample blocks as an individual frog, and obtain the initial population of the preset frog leaping algorithm
- each sample block 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.
- 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.
- 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;
- 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:
- 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
- X ij is the sample block i
- n is the total number of pixels in the sample block i.
- 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.
- 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.
- 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.
- 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;
- 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,
- the optimal frog individual refers to the frog individual with the smallest fitness value in each initial group or new group.
- the location update method based on the shrinkage factor ⁇ may specifically be:
- 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.
- the update step coefficient can be specifically set according to actual conditions.
- the worst frog individuals are updated according to the preset update method to obtain the updated new group, which may include
- Step S301 Update each worst frog individual according to a preset update method to obtain the updated worst frog individual;
- Step S302 Calculate the updated new fitness value of the worst frog individual
- Step S303 Determine whether the new fitness value meets a preset condition
- Step S304 If the new fitness value meets the preset condition, obtain an updated new ethnic group
- 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.
- 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.
- 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
- Step S205 Determine whether the new ethnic group meets a first preset termination condition
- 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
- 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;
- 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.
- 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.
- the optimal frog individual has the same continuous algebra.
- the iterative operation is stopped, and then all the new populations after the iteration are stopped are mixed to obtain New groups.
- Step S208 Determine whether the new group meets a second preset termination condition
- 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;
- 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.
- 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.
- 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,
- 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.
- Step S105 using the sample pixels corresponding to the best matching block to repair the corresponding pixels of the first repaired block;
- 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.
- Step S106 dividing the first repaired block that has been repaired into the source area, and updating the boundary pixels of the target area;
- Step S107 Determine whether the number of updated boundary pixels is greater than a set threshold
- 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.
- 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.
- 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.
- 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.
- 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.
- an embodiment of the present application provides an image restoration device, and the image restoration device includes:
- 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;
- 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;
- 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;
- 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
- 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;
- 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;
- 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.
- 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.
- the preset fitness value calculation method is:
- 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
- X ij is the sample block i
- n is the total number of pixels in the sample block i.
- the new ethnic group acquiring unit is specifically configured to update each worst frog individual according to the following update formula:
- 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.
- 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.
- the priority calculation module 403 is specifically configured to calculate the priority of each repair block according to the following formula:
- 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
- Data(p) is the data of repairing block p Item, representing the structure information of the repair block p
- ⁇ is the target area
- 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
- ⁇ is the normalized parameter.
- Fig. 5 is a schematic diagram of a terminal device provided by an embodiment of the present application.
- 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.
- 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
- 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.
- 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.
- 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.
- 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.
- the terminal device may also include input and output devices, network access devices, buses, etc.
- 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.
- 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.
- each unit 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.
- 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.
- 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.
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Image Processing (AREA)
- Image Analysis (AREA)
Abstract
Description
Claims (20)
- 一种图像修复方法,其特征在于,包括:确定原始图像中待修复的目标区域和已知的源区域,并获取所述目标区域的边界像素点,其中,已知的源区域为所述原始图像中除所述目标区域以外的区域;以各边界像素点为中心点,构建预设大小的多个修复块,其中,所构建的修复块的数量与边界像素点的数量对应;根据各修复块中样本像素点的个数和各修复块的结构信息计算各修复块的优先权,并根据所述优先权选择最先修复块;利用预设蛙跳算法寻找所述源区域中与所述最先修复块最相似的最佳匹配块;采用所述最佳匹配块对应的样本像素点修复所述最先修复块的对应像素点;将已修复的所述最先修复块划分至所述源区域,并更新所述目标区域的边界像素点;若更新后的边界像素点的个数大于设定阈值,则返回执行以各边界像素点为中心点,构建预设大小的多个修复块的步骤以及后续步骤,直到更新后的边界像素点的个数小于或者等于所述设定阈值时,确定所述原始图像修复完成并获取更新后的所述源区域。
- 根据权利要求1所述的图像修复方法,其特征在于,所述利用预设蛙跳算法寻找所述源区域中与所述最先修复块最相似的最佳匹配块,包括:获取所述源区域的样本像素点,并以所述样本像素点为中心点在所述源区域中构建所述预设大小的多个样本块;将各所述样本块确定为一青蛙个体,得到所述预设蛙跳算法的初始群体;采用预设适应度值计算方式计算所述初始群体中各青蛙个体的适应度值,并根据所述适应度值将所述初始群体划分为多个初始族群;获取各初始族群中适应度值最大的最差青蛙个体,并按照预设更新方式对各最差青蛙个体进行更新,得到更新后的新族群;判断所述新族群是否满足第一预设终止条件;若所述新族群不满足所述第一预设终止条件,则将所述新族群确定为初始族群,并返回执行获取各初始族群中适应度值最大的最差青蛙个体的步骤以及后续步骤;若所述新族群满足所述第一预设终止条件,则对各所述新族群进行混合,得到新群体;判断所述新群体是否满足第二预设终止条件;若所述新群体满足所述第二预设终止条件,则获取所述新群体的最优青蛙个体,并将所述最优青蛙个体对应的样本块确定为与所述最先修复块最相似的最佳匹配块;若所述新群体不满足所述第二预设终止条件,则将所述新群体确定为初始群体,并返回执行采用预设适应度值计算方式计算所述初始群体中各青蛙个体的适应度值的步骤以及后续步骤。
- 根据权利要求2所述的图像修复方法,其特征在于,所述按照预设更新方式对各最差青蛙个体进行更新,得到更新后的新族群,包括:按照预设更新方式对各最差青蛙个体进行更新,得到更新后的最差青蛙个体;计算更新后的最差青蛙个体的新适应度值;判断所述新适应度值是否满足预设条件;若所述新适应度值不满足所述预设条件,则随机生成一新青蛙个体,并利用所述新青蛙个体替换所述最差青蛙个体,得到更新后的新族群。
- 一种图像修复装置,其特征在于,包括:边界点获取模块,用于确定原始图像中待修复的目标区域和已知的源区域,并获取所述目标区域的边界像素点,其中,已知的源区域为所述原始图像中除所述目标区域以外的区域;修复块构建模块,用于以各边界像素点为中心点,构建预设大小的多个修复块,其中,所构建的修复块的数量与边界像素点的数量对应;优先权计算模块,用于根据各修复块中样本像素点的个数和各修复块的结构信息计算各修复块的优先权,并根据所述优先权选择最先修复块;匹配块寻找模块,用于利用预设蛙跳算法寻找所述源区域中与所述最先修复块最相似的最佳匹配块;修复块修复模块,用于采用所述最佳匹配块对应的样本像素点修复所述最先修复块的对应像素点;边界点更新模块,用于将已修复的所述最先修复块划分至所述源区域,并更新所述目标区域的边界像素点;修复完成确定模块,用于若更新后的边界像素点的个数大于设定阈值,则返回执行以各边界像素点为中心点,构建预设大小的多个修复块的步骤以及后续步骤,直到更新后的边界像素点的个数小于或者等于所述设定阈值时,确定所述原始图像修复完成并获取更新后的所述源区域。
- 根据权利要求7所述的图像修复装置,其特征在于,所述匹配块寻找模块,包括:样本块构建单元,用于获取所述源区域的样本像素点,并以所述样本像素点为中心点在所述源区域中构建所述预设大小的多个样本块;初始群体获取单元,用于将各所述样本块确定为一青蛙个体,得到所述预设蛙跳算法的初始群体;初始族群划分单元,用于采用预设适应度值计算方式计算所述初始群体中各青蛙个体的适应度值,并根据所述适应度值将所述初始群体划分为多个初始族群;新族群获取单元,用于获取各初始族群中适应度值最大的最差青蛙个体,并按照预设更新方式对各最差青蛙个体进行更新,得到更新后的新族群;新族群判断单元,用于判断所述新族群是否满足第一预设终止条件;初始族群确定单元,用于若所述新族群不满足所述第一预设终止条件,则将所述新族群确定为初始族群,并返回执行获取各初始族群中适应度值最大的最差青蛙个体的步骤以及后续步骤;新群体获取单元,用于若所述新族群满足所述第一预设终止条件,则对各所述新族群进行混合,得到新群体;新群体判断单元,用于判断所述新群体是否满足第二预设终止条件;匹配块确定单元,用于若所述新群体满足所述第二预设终止条件,则获取所述新群体的最优青蛙个体,并将所述最优青蛙个体对应的样本块确定为与所述最先修复块最相似的最佳匹配块;初始群体确定单元,用于若所述新群体不满足所述第二预设终止条件,则将所述新群体确定为初始群体,并返回执行采用预设适应度值计算方式计算所述初始群体中各青蛙个体的适应度值的步骤以及后续步骤。
- 根据权利要求8所述的图像修复装置,其特征在于,所述新族群获取单元,包括:更新子单元,用于按照预设更新方式对各最差青蛙个体进行更新,得到更新后的最差青蛙个体;新适应度值计算子单元,用于计算更新后的最差青蛙个体的新适应度值;新适应度值判断子单元,用于判断所述新适应度值是否满足预设条件;个体随机生成子单元,用于若所述新适应度值不满足所述预设条件,则随机生成一新青蛙个体,并利用所述新青蛙个体替换所述最差青蛙个体,得到更新后的新族群。
- 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现如下步骤:确定原始图像中待修复的目标区域和已知的源区域,并获取所述目标区域的边界像素点,其中,已知的源区域为所述原始图像中除所述目标区域以外的区域;以各边界像素点为中心点,构建预设大小的多个修复块,其中,所构建的修复块的数量与边界像素点的数量对应;根据各修复块中样本像素点的个数和各修复块的结构信息计算各修复块的优先权,并根据所述优先权选择最先修复块;利用预设蛙跳算法寻找所述源区域中与所述最先修复块最相似的最佳匹配块;采用所述最佳匹配块对应的样本像素点修复所述最先修复块的对应像素点;将已修复的所述最先修复块划分至所述源区域,并更新所述目标区域的边界像素点;若更新后的边界像素点的个数大于设定阈值,则返回执行以各边界像素点为中心点,构建预设大小的多个修复块的步骤以及后续步骤,直到更新后的边界像素点的个数小于或者等于所述设定阈值时,确定所述原始图像修复完成并获取更新后的所述源区域。
- 根据权利要求13所述的计算机可读存储介质,其特征在于,所述利用预设蛙跳算法寻找所述源区域中与所述最先修复块最相似的最佳匹配块,包括:获取所述源区域的样本像素点,并以所述样本像素点为中心点在所述源区域中构建所述预设大小的多个样本块;将各所述样本块确定为一青蛙个体,得到所述预设蛙跳算法的初始群体;采用预设适应度值计算方式计算所述初始群体中各青蛙个体的适应度值,并根据所述适应度值将所述初始群体划分为多个初始族群;获取各初始族群中适应度值最大的最差青蛙个体,并按照预设更新方式对各最差青蛙个体进行更新,得到更新后的新族群;判断所述新族群是否满足第一预设终止条件;若所述新族群不满足所述第一预设终止条件,则将所述新族群确定为初始族群,并返回执行获取各初始族群中适应度值最大的最差青蛙个体的步骤以及后续步骤;若所述新族群满足所述第一预设终止条件,则对各所述新族群进行混合,得到新群体;判断所述新群体是否满足第二预设终止条件;若所述新群体满足所述第二预设终止条件,则获取所述新群体的最优青蛙个体,并将所述最优青蛙个体对应的样本块确定为与所述最先修复块最相似的最佳匹配块;若所述新群体不满足所述第二预设终止条件,则将所述新群体确定为初始群体,并返回执行采用预设适应度值计算方式计算所述初始群体中各青蛙个体的适应度值的步骤以及后续步骤。
- 一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现如下步骤:确定原始图像中待修复的目标区域和已知的源区域,并获取所述目标区域的边界像素点,其中,已知的源区域为所述原始图像中除所述目标区域以外的区域;以各边界像素点为中心点,构建预设大小的多个修复块,其中,所构建的修复块的数 量与边界像素点的数量对应;根据各修复块中样本像素点的个数和各修复块的结构信息计算各修复块的优先权,并根据所述优先权选择最先修复块;利用预设蛙跳算法寻找所述源区域中与所述最先修复块最相似的最佳匹配块;采用所述最佳匹配块对应的样本像素点修复所述最先修复块的对应像素点;将已修复的所述最先修复块划分至所述源区域,并更新所述目标区域的边界像素点;若更新后的边界像素点的个数大于设定阈值,则返回执行以各边界像素点为中心点,构建预设大小的多个修复块的步骤以及后续步骤,直到更新后的边界像素点的个数小于或者等于所述设定阈值时,确定所述原始图像修复完成并获取更新后的所述源区域。
- 根据权利要求15所述的终端设备,其特征在于,所述利用预设蛙跳算法寻找所述源区域中与所述最先修复块最相似的最佳匹配块,包括:获取所述源区域的样本像素点,并以所述样本像素点为中心点在所述源区域中构建所述预设大小的多个样本块;将各所述样本块确定为一青蛙个体,得到所述预设蛙跳算法的初始群体;采用预设适应度值计算方式计算所述初始群体中各青蛙个体的适应度值,并根据所述适应度值将所述初始群体划分为多个初始族群;获取各初始族群中适应度值最大的最差青蛙个体,并按照预设更新方式对各最差青蛙个体进行更新,得到更新后的新族群;判断所述新族群是否满足第一预设终止条件;若所述新族群不满足所述第一预设终止条件,则将所述新族群确定为初始族群,并返回执行获取各初始族群中适应度值最大的最差青蛙个体的步骤以及后续步骤;若所述新族群满足所述第一预设终止条件,则对各所述新族群进行混合,得到新群体;判断所述新群体是否满足第二预设终止条件;若所述新群体满足所述第二预设终止条件,则获取所述新群体的最优青蛙个体,并将所述最优青蛙个体对应的样本块确定为与所述最先修复块最相似的最佳匹配块;若所述新群体不满足所述第二预设终止条件,则将所述新群体确定为初始群体,并返回执行采用预设适应度值计算方式计算所述初始群体中各青蛙个体的适应度值的步骤以及后续步骤。
- 根据权利要求16所述的终端设备,其特征在于,所述按照预设更新方式对各最差青蛙个体进行更新,得到更新后的新族群,包括:按照预设更新方式对各最差青蛙个体进行更新,得到更新后的最差青蛙个体;计算更新后的最差青蛙个体的新适应度值;判断所述新适应度值是否满足预设条件;若所述新适应度值不满足所述预设条件,则随机生成一新青蛙个体,并利用所述新青蛙个体替换所述最差青蛙个体,得到更新后的新族群。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910422744.5 | 2019-05-21 | ||
| CN201910422744.5A CN110246095B (zh) | 2019-05-21 | 2019-05-21 | 一种图像修复方法、装置、存储介质及终端设备 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020233083A1 true WO2020233083A1 (zh) | 2020-11-26 |
Family
ID=67884666
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2019/122568 Ceased WO2020233083A1 (zh) | 2019-05-21 | 2019-12-03 | 一种图像修复方法、装置、存储介质及终端设备 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN110246095B (zh) |
| WO (1) | WO2020233083A1 (zh) |
Cited By (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112561830A (zh) * | 2020-12-23 | 2021-03-26 | 安徽大学 | 一种内窥镜图像高亮点修复方法及装置 |
| CN113313651A (zh) * | 2021-06-11 | 2021-08-27 | 中交三航(上海)新能源工程有限公司 | 一种基于周围变化的侧扫声呐图像纹理失真区域修复方法 |
| CN113763409A (zh) * | 2021-08-27 | 2021-12-07 | 南通大学 | 一种基于高斯滤波的高维脑核磁图像多阈值分割方法 |
| CN115994873A (zh) * | 2023-02-28 | 2023-04-21 | 北京字跳网络技术有限公司 | 图像处理方法、装置、设备及存储介质 |
| CN116205801A (zh) * | 2022-12-28 | 2023-06-02 | 江汉大学 | 一种图像的修复方法和装置 |
| CN117457010A (zh) * | 2023-02-27 | 2024-01-26 | 湖南芯海聆半导体有限公司 | 音频三维码编码方法和解码方法 |
| CN118181421A (zh) * | 2024-04-16 | 2024-06-14 | 东北林业大学 | 一种基于bp神经网络的微米木纤维切削加工方法 |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110246095B (zh) * | 2019-05-21 | 2022-04-12 | 深圳壹账通智能科技有限公司 | 一种图像修复方法、装置、存储介质及终端设备 |
| CN115797186A (zh) * | 2021-08-31 | 2023-03-14 | 杭州三坛医疗科技有限公司 | 一种图像修复方法、装置、电子设备及存储介质 |
Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102760285A (zh) * | 2012-05-31 | 2012-10-31 | 河海大学 | 一种图像修复方法 |
| CN103279914A (zh) * | 2013-05-27 | 2013-09-04 | 深圳大学 | 一种基于蛙跳优化的图像压缩感知隐写方法及装置 |
| CN103955906A (zh) * | 2014-05-21 | 2014-07-30 | 武汉科技大学 | 基于蝙蝠算法的Criminisi图像修复方法 |
| CN106056546A (zh) * | 2016-05-25 | 2016-10-26 | 广东工业大学 | 一种基于样本块匹配的图像修复方法和装置 |
| US20160379344A1 (en) * | 2006-11-27 | 2016-12-29 | Google Inc. | Method for sliced inpainting |
| CN108510050A (zh) * | 2018-03-28 | 2018-09-07 | 天津大学 | 一种基于混洗蛙跳的特征选择方法 |
| CN110246095A (zh) * | 2019-05-21 | 2019-09-17 | 深圳壹账通智能科技有限公司 | 一种图像修复方法、装置、存储介质及终端设备 |
Family Cites Families (2)
| 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 (zh) * | 2012-11-12 | 2015-07-01 | 中国科学院研究生院 | 一种基于样本的图像修复方法 |
-
2019
- 2019-05-21 CN CN201910422744.5A patent/CN110246095B/zh not_active Expired - Fee Related
- 2019-12-03 WO PCT/CN2019/122568 patent/WO2020233083A1/zh not_active Ceased
Patent Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20160379344A1 (en) * | 2006-11-27 | 2016-12-29 | Google Inc. | Method for sliced inpainting |
| CN102760285A (zh) * | 2012-05-31 | 2012-10-31 | 河海大学 | 一种图像修复方法 |
| CN103279914A (zh) * | 2013-05-27 | 2013-09-04 | 深圳大学 | 一种基于蛙跳优化的图像压缩感知隐写方法及装置 |
| CN103955906A (zh) * | 2014-05-21 | 2014-07-30 | 武汉科技大学 | 基于蝙蝠算法的Criminisi图像修复方法 |
| CN106056546A (zh) * | 2016-05-25 | 2016-10-26 | 广东工业大学 | 一种基于样本块匹配的图像修复方法和装置 |
| CN108510050A (zh) * | 2018-03-28 | 2018-09-07 | 天津大学 | 一种基于混洗蛙跳的特征选择方法 |
| CN110246095A (zh) * | 2019-05-21 | 2019-09-17 | 深圳壹账通智能科技有限公司 | 一种图像修复方法、装置、存储介质及终端设备 |
Cited By (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112561830A (zh) * | 2020-12-23 | 2021-03-26 | 安徽大学 | 一种内窥镜图像高亮点修复方法及装置 |
| CN112561830B (zh) * | 2020-12-23 | 2022-11-18 | 安徽大学 | 一种内窥镜图像高亮点修复方法及装置 |
| CN113313651A (zh) * | 2021-06-11 | 2021-08-27 | 中交三航(上海)新能源工程有限公司 | 一种基于周围变化的侧扫声呐图像纹理失真区域修复方法 |
| CN113313651B (zh) * | 2021-06-11 | 2024-03-29 | 中交三航(上海)新能源工程有限公司 | 一种基于周围变化的侧扫声呐图像纹理失真区域修复方法 |
| CN113763409A (zh) * | 2021-08-27 | 2021-12-07 | 南通大学 | 一种基于高斯滤波的高维脑核磁图像多阈值分割方法 |
| CN116205801A (zh) * | 2022-12-28 | 2023-06-02 | 江汉大学 | 一种图像的修复方法和装置 |
| CN117457010A (zh) * | 2023-02-27 | 2024-01-26 | 湖南芯海聆半导体有限公司 | 音频三维码编码方法和解码方法 |
| CN115994873A (zh) * | 2023-02-28 | 2023-04-21 | 北京字跳网络技术有限公司 | 图像处理方法、装置、设备及存储介质 |
| CN118181421A (zh) * | 2024-04-16 | 2024-06-14 | 东北林业大学 | 一种基于bp神经网络的微米木纤维切削加工方法 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN110246095B (zh) | 2022-04-12 |
| CN110246095A (zh) | 2019-09-17 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2020233083A1 (zh) | 一种图像修复方法、装置、存储介质及终端设备 | |
| WO2020233084A1 (zh) | 一种图像分割方法、装置、存储介质及终端设备 | |
| CN112800915B (zh) | 建筑物变化检测方法、装置、电子设备以及存储介质 | |
| CN111652845B (zh) | 异常细胞自动标注方法、装置、电子设备及存储介质 | |
| WO2021169116A1 (zh) | 智能化的缺失数据填充方法、装置、设备及存储介质 | |
| WO2021189912A1 (zh) | 图像中目标物的检测方法、装置、电子设备及存储介质 | |
| WO2021218314A1 (zh) | 基于位置定位的事件识别方法、装置、设备及存储介质 | |
| CN115063589B (zh) | 基于知识蒸馏的车辆部件分割方法及相关设备 | |
| CN111595850A (zh) | 切片缺陷检测方法、电子装置及可读存储介质 | |
| WO2020087564A1 (zh) | 三维物体重建方法、计算机设备及存储介质 | |
| US20230325244A1 (en) | Object processing method and apparatus, computer device, storage medium, and program product | |
| CN112541902A (zh) | 相似区域搜索方法、装置、电子设备及介质 | |
| WO2021051868A1 (zh) | 目标的定位方法及装置、计算机设备、计算机存储介质 | |
| CN114359352B (zh) | 图像处理方法、装置、设备、存储介质及计算机程序产品 | |
| WO2020024394A1 (zh) | 背景剔除方法、装置、计算机设备及存储介质 | |
| CN108731648B (zh) | 2000独立坐标系参数获取方法、装置与计算机可读存储介质 | |
| CN114359563A (zh) | 模型训练方法、装置、计算机设备和存储介质 | |
| CN110673146A (zh) | 气象预测图检测方法、装置、计算机设备和可读存储介质 | |
| WO2017201949A1 (zh) | 一种选址方法及装置 | |
| CN116227573B (zh) | 分割模型训练方法、图像分割方法、装置及相关介质 | |
| CN114723894B (zh) | 一种三维坐标获取方法、装置及电子设备 | |
| CN112184753B (zh) | 目标光流法确定方法、装置、计算机设备和存储介质 | |
| CN110428012A (zh) | 脑网络模型建立方法、脑图像分类方法、装置及电子设备 | |
| CN119649476A (zh) | 样本处理方法、装置、设备及存储介质 | |
| JP2014099848A (ja) | イメージ分割システム及びその方法 |
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 |








