Download HALCON Extension Package Programmer`s Manual

Transcript
CHAPTER 6. SPECIAL ROUTINES FOR TYPICAL SUPPLY PROCEDURES
96
Names
HNewRegion, HPutRect, HDupObj
Synopsis
#include "Halcon.h"
HNewRegion(Hproc_handle proc_handle,
Hrlregion
*region)
HPutRect( Hproc_handle proc_handle,
Hkey
obj_key,
INT
width,height)
HDupObj(
Hproc_handle proc_handle,
INT4_8
obj_index)
Figure 6.8: Convenience routines for creating output objects.
definition) of the new object is defined: It contains a copy of region. It is common to call an
image object region, when only its region component is used.
HUserExport Herror CIPConvex(Hproc_handle proc_handle)
{
Hrlregion *region;
Hrlregion *region_new;
}
HCkP(HAllocRLTmp(proc_handle,&region_new) /* allocate memory
HAllReg(proc_handle,&region,i) {
/* all regions
HCkP(HRLConvex2(proc_handle,region,region_new));
/* create an output region object (first output param.)
HNewRegion(proc_handle,region_new);
}
HCkP(HFreeRLTmp(proc_handle,region_new)); /* free memory
return(H_MSG_TRUE);
*/
*/
*/
*/
Figure 6.9: A typical application of HNewRegion: The region transformation “convex hull”.
Typically, HNewRegion is used within segmentation procedures (see Fig. 6.4) and region transforming procedures such as the procedure CIPConvex shown in Fig. 6.9. CIPConvex corresponds to a hypothetical operator trans convex which might be defined like
trans_convex <- CIPConvex[Region:RegionConvex::];
In the example all regions within Region are provided in region by HAllReg (see section
6.1.1) one after the other. The HALCON procedure HRLConvex2 computes the convex hull for
HALCON Extension Package Interface / 2000-11-16