Image Processing Task – Image
Sharpening
PES Institute of Technology &
Management
Department of Electronics and
Communication Engineering
Problem Statement
• Objective: Enhance the edges of an image
using a sharpening filter.
• • 1. Load the image.
• • 2. Apply a kernel to sharpen the image (e.g.,
Laplacian or unsharp masking).
• • 3. Save and display the sharpened image.
Importance of Image Sharpening
• Improves visibility of image features.
• • Highlights object boundaries and enhances
fine details.
• • Used in applications like medical imaging
and object detection.
Techniques for Image Sharpening
• Laplacian Filter: Detects edges by calculating
second derivative.
• • Unsharp Masking: Enhances contrast by
subtracting a blurred version.
• • Kernels highlight rapid intensity changes.
Step-by-Step Approach
• 1. Load image using OpenCV or PIL.
• • 2. Apply sharpening kernel (Laplacian or
unsharp).
• • 3. Save and display the sharpened output.
Sample Kernel Matrices
• Laplacian Kernel:
• [ 0 -1 0 ]
• [-1 4 -1]
• [ 0 -1 0 ]
• • Unsharp Masking Kernel:
• [-1 -1 -1]
• [-1 9 -1]
• [-1 -1 -1]
Output Examples
• Before and After comparison of the image.
• • Visual improvement in edge definition and
clarity.
• • (Insert images here)
Conclusion
• Sharpening improves image detail and edge
clarity.
• • Choice of kernel affects sharpness and noise
levels.
Bonus Task
• Experiment with various sharpening kernels.
• • Analyze effects on different types of images.
• • Observe how sharpness and clarity vary.
References
• OpenCV Documentation
• • Image Processing Books and Lecture Notes
• • Assignment Provided by PESITM
Sharpening Image - Python Code
• import cv2
• import numpy as np
• # Load the image
• image = cv2.imread('input.jpg')
• # Define sharpening kernel (Unsharp Masking)
• kernel = np.array([[-1, -1, -1],

Image_Sharpening_Task_With_Code.pptxhyyy

  • 1.
    Image Processing Task– Image Sharpening PES Institute of Technology & Management Department of Electronics and Communication Engineering
  • 2.
    Problem Statement • Objective:Enhance the edges of an image using a sharpening filter. • • 1. Load the image. • • 2. Apply a kernel to sharpen the image (e.g., Laplacian or unsharp masking). • • 3. Save and display the sharpened image.
  • 3.
    Importance of ImageSharpening • Improves visibility of image features. • • Highlights object boundaries and enhances fine details. • • Used in applications like medical imaging and object detection.
  • 4.
    Techniques for ImageSharpening • Laplacian Filter: Detects edges by calculating second derivative. • • Unsharp Masking: Enhances contrast by subtracting a blurred version. • • Kernels highlight rapid intensity changes.
  • 5.
    Step-by-Step Approach • 1.Load image using OpenCV or PIL. • • 2. Apply sharpening kernel (Laplacian or unsharp). • • 3. Save and display the sharpened output.
  • 6.
    Sample Kernel Matrices •Laplacian Kernel: • [ 0 -1 0 ] • [-1 4 -1] • [ 0 -1 0 ] • • Unsharp Masking Kernel: • [-1 -1 -1] • [-1 9 -1] • [-1 -1 -1]
  • 7.
    Output Examples • Beforeand After comparison of the image. • • Visual improvement in edge definition and clarity. • • (Insert images here)
  • 8.
    Conclusion • Sharpening improvesimage detail and edge clarity. • • Choice of kernel affects sharpness and noise levels.
  • 9.
    Bonus Task • Experimentwith various sharpening kernels. • • Analyze effects on different types of images. • • Observe how sharpness and clarity vary.
  • 10.
    References • OpenCV Documentation •• Image Processing Books and Lecture Notes • • Assignment Provided by PESITM
  • 11.
    Sharpening Image -Python Code • import cv2 • import numpy as np • # Load the image • image = cv2.imread('input.jpg') • # Define sharpening kernel (Unsharp Masking) • kernel = np.array([[-1, -1, -1],