Esempio n. 1
0
def show_match_results(rchip1,
                       rchip2,
                       kpts1,
                       kpts2,
                       fm,
                       fs,
                       fm_V,
                       fs_V,
                       fignum=0,
                       big_title=''):
    num_m = len(fm)
    num_mV = len(fm_V)
    score = fs.sum()
    scoreV = fs_V.sum()

    _title1 = 'num_m  = %r' % num_m
    _title2 = 'num_mV = %r' % num_mV
    _title3 = 'len(kpts1) = %r' % len(kpts1)
    _title4 = 'len(kpts2) = %r' % len(kpts2)
    # TODO: MAKE THESE SUBPLOTS
    df2.show_matches2(rchip1, rchip2, kpts1, kpts2, fm, fs, fignum + 0, 111,
                      _title1)
    df2.show_matches2(rchip1, rchip2, kpts1, kpts2, fm_V, fs_V, fignum + 1,
                      111, _title2)
    df2.show_keypoints(rchip1, kpts1, fignum + 2, _title3)
    df2.show_keypoints(rchip2, kpts2, fignum + 3, _title4)
Esempio n. 2
0
def __test_homog(func_homog, testname, fignum):
    with Timer(msg=testname+' V'):
        fm_V, fs_V, H = mc2.__spatially_verify(func_homog, kpts1, kpts2, fm, fs, DBG=None)
    title_str = ('nInliers=%d '+testname+' V__') % len(fm_V)
    print('L____'+title_str+'\n')
    if __SHOW_INLIER_MATCHES__:
        df2.show_matches2(rchip1, rchip2, kpts1, kpts2, fm_V, fs_V, fignum, 111, title_str)
    return (fm_V, fs_V, H)
Esempio n. 3
0
def __test_homog(func_homog, testname, fignum):
    with Timer(msg=testname + ' V'):
        fm_V, fs_V, H = mc2.__spatially_verify(func_homog,
                                               kpts1,
                                               kpts2,
                                               fm,
                                               fs,
                                               DBG=None)
    title_str = ('nInliers=%d ' + testname + ' V__') % len(fm_V)
    print('L____' + title_str + '\n')
    if __SHOW_INLIER_MATCHES__:
        df2.show_matches2(rchip1, rchip2, kpts1, kpts2, fm_V, fs_V, fignum,
                          111, title_str)
    return (fm_V, fs_V, H)
Esempio n. 4
0
def show_match_results(rchip1, rchip2, kpts1, kpts2, fm, fs, fm_V, fs_V, fignum=0, big_title=''):
    num_m = len(fm)
    num_mV = len(fm_V)
    score = fs.sum()
    scoreV = fs_V.sum()

    _title1 = 'num_m  = %r' % num_m
    _title2 = 'num_mV = %r' % num_mV
    _title3 = 'len(kpts1) = %r' % len(kpts1)
    _title4 = 'len(kpts2) = %r' % len(kpts2)
    # TODO: MAKE THESE SUBPLOTS
    df2.show_matches2(rchip1, rchip2, kpts1, kpts2, fm, fs, fignum+0, 111, _title1)
    df2.show_matches2(rchip1, rchip2, kpts1, kpts2, fm_V, fs_V, fignum+1, 111, _title2)
    df2.show_keypoints(rchip1, kpts1, fignum+2, _title3)
    df2.show_keypoints(rchip2, kpts2, fignum+3, _title4)
Esempio n. 5
0
                       title='cx=%d nkpts=%d' % (cx, len(kpts1)))

# ASSIGNED MATCHES
print('---------------------------------------')
print(' INFO: Assigned feature matches        ')
fm = cx2_fm[cx]
fs = cx2_fs[cx]
print(' * feature matches (assigned) fm.shape = %r' % (fm.shape, ))
print(' * kpts1.shape %r' % (kpts1.shape, ))
print(' * kpts2.shape %r' % (kpts2.shape, ))
print('---------------------------------------')
if __SHOW_ASSIGNED_FEATURE_MATCHES__:
    print('Drawing the assigned matches')
    title_str = 'qcx=%d cx=%d nMatches=%d' % (qcx, cx, len(fm))
    print(title_str)
    df2.show_matches2(rchip1, rchip2, kpts1, kpts2, fm, fs, 4, 111, title_str)
print('---------------------------------------')

# SPATIAL VERIFICATION AND HOMOGRAPHY ESTIMATIONS
print('---------------------------------------')


def __test_homog(func_homog, testname, fignum):
    with Timer(msg=testname + ' V'):
        fm_V, fs_V, H = mc2.__spatially_verify(func_homog,
                                               kpts1,
                                               kpts2,
                                               fm,
                                               fs,
                                               DBG=None)
    title_str = ('nInliers=%d ' + testname + ' V__') % len(fm_V)
Esempio n. 6
0

# ASSIGNED MATCHES
print('---------------------------------------')
print(' INFO: Assigned feature matches        ')
fm      = cx2_fm[cx]
fs      = cx2_fs[cx]
print(' * feature matches (assigned) fm.shape = %r' % (fm.shape,))
print(' * kpts1.shape %r' % (kpts1.shape,))
print(' * kpts2.shape %r' % (kpts2.shape,))
print('---------------------------------------')
if __SHOW_ASSIGNED_FEATURE_MATCHES__:
    print('Drawing the assigned matches')
    title_str = 'qcx=%d cx=%d nMatches=%d' % (qcx, cx, len(fm))
    print(title_str)
    df2.show_matches2(rchip1, rchip2, kpts1, kpts2, fm, fs, 4, 111, title_str)
print('---------------------------------------')



# SPATIAL VERIFICATION AND HOMOGRAPHY ESTIMATIONS
print('---------------------------------------')
def __test_homog(func_homog, testname, fignum):
    with Timer(msg=testname+' V'):
        fm_V, fs_V, H = mc2.__spatially_verify(func_homog, kpts1, kpts2, fm, fs, DBG=None)
    title_str = ('nInliers=%d '+testname+' V__') % len(fm_V)
    print('L____'+title_str+'\n')
    if __SHOW_INLIER_MATCHES__:
        df2.show_matches2(rchip1, rchip2, kpts1, kpts2, fm_V, fs_V, fignum, 111, title_str)
    return (fm_V, fs_V, H)
print('Testing different ways to calculate homography')