Photography! – The word that excites me, anyone who knows me shall agree and can easily relate to this post on the interest to explore this topic.
We are uniting the Photography world onto the Computer Vision to create some Computational Photography.
Computational Photography has and will revolutionize the world of Smart Phone camera and its just Mind-blowing when I started to look into it and try out some code to enhance the image.
Computational photography is all about enhancing and extending the possibilities of digital photography, where it uses hardware to capture the data and software to adjust the image parameters – An example of this technology is nothing but how the Google HDR+ works.
HDR+ works like firstly capturing a burst of images in RAW and merge into a complete RAW image, where the Noise is less and increased Dynamic range. Example below.
More detail on Google HDR+ here
There are a lot of possibilities and another one could be to remove the blurriness.
https://graphics.stanford.edu/talks/compphot-publictalk-may08.pdf
How to understand this is processed and the science behind this!
These are the top 4 image processing libraries are available to consume in Python,
1. OpenCV (Open Source Computer Vision Library)
The library has more than 2500 optimized algorithms, which includes a comprehensive set of both classic and state-of-the-art computer vision and machine learning algorithms. These algorithms can be used to detect and recognize faces, identify objects, classify human actions in videos, track camera movements, track moving objects, extract 3D models of objects and many more.
2. NumPy
Python NumPy (among other things) provides support for large,multi-dimensional arrays. Using NumPy, we can express images as multi-dimensional arrays.
3. PIL Now is PILLOW
The Python Imaging Library or PIL allowed you to do image processing in Python.
4.scikit-image
scikit-image is a collection of algorithms for image processing.
It includes algorithms for segmentation, geometric transformations, colour space manipulation, analysis, filtering, morphology, feature detection, and more. It is designed to interoperate with the Python numerical and scientific libraries NumPy and SciPy.
Below is the sample code to showcase how simple it is to use Numpy and Open CV to improve Noise in the image captured.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
import os import numpy as np import cv2 folder = 'source_folder' # We get all the image files from the source folder files = list([os.path.join(folder, f) for f in os.listdir(folder)]) # We compute the average by adding up the images # Start from an explicitly set as floating point, in order to force the # conversion of the 8-bit values from the images, which would otherwise overflow average = cv2.imread(files[0]).astype(np.float) for file in files[1:]: image = cv2.imread(file) # NumPy adds two images element wise, so pixel by pixel / channel by channel average += image # Divide by count (again each pixel/channel is divided) average /= len(files) # Normalize the image, to spread the pixel intensities across 0..255 # This will brighten the image without losing information output = cv2.normalize(average, None, 0, 255, cv2.NORM_MINMAX) # Save the output cv2.imwrite('output.png', output) |