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

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

?? match.cpp

?? scale invariant algorithm
?? CPP
字號:
/* * Speeded-Up Robust Features (SURF) * http://people.ee.ethz.ch/~surf * * Sample application for feature matching using nearest-neighbor * ratio method. * * BUILD USING "make match.ln". * * Author: Andreas Ess * * 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 <vector>#include <string>#include <iostream>#include <fstream>#include <cmath>#include "ipoint.h"// Define to compile with PGM output#define GRAPHICS#ifdef GRAPHICS#include "image.h"#include "imload.h"#endifusing namespace std;using namespace surf;// Length of descriptor vector, ugly, global variableint vlen;// Calculate square distance of two vectorsdouble distSquare(double *v1, double *v2, int n) {	double dsq = 0.;	while (n--) {		dsq += (*v1 - *v2) * (*v1 - *v2);		v1++;		v2++;	}	return dsq;}// Find closest interest point in a list, given one interest pointint findMatch(const Ipoint& ip1, const vector< Ipoint >& ipts) {	double mind = 1e100, second = 1e100;	int match = -1;	for (unsigned i = 0; i < ipts.size(); i++) {		// Take advantage of Laplacian to speed up matching		if (ipts[i].laplace != ip1.laplace)			continue;		double d = distSquare(ipts[i].ivec, ip1.ivec, vlen);		if (d < mind) {			second = mind;			mind = d;			match = i;		} else if (d < second) {			second = d;		}	}	if (mind < 0.5 * second)		return match;	return -1;}// Find all possible matches between two imagesvector< int > findMatches(const vector< Ipoint >& ipts1, const vector< Ipoint >& ipts2) {	vector< int > matches(ipts1.size());	int c = 0;	for (unsigned i = 0; i < ipts1.size(); i++) {		int match = findMatch(ipts1[i], ipts2);		matches[i] = match;		if (match != -1) {			cout << " Matched feature " << i << " in image 1 with feature "				<< match << " in image 2." << endl;			c++;		}	}	cout << " --> Matched " << c << " features of " << ipts1.size() << " in image 1." << endl;	return matches;}// Load the interest points from a regular ASCII filevoid loadIpoints(string sFileName, vector< Ipoint >& ipts) {	ifstream ipfile(sFileName.c_str());	if( !ipfile ) {		cerr << "ERROR in loadIpoints(): "			<< "Couldn't open file '" << sFileName.c_str() << "'!" << endl;		return;	}	// Load the file header	unsigned count;	ipfile >> vlen >> 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;		// Read in region data, though not needed for actual matching		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;		// Read in Laplacian		ipfile >> ipts[n].laplace;		// SURF makes Laplacian part of descriptor, so skip it..		ipts[n].ivec = new double[vlen - 1];		for (unsigned j = 0; j < vlen - 1; j++)			ipfile >> ipts[n].ivec[j];	}}void drawLine(Image *im, int x1, int y1, int x2, int y2) {	if ((x1 < 0 && x2 < 0) || (y1 < 0 && y2 < 0) ||	    (x1 >= im->getWidth() && x2 >= im->getWidth()) ||            (y1 >= im->getHeight() && y2 >= im->getHeight()))		return;	bool steep = std::abs(y2 - y1) > std::abs(x2 - x1);	if (steep) {		int t;		t = x1;		x1 = y1;		y1 = t;		t = y2;		y2 = x2;		x2 = t;	}	if (x1 > x2) {		// Swap points		int t;		t = x1;		x1 = x2;		x2 = t;		t = y1;		y1 = y2;		y2 = t;	}	int deltax = x2 - x1;	int deltay = std::abs(y2 - y1);	int error = 0;	int y = y1;	int ystep = y1 < y2 ? 1 : -1;	for (int x = x1; x < x2; x++) {		if (steep) {			if (x >= 0 && y >= 0 && y < im->getWidth() && x < im->getHeight())				im->setPix(y, x, 1);		} else {			if (x >= 0 && y >= 0 && x < im->getWidth() && y < im->getHeight())				im->setPix(x, y, 1);		}		error += deltay;		if (2 * error > deltax) {			y += ystep;			error -= deltax;		}	}}void drawCross(Image *im, int x, int y, int s = 5) {	for (int x1 = x - s; x1 <= x + s; x1++)		im->setPix(x1, y, 1);	for (int y1 = y - s; y1 <= y + s; y1++)		im->setPix(x, y1, 1);}int main(int argc, char **argv) {	Image *im1, *im2;#ifdef GRAPHICS	ImLoad ImageLoader;	vector< Ipoint > ipts1, ipts2;	bool drawc = false;#endif	char ofname[100];	im1 = im2 = NULL;	ofname[0] = 0;	// Read the arguments	int arg = 0;	while (++arg < argc) { 		if (! strcmp(argv[arg], "-k1"))			loadIpoints(argv[++arg], ipts1);		if (! strcmp(argv[arg], "-k2"))			loadIpoints(argv[++arg], ipts2);#ifdef GRAPHICS		if (! strcmp(argv[arg], "-im1"))			im1 = ImageLoader.readImage(argv[++arg]); 		if (! strcmp(argv[arg], "-im2"))			im2 = ImageLoader.readImage(argv[++arg]); 		if (! strcmp(argv[arg], "-o"))			strcpy(ofname, argv[++arg]);		if (! strcmp(argv[arg], "-c"))			drawc = true;#endif	}	if (ipts1.size() == 0 || ipts2.size() == 0) {		cout << "Usage:" << endl;		cout << " match -k1 out1.surf -k2 out2.surf -im1 img1.pgm -im2 img2.pgm -o out.pgm" << endl << endl;		cout << "For each feature in first descriptor file, find best in second according to "			<< "nearest neighbor ratio strategy. Display matches in out.pgm, generated "			<< "from img1.pgm and img2.pgm. Use -c to draw crosses at interest points." << endl;		return 1;	}	vector< int > matches = findMatches(ipts1, ipts2);#ifdef GRAPHICS	if (im1 != NULL && im2 != NULL && ofname[0] != 0) {		Image res(max(im1->getWidth(), im2->getWidth()), im1->getHeight() + im2->getHeight());		for (int x = 0; x < im1->getWidth(); x++)			for (int y = 0; y < im1->getHeight(); y++)				res.setPix(x, y, im1->getPix(x, y));		for (int x = 0; x < im2->getWidth(); x++)			for (int y = 0; y < im2->getHeight(); y++)				res.setPix(x, y + im1->getHeight(), im2->getPix(x, y));		// Draw lines for matches		for (unsigned i = 0; i < matches.size(); i++) {			if (matches[i] != -1) {				drawLine(&res, (int)ipts1[i].x, (int)ipts1[i].y,					(int)ipts2[matches[i]].x, (int)(ipts2[matches[i]].y + im1->getHeight()));			}		}		// Draw crosses at interest point locations		if (drawc) {			for (unsigned i = 0; i < ipts1.size(); i++)				drawCross(&res, (int)ipts1[i].x, (int)ipts1[i].y);			for (unsigned i = 0; i < ipts2.size(); i++)				drawCross(&res, (int)ipts2[i].x, (int)ipts2[i].y + im1->getHeight());		}		ImageLoader.saveImage(ofname, &res);	}#endif		return 0;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲另类在线视频| 国产九色sp调教91| 波多野结衣视频一区| 欧美电影影音先锋| 亚洲v精品v日韩v欧美v专区| 在线中文字幕一区| 亚洲免费观看高清完整版在线观看熊| 国产不卡一区视频| 中文字幕精品综合| 激情另类小说区图片区视频区| 欧美一级在线免费| 国内精品伊人久久久久av一坑| 精品少妇一区二区三区在线视频| 裸体健美xxxx欧美裸体表演| 在线精品视频免费播放| 一区二区三区欧美在线观看| 色婷婷精品久久二区二区蜜臀av| 一二三四社区欧美黄| 欧美影院精品一区| 日韩电影一区二区三区四区| 欧美日韩国产成人在线91| 日韩电影免费在线| 久久久精品欧美丰满| av在线免费不卡| 伊人夜夜躁av伊人久久| 欧美老人xxxx18| 午夜久久久久久久久| 欧美成人精品1314www| 国产69精品久久久久毛片| 亚洲免费在线视频| 欧美精品久久天天躁| 亚洲午夜电影在线| 欧美成人精品1314www| 国产91精品免费| 亚洲综合成人在线视频| 日韩精品中文字幕在线不卡尤物| 国内精品视频一区二区三区八戒 | 亚洲二区在线观看| 欧美日韩色一区| 久久av老司机精品网站导航| 亚洲欧美在线aaa| 欧美日韩久久一区| 成人黄页毛片网站| 亚洲自拍另类综合| 久久久久亚洲综合| 欧美日韩性生活| 国产91富婆露脸刺激对白| 亚洲国产综合视频在线观看| 精品裸体舞一区二区三区| 99久久精品99国产精品| 奇米精品一区二区三区在线观看一| 国产三级一区二区| 欧美日韩一级片网站| 成人免费毛片a| 亚洲精品视频在线观看网站| 精品国产污污免费网站入口 | 午夜av一区二区| 91精品午夜视频| 成人黄色小视频| 奇米色777欧美一区二区| 亚洲区小说区图片区qvod| 欧美xxxxx牲另类人与| 在线观看亚洲一区| 成人精品视频一区二区三区| 日韩vs国产vs欧美| 亚洲一区在线播放| 国产精品乱码一区二三区小蝌蚪| 日韩欧美国产一区二区三区| 91小视频在线观看| 成人免费看黄yyy456| 风间由美性色一区二区三区| 国产精品综合av一区二区国产馆| 中文字幕中文字幕在线一区| 精品欧美一区二区久久| 日韩一区二区免费视频| 欧美日韩精品综合在线| 成人免费毛片片v| 亚洲va欧美va国产va天堂影院| 亚洲影视资源网| 中文字幕欧美一区| 欧美国产综合一区二区| 久久午夜电影网| 91蜜桃免费观看视频| 成人av网址在线| 国产激情一区二区三区四区 | 欧美xxxxx牲另类人与| 9191国产精品| 91麻豆精品国产91久久久久| 欧美又粗又大又爽| 91麻豆国产自产在线观看| 波波电影院一区二区三区| 成人高清视频在线| www.爱久久.com| 成人app网站| 极品少妇xxxx精品少妇| 麻豆精品精品国产自在97香蕉| 日本伊人午夜精品| 蜜臀va亚洲va欧美va天堂| 久久精品国产免费看久久精品| 一区二区欧美国产| 日韩有码一区二区三区| 久久精品国产**网站演员| 国产一区二区主播在线| 91视频一区二区| 91精品午夜视频| 国产欧美一区二区三区网站| 亚洲精品国产第一综合99久久| 亚洲成人av一区二区三区| 国产呦萝稀缺另类资源| 在线亚洲高清视频| 精品国产一区二区三区四区四 | 一区二区国产盗摄色噜噜| 麻豆国产精品视频| www.在线成人| 这里只有精品免费| 中文字幕在线观看一区二区| 亚洲h精品动漫在线观看| 国产丶欧美丶日本不卡视频| 欧美性大战久久久久久久蜜臀| 精品国产乱码久久久久久图片| 中文字幕一区三区| 黑人巨大精品欧美黑白配亚洲 | 欧美精品视频www在线观看 | 久久精品人人做人人综合| 一区二区三区在线免费播放| 麻豆精品视频在线观看视频| 日本韩国欧美一区| 亚洲精品一区二区三区福利| 亚洲无线码一区二区三区| 成人黄色小视频| 精品人伦一区二区色婷婷| 亚洲6080在线| 色综合天天性综合| 国产丝袜在线精品| 免费欧美日韩国产三级电影| 欧美综合欧美视频| 中文字幕在线播放不卡一区| 国产综合久久久久久鬼色| 欧美日韩视频第一区| 亚洲人精品午夜| 欧美视频一区在线| 中文字幕一区av| 国产一区二区电影| 日韩欧美电影在线| 亚洲chinese男男1069| 色av综合在线| 亚洲欧洲日韩一区二区三区| 国产乱子伦视频一区二区三区| 91精品国产综合久久久蜜臀图片| 亚洲综合一二区| 色综合久久88色综合天天免费| 国产精品视频一二三| 激情六月婷婷久久| 欧美tk丨vk视频| 日韩高清不卡一区二区| 欧美精选一区二区| 亚洲v日本v欧美v久久精品| 欧美在线观看你懂的| 亚洲欧美一区二区久久| 97精品久久久午夜一区二区三区| 国产色综合一区| 国产精品一区二区久久不卡| 久久免费美女视频| 国产精品一区二区在线播放| 久久免费偷拍视频| 国产美女精品在线| 国产区在线观看成人精品| 国产精品一区久久久久| 久久精品欧美一区二区三区不卡 | 亚洲国产高清不卡| 成人动漫一区二区| 亚洲人快播电影网| 在线视频中文字幕一区二区| 亚洲一区二区在线观看视频| 欧美视频三区在线播放| 日韩福利视频导航| 精品国产一区二区三区久久久蜜月| 久久er99精品| 国产精品每日更新在线播放网址| 国产成人免费视频网站高清观看视频 | 99riav一区二区三区| 亚洲精品免费视频| 7777女厕盗摄久久久| 激情综合五月天| 国产精品久久久久久久久久久免费看| 99热精品一区二区| 亚洲精品一二三四区| 欧美三级午夜理伦三级中视频| 午夜亚洲福利老司机| 欧美成人综合网站| 不卡av免费在线观看| 性感美女久久精品| 亚洲激情中文1区| 在线成人av网站| 国产精品一区二区果冻传媒| 亚洲日本va午夜在线影院| 91福利在线免费观看| 麻豆91免费观看| 亚洲婷婷国产精品电影人久久| 在线观看日韩电影|