xcd
2020-03-29 9a6d8dd28192132ea38f537ad29c410bccfac3be
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
using System;
using HalconDotNet;
 
namespace HalconTools
{
 
    /// <summary>
    /// Base class to have a more abstract definition of a measure result.
    /// </summary>
    public class MeasureResult
    {
        public MeasureResult() { }
    }
 
    /****************************************************************/
    /****************************************************************/
 
    /// <summary>
    /// Measure result class containing data obtained from the HALCON measure
    /// operator for single-edge measurement
    /// </summary>
    public class EdgeResult : MeasureResult
    {
        /// <summary>Row coordinate of extracted edges.</summary>
        public HTuple rowEdge;
 
        /// <summary>Column coordinate of extracted edges.</summary>
        public HTuple colEdge;
 
        /// <summary>Amplitude of the extracted edges (with sign).</summary>
        public HTuple amplitude;
 
        /// <summary>Distance between consecutive edges.</summary>
        public HTuple distance;
 
        /// <summary>Creates empty instance.</summary>
        public EdgeResult() { }
 
        /// <summary>
        /// Creates an edge result instance containing data from
        /// the provided result value (deep copy).
        /// </summary>
        public EdgeResult(EdgeResult result)
            : this(result.rowEdge, result.colEdge,
                  result.amplitude, result.distance)
        {
        }
 
        /// <summary>
        /// Creates an edge result instance using the passed values.
        /// </summary>
        public EdgeResult(HTuple Nrow, HTuple Ncol,
                          HTuple Nampl, HTuple Ndist)
        {
            rowEdge = new HTuple(Nrow);
            colEdge = new HTuple(Ncol);
            amplitude = new HTuple(Nampl);
            distance = new HTuple(Ndist);
        }
 
        /// <summary>
        /// Creates an edge result instance using the passed values.
        /// </summary>
        public EdgeResult(double Nrow, double Ncol,
                          double Nampl, double Ndist)
        {
            rowEdge = new HTuple(Nrow);
            colEdge = new HTuple(Ncol);
            amplitude = new HTuple(Nampl);
            distance = new HTuple(Ndist);
        }
 
    }//end of class EdgeResult
 
 
    /****************************************************************/
    /****************************************************************/
 
    /// <summary>
    /// Measure result class containing data obtained from the HALCON measure
    /// operator for edge pair measurement
    /// </summary>
    public class PairResult : MeasureResult
    {
 
        /// <summary>
        /// Row coordinate of first extracted edges of a pair.
        /// </summary>
        public HTuple rowEdgeFirst;
        /// <summary>
        /// Column coordinate of first extracted edges of a pair.
        /// </summary>
        public HTuple colEdgeFirst;
        /// <summary>
        /// Row coordinate of second extracted edges of a pair.
        /// </summary>
        public HTuple rowEdgeSecond;
        /// <summary>
        /// Column coordinate of second extracted edges of a pair.
        /// </summary>
        public HTuple colEdgeSecond;
        /// <summary>Amplitude of the first extracted edges of a pair (with sign).</summary>
        public HTuple amplitudeFirst;
        /// <summary>Amplitude of the second extracted edges of a pair (with sign).</summary>
        public HTuple amplitudeSecond;
        /// <summary>Distance between edges of a pair.</summary>
        public HTuple intraDistance;
        /// <summary>Distance between consecutive edge pairs</summary>
        public HTuple interDistance;
 
 
        /// <summary>Creates empty instance.</summary>
        public PairResult() { }
 
        /// <summary>
        /// Creates an edge result instance containing data from
        /// the provided result value (deep copy).
        /// </summary>
        public PairResult(PairResult result)
            : this(result.rowEdgeFirst, result.colEdgeFirst,
                  result.rowEdgeSecond, result.colEdgeSecond,
                  result.amplitudeFirst, result.amplitudeSecond,
                  result.intraDistance, result.interDistance)
        {
        }
 
        /// <summary>
        /// Creates an edge result instance using the passed values.
        /// </summary>
        public PairResult(HTuple Nrow1, HTuple Ncol1,
                          HTuple Nrow2, HTuple Ncol2,
                          HTuple Nampl1, HTuple Nampl2,
                          HTuple Ndist, HTuple Nwidth)
        {
            rowEdgeFirst = new HTuple(Nrow1);
            colEdgeFirst = new HTuple(Ncol1);
            rowEdgeSecond = new HTuple(Nrow2);
            colEdgeSecond = new HTuple(Ncol2);
            amplitudeFirst = new HTuple(Nampl1);
            amplitudeSecond = new HTuple(Nampl2);
            intraDistance = new HTuple(Ndist);
            interDistance = new HTuple(Nwidth);
        }
 
        /// <summary>
        /// Creates an edge result instance using the passed values.
        /// </summary>
        public PairResult(double Nrow1, double Ncol1,
                          double Nrow2, double Ncol2,
                          double Nampl1, double Nampl2,
                          double Ndist, double Nwidth)
        {
            rowEdgeFirst = new HTuple(Nrow1);
            colEdgeFirst = new HTuple(Ncol1);
            rowEdgeSecond = new HTuple(Nrow2);
            colEdgeSecond = new HTuple(Ncol2);
            amplitudeFirst = new HTuple(Nampl1);
            amplitudeSecond = new HTuple(Nampl2);
            intraDistance = new HTuple(Ndist);
            interDistance = new HTuple(Nwidth);
        }
 
    }//end of class PairResult
}//end of namespace