Home > OS >  How to using the sift in c calling vlfeat under Ubuntu
How to using the sift in c calling vlfeat under Ubuntu

Time:10-12

Is there any code, it is not

CodePudding user response:

Void FeatureController: : detect (const Mat & amp; _grey_img,
VectorVector & _feature_descriptors) {

Mat grey_img_float=_grey_img. Clone ();
Grey_img_float. ConvertTo (grey_img_float CV_32FC1);


VlSiftFilt * vlSift=vl_sift_new (width, height,
Log2 (min (width, height)),
SIFT_LEVEL_COUNT,
SIFT_MINIMUM_OCTAVE_INDEX);
Vl_sift_set_peak_thresh (vlSift SIFT_PEAK_THRESH);
Vl_sift_set_edge_thresh (vlSift SIFT_EDGE_THRESH);

If (vl_sift_process_first_octave (vlSift, (vl_sift_pix const *) ROI. The data).={VL_ERR_EOF)
Do {
Vl_sift_detect (vlSift);
for(int i=0; i Double angles [4].
_feature_points. Emplace_back (vlSift - & gt; Keys [I]. X, vlSift - & gt; Keys [I] y);
FeatureDescriptor descriptor;
Int angleCount=vl_sift_calc_keypoint_orientations (vlSift, angles, & amp; VlSift - & gt; Keys [I]);
for(int j=0; j Mat descriptor_array (1, SIFT_DESCRIPTOR_DIM, CV_32FC1);
Descriptor_array vl_sift_calc_keypoint_descriptor (vlSift, (vl_sift_pix *). The data, & amp; VlSift - & gt; Keys [I], angles [j]);
Descriptor. AddDescriptor (descriptor_array);
}
_feature_descriptors. Emplace_back (descriptor);
}
} while (vl_sift_process_next_octave (vlSift)!=VL_ERR_EOF);
}
Vl_sift_delete (vlSift);
}
  • Related