/// <summary>
        ///   Inspect beads in an image, as defined by the bead inspection model.
        ///   Instance represents: Handle of the bead inspection model to be used.
        /// </summary>
        /// <param name="image">Image to apply bead inspection on.</param>
        /// <param name="rightContour">The detected right contour of the beads.</param>
        /// <param name="errorSegment">Detected error segments</param>
        /// <param name="errorType">Types of detected errors.</param>
        /// <returns>The detected left contour of the beads.</returns>
        public HXLD ApplyBeadInspectionModel(
            HImage image,
            out HXLD rightContour,
            out HXLD errorSegment,
            out HTuple errorType)
        {
            IntPtr proc = HalconAPI.PreCall(1983);

            this.Store(proc, 0);
            HalconAPI.Store(proc, 1, (HObjectBase)image);
            HalconAPI.InitOCT(proc, 1);
            HalconAPI.InitOCT(proc, 2);
            HalconAPI.InitOCT(proc, 3);
            HalconAPI.InitOCT(proc, 0);
            int  err1 = HalconAPI.CallProcedure(proc);
            HXLD hxld;
            int  err2       = HXLD.LoadNew(proc, 1, err1, out hxld);
            int  err3       = HXLD.LoadNew(proc, 2, err2, out rightContour);
            int  err4       = HXLD.LoadNew(proc, 3, err3, out errorSegment);
            int  procResult = HTuple.LoadNew(proc, 0, err4, out errorType);

            HalconAPI.PostCall(proc, procResult);
            GC.KeepAlive((object)this);
            GC.KeepAlive((object)image);
            return(hxld);
        }
示例#2
0
        /// <summary>
        ///   Receive an XLD object over a socket connection.
        ///   Instance represents: Socket number.
        /// </summary>
        /// <returns>Received XLD object.</returns>
        public HXLD ReceiveXld()
        {
            IntPtr proc = HalconAPI.PreCall(329);

            this.Store(proc, 0);
            HalconAPI.InitOCT(proc, 1);
            int  err = HalconAPI.CallProcedure(proc);
            HXLD hxld;
            int  procResult = HXLD.LoadNew(proc, 1, err, out hxld);

            HalconAPI.PostCall(proc, procResult);
            GC.KeepAlive((object)this);
            return(hxld);
        }