zoukankan      html  css  js  c++  java
  • 修改matlab中的cvexShowMatches函数,使匹配结果更清楚

       

    matlab 2011b中的函数cvexShowMatches()显示匹配图像是非常不爽。

    执行如下代码:

    I1 = imread('cameraman.tif');
    I2 = imresize(imrotate(I1,-20), 1.2);
     
    points1 = detectSURFFeatures(I1,'MetricThreshold',10000);
    points2 = detectSURFFeatures(I2,'MetricThreshold',10000);
     
    [f1, vpts1] = extractFeatures(I1, points1);
    [f2, vpts2] = extractFeatures(I2, points2);
            
    index_pairs = matchFeatures(f1, f2) ;
    matched_pts1 = vpts1(index_pairs(:, 1));
    matched_pts2 = vpts2(index_pairs(:, 2));

    % Note that there are still several outliers present in the data, but
    % otherwise you can clearly see the effects of rotation and scaling on
    % the display of matched features.
      cvexShowMatches(I1,I2,matched_pts1,matched_pts2); % show matching points

       

    显示的图像如下:

       

     这非常不方便,看起来一点都不清楚。

    于是自己修改了cvexShowMatches() 这个函数,这样,就可以显示下面的图像了。是不是比较方便了?

    修改好的函数在最后。请下载。

       

       

    cvexShowMatches2()下载:http://dl.dropbox.com/u/48006175/cvexShowMatches2.m

  • 相关阅读:
    [Scoi2010]游戏
    HDU3415(单调队列)
    POJ1221(整数划分)
    POJ1050(dp)
    POJ2479(dp)
    HDU1864(背包)
    HDU1175(dfs)
    STL_string.vector中find到的iterator的序号
    Qt532.数值转为16进制(并填充)
    异常处理.VC++
  • 原文地址:https://www.cnblogs.com/liyanwei/p/2280584.html
Copyright © 2011-2022 走看看