Bild Nähte Python

Ich habe zu Nähen, zwei oder mehr Bilder zusammen mit python und openCV.
Ich fand diesen code für die Suche nach Eckdaten und die Spiele, aber ich weiß nicht, wie es weiter geht.
Helfen Sie mir bitte!

import numpy as np
import cv2

MIN_MATCH_COUNT = 10

img1 = cv2.imread('a.jpg',0)          # queryImage
img2 = cv2.imread('b.jpg',0) # trainImage

# Initiate SIFT detector
sift = cv2.SIFT()

# find the keypoints and descriptors with SIFT
kp1, des1 = sift.detectAndCompute(img1,None)
kp2, des2 = sift.detectAndCompute(img2,None)

FLANN_INDEX_KDTREE = 0
index_params = dict(algorithm = FLANN_INDEX_KDTREE, trees = 5)
search_params = dict(checks = 50)

flann = cv2.FlannBasedMatcher(index_params, search_params)

matches = flann.knnMatch(des1,des2,k=2)

# store all the good matches as per Lowe's ratio test.
good = []
for m,n in matches:
    if m.distance < 0.7*n.distance:
        good.append(m)
InformationsquelleAutor p0lly11 | 2013-12-29
Schreibe einen Kommentar