Closed zhangjunqiang closed 1 year ago
_detect_features code
def _detect_features(from_image, target_image, detector="sift"):
"""
提取到图片的特征
:param images:
:return:
"""
finder = FeatureDetector(detector)
features = [finder.detect_features(img) for img in [from_image, target_image]]
return features
In the tutorial code. the confidence matrix of array. The diagonal of a matrix is 0.
_detect_features code
def _detect_features(from_image, target_image, detector="sift"): """ 提取到图片的特征 :param images: :return: """ finder = FeatureDetector(detector) features = [finder.detect_features(img) for img in [from_image, target_image]] return features
Why wont you use the build in FeatureDetector class?
_detect_features code
def _detect_features(from_image, target_image, detector="sift"): """ 提取到图片的特征 :param images: :return: """ finder = FeatureDetector(detector) features = [finder.detect_features(img) for img in [from_image, target_image]] return features
Why wont you use the build in FeatureDetector class? It is the build in FeatureDetector. This is the import code:
import mpld3 from matplotlib import pyplot as plt import cv2 as cv from stitching.feature_detector import FeatureDetector from stitching.image_handler import ImageHandler from stitching.feature_matcher import FeatureMatcher
Your list comprehension is wrong
Your list comprehension is wrong
Can you tell me why? Intuitively, two identical pictures should return a high degree of similarity.
You need to get the features Independent of the matching, something like
features1 = detector.detect_features(img1) features2 = detector.detect_features(img2)
And then
matches1to2 = matcher.match_features([features1, features2])
my code like this.
if the from_image and target_image is same. the len(list(relevant_matches)) is 0. when i debug this code. i found that the match.confidence is zero.