feat: chunks from google
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import cv2
|
||||
import json
|
||||
import numpy as np
|
||||
from PIL import Image
|
||||
from dataclasses import dataclass, field
|
||||
from pathlib import Path
|
||||
from position import Position
|
||||
from typing import Literal, Optional, Tuple
|
||||
from PIL import Image
|
||||
|
||||
FeatureMethod = Literal["orb", "sift", "akaze", "brisk"]
|
||||
DEFAULT_METHOD = "orb"
|
||||
@@ -14,6 +15,7 @@ class VisionChunk:
|
||||
image: Image.Image
|
||||
feature_method: FeatureMethod = DEFAULT_METHOD
|
||||
|
||||
pos: Optional[Position] = field(default=None, init=False)
|
||||
keypoints: Optional[list] = field(default=None, init=False)
|
||||
descriptors: Optional[np.ndarray] = field(default=None, init=False)
|
||||
_detector: Optional[cv2.Feature2D] = field(default=None, init=False, repr=False)
|
||||
@@ -25,7 +27,7 @@ class VisionChunk:
|
||||
|
||||
if self.feature_method == "orb":
|
||||
self._detector = cv2.ORB_create(
|
||||
nfeatures=1000,
|
||||
nfeatures=10000,
|
||||
scaleFactor=1.2,
|
||||
nlevels=32,
|
||||
edgeThreshold=31,
|
||||
|
||||
Reference in New Issue
Block a user