00001 
#ifndef _SEGMENT_EXTRACTOR_H_
00002 
#define _SEGMENT_EXTRACTOR_H_
00003 
00004 
00005 
00006 
00007 
00008 
00009 
extern int MAX_NO_PG_FPEAKS;
00010 
00011 
enum{ TILE_UPPER_SEAM, TILE_LOWER_SEAM};
00012 
00013 
enum{   SEGMENT_EXTRACTOR_INCLUDE_ALL, 
00014                 SEGMENT_EXTRACTOR_EXCLUDE_SEGMENTS_ON_EDGE,
00015                 SEGMENT_EXTRACTOR_EXCLUDE_SEGMENTS_ON_UPPER_EDGE,
00016                 SEGMENT_EXTRACTOR_EXCLUDE_SEGMENTS_ON_LOWER_EDGE};
00017 
00018 
#define MAX_NO_OF_SEGMENTS 1024
00019 
00020 
typedef struct
00021 
{
00022         
Map2D*          pMapMask;       
00023         
Map2D*          pMapSource;
00024         Attributes*     pSegmentAttributes;
00025         
int                     nSegmentAttributes;
00026         
int*            pSegmentIndex;
00027         
int                     nSegments;
00028 } SegmentExtractorInput;
00029 
00030 
typedef struct
00031 
{
00032         
Map2D           MapSegment;
00033 } SegmentExtractorOutput;
00034 
00035 
00036 
typedef struct
00037 
{
00038         SegmentExtractorInput  in;
00039         SegmentExtractorOutput out;
00040 } SegmentExtractor;
00041 
00042 
00043 
void SegmentExtractor_init(SegmentExtractor* SegEx, 
Map2D* pMapMask, 
00044                                                                                                         
Map2D* pMapSource,
00045                                                                                                         
int*   pSegmentIndex,
00046                                                                                                         
int    nSegemnts);
00047 
int SegmentExtractor_extractSingleMap(SegmentExtractor* segex);
00048 
int SegmentExtractor_extractSingleMapByLabel(
Map2D* mask, 
Map2D* source, 
Map2D* dest, Attributes attr);
00049 
int SegmentExtractor_extractNonZeroLabels(
Map2D* dest, 
Map2D* source, 
Map2D* mask);
00050 
00051 
int SegmentExtractor_extractMultipleMaps(SegmentExtractor* SegEx);
00052 
int SegmentExtractor_extractMultipleMapsByLabel(
Map2D* mask, 
Map2D* source, 
Map2D* dest, Attributes* attr, 
int* pSegmentIndices, 
int nSegments);
00053 
00054 
int* SegmentExtractor_getSegmentsOnEdge(
Map2D* map, 
int direction, 
int* nSegments);
00055 
00056 
int SegmentExtractor_extractAreaAndTIC(
Map2D* mask, 
Map2D* source, Attributes* attr);
00057 
int SegmentExtractor_extractStatistics(DescriptiveStatistics* stat, 
Map2D* mask, 
Map2D* source, Attributes* attr);
00058 
int SegmentExtractor_extractStatisticsFromLabel(DescriptiveStatistics* stat, 
Map2D* mask, 
Map2D* source, 
int label);
00059 
#endif
00060