20 lines
413 B
Python
Executable File
20 lines
413 B
Python
Executable File
import cv2
|
|
from pathlib import Path
|
|
import tqdm
|
|
import pickle
|
|
import os
|
|
import LFUtilities
|
|
|
|
import BEBLIDParameters as params
|
|
|
|
detector = cv2.ORB_create(params.KEYPOINTS)
|
|
descriptor = cv2.xfeatures2d.BEBLID_create(0.75)
|
|
|
|
|
|
def extract(img_path):
|
|
img = LFUtilities.resize(params.IMG_SIZE, cv2.imread(img_path))
|
|
kp = detector.detect(img, None)
|
|
kp, des = descriptor.compute(img, kp)
|
|
return (kp, des)
|
|
|