DIPlib Documentation - ©1995-2014 Quantitative Imaging Group, Delft University of Technology.

ImageChainCode

Extracts all chain codes from a labeled image

SYNOPSIS

#include "dip_chaincode.h"

dip_Error dip_ImageChainCode ( objectIm, connectivity, objectID, chaincodearray, resources )

DATA TYPES

integer

FUNCTION

Extracts the chain codes for the objects in objectIm (only 2D images supported) that are listed in objectID, assuming that each object is compact (i.e. it returns the chain code for only one border for each label ID in objectID). Chain codes are constructed according to connectivity, which can only be 1 or 2 (see The connectivity parameter). The output structure chaincodearray is allocated by this function and registered in resources.

The dip_ChainCodeArray structure, like all arrays in DIPlib, contains a size and an array element. Each element is of type dip_ChainCode, and accessed by chaincodearray->array[ii], where ii is between 0 and chaincodearray->size-1. Data in the dip_ChainCode structures can only be accessed through the corresponding access functions, see ChainCodeNew.

ARGUMENTS

Data typeNameDescription
dip_ImageobjectImLabeled input image
dip_intconnectivityPixel connectivity of the objects
dip_IntegerArrayobjectIDArray containing object label values
dip_ChainCodeArray *chaincodearrayOutput chain codes
dip_ResourcesresourcesResources tracking structure. See ResourcesNew

SEE ALSO

ChainCodeNew, ChainCodeFree, ChainCodeArrayNew, ChainCodeArrayFree, ChainCodeGetSize, ChainCodeGetChains, ChainCodeGetStart, ChainCodeGetLabel, ChainCodeGetConnectivity, ChainCodeGetLength, ChainCodeGetLongestRun, ChainCodeGetFeret