# Basic Digital Image Processing Tasks
> This repository contains basic implementations of image processing algorithms in python.
## Required Libraries
* PIL
```shell
$ pip install pillow
```
* opencv-python
```shell
$ pip install opencv-python
```
## Algorithms
### Gradient
```shell
$ python gradient.py
```
|Original|Gradient|
|---|---|
|||
### Image Negative
```shell
$ python negative.py binary.jpeg binary
```
|Original|Binary Negative|
|---|---|
|||
```shell
$ python negative.py lena.jpg gray
```
|Original|Grayscale Negative|
|---|---|
|||
```shell
$ python negative.py lena.jpg rgb
```
|Original|RGB Negative|
|---|---|
|||
### Image Segmentation
```shell
$ python Segmentation.py
```
|Original|Segmented|
|---|---|
|||
### Centroid
```shell
$ python Centroid.py
```
|Original|Centroid|
|---|---|
||<table><tr><td>Top Left</td><td>Top Right</td></tr><tr><td></td><td></td></tr><tr><td>Bottom Left</td><td>Bottom Right</td></tr><tr><td></td><td></td></tr></table>|
### Connected Component Labelling
```shell
$ python ccl4.py
```
|Original|CCL4 Labelled|
|---|---|
|||
### Histogram Equalization
```shell
$ python hist_eq.py
```
|Original|Histogram Equalized|
|---|---|
|||
### Local Histogram Analysis
|Original|Local Histogram|
|---|---|
|||
### Morphology
```shell
$ python Simple.py
```
|Original|Morphology|
|---|---|
||<table><tr><td>Erosion</td><td>Dilation</td></tr><tr><td></td><td></td></tr><tr><td>Opening</td><td>Closing</td></tr><tr><td></td><td></td></tr></table>|
### Sharpening
```shell
$ python sharpen.py
```
|Original|Sharpened|
|---|---|
|||
### Skeletonization
```shell
$ python Skeletonization.py
```

### Smoothing
```shell
$ python AvergingFilter.py
```
|Original|Averaging Filter|
|---|---|
|||
```shell
$ python gaussian.py
```
|Original|Gaussian|
|---|---|
|||
```shell
$ python unsharp_masking.py
```
|Original|Unsharp Masking|
|---|---|
|||
```shell
$ python median.py
```
|Original|Median|
|---|---|
|||
### XY Cuts
```shell
$ python XY_Cuts.py
```
|Original|XY Cuts|
|---|---|
|||
### Template Matching
```shell
$ python TemplateMatching.py
```
|Template|Matched in Image|
|---|---|
|||