opencv stitch fast用什么寻找特征点

ImageStitch 基于SIFT算法的图像拼接
主要是运 求得特征点,然后用kd_tree进行 匹 Special Effects 图形 处理 269万源代码下载-
&文件名称: ImageStitch& & [
& & & & &&]
&&所属分类:
&&开发工具: Visual C++
&&文件大小: 31 KB
&&上传时间:
&&下载次数: 174
&&提 供 者:
&详细说明:基于SIFT算法的图像拼接
主要是运用SIFT算法求得特征点,然后用kd_tree进行特征点匹配,根据匹配点求得2x2的变换矩阵,然后利用变换矩阵变换图像(需要插值)。-Image Stitch Based on SIFT
文件列表(点击判断是否您需要的文件,如果是垃圾请在下面评价投诉):
&&match.h&&sift.cpp&&sift.h&&stitch.cpp&&stitch.h&&util.cpp&&util.h&&utils.cpp&&utils.h&&xform.h&&main.cpp&&match.cpp
&[]:文件不全&[]:文件不全&[]:一般,勉强可用&[]:纯粹是垃圾
&近期下载过的用户:
&相关搜索:
&输入关键字,在本站269万海量源码库中尽情搜索:
&[] - SIFT算法,全景图像拼接VC源码,带中文注释,在VC6.0下编译通过
&[] - 相当好的源代码,很有用,值得收藏,多用于图像拼接
&[] - 相位相关法的全景图像拼接程序,拼接的效果还可以。
&[] - SIFT图像拼接,实现了论文中有关的SIFT的算法,使用时正确设置参数
&[] - 图像融合,通过特征提取进行配准,最终实现视频图像的拼接
&[] - 自己用matlab写的sift特征点检测与匹配程序,运行能通过查看: 1122|回复: 6
如何提取边缘信息并只对边缘检测特征点?opencv
有没有编程的大神,可以帮帮忙?
我现在在做图像配准,想要在只配准图像的边缘,以减少错误的匹配。
步骤是先用canny检测边缘,然后对边缘做膨胀处理,然后检测膨胀后的图像区域。但是我不知道怎么用算法实现对把膨胀的区域在原图里体现出来。并且只检测这些区域。。
根据检测到的边缘坐标以及边缘的特征设计边界
请问你能告诉具体怎么操作么,设计边界需要什么函数,用的opencv函数库,本人自己写的代码经历不是特别多
用sift+ransac应该更好吧
canny→膨脹→二值化& &得到一張與原影像尺寸一樣的二值化mask圖
原圖→檢測特徵點→得到座標(x,y)→if mask(x,y)==1 才顯示
用sift+ransac应该更好吧
后续操作是用的ransac~~已经好了,就是想做一些好的预处理,你还有什么好的算法推荐么
canny→膨脹→二值化& &得到一張與原影像尺寸一樣的二值化mask圖
原圖→檢測特徵點→得到座標(x,y)→if ma ...
谢谢~~我试试,先一步步来,
有具体问题还麻烦,不吝赐教
Powered by温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
sunny heart and simpe appearance
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
在CV安装文件下,提供了图像拼接的例子:C:\opencv2.4.2\opencv\samples\cpp\stitching.cpp& 新建工程配置好再运行
stitching是OpenCV2.4.0一个新模块,功能是实现图像拼接,所有的相关函数都被封装在Stitcher类当中。这个类当中我们可能用到的成员函数有createDefault用于创建默认缺省参数stitcher、
estimateTransform用于匹配图像分析摄像头的旋转角度、
composePanorama生成最后的全景图
stitch为最简单的应用。内部实现的过程是非常繁琐,需要很多算法的支持,包括图像特征的寻找和匹配,摄像机的校准,图像的变形,曝光0偿和图像融合。
首先需要调用createDefault函数生成默认的参数,再使用stitch函数进行拼接。
语言平台VS2010&& WIN7& 32位&&& Opencv 2.4.2&&
#include "stdafx.h"
#include &stdio.h&#include &iostream&#include &vector&#include "opencv2/core/core.hpp"#include "opencv2/features2d/features2d.hpp"#include "opencv2/highgui/highgui.hpp"#include "opencv2/calib3d/calib3d.hpp"#include "opencv/cv.h"#include "opencv/highgui.h"#include &opencv2/nonfree//features2d.hpp&& //2.4.2 改进后Surf特征的新库#include&opencv2/legacy/legacy.hpp&&&&& //BruteForceMatcher 匹配头文件#include "opencv2/stitching/stitcher.hpp"& //stitching 影像拼接
int main()
&&&& plImage* img_1 = cvLoadImage("白宫left.jpg");&&&& IplImage* img_2 = cvLoadImage("白宫right.jpg");&&&& vector&Mat&&& && imgs.push_back(img_1);&& imgs.push_back(img_2);&&& //拼接
& M& Stitcher stitcher = Stitcher::createDefault(false);& Stitcher::Status status = stitcher.stitch(imgs, pano);
& imwrite("stitching image.jpg", pano);& imshow("拼接",pano);& waitKey(0);& return 0;
实验结果:
&接下来的工作:
1.sift特征点集进行ransac算法估计透视变换模型参数
2.后期球面投影需要用到摄像机的焦距和3个方位角的信息
&参考资料:
阅读(2767)|
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
loftPermalink:'',
id:'fks_',
blogTitle:'OpenCV2.4.2 --stitching-2-Stiter',
blogAbstract:'\r\nstitcher&类说明文档:
{if x.moveFrom=='wap'}
{elseif x.moveFrom=='iphone'}
{elseif x.moveFrom=='android'}
{elseif x.moveFrom=='mobile'}
${a.selfIntro|escape}{if great260}${suplement}{/if}
{list a as x}
推荐过这篇日志的人:
{list a as x}
{if !!b&&b.length>0}
他们还推荐了:
{list b as y}
转载记录:
{list d as x}
{list a as x}
{list a as x}
{list a as x}
{list a as x}
{if x_index>4}{break}{/if}
${fn2(x.publishTime,'yyyy-MM-dd HH:mm:ss')}
{list a as x}
{if !!(blogDetail.preBlogPermalink)}
{if !!(blogDetail.nextBlogPermalink)}
{list a as x}
{if defined('newslist')&&newslist.length>0}
{list newslist as x}
{if x_index>7}{break}{/if}
{list a as x}
{var first_option =}
{list x.voteDetailList as voteToOption}
{if voteToOption==1}
{if first_option==false},{/if}&&“${b[voteToOption_index]}”&&
{if (x.role!="-1") },“我是${c[x.role]}”&&{/if}
&&&&&&&&${fn1(x.voteTime)}
{if x.userName==''}{/if}
网易公司版权所有&&
{list x.l as y}
{if defined('wl')}
{list wl as x}{/list}查看: 764|回复: 6
特征匹配读取已经匹配的特征点对的问题
#include &stdafx.h&
#include &stdafx.h&
#include &cv.h&
#include &opencv2/objdetect/objdetect.hpp&
#include &opencv2/nonfree/features2d.hpp&& &
#include &opencv2/highgui/highgui.hpp&& && &
#include &iostream&& &&&
#include &opencv2/core/core.hpp&& &&&
#include &opencv2/features2d/features2d.hpp&& && && && &
#include &vector&& &
#include&opencv2/legacy/legacy.hpp&//新版本这个一定要加 我这里是2.4.6版本 当然链接的lib文件也要加进来
void _tmain(int argc, _TCHAR* argv[])
Mat input1=imread(&d:/1.jpg&);//读入图片
Mat input2=imread(&d:/2.jpg&);
SiftFeatureDetector detector(0.06f,5.0);//定义用于提取特征点的对象
vector&KeyPoint& keypoint1,keypoint2;//定义特征点向量
detector.detect(input1,keypoint1);//检测特征点
Mat output1;
drawKeypoints(input1,keypoint1,output1);//绘制特征关键点
imshow(&sift_result1.jpg&,output1);//输出特征图片
imwrite(&sift_result1.jpg&,output1);//保存特征图片
Mat output2;
SiftDescriptorE//定义用于提取特征向量的对象
Mat descriptor1,descriptor2;
BruteForceMatcher&L2&float&&//定义匹配器,对应于float类型,BFMatcher总是尝试所有可能的匹配,从而使得它总能够找到最佳匹配
vector&DMatch&//定义用来存储匹配信息的向量
Mat img_//定义匹配的矩阵
detector.detect(input2,keypoint2);
drawKeypoints(input2,keypoint2,output2);
FileStorage fs1(&test1.txt&,FileStorage::WRITE);//保存文件的类型由后缀名决定
& && &&&fs1&&&calibrationData1&&&output2;
&&fs1.release();
imshow(&out&,output2);
imwrite(&out.jpg&,output2);
pute(input1,keypoint1,descriptor1);//计算特征向量
pute(input2,keypoint2,descriptor2);
matcher.match(descriptor1,descriptor2,matches);//匹配特征向量
drawMatches(input1,keypoint1,input2,keypoint2,matches,img_matches);//绘制寻找到的特征关键点及其匹配
FileStorage fs(&test.txt&,FileStorage::WRITE);//保存文件的类型由后缀名决定
& && &&&fs&&&calibrationData&&&img_
imshow(&matches&,img_matches);
imwrite(&matches.jpg&,img_matches);
waitKey();
匹配出来的特征点对存放在哪个矩阵里面的,是按什么顺序排放的,就是怎么把匹配好的特征点对读出来
matches裡會放匹配到的keypoint的索引值
for(int i=0;i&matches.size();i++)
& & int kp1_idx = matches[i].queryI&&//取得匹配到keypoint1的索引
& & int kp2_idx = matches[i].trainI& &//取得匹配到keypoint2的索引
& & cout&& keypoint1[kp1_idx ].pt.x&&&,&&& keypoint1[kp1_idx ].pt.y;
& & cout&& keypoint2[kp2_idx ].pt.x&&&,&&& keypoint2[kp2_idx ].pt.y&&
非常感谢,还有个问题就是pt.x和pt.y中的x,y是特征点在特征矩阵里面的行数和列数吗&
並沒有什麼特徵矩陣,
應該說特徵點是以KeyPoint的結構存在vector容器裡
KeyPoint的結構包含的變數如下
cv::KeyPoint::KeyPoint& & & & (& & & &
Point2f & & & & _pt,
float & & & & _size,
float & & & & _angle = -1,
float & & & & _response = 0,
int & & & & _octave = 0,
int & & & & _class_id = -1
pt.x和pt.y存的是該特徵點在影像中位置的座標,
Mat descriptor1,descriptor2;&&這個是所謂的特徵點的描述子,
所謂的描述子簡單來說,可以看成特徵點附近的灰階值變化,
可以用來描述該特徵點,
影像→找到影像中的特徵點→找到特徵點的描述子→利用特徵點與描述子進行匹配
並沒有什麼特徵矩陣,
應該說特徵點是以KeyPoint的結構存在vector容器裡
KeyPoint的結構包含的變數如下
上面的看明白了,这个是我输出的一对匹配的特征点的坐标,在网上看到这些坐标的单位是像素,像素不是不能超过255吗
219.332, 56.4079
186.601, 289.409
本帖最后由 smallyouyou 于
15:48 编辑
上面的看明白了,这个是我输出的一对匹配的特征点的坐标,在网上看到这些坐标的单位是像素,像素不是不能 ...
這個值是座標
x值介於[0~影像寬-1]範圍
y值介於[0~影像高-1]範圍你說的應該是像素的灰度值才是介於0~255
你如果要看像素的灰度值
for(int i=0;i&matches.size();i++)
& & int kp1_idx = matches.queryI&&//取得匹配到keypoint1的索引
& & int kp2_idx = matches.trainI& &//取得匹配到keypoint2的索引
& & int x1 = keypoint1[kp1_idx ].pt.x;
& & int y1 = keypoint1[kp1_idx ].pt.y;
& & int x2 = keypoint2[kp2_idx ].pt.x;
& & int y2 = keypoint2[kp2_idx ].pt.y;
& &//印出的值&&x,y:b,g,r
& & cout&& x1&&&,&&& y1&&&:&&&input1.at&Vec3b&(y1,x1)[0]&&&,&&&input1.at&Vec3b&(y1,x1)[1]&&&,&&&input1.at&Vec3b&(y1,x1)[2]&&&&&&;
& & cout&& x2&&&,&&& y2&&&:&&&input2.at&Vec3b&(y2,x2)[0]&&&,&&&input2.at&Vec3b&(y2,x2)[1]&&&,&&&input2.at&Vec3b&(y2,x2)[2]&&
這個值是座標
x值介於[0~影像寬-1]範圍
y值介於[0~影像高-1]範圍你說的應該是像素的灰度值才是介於0~255
知道了,非常感谢
Powered by

我要回帖

更多关于 opencv stitch detail 的文章

 

随机推荐