当前位置:   article > 正文

python 图像配准,python opencv实现图像配准与比较

python图像配准

本文实例为大家分享了python opencv实现图像配准与比较的具体代码,供大家参考,具体内容如下

代码

from skimage import io

import cv2 as cv

import numpy as np

import matplotlib.pyplot as plt

img_path1 = "2_HE_maxarea.png"

img_path2 = "2_IHC_maxarea.png"

img1 = io.imread(img_path1)

img2 = io.imread(img_path2)

img1 = np.uint8(img1)

img2 = np.uint8(img2)

# find the keypoints and descriptors with ORB

orb = cv.ORB_create()

kp1, des1 = orb.detectAndCompute(img1,None)

kp2, des2 = orb.detectAndCompute(img2,None)

# def get_good_match(des1,des2):

# bf = cv.BFMatcher()

# matches = bf.knnMatch(des1, des2, k=2)

# good = []

# for m, n in matches:

# if m.distance < 0.75 * n.distance:

# good.append(m)

# return good,matches

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/153333
推荐阅读
相关标签
  

闽ICP备14008679号