📄 oneblob.cc
字号:
const char *help = "\progname: oneblob.cc\n\code2html: This program computes features (x and y coordinates, excentricity, angle and surface) from an image using a colorcube.\n\version: Torch3 vision2.0, 2004-2005\n\(c) Agnes Just and Sebastien Marcel (marcel@idiap.ch)\n";#include "xtprobeImageDiskXFile.h"#include "ImageRgb.h"#include "ipOneBlob.h"#include "CmdLine.h"using namespace Torch;int main(int argc, char *argv[]){ char *image_filename; char *colorcube_filename; CmdLine cmd; cmd.setBOption("write log", false); cmd.info(help); cmd.addText("\nArguments:"); cmd.addSCmdArg("image", &image_filename, "image filename"); cmd.addSCmdArg("colorcube", &colorcube_filename, "colorcube filename"); cmd.read(argc, argv); Allocator *allocator = new Allocator; Image *image = new(allocator) ImageRgb(); ImageDiskXFile *image_loader = new(allocator) xtprobeImageDiskXFile(image_filename, "r"); image->loadImageXFile(image_loader); allocator->free(image_loader); ipCore *ipblob = new(allocator) ipOneBlob(image->width, image->height, colorcube_filename, "rgb"); ipblob->process(image); real *output = ipblob->getOutput(0); print("x mean = %g\n", output[0]); print("y mean = %g\n", output[1]); print("excentricity = %g\n", output[2]); print("angle = %g\n", output[3]); print("surface = %g\n", output[4]); delete allocator; return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -