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

# ChainCodeGetFeret

Chain code measurement function

## SYNOPSIS

`#include "dip_chaincode.h"`

dip_Error dip_ChainCodeGetFeret ( chaincode, stepSize, feret )

## FUNCTION

This function measures the longest and shortest projections of the object encoded by `chaincode`. The chain code is rotated in `stepSize` degree intervals and the length of the projection on the x and y axes is computed for each orientation. The sizes of maximum and minimum projections, as well as the rotation at which they were obtained, are returned in the `feret` structure, which contains the following elements:

Data type | Name | Description
`dip_float` | `maxDiameter` | The widest projection of the object
`dip_float` | `minDiameter` | The narrowest projection of the object
`dip_float` | `maxPerpendicular` | The width of the projection perpendicular to `minDiameter`
`dip_float` | `maxAngle` | The angle of the projection for `maxDiameter`
`dip_float` | `minAngle` | The angle of the projection for `minDiameter`

`ChainCodeGetFeret` is the function formerly used by `Measure` for the `FeatureFeret` measurement. This measurement now uses `ConvexHullGetFeret` instead.

## ARGUMENTS

Data type | Name | Description
`dip_ChainCode` | `chaincode` | Input chain code
`dip_float` | `stepSize` | The step size, in degrees
`dip_Feret *` | `feret` | Output measurement

## CREDITS

The original code on which the current implementation is based, was donated by Gerie van der Heijden.

## SEE ALSO

`ImageChainCode`, `ChainCodeNew`, `ChainCodeFree`, `ChainCodeGetLength`, `ChainCodeGetLongestRun`, `ChainCodeGetRadius`