Using Correlation

This section explains how to perform correlation on the graphics associated with a segment.

The following figure shows how to set the pick aperture size with GpiSetPickAperture and correlate the segment chain with GpiCorrelateChain, passing it the pick-aperture position as the third argument. The functions use the psizlPick and pptlPick arguments to set the aperture size and position the aperture center. The correlation is performed on visible and detectable segments only (PICKSEL_VISIBLE). GpiCorrelateChain copies any segment-tag pairs to the buffer pointed to by alSegTag and returns the count of hits detected.

#define INCL_GPICORRELATION
#include <os2.h>
LONG fncCORL01  (HPS hps, PSIZEL psizlPick, PPOINTL pptlPick,
                  LONG lMaxHits, LONG lMaxDepth, PLONG alSegTag)
    {
        LONG cHits;

        GpiSetPickApertureSize(hps, PICKAP_REC, psizlPick);
                                                     /* Set the pick aperture. */

        cHits = GpiCorrelateChain(hps, PICKSEL_VISIBLE, pptlPick,
                    lMaxHits, lMaxDepth, alSegTag);
                                                     /* Correlate the hits.    */

        return (cHits);                              /* Return count of hits.  */

} /* fncCORL01 */


[Back: Pick Aperture]
[Next: Coordinate Spaces and Transformations]