| Sno | Back | Back Subject | subject | date | title | note |
|---|---|---|---|---|---|---|
| 1 | 1 | Back to subject | AI for Image Analysis - 20A30702b (Theory) | Sept. 7, 2025 | Unit - 4 Part01 |
1. Blending Two Images
2. Changing Contrast and Brightness 👉 Use cv2.convertScaleAbs(). Contrast The contrast stretching operation takes a low-contrast image as input and stretches the narrower range of the intensity values to span a desired wider range of values in order to output a high-contrast output image, thereby enhancing the image's contrast. It is just a linear scaling function that is applied to image pixel values, and hence the image enhancement is less drastic (than its more sophisticated counterpart histogram equalization, to be described shortly). The following screenshot shows the point transformation function for contrast stretching: As can be seen from the previous screenshot, the upper and lower pixel value limits (over which the image is to be normalized), need to be specified before the stretching can be performed (for example, for a gray-level image, the limits are often set to 0 and 255, in order for the output image to span the entire range of available pixel values). All we need to find is a suitable value of m from the CDF of the original image. The contrast stretching transform produces higher contrast than the original by darkening the levels below the value m (in other words, stretching the values toward the lower limit) in the original image and brightening the levels previous to value m (stretching the values toward the upper limit) in the original image. The following sections describe how to implement contraststretching using the PIL library
Smoothing Images:
Problem with Smoothing
Median filter:
Median Filtering 1.Sort the K2 Values in window Centered at The Pixel Non-Linear Operation
It is the best order statistic filter; it replaces the value of a pixel by the median of gray levels
in the Neighborhood of the pixel.
The original of the pixel is included in the computation of the median of the filter are quite possible because for certain types of random noise, the provide excellent noise reduction capabilities with considerably less blurring then smoothing filters of similar size. These are effective for bipolar and unipolar impulse noise.
GAUSSIAN LOWPASS FILTERS:
Same Gaussian Kernel is used everywhere.
Blurs across edges "Bias" Gaussian Kernel such that Pixcels not similar in Intensity to
Center Pixel Receive a lower weight The form of these filters in two dimensions is given by
ï‚· This transfer function is smooth, like Butterworth filter.
ï‚· Gaussian in frequency domain remains a Gaussian in spatial domain
ï‚· Advantage: No ringing artifacts.
Where D0 is the cutoff frequency. When D(u,v) = D0, the GLPF is down to 0.607 of its maximum
value. This means that a spatial Gaussian filter, obtained by computing the IDFT of above
equation., will have no ringing. Fig..Shows a perspective plot, image display and radial cross
sections of a GLPF function.
magnified sections in (b) and(c).
Fig. shows an application of lowpass filtering for producing a smoother, softer-looking
result from a sharp original. For human faces, the typical objective is to reduce the sharpness of
fine skin lines and small blemished.
Bilateral Filter Non-Linear Operation
(Cannot be Implemented using Convolution) |