Beispiel #1
0
def search_SIFT_FLANN(returnCount=100, mydataSIFT=mydataSIFT, write=False): 
    imagepredictionsFLANN , searchtimesift = ImageSearch_Algo_SIFT.SIFT_SEARCH(mydataSIFT, q_path, sift_features_limit=SIFT_FEATURES_LIMIT , lowe_ratio=LOWE_RATIO, predictions_count=returnCount)
    if write: 
        a ,d, ind, cnt = accuracy.accuracy_matches(q_path, imagepredictionsFLANN, 20 )
        # print ('Accuracy =',  a, '%', '| Quality:', d )
        # print ('Count', cnt, ' | position', ind)
        row_dict['acc_sift_Flann'] = a
        row_dict['index_sift_Flann'] = ind
        row_dict['Count_sift_Flann'] = cnt
        row_dict['quality_sift_Flann'] = d
        row_dict['time_sift_Flann'] = searchtimesift

    return imagepredictionsFLANN, searchtimesift
Beispiel #2
0
# mypaths = random.sample(imagepaths, 200)

# q_paths = list(mypaths)
# # print (q_paths)

import Accuracy as accuracy

keypoints = [50]
# 100 ,300, 500, 700, 900
accStatssiftkp100 = pd.DataFrame(columns=['file', 'PCount'])
for q_path in q_paths:
    row_dict = {'file': q_path}

    for item in keypoints:

        imagepredictions, searchtime = ImageSearch_Algo_SIFT.SIFT_SEARCH(
            mydatasift, q_path, item, 0.75, 50)
        a, d, i, cnt = accuracy.accuracy_matches(q_path, imagepredictions, 20)

        row_dict['kp_' + str(item) + '_predict20'] = a
        # row_dict['kp_' + str(item)+ '_predict20'] = a20
        # row_dict['kp_' + str(item)+ '_predict30'] = a30
        # row_dict['kp_' + str(item) +'_predict50'] = a50
        row_dict['kp_' + str(item) + '_quality'] = d
        row_dict['kp_' + str(item) + '_time'] = searchtime
        row_dict['kp_' + str(item) + 'matchposition'] = i
        row_dict['hsv' + 'PCount'] = cnt

        print("Processing, time", q_paths.index(q_path), searchtime, item)

    accStatssiftkp100 = accStatssiftkp100.append(row_dict, ignore_index=True)
Beispiel #3
0
print("ORB BF Search time :", searchtime)
a, q, pos, cnt = accuracy.accuracy_matches(q_path, imagematches, 20)
print('Accuracy =', a, '%', '| Quality:', q)
print('Count', cnt, ' | position', pos)

# ----- END Alternative

# compiled run over 100 samples
q_paths = random.sample(imagepaths, 100)  # random sample 100 items in list

accStatssift = pd.DataFrame(columns=['file'])

for q_path in q_paths:
    row_dict = {'file': q_path}

    imagepredictions, searchtime = ImageSearch_Algo_SIFT.SIFT_SEARCH(
        mydataSIFT, q_path, sift_features_limit, 0.75, 50)
    a, d, i, cnt = accuracy.accuracy_matches(q_path, imagepredictions, 20)

    # adding to dict
    row_dict['kp_' + str(sift_features_limit) + '_predict10'] = a
    row_dict['kp_' + str(sift_features_limit) + '_quality'] = d
    row_dict['kp_' + str(sift_features_limit) + '_time'] = searchtime
    row_dict['kp_' + str(sift_features_limit) + 'matchposition'] = i
    row_dict['kp_' + str(sift_features_limit) + 'PCount'] = cnt

    accStatssift = accStatssift.append(row_dict, ignore_index=True)
    print("Processing, time", q_paths.index(q_path), searchtime)

# plt.plot(accStats['Acc'])
# plt.plot (accStats['PCount'])
# plt.hlines(accStats['kp_100_time'].mean(), 0, 100, 'r')