using System;
using HalconDotNet;
namespace HalconTools
{
///
/// Base class to have a more abstract definition of a measure result.
///
public class MeasureResult
{
public MeasureResult() { }
}
/****************************************************************/
/****************************************************************/
///
/// Measure result class containing data obtained from the HALCON measure
/// operator for single-edge measurement
///
public class EdgeResult : MeasureResult
{
/// Row coordinate of extracted edges.
public HTuple rowEdge;
/// Column coordinate of extracted edges.
public HTuple colEdge;
/// Amplitude of the extracted edges (with sign).
public HTuple amplitude;
/// Distance between consecutive edges.
public HTuple distance;
/// Creates empty instance.
public EdgeResult() { }
///
/// Creates an edge result instance containing data from
/// the provided result value (deep copy).
///
public EdgeResult(EdgeResult result)
: this(result.rowEdge, result.colEdge,
result.amplitude, result.distance)
{
}
///
/// Creates an edge result instance using the passed values.
///
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);
}
///
/// Creates an edge result instance using the passed values.
///
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
/****************************************************************/
/****************************************************************/
///
/// Measure result class containing data obtained from the HALCON measure
/// operator for edge pair measurement
///
public class PairResult : MeasureResult
{
///
/// Row coordinate of first extracted edges of a pair.
///
public HTuple rowEdgeFirst;
///
/// Column coordinate of first extracted edges of a pair.
///
public HTuple colEdgeFirst;
///
/// Row coordinate of second extracted edges of a pair.
///
public HTuple rowEdgeSecond;
///
/// Column coordinate of second extracted edges of a pair.
///
public HTuple colEdgeSecond;
/// Amplitude of the first extracted edges of a pair (with sign).
public HTuple amplitudeFirst;
/// Amplitude of the second extracted edges of a pair (with sign).
public HTuple amplitudeSecond;
/// Distance between edges of a pair.
public HTuple intraDistance;
/// Distance between consecutive edge pairs
public HTuple interDistance;
/// Creates empty instance.
public PairResult() { }
///
/// Creates an edge result instance containing data from
/// the provided result value (deep copy).
///
public PairResult(PairResult result)
: this(result.rowEdgeFirst, result.colEdgeFirst,
result.rowEdgeSecond, result.colEdgeSecond,
result.amplitudeFirst, result.amplitudeSecond,
result.intraDistance, result.interDistance)
{
}
///
/// Creates an edge result instance using the passed values.
///
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);
}
///
/// Creates an edge result instance using the passed values.
///
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