转战matlab了。步骤说一下:

目标图obj 含目标的场景图scene

0. 载入图像

  1. 分别检测SURF特征点
  2. 分别提取SURF描述子,即特征向量
  3. 用两个特征相互匹配
  4. 利用匹配结果计算两者之间的transform关系tform
  5. 根据obj位置与变换关系tform,在scene图上框出obj

代码,来自matlab,http://localhost:9090/vision/gs/object-detection-and-tracking.html#btt5qyu

%step1:读取图片
%读取object图片
boxImage = imread('stapleRemover.jpg');
%读取场景图片
sceneImage = imread('clutteredDesk.jpg'); %step2:检测特征点
boxPoints = detectSURFFeatures(boxImage);
scenePoints = detectSURFFeatures(sceneImage); % figure; imshow(boxImage);
% title('Box Image中最强的100个feature points');
% hold on;
% plot(boxPoints.selectStrongest(100)); %step3 extract feature descriptors 提取出特征的描述子
%使用extractFeatures(),具体的feature类型是通过boxPoints位置的参数指定的,这里是SURF
%烂设计,为什么extractFeatures输入了boxPoints后,还要返回boxPoints?
[boxFeatures, boxPoints] = extractFeatures(boxImage, boxPoints);
[sceneFeatures, scenePoints] = extractFeatures(sceneImage, scenePoints); %step4 find putative point matches
%Match the features using their descriptors.
boxPairs = matchFeatures(boxFeatures, sceneFeatures);
%Display putatively matched features.
matchedBoxPoints = boxPoints(boxPairs(:,1), :);
matchedScenePoints = scenePoints(boxPairs(:,2),:);
figure;
showMatchedFeatures(boxImage, sceneImage, matchedBoxPoints, matchedScenePoints, 'montage');
title('Putatively Matched Points (Including Outliers)'); %step5 locate the Object in the Scene Using Putative Matches
[tform, inlierBoxPoints, inlierScenePoints] = ...
estimateGeometricTransform(matchedBoxPoints, matchedScenePoints, 'affine');
figure;
showMatchedFeatures(boxImage, sceneImage, inlierBoxPoints, ...
inlierScenePoints, 'montage');
title('Matched Points (Inliers Only)'); %Get the bounding polygon of the reference image.
boxPolygon = [1, 1;... % top-left
size(boxImage,2), 1; ... % top-right
size(boxImage, 2), size(boxImage, 1); ... % bottom-right
1, size(boxImage, 1); ... % bottom-left
1, 1]; % top-left again to close the polygon % transform the polygon into the coordinate system of the target image
%将多边形变换到目标图片上,变换的结果表示了物体的位置
newBoxPolygon = transformPointsForward(tform, boxPolygon); %display the detected object 显示被检测到的物体
figure; imshow(sceneImage);
hold on;
line(newBoxPolygon(:, 1), newBoxPolygon(:, 2), 'Color', 'y');
title('Detected Box');

基于SURF特征的目标检测的更多相关文章

  1. #Deep Learning回顾#之基于深度学习的目标检测(阅读小结)

    原文链接:https://www.52ml.net/20287.html 这篇博文主要讲了深度学习在目标检测中的发展. 博文首先介绍了传统的目标检测算法过程: 传统的目标检测一般使用滑动窗口的框架,主 ...

  2. AAAI2019 | 基于区域分解集成的目标检测 论文解读

    Object Detection based on Region Decomposition and Assembly AAAI2019 | 基于区域分解集成的目标检测 论文解读 作者 | 文永亮 学 ...

  3. 基于深度学习的目标检测技术演进:R-CNN、Fast R-CNN,Faster R-CNN

    基于深度学习的目标检测技术演进:R-CNN.Fast R-CNN,Faster R-CNN object detection我的理解,就是在给定的图片中精确找到物体所在位置,并标注出物体的类别.obj ...

  4. OpenCV中基于HOG特征的行人检测

    目前基于机器学习方法的行人检测的主流特征描述子之一是HOG(Histogram of Oriented Gradient, 方向梯度直方图).HOG特征是用于目标检测的特征描述子,它通过计算和统计图像 ...

  5. 基于SURF特征的图像与视频拼接技术的研究和实现(一)

    基于SURF特征的图像与视频拼接技术的研究和实现(一)      一直有计划研究实时图像拼接,但是直到最近拜读西电2013年张亚娟的<基于SURF特征的图像与视频拼接技术的研究和实现>,条 ...

  6. 基于Haar特征Adaboost人脸检测级联分类

    基于Haar特征Adaboost人脸检测级联分类 基于Haar特征Adaboost人脸检测级联分类,称haar分类器. 通过这个算法的名字,我们能够看到这个算法事实上包括了几个关键点:Haar特征.A ...

  7. 第十九节、基于传统图像处理的目标检测与识别(词袋模型BOW+SVM附代码)

    在上一节.我们已经介绍了使用HOG和SVM实现目标检测和识别,这一节我们将介绍使用词袋模型BOW和SVM实现目标检测和识别. 一 词袋介绍 词袋模型(Bag-Of-Word)的概念最初不是针对计算机视 ...

  8. 第十八节、基于传统图像处理的目标检测与识别(HOG+SVM附代码)

    其实在深度学习中我们已经介绍了目标检测和目标识别的概念.为了照顾一些没有学过深度学习的童鞋,这里我重新说明一次:目标检测是用来确定图像上某个区域是否有我们要识别的对象,目标识别是用来判断图片上这个对象 ...

  9. 基于深度学习的目标检测技术演进:R-CNN、Fast R-CNN、Faster R-CNN

    object detection我的理解,就是在给定的图片中精确找到物体所在位置,并标注出物体的类别.object detection要解决的问题就是物体在哪里,是什么这整个流程的问题.然而,这个问题 ...

随机推荐

  1. C语言:枚举类型

    整数常量的符号名称... #include <stdio.h> enum _bool {false,true}; int main(){ enum colors { red, orange ...

  2. js读取解析JSON类型数据(转)

    谢谢博主,转自http://blog.csdn.net/beyond0851/article/details/9285771 一.什么是JSON? JSON(JavaScript Object Not ...

  3. 如何迁移Alwayson AG

    Windows cluster要求同一个cluster中的所有windows版本都是相同的,这样就出现一个问题,当我们要将对windows进行升级时,(例如从windows 2008 R2升级到win ...

  4. maven spring profile 协同

    请在网上查相关的使用情景,这里直接上要点.另外,可能不只一种方法,但这里只有一种. 1.POM.XML片段,使web.xml文件中有关活跃spring profile的内容可以被maven自动替换 & ...

  5. CI(CodeIgniter)框架入门教程——第二课 初始MVC

    本文转载自:http://www.softeng.cn/?p=53 今天的主要内容是,使用CodeIgniter框架完整的MVC内容来做一个简单的计算器,通过这个计算器,让大家能够体会到我在第一节课中 ...

  6. strlen 与 sizeof 的区别

    void ngx_time_init(void) { ngx_cached_err_log_time.len = sizeof("1970/09/28 12:00:00") - 1 ...

  7. 调试记录:The public type <<classname>> must be defined in its own file

    (摘自stackoverflow) “The public type <<classname>> must be defined in its own file” error ...

  8. SEO站点优化学习总结

    1.网站收录查询 在搜索引擎里面输入Site:域名 即可. 尾巴——学习SEO可以看看以下几个网站: 卢松松博客[一个草根的博客]:http://lusongsong.com/ 站长之家[里面有站长统 ...

  9. Android开发之AutoCompleteTextView的简单使用

    这里只谈简单的使用: 代码xml: <AutoCompleteTextView android:id="@+id/actv" android:layout_width=&qu ...

  10. [转]mysql免安装版配置

    现在mysql有一个installer,相当于安装包管理器.包含mysql的各个组件,比如workbench,各个语言的connector.十分方便,不用就可惜了.实在没有必要下载zip版,自己配置. ...