I have been studying denoising images for several days now, and have decided to post about what I have learned so far. To begin with, I learned the library cv2 does not work on Google Colab, which is the website that I normally use to write code in Python. Therefore, a patch needs to be used in place of cv2, being cv2_imshow.
The code below shows which libraries need to be imported to be able to denoise an image in Google Colab, being:-
- Cv2 for computer vision,
- Numpy to perform numerical computations,
- Cv2_imshow, which is a patch that makes it possible to view images in Google Colab.
I have a picture of my deceased father in my Google account, so decided to read and show it:-
This is a good picture of my dad. I have been told that he looked like James Dean:-
In order to denoise the images, I had to:-
- Convert it to gray,
- Blur it with a Gaussian function,
- Smooth the image,
- Divide the image by 255, and
- Sharpen the image using masking.