Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
HighlightFeatures.cs
4
6{
10 public static partial class MorphologicalOperations
11 {
19 public static Matrix<float> HighlightFeatures_3x3(this Matrix<float> M, float Threshold)
20 {
21 return M.HighlightFeatures_3x3(Threshold, 0f, 1f);
22 }
23
33 public static Matrix<float> HighlightFeatures_3x3(this Matrix<float> M, float Threshold,
34 float MinThreshold, float MaxThreshold)
35 {
36 Matrix<float> Image1 = M.
37 Dilate(Shape.Cross_3x3, MaxThreshold).
38 Erode(Shape.Diamond_3x3, MinThreshold);
39
40 Matrix<float> Image2 = M.
41 Dilate(Shape.X_3x3, MaxThreshold).
42 Erode(3, 3, MinThreshold);
43
44 Image1.AbsoluteDifference(Image2);
45 Image1.Threshold(Threshold);
46
47 return Image1;
48 }
49
57 public static Matrix<float> HighlightFeatures_5x5(this Matrix<float> M, float Threshold)
58 {
59 return M.HighlightFeatures_5x5(Threshold, 0f, 1f);
60 }
61
71 public static Matrix<float> HighlightFeatures_5x5(this Matrix<float> M, float Threshold,
72 float MinThreshold, float MaxThreshold)
73 {
74 Matrix<float> Image1 = M.
75 Dilate(Shape.Cross_5x5, MaxThreshold).
76 Erode(Shape.Diamond_5x5, MinThreshold);
77
78 Matrix<float> Image2 = M.
79 Dilate(Shape.X_5x5, MaxThreshold).
80 Erode(5, 5, MinThreshold);
81
82 Image1.AbsoluteDifference(Image2);
83 Image1.Threshold(Threshold);
84
85 return Image1;
86 }
87
95 public static Matrix<float> HighlightFeatures_7x7(this Matrix<float> M, float Threshold)
96 {
97 return M.HighlightFeatures_7x7(Threshold, 0f, 1f);
98 }
99
109 public static Matrix<float> HighlightFeatures_7x7(this Matrix<float> M, float Threshold,
110 float MinThreshold, float MaxThreshold)
111 {
112 Matrix<float> Image1 = M.
113 Dilate(Shape.Cross_7x7, MaxThreshold).
114 Erode(Shape.Diamond_7x7, MinThreshold);
115
116 Matrix<float> Image2 = M.
117 Dilate(Shape.X_7x7, MaxThreshold).
118 Erode(7, 7, MinThreshold);
119
120 Image1.AbsoluteDifference(Image2);
121 Image1.Threshold(Threshold);
122
123 return Image1;
124 }
125
133 public static Matrix<int> HighlightFeatures_3x3(this Matrix<int> M, int Threshold)
134 {
135 return M.HighlightFeatures_3x3(Threshold, 0, 0x01000000);
136 }
137
147 public static Matrix<int> HighlightFeatures_3x3(this Matrix<int> M, int Threshold,
148 int MinThreshold, int MaxThreshold)
149 {
150 Matrix<int> Image1 = M.
151 Dilate(Shape.Cross_3x3, MaxThreshold).
152 Erode(Shape.Diamond_3x3, MinThreshold);
153
154 Matrix<int> Image2 = M.
155 Dilate(Shape.X_3x3, MaxThreshold).
156 Erode(3, 3, MinThreshold);
157
158 Image1.AbsoluteDifference(Image2);
159 Image1.Threshold(Threshold);
160
161 return Image1;
162 }
163
171 public static Matrix<int> HighlightFeatures_5x5(this Matrix<int> M, int Threshold)
172 {
173 return M.HighlightFeatures_5x5(Threshold, 0, 0x01000000);
174 }
175
185 public static Matrix<int> HighlightFeatures_5x5(this Matrix<int> M, int Threshold,
186 int MinThreshold, int MaxThreshold)
187 {
188 Matrix<int> Image1 = M.
189 Dilate(Shape.Cross_5x5, MaxThreshold).
190 Erode(Shape.Diamond_5x5, MinThreshold);
191
192 Matrix<int> Image2 = M.
193 Dilate(Shape.X_5x5, MaxThreshold).
194 Erode(5, 5, MinThreshold);
195
196 Image1.AbsoluteDifference(Image2);
197 Image1.Threshold(Threshold);
198
199 return Image1;
200 }
201
209 public static Matrix<int> HighlightFeatures_7x7(this Matrix<int> M, int Threshold)
210 {
211 return M.HighlightFeatures_7x7(Threshold, 0, 0x01000000);
212 }
213
223 public static Matrix<int> HighlightFeatures_7x7(this Matrix<int> M, int Threshold,
224 int MinThreshold, int MaxThreshold)
225 {
226 Matrix<int> Image1 = M.
227 Dilate(Shape.Cross_7x7, MaxThreshold).
228 Erode(Shape.Diamond_7x7, MinThreshold);
229
230 Matrix<int> Image2 = M.
231 Dilate(Shape.X_7x7, MaxThreshold).
232 Erode(7, 7, MinThreshold);
233
234 Image1.AbsoluteDifference(Image2);
235 Image1.Threshold(Threshold);
236
237 return Image1;
238 }
239 }
240}
Shape for morphological operations.
Definition: Shape.cs:9
static readonly Shape Diamond_3x3
Diamond shape
Definition: Shape.cs:154
static readonly Shape X_7x7
X shape
Definition: Shape.cs:140
static readonly Shape X_5x5
X shape
Definition: Shape.cs:128
static readonly Shape X_3x3
X shape
Definition: Shape.cs:118
static readonly Shape Diamond_7x7
Diamond shape
Definition: Shape.cs:171
static readonly Shape Diamond_5x5
Diamond shape
Definition: Shape.cs:159
static readonly Shape Cross_5x5
Cross shape
Definition: Shape.cs:92
static readonly Shape Cross_7x7
Cross shape
Definition: Shape.cs:104
static readonly Shape Cross_3x3
Cross shape
Definition: Shape.cs:82
Implements a Matrix, basic component for computations in Image Processing and Computer Vision.
Definition: Matrix.cs:12
static Matrix< int > HighlightFeatures_7x7(this Matrix< int > M, int Threshold)
Highlights features in a matrix, utilizing a sequence of morphological filters. 7x7 morphological sha...
static Matrix< int > HighlightFeatures_3x3(this Matrix< int > M, int Threshold)
Highlights features in a matrix, utilizing a sequence of morphological filters. 3x3 morphological sha...
static Matrix< float > Erode(this Matrix< float > M)
Erodes an image by replacing a pixel with the minimum value of a square neighborhood of the pixel.
Definition: Erode.cs:17
static Matrix< int > HighlightFeatures_7x7(this Matrix< int > M, int Threshold, int MinThreshold, int MaxThreshold)
Highlights features in a matrix, utilizing a sequence of morphological filters. 7x7 morphological sha...
static Matrix< float > HighlightFeatures_7x7(this Matrix< float > M, float Threshold, float MinThreshold, float MaxThreshold)
Highlights features in a matrix, utilizing a sequence of morphological filters. 7x7 morphological sha...
static Matrix< float > HighlightFeatures_7x7(this Matrix< float > M, float Threshold)
Highlights features in a matrix, utilizing a sequence of morphological filters. 7x7 morphological sha...
static Matrix< float > HighlightFeatures_3x3(this Matrix< float > M, float Threshold, float MinThreshold, float MaxThreshold)
Highlights features in a matrix, utilizing a sequence of morphological filters. 3x3 morphological sha...
static Matrix< int > HighlightFeatures_3x3(this Matrix< int > M, int Threshold, int MinThreshold, int MaxThreshold)
Highlights features in a matrix, utilizing a sequence of morphological filters. 3x3 morphological sha...
static Matrix< float > HighlightFeatures_5x5(this Matrix< float > M, float Threshold, float MinThreshold, float MaxThreshold)
Highlights features in a matrix, utilizing a sequence of morphological filters. 5x5 morphological sha...
static Matrix< int > HighlightFeatures_5x5(this Matrix< int > M, int Threshold, int MinThreshold, int MaxThreshold)
Highlights features in a matrix, utilizing a sequence of morphological filters. 5x5 morphological sha...
static Matrix< float > HighlightFeatures_3x3(this Matrix< float > M, float Threshold)
Highlights features in a matrix, utilizing a sequence of morphological filters. 3x3 morphological sha...
static Matrix< float > HighlightFeatures_5x5(this Matrix< float > M, float Threshold)
Highlights features in a matrix, utilizing a sequence of morphological filters. 5x5 morphological sha...
static Matrix< int > HighlightFeatures_5x5(this Matrix< int > M, int Threshold)
Highlights features in a matrix, utilizing a sequence of morphological filters. 5x5 morphological sha...
static Matrix< float > Dilate(this Matrix< float > M)
Dilates an image by replacing a pixel with the maximum value of a square neighborhood of the pixel.
Definition: Dilate.cs:17