internal static int LoadNew(IntPtr proc, int parIndex, int err, out HFeatureSet[] obj) { HTuple tuple; err = HTuple.LoadNew(proc, parIndex, err, out tuple); obj = new HFeatureSet[tuple.Length]; for (int index = 0; index < tuple.Length; ++index) { obj[index] = new HFeatureSet(tuple[index].IP); } return(err); }
/// <summary> /// Classify a set of arrays. /// Instance represents: Handle of the classifier. /// </summary> /// <param name="sampKey">Key of the test data.</param> /// <returns>Error during the assignment.</returns> public double TestSampsetBox(HFeatureSet sampKey) { IntPtr proc = HalconAPI.PreCall(1897); this.Store(proc, 0); HalconAPI.Store(proc, 1, (HTool)sampKey); HalconAPI.InitOCT(proc, 0); int err = HalconAPI.CallProcedure(proc); double doubleValue; int procResult = HalconAPI.LoadD(proc, 0, err, out doubleValue); HalconAPI.PostCall(proc, procResult); GC.KeepAlive((object)this); GC.KeepAlive((object)sampKey); return(doubleValue); }
/// <summary> /// Train the classifier with one data set. /// Instance represents: Handle of the classifier. /// </summary> /// <param name="sampKey">Number of the data set to train.</param> /// <param name="outfile">Name of the protocol file. Default: "training_prot"</param> /// <param name="NSamples">Number of arrays of attributes to learn. Default: 500</param> /// <param name="stopError">Classification error for termination. Default: 0.05</param> /// <param name="errorN">Error during the assignment. Default: 100</param> public void LearnSampsetBox( HFeatureSet sampKey, string outfile, int NSamples, double stopError, int errorN) { IntPtr proc = HalconAPI.PreCall(1890); this.Store(proc, 0); HalconAPI.Store(proc, 1, (HTool)sampKey); HalconAPI.StoreS(proc, 2, outfile); HalconAPI.StoreI(proc, 3, NSamples); HalconAPI.StoreD(proc, 4, stopError); HalconAPI.StoreI(proc, 5, errorN); int procResult = HalconAPI.CallProcedure(proc); HalconAPI.PostCall(proc, procResult); GC.KeepAlive((object)this); GC.KeepAlive((object)sampKey); }
internal static int LoadNew(IntPtr proc, int parIndex, int err, out HFeatureSet obj) { obj = new HFeatureSet(HTool.UNDEF); return(obj.Load(proc, parIndex, err)); }