Exemplo n.º 1
0
void print_pairs(const struct sift_keypoints *k1,
                 const struct sift_keypoints *k2)
{
    if (k1->size > 0){
        int n = k1->size;
        for(int i = 0; i < n ;i++){
            fprintf_one_keypoint(stdout, k1->list[i], 0, 0, 0);
            fprintf_one_keypoint(stdout, k2->list[i], 0, 0, 0);
            fprintf(stdout, "\n");
        }
    }
}
Exemplo n.º 2
0
void save_pairs_extra(const char* name,
                      const struct sift_keypoints *k1,
                      const struct sift_keypoints *k2A,
                      const struct sift_keypoints *k2B)
{
    FILE* f = fopen(name,"w");
    
    if (k1->size > 0){

        int n_hist = k1->list[0]->n_hist;
        int n_ori = k1->list[0]->n_ori;
        int dim = n_hist*n_hist*n_ori;
        int n_bins  = k1->list[0]->n_bins;
        int n = k1->size;
        for(int i = 0; i < n; i++){
            fprintf_one_keypoint(f, k1->list[i], dim, n_bins, 2);
            fprintf_one_keypoint(f, k2A->list[i], dim, n_bins, 2);
            fprintf_one_keypoint(f, k2B->list[i], dim, n_bins, 2);
            fprintf(f, "\n");
        }
    }
    fclose(f);
}
Exemplo n.º 3
0
void fprintf_keypoints(FILE* f, const struct sift_keypoints* keys, int flag)
{
    if (keys->size > 0){

        int n_hist = keys->list[0]->n_hist;
        int n_ori  = keys->list[0]->n_ori;
        int n_descr = n_hist*n_hist*n_ori;
        int n_bins = keys->list[0]->n_bins;

        for(int k=0;k<keys->size;k++){
            struct keypoint* key = keys->list[k];
            fprintf_one_keypoint(f, key, n_descr, n_bins, flag);
            fprintf(f,"\n");
        }
    }
}