This repository implements Quarter Laplacian Filter for Edge Aware Image Processing using the approach mentioned in this paper.
Image smoothing is the fundamental operation in image processing. We use it to remove image details or noise in the image. While performing smoothing operation, it is needed to remove small gradients and preserve the large ones which is called edge preserving. This repository uses Laplasian filter originally obtained from diffusion equation.
It is implemented using classical box filter method but instead of using entire Laplacian Kernel this method uses quarter of Laplacian Kernel.
Standard Laplacian Kernels are as follows:
[0, 1/4, 0 ] [-1/16, 5/16, -1/16] [1/12, 1/6, 1/12] [1/4, -1, 1/4] , [5/16, -1, 5/16] , [1/6, -1, 1/6] [0, 1/4, 0 ] [-1/16, 5/16, -1/16] [1/12, 1/6, 1/12]
This implementation uses right most Kernel which is the most isotropic kernel as mentioned in the paper. Therefore, the quarter Laplacian filters would be as follows:
[1/3, 1/3, 0] [0, 1/3, 1/3] [0, 0, 0] [0, 0, 0] K1 = [1/3, -1, 0] , K2 = [0, -1, 1/3] K3 = [0, -1, 1/3] , K4 = [1/3, -1, 0] [0, 0, 0] [0, 0, 0] [0, 1/3, 1/3] [1/3, 1/3, 0]
NOTE: Linux based OS or MacOS required to run this shell script.
-
Clone the repository from git.
-
Open the command line interface (CLI) of your OS and move to the project folder ICIP1_quarter_laplacian/ using cd command.
-
Run the installation script using following command
$ ./install.sh
this script will automatically create a new directory namely env_dir/ to create a virtual environment, activate that environment and install all the required library into that.
NOTE: If you get permission denied error while running this script, kindly run the command
$ chmod 755 install.sh
-
Once the project is installed and environment is activated, main.py can be run using Python3 as follows
$ python3 main.py [image_name]
It is important to note that we are using Python3 for the implementation purpose. Also, user can provide image name with its path as an optional parameter to main.py which will be considered as base original image and all operations will be performed on that image. If parameter is not provided, all smoothing operations will be performed on this standard camera-man image which is similar to the one shown in paper of ICIP1.
Chirag Vaghela