Image and Video Analytics Assignment
Image and Video Analytics Assignment
1.Noise Reduction:
Noise in an image can be caused by various factors such as low light,
sensor noise, and compression artifacts. Noise reduction techniques aim to
remove noise from the image while preserving its essential features. Some
common noise reduction techniques include Gaussian smoothing, median
filtering, and wavelet denoising .
Techniques:
1. Gaussian Filtering:
o How it works: Applies a Gaussian function to smooth the image.
o Use case: Effective for reducing Gaussian noise.
o Example: Blurring an image to reduce high-frequency noise.
Sample code:
gaussian_blur1 = cv2.GaussianBlur(img,(5,5),2,cv2.BORDER_DEFAULT)
gaussian_blur2 = cv2.GaussianBlur(img,(5,5),7,cv2.BORDER_DEFAULT)
plt.figure(figsize=(20, 20))
plt.subplot(1,3,1),plt.imshow(img,cmap = 'gray')
plt.title('Noisy Image')
plt.subplot(1,3,2),
plt.imshow(gaussian_blur1,cmap = 'gray')
plt.subplot(1,3,3),
plt.imshow(gaussian_blur2,cmap = 'gray')
median = cv2.medianBlur(img,5)
plt.figure(figsize=(16, 16))
plt.subplot(121),plt.imshow(img,cmap = 'gray')
plt.title('Noisy Image')
plt.subplot(122),
plt.imshow(median,cmap = 'gray')
plt.title('Median filter')
plt.show()
3. Wavelet Transform:
o How it works: Decomposes the image into different frequency
components and processes them separately.
o Use case: Effective for multi-scale noise reduction.
o Example: Denoising an image by thresholding wavelet coefficients.
2.Contrast Enhancement:
Contrast enhancement techniques aim to increase the contrast of
an image, making it easier to distinguish between different image features.
These techniques can be helpful in applications such as medical imaging and
surveillance. Some standard contrast enhancement techniques include
histogram equalization, adaptive histogram equalization, and contrast stretching .
Techniques:
1. Histogram Equalization:
Techniques:
2. Bilinear Interpolation:
3. Bicubic Interpolation:
4. Lanczos Resampling:
Techniques:
1. White Balance Adjustment:
o How it works: Corrects the color temperature to make whites appear
neutral.
o Use case: Removes color casts caused by different lighting
conditions.
o Example: Adjusting a photo taken under tungsten light to remove the
yellowish tint
2. Gray World Assumption:
Sample code:
plt.imshow(img,cmap='gray')
3. Color Transfer:
5. Segmentation:
Segmentation techniques are used to divide an image into regions based
on its content. Segmentation can be helpful in applications such as medical
imaging, where specific structures or organs must be isolated from the image.
Some standard segmentation techniques include thresholding, edge detection,
and region growing.
Techniques:
1. Threshold-Based Segmentation
• How it works: Divides the image into segments based on a threshold value.
Pixels with intensity values above the threshold are assigned to one segment,
and those below are assigned to another.
• Use case: Simple and effective for images with distinct intensity differences.
• Example: Separating the foreground from the background in a binary image.
Sample code:
#Thresholding: try playing with the threshold value (144 here) to see the changes
plt.imshow(thresh1,cmap='gray')
2. Edge-Based Segmentation
• How it works: Detects edges within an image and uses these edges to define
boundaries between segments.
• Use case: Effective for images with clear, well-defined edges.
• Example: Identifying the boundaries of objects in a photograph.
3. Region-Based Segmentation
• How it works: Groups pixels into regions based on predefined criteria, such as
intensity or texture.
• Use case: Useful for images where regions have similar characteristics.
• Example: Segmenting different tissues in a medical image.
6. Feature Extraction:
Feature extraction techniques are used to identify and extract relevant
features from an image. These features can be used in object recognition and
image classification applications. Some standard feature extraction techniques
include edge detection, corner detection, and texture analysis.
Techniques:
1. Edge Detection
3. Texture Analysis