Community Core Vision 1.4
Cross platform, user friendly computer vision.
C:/CCV/1.4/addons/ofxFiducialFinder/src/libfidtrack/fidtrackX.h
Go to the documentation of this file.
00001 /*
00002   Fiducial tracking library.
00003   Copyright (C) 2004 Ross Bencina <rossb@audiomulch.com>
00004   Maintainer (C) 2005-2008 Martin Kaltenbrunner <mkalten@iua.upf.edu>
00005 
00006   This library is free software; you can redistribute it and/or
00007   modify it under the terms of the GNU Lesser General Public
00008   License as published by the Free Software Foundation; either
00009   version 2.1 of the License, or (at your option) any later version.
00010 
00011   This library is distributed in the hope that it will be useful,
00012   but WITHOUT ANY WARRANTY; without even the implied warranty of
00013   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014   Lesser General Public License for more details.
00015 
00016   You should have received a copy of the GNU Lesser General Public
00017   License along with this library; if not, write to the Free Software
00018   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 */
00020 
00021 #ifndef INCLUDED_FIDTRACK_H
00022 #define INCLUDED_FIDTRACK_H
00023 
00024 #ifdef __cplusplus
00025 extern "C"
00026 {
00027 #endif /* __cplusplus */
00028 
00029 
00030 #include "segment.h"
00031 #include "treeidmap.h"
00032 #include "floatpoint.h"
00033 
00034 typedef struct FidtrackerX{
00035 
00036     int min_target_root_descendent_count;
00037     int max_target_root_descendent_count;
00038     int min_depth, max_depth;
00039 
00040     struct fidRegion root_regions_head;
00041 
00042     char *depth_strings;
00043     int depth_string_count;
00044     int depth_string_length;
00045     int next_depth_string;
00046     char *temp_coloured_depth_string;
00047 
00048     double black_x_sum, black_y_sum, black_leaf_count;
00049     double white_x_sum, white_y_sum, white_leaf_count;
00050 
00051  //   int min_leaf_width_or_height;
00052         int total_leaf_count;
00053     double total_leaf_size;
00054     double average_leaf_size;
00055 
00056     TreeIdMap *treeidmap;
00057 
00058     ShortPoint *pixelwarp;
00059 
00060 } FidtrackerX;
00061 
00062 /* pixelwarp is a Width by Height array of pixel coordinates and can be NULL */
00063 
00064 void initialize_fidtrackerX( FidtrackerX *ft, TreeIdMap *treeidmap, ShortPoint *pixelwarp );
00065 
00066 void terminate_fidtrackerX( FidtrackerX *ft );
00067 
00068 
00069 
00070 #define INVALID_FIDUCIAL_ID  INVALID_TREE_ID
00071 
00072 typedef struct FiducialX{
00073     int id;                                 /* can be INVALID_FIDUCIAL_ID */
00074 
00075     short top,bottom,left,right;
00076     float x, y;
00077     float angle;
00078     float leaf_size;
00079     float root_size;
00080 }FiducialX;
00081 
00082 typedef struct RegionX{
00083     //int type;
00084 
00085     short top,bottom,left,right;
00086     short width,height;
00087     short x, y;
00088         int area;
00089         struct Span *span;
00090 
00091 } RegionX;
00092 
00093 
00094 /*
00095     usage:
00096 
00097     #define MAX_FIDUCIAL_COUNT  128
00098     Fiducial fiducials[ MAX_FIDUCIAL_COUNT ];
00099     PartialSegmentTopology pst;
00100     int count;
00101 
00102     count = find_fiducials( segments, &pst, fiducials, MAX_FIDUCIAL_COUNT );
00103 */
00104 
00105 int find_fiducialsX( FiducialX *fiducials, int max_count,
00106         FidtrackerX *ft, Segmenter *segments, int width, int height);
00107 
00108 int find_regionsX( RegionX *regions, int max_count,
00109         FidtrackerX *ft, Segmenter *segments, int width, int height);
00110 
00111 
00112 #ifdef __cplusplus
00113 }
00114 #endif /* __cplusplus */
00115 #endif /* INCLUDED_FIDTRACK_H */
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines