资源简介
基于SIFT算法的特征提取,RANSAC随机采样一致算法的图像配准、融合、拼接Python代码,里边用测试用例

代码片段和文件信息
# -*- coding: utf-8 -*-
“““
Created on Thu May 11 17:32:56 2017
@author: Administrator
“““
import cv2
import numpy as np
import random
color = [(25500)(2551560)(2552550)(02550)(0255255)(00255)(2550255)]
#图片大小一致
def display(img1 img2 kp1 kp2):
height1 = img1.shape[0]
width1 = img1.shape[1]
height2 = img2.shape[0]
width2 = img2.shape[1]
emptyImage = np.concatenate((img1img2)axis=1)
for i in range(len(kp1)):
number = random.randint(06)
x1 = int(kp1[i][0])
y1 = int(kp1[i][1])
x2 = int(kp2[i][0])
y2 = int(kp2[i][1])
cv2.circle(emptyImage(x1 y1)2(25500)2)
cv2.circle(emptyImage(width1+x2 y2)2(25500)2)
cv2.line(emptyImage (x1y1) (width1+x2 y2) color[number] thickness=1 lineType=1)
return emptyImage
#图片大小不一致
def display1(img1 img2 kp1 kp2):
height1 = img1.shape[0]
width1 = img1.shape[1]
height2 = img2.shape[0]
width2 = img2.shape[1]
# 三通道图片:
emptyImage = np.zeros((max(height1height2)width1+width23)dtype=np.uint8)
emptyImage[0:height10:width1:]=img1[0:height10:width1:]
emptyImage[0:height2width1:width1+width2:]=img2[0:height20:width2:]
# # 灰度图片:
# emptyImage = np.zeros((max(height1 height2) width1 + width2) dtype=np.uint8)
# emptyImage[0:height1 0:width1] = img1
# emptyImage[0:height2 width1:width1 + width2] = img2
for i in range(len(kp1)):
x1 = int(kp1[i][0])
y1 = int(kp1[i][1])
x2 = int(kp2[i][0])
y2 = int(kp2[i][1])
cv2.circle(emptyImage(x1 y1)2(00255)2)
cv2.circle(emptyImage(width1+x2 y2)2(00255)2)
cv2.line(emptyImage (x1y1) (width1+x2 y2) (02550) thickness=1 lineType=0)
return emptyImage
#show image with key point
def show_image(img keypoit):
image = np.zeros((img.shape[0]img.shape[1]3)dtype=np.uint8)
image[:::] = img[:::]
for i in range(len(keypoit)):
x1 = int(keypoit[i][0])
y1 = int(keypoit[i][1])
cv2.circle(image(x1 y1)1(25500)1)
return image
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-11-17 11:07 Register优化程序\
文件 46026 2017-08-18 11:17 Register优化程序\51.jpg
文件 15672 2018-05-08 16:51 Register优化程序\53.jpg
文件 2269 2018-05-08 17:59 Register优化程序\register_display.py
文件 4216 2018-05-09 18:31 Register优化程序\register_image_fusion.py
文件 6264 2019-10-09 09:45 Register优化程序\register_main.py
文件 2094 2018-04-27 09:28 Register优化程序\register_match.py
文件 3777 2018-04-27 09:28 Register优化程序\register_ransac.py
- 上一篇:easygui一个python简单的gui库
- 下一篇:卷积神经网络回归模型
相关资源
- 二级考试python试题12套(包括选择题和
- pywin32_python3.6_64位
- python+ selenium教程
- PycURL(Windows7/Win32)Python2.7安装包 P
- 英文原版-Scientific Computing with Python
- 7.图像风格迁移 基于深度学习 pyt
- 基于Python的学生管理系统
- A Byte of Python(简明Python教程)(第
- Python实例174946
- Python 人脸识别
- Python 人事管理系统
- 基于python-flask的个人博客系统
- 计算机视觉应用开发流程
- python 调用sftp断点续传文件
- python socket游戏
- 基于Python爬虫爬取天气预报信息
- python函数编程和讲解
- Python开发的个人博客
- 基于python的三层神经网络模型搭建
- python实现自动操作windows应用
- python人脸识别(opencv)
- python 绘图(方形、线条、圆形)
- python疫情卡UN管控
- python 连连看小游戏源码
- 基于PyQt5的视频播放器设计
- 一个简单的python爬虫
- csv文件行列转换python实现代码
- Python操作Mysql教程手册
- Python Machine Learning Case Studies
- python获取硬件信息
评论
共有 条评论