Beispiel #1
0
        internal static int LoadNew(IntPtr proc, int parIndex, int err, out HClassLUT[] obj)
        {
            HTuple tuple;

            err = HTuple.LoadNew(proc, parIndex, err, out tuple);
            obj = new HClassLUT[tuple.Length];
            for (int index = 0; index < tuple.Length; ++index)
            {
                obj[index] = new HClassLUT(tuple[index].IP);
            }
            return(err);
        }
Beispiel #2
0
        /// <summary>
        ///   Create a look-up table using a k-nearest neighbors classifier (k-NN) to classify byte images.
        ///   Instance represents: Handle of the k-NN classifier.
        /// </summary>
        /// <param name="genParamName">Names of the generic parameters that can be adjusted for the LUT classifier creation. Default: []</param>
        /// <param name="genParamValue">Values of the generic parameters that can be adjusted for the LUT classifier creation. Default: []</param>
        /// <returns>Handle of the LUT classifier.</returns>
        public HClassLUT CreateClassLutKnn(HTuple genParamName, HTuple genParamValue)
        {
            IntPtr proc = HalconAPI.PreCall(1819);

            this.Store(proc, 0);
            HalconAPI.Store(proc, 1, genParamName);
            HalconAPI.Store(proc, 2, genParamValue);
            HalconAPI.InitOCT(proc, 0);
            int err = HalconAPI.CallProcedure(proc);

            HalconAPI.UnpinTuple(genParamName);
            HalconAPI.UnpinTuple(genParamValue);
            HClassLUT hclassLut;
            int       procResult = HClassLUT.LoadNew(proc, 0, err, out hclassLut);

            HalconAPI.PostCall(proc, procResult);
            GC.KeepAlive((object)this);
            return(hclassLut);
        }
Beispiel #3
0
 internal static int LoadNew(IntPtr proc, int parIndex, int err, out HClassLUT obj)
 {
     obj = new HClassLUT(HTool.UNDEF);
     return(obj.Load(proc, parIndex, err));
 }