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

            err = HTuple.LoadNew(proc, parIndex, err, out tuple);
            obj = new HStereoModel[tuple.Length];
            for (int index = 0; index < tuple.Length; ++index)
            {
                obj[index] = new HStereoModel(tuple[index].IP);
            }
            return(err);
        }
Example #2
0
        /// <summary>
        ///   Create a HALCON stereo model.
        ///   Instance represents: Handle to the camera setup model.
        /// </summary>
        /// <param name="method">Reconstruction method. Default: "surface_pairwise"</param>
        /// <param name="genParamName">Name of the model parameter to be set. Default: []</param>
        /// <param name="genParamValue">Value of the model parameter to be set. Default: []</param>
        /// <returns>Handle of the stereo model.</returns>
        public HStereoModel CreateStereoModel(
            string method,
            string genParamName,
            HTuple genParamValue)
        {
            IntPtr proc = HalconAPI.PreCall(527);

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

            HalconAPI.UnpinTuple(genParamValue);
            HStereoModel hstereoModel;
            int          procResult = HStereoModel.LoadNew(proc, 0, err, out hstereoModel);

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