/// <summary> /// Combine road hypotheses from two resolution levels. /// Instance represents: XLD polygons to be examined. /// </summary> /// <param name="modParallels">Modified parallels obtained from EdgePolygons.</param> /// <param name="extParallels">Extended parallels obtained from EdgePolygons.</param> /// <param name="centerLines">Road-center-line polygons to be examined.</param> /// <param name="maxAngleParallel">Maximum angle between two parallel line segments. Default: 0.523598775598</param> /// <param name="maxAngleColinear">Maximum angle between two collinear line segments. Default: 0.261799387799</param> /// <param name="maxDistanceParallel">Maximum distance between two parallel line segments. Default: 40</param> /// <param name="maxDistanceColinear">Maximum distance between two collinear line segments. Default: 40</param> /// <returns>Roadsides found.</returns> public HXLDPoly CombineRoadsXld( HXLDModPara modParallels, HXLDExtPara extParallels, HXLDPoly centerLines, double maxAngleParallel, double maxAngleColinear, double maxDistanceParallel, double maxDistanceColinear) { IntPtr proc = HalconAPI.PreCall(37); this.Store(proc, 1); HalconAPI.Store(proc, 2, (HObjectBase)modParallels); HalconAPI.Store(proc, 3, (HObjectBase)extParallels); HalconAPI.Store(proc, 4, (HObjectBase)centerLines); HalconAPI.StoreD(proc, 0, maxAngleParallel); HalconAPI.StoreD(proc, 1, maxAngleColinear); HalconAPI.StoreD(proc, 2, maxDistanceParallel); HalconAPI.StoreD(proc, 3, maxDistanceColinear); HalconAPI.InitOCT(proc, 1); int err = HalconAPI.CallProcedure(proc); HXLDPoly hxldPoly; int procResult = HXLDPoly.LoadNew(proc, 1, err, out hxldPoly); HalconAPI.PostCall(proc, procResult); GC.KeepAlive((object)this); GC.KeepAlive((object)modParallels); GC.KeepAlive((object)extParallels); GC.KeepAlive((object)centerLines); return(hxldPoly); }
/// <summary> /// Select contours or polygons using shape features. /// Instance represents: Contours or polygons to be examined. /// </summary> /// <param name="features">Shape features to be checked. Default: "area"</param> /// <param name="operation">Operation type between the individual features. Default: "and"</param> /// <param name="min">Lower limits of the features or 'min'. Default: 150.0</param> /// <param name="max">Upper limits of the features or 'max'. Default: 99999.0</param> /// <returns>Contours or polygons fulfilling the condition(s).</returns> public HXLDPoly SelectShapeXld( HTuple features, string operation, HTuple min, HTuple max) { IntPtr proc = HalconAPI.PreCall(1678); this.Store(proc, 1); HalconAPI.Store(proc, 0, features); HalconAPI.StoreS(proc, 1, operation); HalconAPI.Store(proc, 2, min); HalconAPI.Store(proc, 3, max); HalconAPI.InitOCT(proc, 1); int err = HalconAPI.CallProcedure(proc); HalconAPI.UnpinTuple(features); HalconAPI.UnpinTuple(min); HalconAPI.UnpinTuple(max); HXLDPoly hxldPoly; int procResult = HXLDPoly.LoadNew(proc, 1, err, out hxldPoly); HalconAPI.PostCall(proc, procResult); GC.KeepAlive((object)this); return(hxldPoly); }
/// <summary> /// Compute the mapping between the distorted image and the rectified image based upon the points of a regular grid. /// Instance represents: Input contours. /// </summary> /// <param name="image">Input image.</param> /// <param name="meshes">Output contours.</param> /// <param name="gridSpacing">Distance of the grid points in the rectified image.</param> /// <param name="rotation">Rotation to be applied to the point grid. Default: "auto"</param> /// <param name="row">Row coordinates of the grid points.</param> /// <param name="column">Column coordinates of the grid points.</param> /// <param name="mapType">Type of mapping. Default: "bilinear"</param> /// <returns>Image containing the mapping data.</returns> public HImage GenGridRectificationMap( HImage image, out HXLDPoly meshes, int gridSpacing, string rotation, HTuple row, HTuple column, string mapType) { IntPtr proc = HalconAPI.PreCall(1159); this.Store(proc, 2); HalconAPI.Store(proc, 1, (HObjectBase)image); HalconAPI.StoreI(proc, 0, gridSpacing); HalconAPI.StoreS(proc, 1, rotation); HalconAPI.Store(proc, 2, row); HalconAPI.Store(proc, 3, column); HalconAPI.StoreS(proc, 4, mapType); HalconAPI.InitOCT(proc, 1); HalconAPI.InitOCT(proc, 2); int err1 = HalconAPI.CallProcedure(proc); HalconAPI.UnpinTuple(row); HalconAPI.UnpinTuple(column); HImage himage; int err2 = HImage.LoadNew(proc, 1, err1, out himage); int procResult = HXLDPoly.LoadNew(proc, 2, err2, out meshes); HalconAPI.PostCall(proc, procResult); GC.KeepAlive((object)this); GC.KeepAlive((object)image); return(himage); }
/// <summary> /// Join modified XLD parallels lying on the same polygon. /// Instance represents: Extended XLD parallels. /// </summary> /// <returns>Maximally extended parallels.</returns> public HXLDPoly MaxParallelsXld() { IntPtr proc = HalconAPI.PreCall(38); this.Store(proc, 1); HalconAPI.InitOCT(proc, 1); int err = HalconAPI.CallProcedure(proc); HXLDPoly hxldPoly; int procResult = HXLDPoly.LoadNew(proc, 1, err, out hxldPoly); HalconAPI.PostCall(proc, procResult); GC.KeepAlive((object)this); return(hxldPoly); }
/// <summary> /// Transform the shape of contours or polygons. /// Instance represents: Contours or polygons to be transformed. /// </summary> /// <param name="type">Type of transformation. Default: "convex"</param> /// <returns>Transformed contours respectively polygons.</returns> public HXLDPoly ShapeTransXld(string type) { IntPtr proc = HalconAPI.PreCall(1689); this.Store(proc, 1); HalconAPI.StoreS(proc, 0, type); HalconAPI.InitOCT(proc, 1); int err = HalconAPI.CallProcedure(proc); HXLDPoly hxldPoly; int procResult = HXLDPoly.LoadNew(proc, 1, err, out hxldPoly); HalconAPI.PostCall(proc, procResult); GC.KeepAlive((object)this); return(hxldPoly); }
/// <summary> /// Select objects from an object tuple. /// Instance represents: Input objects. /// </summary> /// <param name="index">Indices of the objects to be selected. Default: 1</param> /// <returns>Selected objects.</returns> public HXLDPoly SelectObj(int index) { IntPtr proc = HalconAPI.PreCall(587); this.Store(proc, 1); HalconAPI.StoreI(proc, 0, index); HalconAPI.InitOCT(proc, 1); int err = HalconAPI.CallProcedure(proc); HXLDPoly hxldPoly; int procResult = HXLDPoly.LoadNew(proc, 1, err, out hxldPoly); HalconAPI.PostCall(proc, procResult); GC.KeepAlive((object)this); return(hxldPoly); }
/// <summary> /// Compute the symmetric difference of closed polygons. /// Instance represents: Polygons enclosing the first region. /// </summary> /// <param name="polygons2">Polygons enclosing the second region.</param> /// <returns>Polygons enclosing the symmetric difference.</returns> public HXLDPoly SymmDifferenceClosedPolygonsXld(HXLDPoly polygons2) { IntPtr proc = HalconAPI.PreCall(7); this.Store(proc, 1); HalconAPI.Store(proc, 2, (HObjectBase)polygons2); HalconAPI.InitOCT(proc, 1); int err = HalconAPI.CallProcedure(proc); HXLDPoly hxldPoly; int procResult = HXLDPoly.LoadNew(proc, 1, err, out hxldPoly); HalconAPI.PostCall(proc, procResult); GC.KeepAlive((object)this); GC.KeepAlive((object)polygons2); return(hxldPoly); }
/// <summary> /// Choose all contours or polygons containing a given point. /// Instance represents: Contours or polygons to be examined. /// </summary> /// <param name="row">Line coordinate of the test point. Default: 100.0</param> /// <param name="column">Column coordinate of the test point. Default: 100.0</param> /// <returns>All contours or polygons containing the test point.</returns> public HXLDPoly SelectXldPoint(double row, double column) { IntPtr proc = HalconAPI.PreCall(1676); this.Store(proc, 1); HalconAPI.StoreD(proc, 0, row); HalconAPI.StoreD(proc, 1, column); HalconAPI.InitOCT(proc, 1); int err = HalconAPI.CallProcedure(proc); HXLDPoly hxldPoly; int procResult = HXLDPoly.LoadNew(proc, 1, err, out hxldPoly); HalconAPI.PostCall(proc, procResult); GC.KeepAlive((object)this); return(hxldPoly); }
/// <summary> /// Compare image objects regarding equality. /// Instance represents: Test objects. /// </summary> /// <param name="objects2">Comparative objects.</param> /// <returns>boolean result value.</returns> public int TestEqualObj(HXLDPoly objects2) { IntPtr proc = HalconAPI.PreCall(591); this.Store(proc, 1); HalconAPI.Store(proc, 2, (HObjectBase)objects2); HalconAPI.InitOCT(proc, 0); int err = HalconAPI.CallProcedure(proc); int intValue; int procResult = HalconAPI.LoadI(proc, 0, err, out intValue); HalconAPI.PostCall(proc, procResult); GC.KeepAlive((object)this); GC.KeepAlive((object)objects2); return(intValue); }
/// <summary> /// Concatenate two iconic object tuples. /// Instance represents: Object tuple 1. /// </summary> /// <param name="objects2">Object tuple 2.</param> /// <returns>Concatenated objects.</returns> public HXLDPoly ConcatObj(HXLDPoly objects2) { IntPtr proc = HalconAPI.PreCall(584); this.Store(proc, 1); HalconAPI.Store(proc, 2, (HObjectBase)objects2); HalconAPI.InitOCT(proc, 1); int err = HalconAPI.CallProcedure(proc); HXLDPoly hxldPoly; int procResult = HXLDPoly.LoadNew(proc, 1, err, out hxldPoly); HalconAPI.PostCall(proc, procResult); GC.KeepAlive((object)this); GC.KeepAlive((object)objects2); return(hxldPoly); }
/// <summary> /// Apply an arbitrary affine transformation to XLD polygons. /// Instance represents: Input XLD polygons. /// </summary> /// <param name="homMat2D">Input transformation matrix.</param> /// <returns>Transformed XLD polygons.</returns> public HXLDPoly AffineTransPolygonXld(HHomMat2D homMat2D) { IntPtr proc = HalconAPI.PreCall(48); this.Store(proc, 1); HalconAPI.Store(proc, 0, (HData)homMat2D); HalconAPI.InitOCT(proc, 1); int err = HalconAPI.CallProcedure(proc); HalconAPI.UnpinTuple((HTuple)((HData)homMat2D)); HXLDPoly hxldPoly; int procResult = HXLDPoly.LoadNew(proc, 1, err, out hxldPoly); HalconAPI.PostCall(proc, procResult); GC.KeepAlive((object)this); return(hxldPoly); }
/// <summary> /// Replaces one or more elements of an iconic object tuple. /// Instance represents: Iconic Input Object. /// </summary> /// <param name="objectsReplace">Element(s) to replace.</param> /// <param name="index">Index/Indices of elements to be replaced.</param> /// <returns>Tuple with replaced elements.</returns> public HXLDPoly ReplaceObj(HXLDPoly objectsReplace, int index) { IntPtr proc = HalconAPI.PreCall(2125); this.Store(proc, 1); HalconAPI.Store(proc, 2, (HObjectBase)objectsReplace); HalconAPI.StoreI(proc, 0, index); HalconAPI.InitOCT(proc, 1); int err = HalconAPI.CallProcedure(proc); HXLDPoly hxldPoly; int procResult = HXLDPoly.LoadNew(proc, 1, err, out hxldPoly); HalconAPI.PostCall(proc, procResult); GC.KeepAlive((object)this); GC.KeepAlive((object)objectsReplace); return(hxldPoly); }
/// <summary> /// Remove objects from an iconic object tuple. /// Instance represents: Input object tuple. /// </summary> /// <param name="index">Indices of the objects to be removed.</param> /// <returns>Remaining object tuple.</returns> public HXLDPoly RemoveObj(HTuple index) { IntPtr proc = HalconAPI.PreCall(2124); this.Store(proc, 1); HalconAPI.Store(proc, 0, index); HalconAPI.InitOCT(proc, 1); int err = HalconAPI.CallProcedure(proc); HalconAPI.UnpinTuple(index); HXLDPoly hxldPoly; int procResult = HXLDPoly.LoadNew(proc, 1, err, out hxldPoly); HalconAPI.PostCall(proc, procResult); GC.KeepAlive((object)this); return(hxldPoly); }
/// <summary> /// Compare iconic objects regarding equality. /// Instance represents: Reference objects. /// </summary> /// <param name="objects2">Test objects.</param> /// <param name="epsilon">Maximum allowed difference between two gray values or coordinates etc. Default: 0.0</param> /// <returns>Boolean result value.</returns> public int CompareObj(HXLDPoly objects2, HTuple epsilon) { IntPtr proc = HalconAPI.PreCall(588); this.Store(proc, 1); HalconAPI.Store(proc, 2, (HObjectBase)objects2); HalconAPI.Store(proc, 0, epsilon); HalconAPI.InitOCT(proc, 0); int err = HalconAPI.CallProcedure(proc); HalconAPI.UnpinTuple(epsilon); int intValue; int procResult = HalconAPI.LoadI(proc, 0, err, out intValue); HalconAPI.PostCall(proc, procResult); GC.KeepAlive((object)this); GC.KeepAlive((object)objects2); return(intValue); }
public static int LoadNew(IntPtr proc, int parIndex, int err, out HXLDPoly obj) { obj = new HXLDPoly(HObjectBase.UNDEF); return(obj.Load(proc, parIndex, err)); }