/** @brief Main SIFT routine * * takes as input 1) a list of keypoints coordinates and 2) an image. * */ int main(int argc, char **argv) { if (argc !=3){ print_usage(); return -1; } /** Load image */ int w, h; float* x = read_image_to_gray(argv[2], &w, &h); /** Read keypoints locations from file */ int n; struct sift_keypoint_std * k = sift_read_keyslocation_from_file(argv[1], &n); /** Compute the SIFT descriptors */ sift_fill_descriptors(x, w, h, k, n); /** Save into a file the keypoints with their orientations and their feature vectors */ fprintf_keypoint_std(stdout, k, n); /* memory deallocation */ xfree(x); xfree(k); return 0; }
void sift_write_to_file(const char *filename, const struct sift_keypoint_std *k, int n, bool binary) { FILE* file = fopen(filename, "w"); if (binary) raw_dump_keypoint_std(file, k, n); else fprintf_keypoint_std(file, k, n); fclose(file); }
void sift_write_to_file(const char *filename, const struct sift_keypoint_std *k, int n) { FILE* file = fopen(filename,"w"); fprintf_keypoint_std(file, k, n); fclose(file); }