00001
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef _GAN_EDGE_FEATURE_H
00030 #define _GAN_EDGE_FEATURE_H
00031
00032 #include <gandalf/common/misc_defs.h>
00033 #include <gandalf/vision/camera.h>
00034 #include <gandalf/vision/cameraf.h>
00035 #include <gandalf/vision/local_feature.h>
00036 #include <gandalf/linalg/2x3matrixf.h>
00037 #include <gandalf/linalg/2vectorf.h>
00038
00039 #ifdef __cplusplus
00040 extern "C" {
00041 #endif
00042
00053
00054 typedef struct Gan_EdgeFeature
00055 {
00057 unsigned short r, c;
00058
00061 Gan_Vector2_f p;
00062
00064 Gan_Vector2_f pu;
00065
00067 float strength;
00068
00070
00076 float angle;
00077
00080 float cov;
00081
00083 int status;
00084
00086 int index;
00087
00089 struct Gan_EdgeFeature *next;
00090
00092 struct Gan_EdgeFeature *prev;
00093 } Gan_EdgeFeature;
00094
00096 typedef struct Gan_EdgeString
00097 {
00099 Gan_EdgeFeature *first;
00100
00102 Gan_EdgeFeature *last;
00103
00105 unsigned length;
00106 } Gan_EdgeString;
00107
00109 typedef struct Gan_EdgeFeatureMap
00110 {
00112 unsigned nedges;
00113
00115 Gan_EdgeFeature *edge;
00116
00118 unsigned max_nedges;
00119
00121 unsigned nstrings;
00122
00124 Gan_EdgeString *string;
00125
00127 unsigned max_nstrings;
00128
00130 unsigned height, width;
00131
00133 Gan_Bool A_set;
00134
00137 Gan_Matrix23_f A, Ai;
00138
00141 Gan_Camera_f camera;
00142
00144 Gan_LocalFeatureMap local_fmap;
00145
00147 Gan_Bool alloc;
00148 } Gan_EdgeFeatureMap;
00149
00150 Gan_EdgeFeatureMap *gan_edge_feature_map_form ( Gan_EdgeFeatureMap *emap,
00151 unsigned max_nedges,
00152 unsigned max_strings );
00153 void gan_edge_feature_map_free ( Gan_EdgeFeatureMap *emap );
00154 Gan_Bool gan_edge_feature_map_clear ( Gan_EdgeFeatureMap *emap,
00155 unsigned height, unsigned width,
00156 Gan_Matrix23_f *A, Gan_Camera *camera,
00157 Gan_LocalFeatureMapParams *lpms );
00158 Gan_EdgeFeature *gan_edge_feature_add ( Gan_EdgeFeatureMap *emap,
00159 unsigned r, unsigned c,
00160 float rf, float cf,
00161 float angle, float cov,
00162 int status, int index,
00163 float strength );
00164 Gan_EdgeString *gan_edge_feature_string_add ( Gan_EdgeFeatureMap *emap,
00165 Gan_EdgeFeature *edge );
00166 Gan_Bool gan_edge_feature_string_set_status ( Gan_EdgeString *string,
00167 int status );
00168 Gan_Bool gan_edge_feature_map_postprocess ( Gan_EdgeFeatureMap *emap );
00169
00171
00181 Gan_EdgeFeatureMap *gan_edge_feature_map_alloc ( unsigned max_nedges,
00182 unsigned max_nstrings );
00183
00192 #ifdef __cplusplus
00193 }
00194 #endif
00195
00196 #endif