亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? main.cpp

?? scale invariant algorithm
?? CPP
字號:
/*
 * Speeded-Up Robust Features (SURF)
 * http://people.ee.ethz.ch/~surf
 *
 * Authors: Herbert Bay, Andreas Ess, Geert Willems
 * Windows port by Stefan Saur
 *
 * Copyright (2006): ETH Zurich, Switzerland
 * Katholieke Universiteit Leuven, Belgium
 * All rights reserved.
 *
 * For details, see the paper:
 * Herbert Bay,  Tinne Tuytelaars,  Luc Van Gool,
 *  "SURF: Speeded Up Robust Features"
 * Proceedings of the ninth European Conference on Computer Vision, May 2006
 *
 * Permission to use, copy, modify, and distribute this software and
 * its documentation for educational, research, and non-commercial
 * purposes, without fee and without a signed licensing agreement, is
 * hereby granted, provided that the above copyright notice and this
 * paragraph appear in all copies modifications, and distributions.
 *
 * Any commercial use or any redistribution of this software
 * requires a license from one of the above mentioned establishments.
 *
 * For further details, contact Andreas Ess (aess@vision.ee.ethz.ch).
 */

#include <iostream>
#include <fstream>
#include <vector>
#include <cmath>
#include <string.h>

#ifdef WIN32
#include "surfWINDLL.h"
#endif

#include "imload.h"
#include "surflib.h"

#include "os_mapping.h"

using namespace std;
using namespace surf;

// Length of the descriptor vector
int VLength;

// Forward declaration of the functions to load/save the SURF points
void loadIpoints(string fn, vector< Ipoint >& keys, bool bVerbose = false);
void saveIpoints(string fn, const vector< Ipoint >& keys, bool bVerbose = false, bool bLaplacian = true);

int main (int argc, char **argv)
{
  // Initial sampling step (default 2)
  int samplingStep = 2;
  // Number of analysed octaves (default 4)
  int octaves = 4;
  // Blob response treshold
  double thres = 4.0;
  // Set this flag "true" to double the image size
  bool doubleImageSize = false;
  // Initial lobe size, default 3 and 5 (with double image size)
  int initLobe = 3;
  // Upright SURF or rotation invaraiant
  bool upright = false;
  // If the extended flag is turned on, SURF 128 is used
  bool extended = false;
  // Spatial size of the descriptor window (default 4)
  int indexSize = 4;
  // Variables for the timing measure
  osmapping::os_TIME tim1, tim2; //STS
  // verbose output
  bool bVerbose = true;
  // skip sign of laplacian
  bool bLaplacian = true;

  bool bLoadRegions  = false;
  string sRegionFile = "";

  // Print command line help
  if (argc==1) {
    cerr << "./surf -i img.pgm -o img.surf [options]\n"
         << "  blob response threshold          -thres 1000\n"
         << "  double image size:               -d\n"
         << "  custom lobe size:                -ms 3\n"
         << "  initial sampling step:           -ss 2\n"
         << "  number of octaves:               -oc 4\n"
         << "  U-SURF (not rotation invariant): -u\n"
         << "  extended descriptor (SURF-128):  -e\n"
         << "  descriptor size:                 -in 4\n"
         << "  input regions:                   -p1 <file>\n"
         << "  verbose output:                  -v\n"
         << "  don't write laplacian:           -nl\n"
         << "  quiet mode:                      -q\n";
    return(0);
  }

  // Read the arguments
  ImLoad ImageLoader;
  int arg = 0;
  string fn = "out.surf";
  Image *im=NULL;
  while (++arg < argc) { 
    if (! strcmp(argv[arg], "-i"))
      im = ImageLoader.readImage(argv[++arg]); 
    if (! strcmp(argv[arg], "-o"))
      fn = argv[++arg];
    if (! strcmp(argv[arg], "-thres"))
      thres = (atof(argv[++arg]))/10000;
    if (! strcmp(argv[arg], "-d"))
      doubleImageSize = true;
    if (! strcmp(argv[arg], "-ms"))
      initLobe = atoi(argv[++arg]);
    if (! strcmp(argv[arg], "-oc"))
      octaves = atoi(argv[++arg]);
    if (! strcmp(argv[arg], "-ss"))
      samplingStep = atoi(argv[++arg]);
    if (! strcmp(argv[arg], "-u"))
      upright = true;
    if (! strcmp(argv[arg], "-e"))
      extended = true;
    if (! strcmp(argv[arg], "-in"))
      indexSize = atoi(argv[++arg]);
    if (! strcmp(argv[arg], "-p1")) {
      bLoadRegions = true;
      sRegionFile  = argv[++arg];
    }
    if (! strcmp(argv[arg], "-v"))
      bVerbose = true;
    if (! strcmp(argv[arg], "-nl"))
      bLaplacian = false;
    if (! strcmp(argv[arg], "-q"))
      bVerbose = false;
  }

  // Start measuring the time
  osmapping::os_GetTime(&tim1);

  // Create the integral image
  Image iimage(im, doubleImageSize);

  // Start finding the SURF points
  if( bVerbose )
    cout << "Finding SURFs...\n";

  // These are the interest points
  vector< Ipoint > ipts;
  ipts.reserve(1000);

  // Extract interest points with Fast-Hessian
  FastHessian fh(&iimage, /* pointer to integral image */
                 ipts,
                 thres, /* blob response threshold */
                 doubleImageSize, /* double image size flag */
                 initLobe * 3 /* 3 times lobe size equals the mask size */, 
                 samplingStep, /* subsample the blob response map */
                 octaves /* number of octaves to be analysed */);

  if( bLoadRegions ) {
    // Load the interest points from disk
    loadIpoints( sRegionFile, ipts, bVerbose );
  } else {
    // Extract them and get their pointer
    fh.getInterestPoints();
  }

  // Initialise the SURF descriptor
  Surf des(&iimage, /* pointer to integral image */  
           doubleImageSize, /* double image size flag */ 
           upright, /* rotation invariance or upright */
           extended, /* use the extended descriptor */
           indexSize /* square size of the descriptor window (default 4x4)*/);

  // Get the length of the descriptor vector resulting from the parameters
  VLength = des.getVectLength();

  // Compute the orientation and the descriptor for every interest point
  for (unsigned n=0; n<ipts.size(); n++){
    //for (Ipoint *k = ipts; k != NULL; k = k->next){
    // set the current interest point
    des.setIpoint(&ipts[n]);
    // assign reproducible orientation
    des.assignOrientation();
    // make the SURF descriptor
    des.makeDescriptor();
  }

  // stop measuring the time, we're all done
  osmapping::os_GetTime(&tim2);

  // save the interest points in the output file
  saveIpoints(fn, ipts, bVerbose, bLaplacian);

  // print some nice information on the command prompt
  if( bVerbose )
    cout << "Detection time: " << osmapping::os_TimeDiff(&tim2, &tim1) << " ms" << endl;

  delete im;

  return 0;
}

// Save the interest points to a regular ASCII file
void saveIpoints(string sFileName, const vector< Ipoint >& ipts, bool bVerbose, bool bLaplacian) 
{
  ofstream ipfile(sFileName.c_str());
  if( !ipfile ) {
    cerr << "ERROR in loadIpoints(): "
         << "Couldn't open file '" << sFileName.c_str() << "'!" << endl; //STS
    return;
  }

  double sc;
  unsigned count = ipts.size();

  // Write the file header
  if (bLaplacian)
    ipfile << VLength + 1 << endl << count << endl;
  else
    ipfile << VLength << endl << count << endl;

  // In order to just save the interest points without descriptor, comment 
  // the above and uncomment the following command.
  // ipfile << 1.0 << endl << count << endl;
  // Save interest point with descriptor in the format of Krystian Mikolajczyk
  // for reasons of comparison with other descriptors. As our interest points 
  // are circular in any case, we use the second component of the ellipse to 
  // provide some information about the strength of the interest point. This is 
  // important for 3D reconstruction as only the strongest interest points are 
  // considered. Replace the strength with 0.0 in order to perform Krystian's 
  // comparisons.
  for (unsigned n=0; n<ipts.size(); n++){
    // circular regions with diameter 5 x scale
    sc = 2.5 * ipts[n].scale; sc*=sc;
    ipfile  << ipts[n].x /* x-location of the interest point */
            << " " << ipts[n].y /* y-location of the interest point */
            << " " << 1.0/sc /* 1/r^2 */
            << " " << 0.0     //(*ipts)[n]->strength /* 0.0 */
            << " " << 1.0/sc; /* 1/r^2 */

    if (bLaplacian)
      ipfile << " " << ipts[n].laplace;

    // Here comes the descriptor
    for (int i = 0; i < VLength; i++) {
      ipfile << " " << ipts[n].ivec[i];
    }
    ipfile << endl;
  }

  // Write message to terminal.
  if( bVerbose )
    cout << count << " interest points found" << endl;
}


// Load the interest points from a regular ASCII file
void loadIpoints(string sFileName, vector< Ipoint >& ipts, bool bVerbose) 
{
  ifstream ipfile(sFileName.c_str());
  if( !ipfile ) {
    cerr << "ERROR in loadIpoints(): "
         << "Couldn't open file '" << sFileName.c_str() << "'!" << endl; //STS
    return;
  }

  // Load the file header
  float    dummy;
  unsigned count;
  ipfile >> dummy >> count;

  // create a new interest point vector
  ipts.clear();
  ipts.resize(count);

  // Load the interest points in Mikolajczyk's format
  for (unsigned n=0; n<count; n++){
    // circular regions with diameter 5 x scale
    float x, y, a, b, c;
    ipfile >> x >> y >> a >> b >> c;

    float det = sqrt((a-c)*(a-c) + 4.0*b*b);
    float e1 = 0.5*(a+c + det);
    float e2 = 0.5*(a+c - det);
    float l1 = (1.0/sqrt(e1));
    float l2 = (1.0/sqrt(e2));
    float sc = sqrt( l1*l2 );

    ipts[n].x     = x;
    ipts[n].y     = y;
    ipts[n].scale = sc/2.5;
  }

  // close the interest point file again
  ipfile.close();

  // Write message to terminal.
  if( bVerbose )
    cout << "read in " << count << " interest points." << endl;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
69精品人人人人| 亚洲一区二区视频在线| 亚洲男人的天堂在线aⅴ视频| 午夜欧美视频在线观看| 成人一区二区视频| 精品国精品自拍自在线| 亚洲精品中文字幕乱码三区| 国产一区二区日韩精品| 欧美日韩国产成人在线免费| 亚洲欧美日韩在线| 国产suv精品一区二区883| 日韩精品一区二区三区在线| 亚洲网友自拍偷拍| 94-欧美-setu| 国产三级一区二区| 韩国欧美一区二区| 51精品国自产在线| 午夜日韩在线观看| 欧美私模裸体表演在线观看| 亚洲视频在线观看一区| 国产福利视频一区二区三区| 26uuu国产日韩综合| 美国十次了思思久久精品导航| 欧美性猛交一区二区三区精品| 亚洲精品视频在线观看网站| av影院午夜一区| 久久久久国产免费免费| 国内一区二区在线| 久久久国产精品麻豆| 韩国在线一区二区| 国产午夜亚洲精品午夜鲁丝片| 黄页网站大全一区二区| 久久综合狠狠综合久久激情| 麻豆freexxxx性91精品| 欧美一卡2卡三卡4卡5免费| 午夜日韩在线观看| 欧美大片国产精品| 国产成人av影院| 国产精品国产三级国产aⅴ无密码| 成人免费高清视频在线观看| 一区精品在线播放| 在线亚洲人成电影网站色www| 亚洲精品大片www| 欧美在线免费播放| 日韩av电影免费观看高清完整版 | 久久精品一区二区三区四区| 国产一区二区三区视频在线播放| 久久久www成人免费毛片麻豆| 国产高清亚洲一区| 椎名由奈av一区二区三区| 日本韩国欧美国产| 天天做天天摸天天爽国产一区 | 在线观看网站黄不卡| 日产国产高清一区二区三区| 精品国产乱码久久久久久1区2区 | 毛片一区二区三区| 中文子幕无线码一区tr| 欧美四级电影网| 国产一区二区三区免费| 亚洲柠檬福利资源导航| 欧美一区二区三区在线视频| 国产凹凸在线观看一区二区| 亚洲一区二区三区在线看| 日韩欧美国产小视频| 国产aⅴ综合色| 天天综合天天做天天综合| 亚洲福利视频三区| wwwwxxxxx欧美| 欧美影视一区在线| 国产精品系列在线播放| 亚洲综合色噜噜狠狠| 2017欧美狠狠色| 91精品91久久久中77777| 久久99精品国产麻豆婷婷洗澡| 国产精品久久久久aaaa樱花 | 另类欧美日韩国产在线| 国产精品福利一区| 欧美老女人在线| 成人a区在线观看| 日韩成人精品在线观看| 亚洲视频中文字幕| 久久久久久一二三区| 精品视频1区2区| 99免费精品在线| 精品在线亚洲视频| 亚洲国产综合人成综合网站| 日本一区二区三区免费乱视频| 色国产综合视频| 国产成人免费视频网站| 日本美女一区二区三区视频| 综合激情成人伊人| 国产色综合久久| 亚洲精品一区二区在线观看| 欧美日本一区二区在线观看| 99国产欧美久久久精品| 国产美女精品在线| 麻豆精品视频在线观看免费| 亚洲第一会所有码转帖| 亚洲福利视频一区| 亚洲三级在线播放| 国产欧美精品在线观看| 久久人人爽爽爽人久久久| 欧美一卡在线观看| 欧美一区二区在线视频| 欧美四级电影网| 欧美三级视频在线播放| 在线视频国内一区二区| 91网上在线视频| 99在线精品一区二区三区| 成人av在线电影| 高清免费成人av| 成人三级在线视频| 不卡的av在线播放| 99久久综合色| 色偷偷一区二区三区| 日本电影亚洲天堂一区| 91免费国产在线| 在线观看免费亚洲| 欧美日韩一区不卡| 日韩一区二区三区电影| 日韩视频永久免费| 精品欧美黑人一区二区三区| 精品国产乱码久久久久久图片| 欧美电影免费观看高清完整版在| 精品久久国产老人久久综合| 精品日韩一区二区| 欧美国产精品一区二区三区| 自拍偷拍欧美精品| 亚洲国产欧美一区二区三区丁香婷| 亚洲国产aⅴ成人精品无吗| 午夜精品久久久久| 激情综合色综合久久| 国产精品中文有码| 91美女片黄在线观看91美女| 欧美艳星brazzers| 欧美刺激脚交jootjob| 国产女同互慰高潮91漫画| 亚洲精品免费视频| 蜜桃免费网站一区二区三区| 国产成人午夜精品影院观看视频 | 欧美激情一区二区三区在线| 一区精品在线播放| 五月婷婷综合网| 极品美女销魂一区二区三区免费 | 亚洲欧美日韩在线| 日韩国产一二三区| 国产成都精品91一区二区三| 91美女片黄在线观看91美女| 在线播放日韩导航| 国产日韩欧美精品在线| 亚洲影视资源网| 国产乱一区二区| 欧美亚洲高清一区二区三区不卡| 精品国内二区三区| 一区二区三区四区亚洲| 久久99精品国产| 在线观看日韩电影| 国产视频一区二区三区在线观看| 香蕉乱码成人久久天堂爱免费| 国产成人综合视频| 777色狠狠一区二区三区| 国产精品水嫩水嫩| 毛片一区二区三区| 欧洲另类一二三四区| 国产欧美一区二区精品仙草咪| 婷婷六月综合亚洲| 99热这里都是精品| 精品久久国产字幕高潮| 亚洲一区二区三区中文字幕| 成人国产精品免费| 日韩欧美一级在线播放| 亚洲国产中文字幕在线视频综合| 国产91精品免费| 日韩女同互慰一区二区| 亚洲成av人片| 91免费观看在线| 国产精品午夜春色av| 精品在线亚洲视频| 欧美一卡2卡3卡4卡| 亚洲国产成人av网| 91丨九色丨蝌蚪丨老版| 国产欧美精品一区二区色综合 | 日韩激情在线观看| 一本久久a久久精品亚洲 | 久久久午夜精品理论片中文字幕| 天天av天天翘天天综合网色鬼国产| 99久久精品免费看国产| 国产无遮挡一区二区三区毛片日本| 美日韩一区二区| 678五月天丁香亚洲综合网| 亚洲一区二区欧美| 在线观看视频一区二区欧美日韩| 亚洲欧美日韩国产中文在线| 99在线视频精品| 亚洲免费在线播放| 欧美亚洲高清一区| 日韩和欧美的一区| 欧美一区二区播放| 国产在线精品国自产拍免费| 久久久精品一品道一区|