Commit ada3e6e6 authored by Maria Dimashova's avatar Maria Dimashova

fixed erasing class_id and response members in sift (#1130)

parent 29207968
...@@ -165,6 +165,9 @@ struct feature ...@@ -165,6 +165,9 @@ struct feature
double descr[FEATURE_MAX_D]; /**< descriptor */ double descr[FEATURE_MAX_D]; /**< descriptor */
detection_data* feature_data; /**< user-definable data */ detection_data* feature_data; /**< user-definable data */
int class_id;
float response;
}; };
/******************************* Defs and macros *****************************/ /******************************* Defs and macros *****************************/
...@@ -1480,7 +1483,7 @@ inline KeyPoint featureToKeyPoint( const feature& feat ) ...@@ -1480,7 +1483,7 @@ inline KeyPoint featureToKeyPoint( const feature& feat )
{ {
float size = (float)(feat.scl * SIFT::DescriptorParams::GET_DEFAULT_MAGNIFICATION() * 4); // 4==NBP float size = (float)(feat.scl * SIFT::DescriptorParams::GET_DEFAULT_MAGNIFICATION() * 4); // 4==NBP
float angle = (float)(feat.ori * a_180divPI); float angle = (float)(feat.ori * a_180divPI);
return KeyPoint( (float)feat.x, (float)feat.y, size, angle, 0, feat.feature_data->octv, 0 ); return KeyPoint( (float)feat.x, (float)feat.y, size, angle, feat.response, feat.feature_data->octv, feat.class_id );
} }
static void fillFeatureData( feature& feat, const SiftParams& params ) static void fillFeatureData( feature& feat, const SiftParams& params )
...@@ -1585,6 +1588,9 @@ inline void keyPointToFeature( const KeyPoint& keypoint, feature& feat, const Si ...@@ -1585,6 +1588,9 @@ inline void keyPointToFeature( const KeyPoint& keypoint, feature& feat, const Si
feat.scl = keypoint.size / (SIFT::DescriptorParams::GET_DEFAULT_MAGNIFICATION()*4); // 4==NBP feat.scl = keypoint.size / (SIFT::DescriptorParams::GET_DEFAULT_MAGNIFICATION()*4); // 4==NBP
feat.ori = keypoint.angle * a_PIdiv180; feat.ori = keypoint.angle * a_PIdiv180;
feat.response = keypoint.response;
feat.class_id = keypoint.class_id;
feat.feature_data = (detection_data*) calloc( 1, sizeof( detection_data ) ); feat.feature_data = (detection_data*) calloc( 1, sizeof( detection_data ) );
fillFeatureData( feat, params ); fillFeatureData( feat, params );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment