- OpenCV Python 教程
- OpenCV Python - 主页
- OpenCV Python - 概述
- OpenCV Python - 环境
- OpenCV Python - 读取图像
- OpenCV Python - 写入图像
- OpenCV Python - 使用 Matplotlib
- OpenCV Python - 图像属性
- OpenCV Python - 位运算
- OpenCV Python - 形状和文本
- OpenCV Python - 鼠标事件
- OpenCV Python - 添加轨迹栏
- OpenCV Python - 调整大小和旋转
- OpenCV Python - 图像阈值
- OpenCV Python - 图像过滤
- OpenCV Python - 边缘检测
- OpenCV Python - 直方图
- OpenCV Python - 颜色空间
- OpenCV Python - 转换
- OpenCV Python - 图像轮廓
- OpenCV Python - 模板匹配
- OpenCV Python - 图像Pyramid
- OpenCV Python - 图像相加
- OpenCV Python - 图像混合
- OpenCV Python - 傅里叶变换
- OpenCV Python - 捕获视频
- OpenCV Python - 播放视频
- OpenCV Python - 视频图像
- OpenCV Python - 来自图像的视频
- OpenCV Python - 人脸检测
- OpenCV Python - Meanshift/Camshift
- OpenCV Python - 特征检测
- OpenCV Python - 特征匹配
- OpenCV Python - 数字识别
- OpenCV Python 资源
- OpenCV Python - 快速指南
- OpenCV Python - 资源
- OpenCV Python - 讨论
OpenCV Python - 特征匹配
OpenCV 提供了两种特征匹配技术。蛮力匹配和 FLANN 匹配器技术。
例子
以下示例使用暴力方法
import numpy as np import cv2 img1 = cv2.imread('lena.jpg') img2 = cv2.imread('lena-test.jpg') # Convert it to grayscale img1_bw = cv2.cvtColor(img1,cv2.COLOR_BGR2GRAY) img2_bw = cv2.cvtColor(img2, cv2.COLOR_BGR2GRAY) orb = cv2.ORB_create() queryKeypoints, queryDescriptors = orb.detectAndCompute(img1_bw,None) trainKeypoints, trainDescriptors = orb.detectAndCompute(img2_bw,None) matcher = cv2.BFMatcher() matches = matcher.match(queryDescriptors,trainDescriptors) img = cv2.drawMatches(img1, queryKeypoints, img2, trainKeypoints, matches[:20],None) img = cv2.resize(img, (1000,650)) cv2.imshow("Feature Match", img)