using System; using HalconDotNet; namespace HalconTools { public class FitLineResult { /// /// Model contour applied for model detection /// public HXLDCont mContours; public HXLDCont mContLine; public HXLDCont mContPoints; /// /// All model contours detected /// public HXLDCont mFitLineResult; /// /// Row coordinate of the found instances of the model /// public HTuple mRow; /// /// Column coordinate of the found instances of the model /// public HTuple mCol; //Fit result public HTuple mRowStart; public HTuple mColumnStart; public HTuple mRowEnd; public HTuple mColumnEnd; public HTuple mVector; public HTuple mNC; public HTuple mDist; /// /// Rotation angle of the found instances of the model /// public HTuple mAngle; public HTuple hv_Rows; public HTuple hv_Columns; /// /// Image Width /// public int mWidth; /// /// Image Height /// public int mHeight; /// /// Time needed to detect count numbers of model instances /// public double mTime; /// /// Number of model instances found /// public int count; /// /// 2D homogeneous transformation matrix that can be used to transform /// data from the model into the test image. /// public HHomMat2D hmat; /// Constructor public FitLineResult() { hmat = new HHomMat2D(); mFitLineResult = new HXLDCont(); mContLine = new HXLDCont(); mContPoints = new HXLDCont(); } /// /// Gets the detected contour. /// /// Detected contour public HXLDCont getDetectionResults() { HXLDCont rContours = new HXLDCont(); hmat.HomMat2dIdentity(); mFitLineResult.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 mFitLineResult; } /// /// Resets the detection results and sets count to 0. /// public void reset() { count = 0; } } }