Digital Image Processing Computer Vision: Marya Butt, PHD
Digital Image Processing Computer Vision: Marya Butt, PHD
PROCESSING
COMPUTER VISION
Process of streching the pixel values across the entire range from 0-255
Image Enhancement
Histogram Equalization
Process of streching the pixel values across the entire range from 0-255
“Is it possible to improve image contrast without also
boosting noise at the same time?”
Figure 6. (A) Green Channel, (B) after histogram equalization, (C) after
CLAHE.
Image
Enhancement
• CLAHE
Applications
Multiresolution Processing
The picture on the right is fine for counting the number of cars,
but not for reading the number plate
Image Binarization
Source:Apeer.com
Image Processing
Filter Vs Kernel
Matrices applied to an image to apply image effects which can be
done through the mathematical operation known as convolution.
Compression
reducing the size of the image with minimum deterioration in its
quality (image shrinkage)
For Expansion:
img_scaled = cv2.resize(img,None,fx=1.2, fy=1.2, interpolation = cv2.INTER_LINEAR)
cv2.imshow('Scaling - Linear Interpolation', img_scaled)
For compression:
img_scaled = cv2.resize(img,(450, 400), interpolation = cv2.INTER_AREA)
cv2.imshow('Scaling - Skewed Size', img_scaled)
OpenCV provides a function called resize to achieve image scaling. If you don't specify a size (by
using None), then it expects the X and Y scaling factors. In our example, the image will be
enlarged by a factor of 1.2.
Morphological Processing
(Erosion & Dilation)
Morphological image processing is a collection of non-linear
operations related to the shape or morphology of features in an
image
Morphological techniques probe an image with a small shape or template called
a structuring element. The structuring element is positioned at all possible locations
in the image and it is compared with the corresponding neighbourhood of pixels.
Some operations test whether the element "fits" within the neighbourhood, while
others test whether it "hits" or intersects the neighbourhood
Morphological Processing
(Erosion & Dilation)
Morphological Processing
(Erosion & Dilation)
How to erode and dilate in python?
# Create structure element Kernel
kernel = np.ones((5, 5), np.uint8)
# display results
cv2.imshow('Input', img)
cv2.imshow('Erosion', img_erosion)
cv2.imshow('Dilation', img_dilation)
cv2.waitKey(0)
Image Segmentation
(Locate objects & Boundaries)
DIP to CV (Computer Vision)
Continuum from IP to CV
Neuron & Artificial Neuron
Feed Forward NN
• Data or the input travels in one direction
• Single layer feed forward network
• Output=1 if > threshold(usually 0)
• Neuron deactivated value=-1
Recurrent Neural Network(RNN)
Which NN to be used?