def _create_image_list(ref_images, image_list_path):
    #create image list with coordinate of gps points
    ills = []
    for image in ref_images:
        exif = opensfm_interface.load_exif(image_list_path + '/', image)
        if ('gps' not in exif or 'latitude' not in exif['gps']
                or 'longitude' not in exif['gps']):
            logger.warning('Skipping {} because of missing GPS'.format(image))
            continue

        lat = exif['gps']['latitude']
        lon = exif['gps']['longitude']
        ills.append((image, lat, lon))
    #print(ills)
    create_image_list(ills, image_list_path)
def match_images(file_path, ref_images, cand_images, opensfm_config):
    """ Perform pair matchings between two sets of images.

    It will do matching for each pair (i, j), i being in
    ref_images and j in cand_images, taking assumption that
    matching(i, j) == matching(j ,i). This does not hold for
    non-symmetric matching options like WORDS. Data will be
    stored in i matching only.
    """

    # Get EXIFs data

    print('matching images before exif')
    all_images = list(set(ref_images+cand_images))
    print('matching images right before load exif')
    exifs = {im: opensfm_interface.load_exif(file_path,im) for im in all_images}
    print('matching images after')

    # Generate pairs for matching

    # generate pairs for matching
    # list of tuples
    pairs, preport = new_pairs_selection.match_candidates_from_metadata( file_path, 
        ref_images, cand_images, exifs, opensfm_config)


    #print('printing pairs')
    #print(pairs)
    #print()
    #print()
    #exit(1)

    # Match them !
    print('match images now')
    ret = match_images_with_pairs(file_path ,opensfm_config, exifs, ref_images, pairs), preport

    #print('ret')
    #print(ret)
    #print()
    #print()
    #exit(1)
    print('finish match and returning')

    return ret
Exemple #3
0
def match_images(file_path, ref_images, cand_images, opensfm_config):
    """ Perform pair matchings between two sets of images.

    It will do matching for each pair (i, j), i being in
    ref_images and j in cand_images, taking assumption that
    matching(i, j) == matching(j ,i). This does not hold for
    non-symmetric matching options like WORDS. Data will be
    stored in i matching only.
    """

    # Get EXIFs data
    all_images = list(set(ref_images + cand_images))
    exifs = {
        im: opensfm_interface.load_exif(file_path, im)
        for im in all_images
    }

    # Generate pairs for matching
    pairs, preport = new_pairs_selection.match_candidates_from_metadata(
        file_path, ref_images, cand_images, exifs, opensfm_config)

    # Match them !
    return match_images_with_pairs(file_path, opensfm_config, exifs,
                                   ref_images, pairs), preport



        #job_queue.join()

        start = timer()
         

        print('after queue join filepath')
  

        ref_images = os.listdir(file_path +'/images')
        print(ref_images)
        cand_images = ref_images
        exifs = {im: opensfm_interface.load_exif(file_path,im) for im in ref_images}

        print(exifs)
       

        print(file_path)
        

        pairs, preport = new_pairs_selection.match_candidates_from_metadata( file_path, 
        ref_images, cand_images, exifs, opensfm_config)

        print('here')
        print(pairs)

        results = {}
        #for each pair