| Customize Help


The buffers in a container are called its components. In most respects, components are no different from other buffers allocated using the MbufAlloc...() functions. Components have their own MIL buffer identifier and can be used with MIL functions that take a buffer. However, components are allocated and freed differently from other buffers. Typically, when a container is used as a destination for a grabbing or 3D processing function, that function will allocate and free the components automatically as required. You can allocate components manually using MbufAllocComponent(), MbufCopyComponent(), or MbufCreateComponent(). If you need to free components manually, use MbufFreeComponent() or free the container using MbufFree().

Component type

Each component has a component type, which indicates the type of information stored in the component. For example, a component with the component type M_COMPONENT_RANGE stores 3D coordinates when the container stores a point cloud. MIL uses the component type to determine what type of information a component stores about the points in a point cloud container.

Typically, a component's component type is set automatically during acquisition. You can set a component's component type manually using MbufControlContainer() with M_COMPONENT_TYPE.

Group, region, and source ID

If you grab data from a 3D sensor that transmits data in a format suitable for grabbing into a container, it might assign each component a group, region, and/or source ID number. Typically, components which have the same group, region, or source ID are associated in some way; for example, if your 3D sensor transmits the range and confidence components for multiple 3D scenes in a single grab, each set of components might have a different group ID. These component ID numbers can be inquired using MbufInquireContainer() with M_COMPONENT_GROUP_ID, M_COMPONENT_REGION_ID and M_COMPONENT_SOURCE_ID respectively.

You can create a child container that contains only the components of a single group, using MbufChildContainer() with M_COMPONENT_BY_GROUP_ID(). You can then call MbufConvert3d() with the child container to convert the 3D data to a 3D-processable point cloud container.

Your 3D sensor might transmit group, region, and source IDs that are not sequential. Refer to your 3D sensor manual to determine what ID numbers it will assign to components.

Component criterion

Some functions, such as MbufFreeComponent(), allow you to perform operations on the components of a specified container (such as freeing those components) by specifying a criterion. In some cases, these criteria (such as M_COMPONENT_BY_INDEX()) can only refer to a single component in the container. In other cases they can potentially refer to several components in the container (such as M_COMPONENT_INTENSITY, which specifies all intensity components in the container).

Some functions, such as MbufInquireContainer(), require that you specify a criterion that identifies only a single component in the container. For these functions, an error will be generated if there is more than one component in the container that meets the specified criterion.