0% found this document useful (0 votes)
3 views

Fuzzy Techinique for Intensity Transformation and Spatial Filter

Uploaded by

worku
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Fuzzy Techinique for Intensity Transformation and Spatial Filter

Uploaded by

worku
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 23

Adama Science And Technology University

School of Electrical Engineering and Computing


Department of Computer Science and Engineering
Section-1, Group-2
Title:- Fuzzy Techniques for Intensity
Transformations and Spatial Filtering
prepared by
Name ID
Milki Dida Wodajo pgr/38320/17
Mubarek Ahmed Hussen pgr/38322/17
Tamirat Mulu Beressa
pgr/38325/17
Tigist Dereje Aweta
pgr/38328/17
Yeabsra Habtu Kumlachew pgr/38331/17
Outline
Introduction
 Intensity Transformations
 Spatial Filtering

Membership Functions
- Triangular Membership Function
- Trapezoidal Membership Function
- Gaussian Membership Function
- Sigmoidal Membership Function
- Bell-Shaped Membership Functionction

Spatial filters
Conclusions
Introduction

• What are Intensity Transformations?


 Techniques to manipulate image intensity values for enhancement or
feature extraction.
 Examples include enhancing contrast, highlighting details, or correcting
brightness levels.
• What is Spatial Filtering?
 Methods that modify pixel intensity based on its spatial neighborhood.
 Examples include noise reduction, edge detection, and feature
smoothing.
Introduction....
Role of Fuzzy Techniques:
 Fuzzy Techniques are widely used in image processing to handle
uncertainty and improve image quality through adaptive intensity
transformations and spatial filtering.
 These methods adjust pixel intensities based on membership
functions to enhance image clarity.
 Useful in situations where precise boundaries and values are
difficult to define.
Objectives
Explain fuzzy membership functions
Explore fuzzy methods for intensity transformation.
Apply fuzzy spatial filtering for image enhancement
Demonstrate practical applications with Python.
Understand the integration of fuzzy logic in real-
world image processing tasks.

01/19/20
25
Membership Functions Overview
Fuzzy Membership Functions are mathematical functions that
represent the degree to which an element belongs to a fuzzy set.
Common membership functions include:
- Triangular Membership Function
- Trapezoidal Membership Function
- Gaussian Membership Function
- Sigmoidal Membership Function
- Bell-Shaped Membership Function

01/19/20
25
Membership Functions ....

01/19/20
25
Triangular Membership Function
• Formula:

• Parameters: a, b, c
• Triangular membership functions are simple and linear
functions commonly used in fuzzy logic, making them
easy to implement.
Trapezoidal Membership Function

• Formula:

• Parameters: a, b, c, d
• Trapezoidal functions are similar to triangular ones but
have a flat top, making them suitable for ranges of values.
Gaussian Membership Function

• Formula:

• Parameters: mean, sigma


• Gaussian functions are smooth and widely used for
continuous data, ideal for real-world data.
Intensity Transformation with Fuzzy Logic

• Fuzzy logic can be applied to adjust pixel intensities in an


image.
• Steps:
- Map input pixel intensities to fuzzy values.
- Apply membership functions.
- Convert back to pixel intensities.
Required Libraries

OpenCV: Library for image and video processing.


NumPy: For numerical and matrix computations.
 Matplotlib’s pyplot: for plotting images and visualizing data.
 Google Colab-specific import that allows us to interact with
local file system. The files module helps upload and download
files to and from the Colab environment.

01/19/20
25
Uploading Images
Uploading with Google Colab:
Allows easy interaction for image processing
tasks.
Use the following code to upload an image:
 from google.colab import files
 uploaded = files.upload()
Displays a file upload widget to select an
image.
01/19/20
25
Code Example: Intensity Transformation

def triangular_membership(x, a, b, c):


return max(0, min((x-a)/(b-a), (c-x)/(c-b)))

def apply_intensity_transformation(image, func, params):


transformed = func(image, *params)
return transformed
Spatial Filtering with Fuzzy Logic

• Fuzzy spatial filtering involves modifying pixel values


based on their neighbors.
• Common applications:
• - Smoothing (noise reduction)
• - Sharpening (edge enhancement)
Code Example: Spatial Filtering
def fuzzy_filter(image, kernel, membership_func):
filtered_image = np.zeros_like(image)
for i in range(image.shape[0]):
for j in range(image.shape[1]):
neighbors = image[i-1:i+2, j-1:j+2]
fuzzy_values = membership_func(neighbors)
filtered_image[i, j] = np.mean(fuzzy_values)
return filtered_image
Results Visualization
Display results using plt.imshow() and with some
decoration labels
Example Code:
plt.figure(figsize=(12, 8))
plt.subplot(2, 3, 1)
plt.imshow(image, cmap='gray')
plt.title('Original Image')
plt.axis('off') # Hide axis ticks

Result: Side-by-side Comparison of the original image


and the transformed image after applying fuzzy intensity
transformations and fuzzy spatial filtering.
01/19/20
25
Full Pipeline Overview

Steps to process an image:


1.Upload image via Colab.
2.Apply intensity transformations (using each membership
function).
3.Apply spatial filters (using each membership function).
4.Visualize the processed images.

01/19/20
25
Advantages of Fuzzy Techniques

• Flexible and adaptive


• Handles uncertainty in image processing
• Improves image quality without hard thresholds
• Suitable for a wide range of applications
Challenges of Fuzzy Techniques

• Computational complexity
• Subjectivity in defining membership functions
• Difficulties in selecting appropriate parameters
Applications
Medical Imaging: Enhance X-rays, MRIs, and CT
scans.
Remote Sensing: Extract terrain features from satellite
imagery.
Industrial Automation: Detect product defects and
edges.
Photography: Improve image clarity and noise
reduction.
01/19/20
25
Conclusion
Intensity transformations improve contrast and
detail visibility.
Spatial filtering removes noise and highlights key
features.
Fuzzy techniques significantly enhance image
processing capabilities by handling uncertainty and
improving image clarity
Fuzzy techniques significantly enhance image
processing capabilities.
01/19/20
25
Thank You!!!

01/19/20
25

You might also like