Example #1
0
        /// <summary>
        ///   Return the iconic object of a drawing object.
        ///   Instance represents: Handle of the drawing object.
        /// </summary>
        /// <returns>Copy of the iconic object represented by the drawing object.</returns>
        public HObject GetDrawingObjectIconic()
        {
            IntPtr proc = HalconAPI.PreCall(1302);

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

            HalconAPI.PostCall(proc, procResult);
            GC.KeepAlive((object)this);
            return(hobject);
        }
Example #2
0
        /// <summary>
        ///   Query an iconic value of a text segmentation result.
        ///   Instance represents: Text result.
        /// </summary>
        /// <param name="resultName">Name of the result to be returned. Default: "all_lines"</param>
        /// <returns>Returned result.</returns>
        public HObject GetTextObject(string resultName)
        {
            IntPtr proc = HalconAPI.PreCall(415);

            this.Store(proc, 0);
            HalconAPI.StoreS(proc, 1, resultName);
            HalconAPI.InitOCT(proc, 1);
            int     err = HalconAPI.CallProcedure(proc);
            HObject hobject;
            int     procResult = HObject.LoadNew(proc, 1, err, out hobject);

            HalconAPI.PostCall(proc, procResult);
            GC.KeepAlive((object)this);
            return(hobject);
        }
Example #3
0
        /// <summary>
        ///   Retrieve an object associated with the key from the message.
        ///   Instance represents: Message handle.
        /// </summary>
        /// <param name="key">Key string.</param>
        /// <returns>Tuple value retrieved from the message.</returns>
        public HObject GetMessageObj(string key)
        {
            IntPtr proc = HalconAPI.PreCall(536);

            this.Store(proc, 0);
            HalconAPI.StoreS(proc, 1, key);
            HalconAPI.InitOCT(proc, 1);
            int     err = HalconAPI.CallProcedure(proc);
            HObject hobject;
            int     procResult = HObject.LoadNew(proc, 1, err, out hobject);

            HalconAPI.PostCall(proc, procResult);
            GC.KeepAlive((object)this);
            return(hobject);
        }
Example #4
0
        /// <summary>
        ///   Remove objects from an iconic object tuple.
        ///   Instance represents: Input object tuple.
        /// </summary>
        /// <param name="index">Indices of the objects to be removed.</param>
        /// <returns>Remaining object tuple.</returns>
        public HObject RemoveObj(int index)
        {
            IntPtr proc = HalconAPI.PreCall(2124);

            this.Store(proc, 1);
            HalconAPI.StoreI(proc, 0, index);
            HalconAPI.InitOCT(proc, 1);
            int     err = HalconAPI.CallProcedure(proc);
            HObject hobject;
            int     procResult = HObject.LoadNew(proc, 1, err, out hobject);

            HalconAPI.PostCall(proc, procResult);
            GC.KeepAlive((object)this);
            return(hobject);
        }
Example #5
0
        /// <summary>
        ///   Access iconic objects that were created during the search for 2D data code symbols.
        ///   Instance represents: Handle of the 2D data code model.
        /// </summary>
        /// <param name="candidateHandle">Handle of the 2D data code candidate or name of a group of candidates for which the iconic data is requested. Default: "all_candidates"</param>
        /// <param name="objectName">Name of the iconic object to return. Default: "candidate_xld"</param>
        /// <returns>Objects that are created as intermediate results during the detection or evaluation of 2D data codes.</returns>
        public HObject GetDataCode2dObjects(int candidateHandle, string objectName)
        {
            IntPtr proc = HalconAPI.PreCall(1766);

            this.Store(proc, 0);
            HalconAPI.StoreI(proc, 1, candidateHandle);
            HalconAPI.StoreS(proc, 2, objectName);
            HalconAPI.InitOCT(proc, 1);
            int     err = HalconAPI.CallProcedure(proc);
            HObject hobject;
            int     procResult = HObject.LoadNew(proc, 1, err, out hobject);

            HalconAPI.PostCall(proc, procResult);
            GC.KeepAlive((object)this);
            return(hobject);
        }
Example #6
0
        /// <summary>
        ///   Get intermediate iconic results of a stereo reconstruction.
        ///   Instance represents: Handle of the stereo model.
        /// </summary>
        /// <param name="pairIndex">Camera indices of the pair ([From, To]).</param>
        /// <param name="objectName">Name of the iconic result to be returned.</param>
        /// <returns>Iconic result.</returns>
        public HObject GetStereoModelObject(int pairIndex, string objectName)
        {
            IntPtr proc = HalconAPI.PreCall(522);

            this.Store(proc, 0);
            HalconAPI.StoreI(proc, 1, pairIndex);
            HalconAPI.StoreS(proc, 2, objectName);
            HalconAPI.InitOCT(proc, 1);
            int     err = HalconAPI.CallProcedure(proc);
            HObject hobject;
            int     procResult = HObject.LoadNew(proc, 1, err, out hobject);

            HalconAPI.PostCall(proc, procResult);
            GC.KeepAlive((object)this);
            return(hobject);
        }
Example #7
0
        /// <summary>
        ///   Concatenate two iconic object tuples.
        ///   Instance represents: Object tuple 1.
        /// </summary>
        /// <param name="objects2">Object tuple 2.</param>
        /// <returns>Concatenated objects.</returns>
        public HObject ConcatObj(HObject objects2)
        {
            IntPtr proc = HalconAPI.PreCall(584);

            this.Store(proc, 1);
            HalconAPI.Store(proc, 2, (HObjectBase)objects2);
            HalconAPI.InitOCT(proc, 1);
            int     err = HalconAPI.CallProcedure(proc);
            HObject hobject;
            int     procResult = HObject.LoadNew(proc, 1, err, out hobject);

            HalconAPI.PostCall(proc, procResult);
            GC.KeepAlive((object)this);
            GC.KeepAlive((object)objects2);
            return(hobject);
        }
        /// <summary>
        ///   Get (intermediate) iconic results of a structured light model.
        ///   Instance represents: Handle of the structured light model.
        /// </summary>
        /// <param name="objectName">Name of the iconic result to be returned.</param>
        /// <returns>Iconic result.</returns>
        public HObject GetStructuredLightObject(HTuple objectName)
        {
            IntPtr proc = HalconAPI.PreCall(2118);

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

            HalconAPI.UnpinTuple(objectName);
            HObject hobject;
            int     procResult = HObject.LoadNew(proc, 1, err, out hobject);

            HalconAPI.PostCall(proc, procResult);
            GC.KeepAlive((object)this);
            return(hobject);
        }
Example #9
0
        /// <summary>
        ///   Query iconic results of a texture inspection.
        ///   Instance represents: Handle of the texture inspection result.
        /// </summary>
        /// <param name="resultName">Name of the iconic object to be returned. Default: "novelty_region"</param>
        /// <returns>Returned iconic object.</returns>
        public HObject GetTextureInspectionResultObject(HTuple resultName)
        {
            IntPtr proc = HalconAPI.PreCall(2077);

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

            HalconAPI.UnpinTuple(resultName);
            HObject hobject;
            int     procResult = HObject.LoadNew(proc, 1, err, out hobject);

            HalconAPI.PostCall(proc, procResult);
            GC.KeepAlive((object)this);
            return(hobject);
        }
Example #10
0
        /// <summary>
        ///   Select objects from an object tuple.
        ///   Instance represents: Input objects.
        /// </summary>
        /// <param name="index">Indices of the objects to be selected. Default: 1</param>
        /// <returns>Selected objects.</returns>
        public HObject SelectObj(HTuple index)
        {
            IntPtr proc = HalconAPI.PreCall(587);

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

            HalconAPI.UnpinTuple(index);
            HObject hobject;
            int     procResult = HObject.LoadNew(proc, 1, err, out hobject);

            HalconAPI.PostCall(proc, procResult);
            GC.KeepAlive((object)this);
            return(hobject);
        }
Example #11
0
        /// <summary>
        ///   Access iconic objects that were created during the search or decoding of bar code symbols.
        ///   Instance represents: Handle of the bar code model.
        /// </summary>
        /// <param name="candidateHandle">Indicating the bar code results respectively candidates for which the data is required. Default: "all"</param>
        /// <param name="objectName">Name of the iconic object to return. Default: "candidate_regions"</param>
        /// <returns>Objects that are created as intermediate results during the detection or evaluation of bar codes.</returns>
        public HObject GetBarCodeObject(HTuple candidateHandle, string objectName)
        {
            IntPtr proc = HalconAPI.PreCall(1990);

            this.Store(proc, 0);
            HalconAPI.Store(proc, 1, candidateHandle);
            HalconAPI.StoreS(proc, 2, objectName);
            HalconAPI.InitOCT(proc, 1);
            int err = HalconAPI.CallProcedure(proc);

            HalconAPI.UnpinTuple(candidateHandle);
            HObject hobject;
            int     procResult = HObject.LoadNew(proc, 1, err, out hobject);

            HalconAPI.PostCall(proc, procResult);
            GC.KeepAlive((object)this);
            return(hobject);
        }
Example #12
0
        /// <summary>
        ///   Replaces one or more elements of an iconic object tuple.
        ///   Instance represents: Iconic Input Object.
        /// </summary>
        /// <param name="objectsReplace">Element(s) to replace.</param>
        /// <param name="index">Index/Indices of elements to be replaced.</param>
        /// <returns>Tuple with replaced elements.</returns>
        public HObject ReplaceObj(HObject objectsReplace, HTuple index)
        {
            IntPtr proc = HalconAPI.PreCall(2125);

            this.Store(proc, 1);
            HalconAPI.Store(proc, 2, (HObjectBase)objectsReplace);
            HalconAPI.Store(proc, 0, index);
            HalconAPI.InitOCT(proc, 1);
            int err = HalconAPI.CallProcedure(proc);

            HalconAPI.UnpinTuple(index);
            HObject hobject;
            int     procResult = HObject.LoadNew(proc, 1, err, out hobject);

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