This is a Matlab re-implementation of the paper.

Qiangwei Peng, and Wen Huang, 
An Image Inpainting Algorithm Using Exemplar Matching and
Low-Rank Sparse Prior.

It is provided for educational/researrch purpose only. 
Please cite our paper if you found the software useful for your work.

In order to run this algorithm, you need to compile the relevant files.  
First you need to go to the path code\2nd_stage\ROPTLIB and run the command 
GenerateMyMex(1);
MyMex TestFRankETextureInpainting; 
Then you need to go to the path code\2nd_stage\external\Bk_matlab and run the command
BK_BuildLib;
BK_LoadLib;
Then run command ImportDIR to set up the required path.

If you want to reproduce numerical experiments in this paper, 
please see scripts IARPG_LADM_Ex_5_2.m,  IARPG_Ex_5_3.m,   LADM_Ex_5_3.m,  
IARPG_Integration_Ex_5_4.m, and Integration_Ex_5_5.m
under the folders code\2nd_stage.
The results are saved under the folders experiment5.2, experiment5.3, experiment5.4 and experiment5.5. 

If you want to use this software to recovery your own images, you need 
to put the original image and binary mask into the path data\user_data
and then see main program inpainting_2stage.m. 

There are five main directories:

- code: the integration algorithm code implementation

- data: the folder for input images and masks

- experiment5.2, 5.3 5.4 and 5,5: the storage folder for the results of  image inpainting experiments 
in subsections 5.2, 5.3 5.4 and 5.5 of the paper.