internal static int LoadNew( IntPtr proc, int parIndex, int err, out HTextureInspectionResult obj) { obj = new HTextureInspectionResult(HTool.UNDEF); return(obj.Load(proc, parIndex, err)); }
internal static int LoadNew( IntPtr proc, int parIndex, int err, out HTextureInspectionResult[] obj) { HTuple tuple; err = HTuple.LoadNew(proc, parIndex, err, out tuple); obj = new HTextureInspectionResult[tuple.Length]; for (int index = 0; index < tuple.Length; ++index) { obj[index] = new HTextureInspectionResult(tuple[index].IP); } return(err); }
/// <summary> /// Inspection of the texture within an image. /// Instance represents: Handle of the texture inspection model. /// </summary> /// <param name="image">Image of the texture to be inspected.</param> /// <param name="textureInspectionResultID">Handle of the inspection results.</param> /// <returns>Novelty regions.</returns> public HRegion ApplyTextureInspectionModel( HImage image, out HTextureInspectionResult textureInspectionResultID) { IntPtr proc = HalconAPI.PreCall(2044); this.Store(proc, 0); HalconAPI.Store(proc, 1, (HObjectBase)image); HalconAPI.InitOCT(proc, 1); HalconAPI.InitOCT(proc, 0); int err1 = HalconAPI.CallProcedure(proc); HRegion hregion; int err2 = HRegion.LoadNew(proc, 1, err1, out hregion); int procResult = HTextureInspectionResult.LoadNew(proc, 0, err2, out textureInspectionResultID); HalconAPI.PostCall(proc, procResult); GC.KeepAlive((object)this); GC.KeepAlive((object)image); return(hregion); }