⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 affine2d.cc

📁 torch tracking code, it is a good code
💻 CC
字号:
const char *help = "\progname: affine2D.cc\n\code2html: This program tests Affine2D class methods.\n\version: Torch3 vision2.0, 2003-2005\n\(c) Sebastien Marcel (marcel@idiap.ch)\n";#include "general.h"#include "RotationMatrix2D.h"#include "Affine2D.h"#include "CmdLine.h"using namespace Torch;int main(int argc, char **argv){ 	real x, y; 	real xc, yc;	real angle;	bool verbose;	// Construct the command line  	CmdLine cmd;	cmd.setBOption("write log", false);	  	// Put the help line at the beginning  	cmd.info(help);  	cmd.addText("\nArguments:");  	cmd.addRCmdArg("x", &x, "x");  	cmd.addRCmdArg("y", &y, "y");  	cmd.addRCmdArg("xc", &xc, "xc");  	cmd.addRCmdArg("yc", &yc, "yc");  	cmd.addRCmdArg("angle", &angle, "ccw angle in degree");  	cmd.addText("\nOptions:");  	cmd.addBCmdOption("-verbose", &verbose, false, "verbose");	cmd.read(argc, argv);	//	RotationMatrix2D r(angle);	print("rotation matrix = %s\n", r.sprint());	//	Vector2D v(xc, yc);	print("translation vector = %s\n", v.sprint());	//	Affine2D affine(r, v);	//	Vector2D X(x, y);	print("X = %s\n", X.sprint());	Vector2D X_(0, 0);	//	X_ = affine * X;	print("X' = %s\n", X_.sprint());	//	Vector2D w(xc, xc);	print("translation vector = %s\n", w.sprint());	//	X_ = X_ + w;	print("X' + w = %s\n", X_.sprint());	//	RotationMatrix2D r_1(-angle);	print("rotation matrix inverse = %s\n", r_1.sprint());		//	Affine2D affine_1(r_1, w);	print("X' + w = %s\n", X_.sprint());		Vector2D X_1(0, 0);	X_1 = affine_1 * X_;	print("X_1 = %s\n", X_1.sprint());	X_1 += v;	print("X-1 + v = %s == %s\n", X_1.sprint(), X.sprint());}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -