using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using HalconDotNet;
|
|
namespace HalconTools
|
{
|
public class FitCircleResult
|
{
|
/// <summary>
|
/// Model contour applied for model detection
|
/// </summary>
|
public HXLD mContours;
|
|
public HXLDCont mContCircle;
|
|
public HXLDCont mContPoints;
|
|
/// <summary>
|
/// All circle contours detected
|
/// </summary>
|
public HXLDCont mFitCircleResult;
|
|
/// <summary>
|
/// Row coordinate of the found instances of the model
|
/// </summary>
|
public HTuple mRow;
|
/// <summary>
|
/// Column coordinate of the found instances of the model
|
/// </summary>
|
public HTuple mCol;
|
|
//Fit result
|
public HTuple mRowCenter;
|
|
public HTuple mColumnCenter;
|
|
public HTuple mRadius;
|
|
public HTuple mStartPhi;
|
|
public HTuple mEndPhi;
|
|
public HTuple mPointOrder;
|
|
/// <summary>
|
/// Rotation angle of the found instances of the model
|
/// </summary>
|
public HTuple mAngle;
|
|
public HTuple hv_Rows;
|
|
public HTuple hv_Columns;
|
|
/// <summary>
|
/// Image Width
|
/// </summary>
|
public int mWidth;
|
|
/// <summary>
|
/// Image Height
|
/// </summary>
|
public int mHeight;
|
|
/// <summary>
|
/// Time needed to detect <c>count</c> numbers of model instances
|
/// </summary>
|
public double mTime;
|
/// <summary>
|
/// Number of model instances found
|
/// </summary>
|
public int count;
|
/// <summary>
|
/// 2D homogeneous transformation matrix that can be used to transform
|
/// data from the model into the test image.
|
/// </summary>
|
public HHomMat2D hmat;
|
|
/// <summary>Constructor</summary>
|
public FitCircleResult()
|
{
|
hmat = new HHomMat2D();
|
mFitCircleResult = new HXLDCont();
|
mContCircle = new HXLDCont();
|
mContPoints = new HXLDCont();
|
}
|
|
|
/// <summary>
|
/// Gets the detected contour.
|
/// </summary>
|
/// <returns>Detected contour</returns>
|
public HXLDCont getDetectionResults()
|
{
|
HXLDCont rContours = new HXLDCont();
|
hmat.HomMat2dIdentity();
|
mFitCircleResult.GenEmptyObj();
|
|
//for (int i = 0; i < count; i++)
|
//{
|
// hmat.VectorAngleToRigid(0, 0, 0, mRow[i].D, mCol[i].D, mAngle[i].D);
|
// rContours = hmat.AffineTransContourXld(mContour);
|
// mFitLineResult = mFitLineResult.ConcatObj(rContours);
|
//}
|
return mFitCircleResult;
|
}
|
|
|
/// <summary>
|
/// Resets the detection results and sets count to 0.
|
/// </summary>
|
public void reset()
|
{
|
count = 0;
|
}
|
}
|
}
|