regionHisto

[ XITE Reference Manual | XITE home ]

Name

regionHisto, regionHistoUpdate - make a histogram of pixels in a region

Syntax

 #include <xite/region.h>
 #include <xite/region.h>

 int regionHisto( IBAND band, region* reg,
    int loop, histogram histo );

 int regionHistoUpdate( IBAND band,
    region* reg, int loop, histogram histo );

Description

regionHisto creates a histogram over the pixels in "band" that are inside region "reg". If "loop" is true, the next pointer in "reg" is followed until NIL, and the pixels in all regions are included in the histogram. If "reg" contains pixels that are not inside "band", these pixels will not influence the output histogram. If reg == NULL the histogram if filled with 0.

regionHistoUpdate updates a histogram over the pixels in band that are inside region "reg". If "loop" is true, the next pointer in "reg" is followed until NIL, and the pixels in all regions are included in the histogram. If "reg" contains pixels that are not inside "band", these pixels will not influence the output histogram.

Return value

 0 => OK
 1 => bad pixel type in "band", accepts only UNS_BYTE.
 2 => reg points to NIL

See also

regionAnalyse(1), regionArea(3), regionConvexHull(3), regionCreate(3), regionDraw(3), regionFree(3), regionImoment(3), regionInsertYline(3), regionDeleteYline(3), regionEndInsert(3), regionXmean(3), regionYmean(3), regionMean(3), regionXmin(3), regionXmax(3), regionYmin(3), regionYmax(3), regionMinMax(3), regionCMoment(3), regionPMoment(3), regionMoment(3), regionPerform(3), regionPerimeter(3), regionIsPoint(3), regionPoint(3), regionSearch(3), regionSort(3), regionCopy(3), regionUnion(3), regionOverlap(3), regionNeighbor(3), regionVolume(3), regionYline(3)

Author

Tor L|nnestad, BLAB, ifi, UiO

Example 1

Compute the histogram of a region:
 IBAND b;
 region *reg;
 histogram h;
 ..create reg..
 regionHisto(b, reg, FALSE, h);

Example 2

Compute the histogram of all regions with objectnr == 2
 IBAND b;
 region *reg;
 histogram h;
 ..create reg..
 regionHisto(b, NULL, FALSE, h);  / * Zero histogram * /
 for (rnr=1; rnr<=rsize; r++)
   if (regs[rnr]->objectnr == 2)
     regionHistoUpdate(b, regs[rnr], FALSE, h);

Id

$Id: regionHisto.c,v 1.19 1995/10/27 10:49:37 svein Exp $