Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ObjectInformation.cs
2
4{
8 public class ObjectInformation
9 {
10 private readonly ObjectMap map;
11 private readonly ushort nr;
12 private readonly int x0;
13 private readonly int y0;
14 private int nrPixels = 0;
15 private Point[]? contour = null;
16 private int minX;
17 private int maxX;
18 private int minY;
19 private int maxY;
20
28 public ObjectInformation(ushort Nr, int X0, int Y0, ObjectMap Map)
29 {
30 this.nr = Nr;
31 this.x0 = this.minX = this.maxX = X0;
32 this.y0 = this.minY = this.maxY = Y0;
33 this.map = Map;
34 }
35
36 internal void AddPixels(int x1, int x2, int y)
37 {
38 this.nrPixels += x2 - x1 + 1;
39
40 if (x1 < this.minX)
41 this.minX = x1;
42
43 if (x2 > this.maxX)
44 this.maxX = x2;
45
46 if (y < this.minY)
47 this.minY = y;
48 else if (y > this.maxY)
49 this.maxY = y;
50 }
51
55 public ushort Nr => this.nr;
56
60 public int NrPixels => this.nrPixels;
61
65 public int MinX => this.minX;
66
70 public int MaxX => this.maxX;
71
75 public int MinY => this.minY;
76
80 public int MaxY => this.maxY;
81
85 public int X0 => this.x0;
86
90 public int Y0 => this.y0;
91
95 public int Width => this.maxX - this.minX + 1;
96
100 public int Height => this.maxY - this.minY + 1;
101
105 public ObjectMap Map => this.map;
106
110 public Point[] Contour
111 {
112 get
113 {
114 this.contour ??= this.map.FindContour(this.x0, this.y0, this.nr);
115 return this.contour;
116 }
117 }
118 }
119}
Contains information about an object.
int MaxX
Largest X-coordinate of bounding box
int MinY
Smallest Y-coordinate of bounding box
ushort Nr
Object number in image
int NrPixels
Number of pixels in object.
int MaxY
Largest Y-coordinate of bounding box
ObjectMap Map
Object Map containing information about the objects in an image.
int MinX
Smallest X-coordinate of bounding box
int X0
X-Coordinate where object was first detected.
int Y0
Y-Coordinate where object was first detected.
Point[] Contour
Contour of the object.
ObjectInformation(ushort Nr, int X0, int Y0, ObjectMap Map)
Contains information about an object.
Contains an object map of contents in an image.
Definition: ObjectMap.cs:11
Represents a point in an image.
Definition: Point.cs:7