If you use the code, please cite the following paper: @Article{zhan2015multifocus, author = {Zhan, Kun and Li, Qiaoqiao and Teng, Jicai and Wang, Mingying and Shi, Jinhui}, title = {Multifocus image fusion using phase congruency}, journal = {Journal of Electronic Imaging}, year = {2015}, volume = {24}, number = {3}, pages = {033014}, publisher = {International Society for Optics and Photonics} }