-
Image resizing is a widely used operation in image processing. Either for scaling up or for scaling down, we use interpolation to find the corresponding pixel intensity in the resulting image. Choice of interpolation method is important as it directly affects the quality of the resulting image. The following interpolation methods were mentioned in class:
• Nearest neighbour
• Bilinear
• BicubicIf we look at PILLOWS reference page wean see that the resize() function has predefined resampling functions:
• PIL.Image.NEAREST
• PIL.Image.BILINEAR
• PIL.Image.BICUBIC
• PIL.Image.LANCZOSLANCZOS is a more sophisticated method which gives better results compared to first three methods.
For this question, we will implement a jupyter notebook script and will perform these operations :
Ques 1. Read color version of the image "lena.png", Convert colored lena image to grayscale image.
Ques 2. Resize (scale down) the grayscale lena image to half its original size. Then, resize (scale up) it up back to the original size using resize() with PIL.Image.NEAREST
Ques3. Resize (scale down) the grayscale lena image to half its original size. Then, resize (scale up) it up back to the original size using resize() with PIL.Image.BILINEAR
Ques4. Resize (scale down) the grayscale lena image to half its original size. Then, resize (scale up) it up back to the original size using resize() with PIL.Image.BICUBIC
Ques5. our script should display the results as follows using matplotlib along with the PSNR values w.r.t original image below the result image
-
Ques1. Defining a generic function (ChSwap) that takes a color image as input and returns the corresponding output image in which the R,G,B channels are swapped as follows:
o Splits the input image into R, G, B Channels o Red (Out) = Blue (In)
o Green (Out) = Red (In) o Blue (Out) = Green(In)
o Combine the new channels to create the new image and returnQues2. Read color version of the image "Lenna.png”.
Ques3. Use function ChSwap to create a color band swapped version of lena
Ques4. Using matplotlib plot, display the original and new images side-by-side.
-
Ques1. We have discussed intensity transformation functions in detail in class and you have gained necessary implementation skills from Lab1. Now, let’s apply them to a real life challenge!
Ques2. Although not very common among us Indians, red-eye effect is a common phenomenon in flash photography where pupils in the eyes appear red! Automatic Redeye Detection and Correction Algorithms are now very common in most cameras and cell phones!! (Due to the inherent complexity, we will not deal with automatic detection aspect now, but will only work on correction)
Ques3. Come up with your own red-eye correction algorithm (RedEyeRemoval) using piece-wise intensity transformations! (Don’t worry if other parts of the image with red color get distorted!)
Ques4. Two important aspect of this algorithm are (1) Figuring out the range of intensities to modify (2) Deciding on what the modified intensity values should be!
Ques5. Four sample images with red eyes are provided with this lab. Your function, RedEyeRemoval, should take an input image and display/output the corrected image. Using matplotlib plot, display the original and new images side-by-side. (Test your algorithm on all the sample images.
- We have to take an image of our face. Make sure you're wearing clear spectacles so that more edges are visible.
- There should be three images(one clear image, one with gaussian noise and one with salt and pepper noise)
- Perform 5 edge detection techniques on these three images
- Prewitt Edge Detection
- Sobel Edge Detection
- Laplacian Edge Detection
- Canny Edge Detection
- Robert Edge Detection
- Perform Thresholding Technique
- Simple/Binary Thresholding
- Mean Adaptive Thresholding
- Gaussian Adaptive Thresholding
- Ostu's Thresholding