-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathOpenSfM.py
More file actions
32 lines (23 loc) · 863 Bytes
/
Copy pathOpenSfM.py
File metadata and controls
32 lines (23 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# OpenSfM.py
# Zhizhou Gu
# Work In Progress: Using OpenSfM python bind to implement reconstruct pipeline
import opensfm
from opensfm import features
import cv2
import numpy as np
import os
import pdb
def read_and_feature_detection(dir_path):
file_names = os.listdir(dir_path)
for file_name in file_names:
# Load an image using OpenCV
image = cv2.imread(dir_path + '/' + file_name)
# The 'image' variable is now a numpy array/matrix representing the image
# print(image)
f = features.extract_features_sift(image, {'sift_edge_threshold': 6, 'sift_peak_threshold': 0.02, 'feature_root': True }, 8)
# print('f', f)
breakpoint()
print('f[0]', f[0])
print('f[1]', f[1])
# opensfm.pyfeatures.akaze(image)
read_and_feature_detection('./images/lund')