Fuzzy Logic Based Edge Detection
-
Upload
dawn-raider-gupta -
Category
Data & Analytics
-
view
914 -
download
3
description
Transcript of Fuzzy Logic Based Edge Detection
![Page 1: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/1.jpg)
Digital Image ProcessingEdge Detection using Dual FIS Optimization
Ishaan Gupta
03914802810
7E123 – E2
Electronics and Communications
MAIT
Mentored By:Prof. Nitin SharmaAssistant ProfessorElectronics and Communications DeptMAIT
![Page 2: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/2.jpg)
What is D.I.P. ?
• Processing of digital images by means of a digital computer.• Output can be image and/or values.• Deals with spatial coordinates, amplitude of ‘f’ at any pair coordinates
(x,y) called gray levels or intensity values which are finite and discrete.
![Page 3: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/3.jpg)
Steps in DIPImage acquisition
Image filtering and enhancement
Image restoration
Color Image Processing.
Wavelets and multi-resolution
Processing.
Compression
Morphological Processing.
Segmentation
Representation & Description.
Object Recognition
![Page 4: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/4.jpg)
Image acquisition
• Done via:• Camera – Visible spectrum• Image matrix (Draw Functions / Convert intensity values -> Image)• Techniques :
• Xray• Gamma• Ultrasound• IR• Satellite (Multi-resolution)
![Page 5: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/5.jpg)
Image filters & enhancement
• Filters – LPF, HPF, BPF, Gaussian Filters, etc.• Depth – Field view, panorama, IR based, Laser Based• Enhancement – Brightness, Contrast, Smoothening, Equalization,
Saturation [RGB Master, R master, G Master, B Master] , etc.
![Page 6: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/6.jpg)
Detection
• Edge• Color• Intensity / gray level - Binary and grayscale Images• Objects and Object description.
![Page 7: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/7.jpg)
Edge detection algos
• Gaussian - Canny’s Algo, Shen-Castan, etc• LoG (Laplacian of Gaussian) – Marr-Hildreth – Second Derivative• Zero Crossing – LoG based• Classical - Prewitt• Classical - Sobel
![Page 8: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/8.jpg)
ComparisonsOperator Advantages Disadvantages
Classical (Sobel,prewitt, Kirsch,…)
Simplicity,Detection of edges and their
orientations
Sensitivity tonoise, Inaccurate
ZeroCrossing(Laplacian, Second
directional derivative)
Detection ofedges and their orientations. Having fixed characteristics in all directions
Responding tosome of the existing edges,
Sensitivity to noise
Laplacian ofGaussian(LoG) (Marr-Hildreth)
Finding thecorrect places of edges, Testing wider
area around the pixel
Malfunctioningat the corners, curves and where the gray level intensity function varies. Not finding the orientation of edge
because of using the Laplacian filter
Gaussian(Canny,Shen-Castan)
Usingprobability for finding error rate,
Localization and response. Improving signal to noise ratio, Better detection
specially in noise conditions
ComplexComputations, False zero crossing,
Time consuming
![Page 9: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/9.jpg)
9
Edge Detection
![Page 10: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/10.jpg)
10
• Convert a 2D image into a set of curves• Extracts salient features of the scene• More compact than pixels
![Page 11: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/11.jpg)
11
Origin of Edges
• Edges are caused by a variety of factors
depth discontinuity
surface color discontinuity
illumination discontinuity
surface normal discontinuity
![Page 12: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/12.jpg)
12
Profiles of image intensity edges
![Page 13: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/13.jpg)
13
Edge detection
1. Detection of short linear edge segments (edgels)
2. Aggregation of edgels into extended edges• (maybe parametric description)
![Page 14: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/14.jpg)
14
Edgel detection
• Difference operators• Parametric-model matchers
![Page 15: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/15.jpg)
15
Edge is Where Change Occurs
• Change is measured by derivative in 1D• Biggest change, derivative has maximum magnitude• Or 2nd derivative is zero.
![Page 16: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/16.jpg)
16
Image gradient• The gradient of an image:
• The gradient points in the direction of most rapid change in intensity
The gradient direction is given by:
• how does this relate to the direction of the edge?
The edge strength is given by the gradient magnitude
![Page 17: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/17.jpg)
17
The discrete gradient• How can we differentiate a digital image f[x,y]?
• Option 1: reconstruct a continuous image, then take gradient• Option 2: take discrete derivative (finite difference)
![Page 18: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/18.jpg)
18
The Sobel operator• Better approximations of the derivatives exist
• The Sobel operators below are very commonly used
-1 0 1
-2 0 2
-1 0 1
1 2 1
0 0 0
-1 -2 -1
• The standard defn. of the Sobel operator omits the 1/8 term– doesn’t make a difference for edge detection– the 1/8 term is needed to get the right gradient value, however
![Page 19: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/19.jpg)
19
Gradient operators
(a): Roberts’ cross operator (b): 3x3 Prewitt operator(c): Sobel operator (d) 4x4 Prewitt operator
![Page 20: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/20.jpg)
20
Effects of noise• Consider a single row or column of the image
• Plotting intensity as a function of position gives a signal
![Page 21: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/21.jpg)
21
Solution: Smooth first
![Page 22: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/22.jpg)
22
Derivative theorem of convolution• This saves us one operation:
![Page 23: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/23.jpg)
23
Laplacian of Gaussian• Consider
Laplacian of Gaussianoperator
![Page 24: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/24.jpg)
24
2D edge detection filters
• is the Laplacian operator:
Laplacian of Gaussian
Gaussian derivative of Gaussian
![Page 25: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/25.jpg)
25
Optimal Edge Detection: Canny
• Assume: • Linear filtering• Additive iid Gaussian noise
• Edge detector should have:• Good Detection. Filter responds to edge, not noise.• Good Localization: detected edge near true edge.• Single Response: one per edge.
![Page 26: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/26.jpg)
26
Optimal Edge Detection: Canny (continued)
• Optimal Detector is approximately Derivative of Gaussian.• Detection/Localization trade-off
• More smoothing improves detection• And hurts localization.
![Page 27: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/27.jpg)
27
The Canny edge detector
• original image (Lena)
![Page 28: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/28.jpg)
28
The Canny edge detector
norm of the gradient
![Page 29: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/29.jpg)
29
The Canny edge detector
thresholding
![Page 30: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/30.jpg)
30
The Canny edge detector
thinning(non-maximum suppression)
![Page 31: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/31.jpg)
31
Non-maximum suppression
• Check if pixel is local maximum along gradient direction
• requires checking interpolated pixels p and r
![Page 32: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/32.jpg)
32
Predictingthe nextedge point
Assume the marked point is an edge point. Then we construct the tangent to the edge curve (which is normal to the gradient at that point) and use this to predict the next points (here either r or s).
(Forsyth & Ponce)
![Page 33: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/33.jpg)
33
Hysteresis
• Check that maximum value of gradient value is sufficiently large• drop-outs? use hysteresis
• use a high threshold to start edge curves and a low threshold to continue them.
![Page 34: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/34.jpg)
34
Effect of (Gaussian kernel size)
Canny with Canny with original
The choice of depends on desired behavior• large detects large scale edges• small detects fine features
![Page 35: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/35.jpg)
35
Scale• Smoothing• Eliminates noise edges.• Makes edges smoother.• Removes fine detail.
![Page 36: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/36.jpg)
36
![Page 37: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/37.jpg)
37
fine scalehigh threshold
![Page 38: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/38.jpg)
38
coarse scale,high threshold
![Page 39: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/39.jpg)
39
coarsescalelowthreshold
![Page 40: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/40.jpg)
40
Scale space
• Properties of scale space (w/ Gaussian smoothing)• edge position may shift with increasing scale ()• two edges may merge with increasing scale • an edge may not split into two with increasing scale
larger
Gaussian filtered signal
first derivative peaks
![Page 41: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/41.jpg)
41
Edge detection by subtraction
original
![Page 42: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/42.jpg)
42
Edge detection by subtraction
smoothed (5x5 Gaussian)
![Page 43: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/43.jpg)
43
Edge detection by subtraction
smoothed – original(scaled by 4, offset +128)
Why doesthis work?
filter demo
![Page 44: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/44.jpg)
44
Gaussian - image filter
Laplacian of Gaussian
Gaussian delta function
![Page 45: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/45.jpg)
45
An edge is not a line...
![Page 46: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/46.jpg)
46
Finding lines in an image
• Option 1:• Search for the line at every possible position/orientation• What is the cost of this operation?
• Option 2:• Use a voting scheme: Hough transform
![Page 47: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/47.jpg)
47
Finding lines in an image
• Connection between image (x,y) and Hough (m,b) spaces
• A line in the image corresponds to a point in Hough space• To go from image space to Hough space:
• given a set of points (x,y), find all (m,b) such that y = mx + b
x
y
m
b
m0
b0
image space Hough space
![Page 48: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/48.jpg)
48
Finding lines in an image
• Connection between image (x,y) and Hough (m,b) spaces• A line in the image corresponds to a point in Hough space• To go from image space to Hough space:
• given a set of points (x,y), find all (m,b) such that y = mx + b
• What does a point (x0, y0) in the image space map to?
x
y
m
b
image space Hough space
– A: the solutions of b = -x0m + y0
– this is a line in Hough space
x0
y0
![Page 49: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/49.jpg)
49
Corners contain more edges than lines.
• A point on a line is hard to match.
Corner detection
![Page 50: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/50.jpg)
50
Corners contain more edges than lines.• A corner is easier
![Page 51: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/51.jpg)
51
Edge Detectors Tend to Fail at Corners
![Page 52: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/52.jpg)
52
Finding Corners
Intuition:
• Right at corner, gradient is ill defined.
• Near corner, gradient has two different values.
![Page 53: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/53.jpg)
Fuzzy Logic&
Fuzzy Inference System (FIS)
![Page 54: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/54.jpg)
Introduction to Fuzzy Sets
• Introduced by A. L. Zadeh (1965)• Fuzzy sets provide the mechanism for dealing with imprecise
information• Based and related closely to usage of probability in crisp information.• Provides margin for error and its correction possibilities in both input
and output values.• Takes into account full or partial membership and relationship
between one value to another.
![Page 55: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/55.jpg)
FuzzyInferenceSystem (FIS)
FIS
Types
Mamdani
Sugeno
Components
Membership Functions
IF-THEN Rules
Logical Operations
Applications
DIP
Localizations
Network Analysis
![Page 56: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/56.jpg)
Steps in FIS
![Page 57: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/57.jpg)
FIS Toolbox in MATLAB
![Page 58: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/58.jpg)
Conventional FIS usage in DIP
FIS
(4 In
put)
Image processor Edge
![Page 59: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/59.jpg)
My usage
Image Restoration
Image Enhancement
Noise Removal using
LoGFIS OutDIP2Edge
Detection2DIP 1Edge detection1
Mat2Gray out1
FIS Image processor FIS Image
Processor
Edge Out
Mat2Gray out Filtration Noise
RemovalImage
enhancementImage
restoration
![Page 60: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/60.jpg)
FIS 1
![Page 61: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/61.jpg)
Membership Function of Input
![Page 62: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/62.jpg)
Membership of Output
![Page 63: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/63.jpg)
IF-THEN Rule set = 16
![Page 64: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/64.jpg)
FIS2
![Page 65: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/65.jpg)
Membership Function of Input
![Page 66: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/66.jpg)
Membership of Output
![Page 67: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/67.jpg)
IF-THEN Ruleset = 28 +10
![Page 68: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/68.jpg)
Final Outputs Compared
![Page 69: Fuzzy Logic Based Edge Detection](https://reader036.fdocuments.us/reader036/viewer/2022081422/558631e4d8b42a32618b4fb0/html5/thumbnails/69.jpg)
Thank You