本文整理汇总了C++中AffineTransform::computeTransform方法的典型用法代码示例。如果您正苦于以下问题:C++ AffineTransform::computeTransform方法的具体用法?C++ AffineTransform::computeTransform怎么用?C++ AffineTransform::computeTransform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AffineTransform
的用法示例。
在下文中一共展示了AffineTransform::computeTransform方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: submain
// ######################################################################
static int submain(const int argc, char** argv)
{
MYLOGVERB = LOG_INFO; // suppress debug messages
// Instantiate a ModelManager:
ModelManager manager("test get eye position");
nub::soft_ref<EyeTrackerConfigurator>
etc(new EyeTrackerConfigurator(manager));
manager.addSubComponent(etc);
nub::soft_ref<EventLog> el(new EventLog(manager));
manager.addSubComponent(el);
nub::soft_ref<PsychoDisplay> d(new PsychoDisplay(manager));
manager.addSubComponent(d);
manager.setOptionValString(&OPT_EventLogFileName, "psychodata.psy");
manager.setOptionValString(&OPT_EyeTrackerType, "ISCAN");
// Parse command-line:
if (manager.parseCommandLine(argc, argv, "", 0, 0) == false)
return(1);
// hook our various babies up and do post-command-line configs:
nub::soft_ref<EyeTracker> et = etc->getET();
et->setEventLog(el);
// let's get all our ModelComponent instances started:
manager.start();
d->setEyeTracker(et);
d->setEventLog(el);
el->pushEvent(std::string("===== Trial 1: ====="));
//lets time stamp event log and start the eyetracker
//et->track(true);
//here we will start testing the get pos
LINFO("eyescanner started going to start reading stuff");
// int i=0;
d->clearScreen();
d->displayISCANcalib();
d->waitForKey();
Image< PixRGB<byte> > displayImage (1920,1080, ZEROS);
drawCircle(displayImage, Point2D<int>(1920/2,1080/2), 5, PixRGB<byte>(255,0,0));
SDL_Surface *surf = d->makeBlittableSurface(displayImage, true);
d->displaySurface(surf, -2);
CalibrationTransform::Data pts;
AffineTransform a;
Image<double> txf;
Point2D<int> testpoint;
Point2D<double> testpointCalib,testpointD;
LINFO("precalib");
pts = et->getCalibrationSet(d);
LINFO("postcalib");
txf = a.computeTransform(pts);
LINFO("transform is...");
std::cerr << txf << std::endl;
testpoint = et->getEyePos();
testpointD = Point2D<double>(testpoint);
LINFO("\n testpoint %d,%d",testpoint.i,testpoint.j);
testpointCalib = a.getCalibrated(testpointD);
LINFO("\n testpoint %d,%d, calibrated %f,%f",testpoint.i,testpoint.j,testpointCalib.i,testpointCalib.j);
d->clearScreen();
//now for a live demo of real time eyetracking
char tmp[40];
//SDL_Surface *surf2;
while(d->checkForKey() < 0)
{
displayImage.clear();
testpoint = et->getEyePos();
testpointD = Point2D<double>(testpoint);
testpointCalib = a.getCalibrated(testpointD);
LINFO("\n testpoint %d,%d, calibrated %f,%f",testpoint.i,testpoint.j,testpointCalib.i,testpointCalib.j);
drawCircle(displayImage, Point2D<int>(testpointCalib), 2, PixRGB<byte>(255,0,0));
sprintf(tmp,"(%d,%d)",(int)testpointCalib.i,(int)testpointCalib.j);
writeText(displayImage,Point2D<int>(testpointCalib),tmp,PixRGB<byte>(255,0,0),PixRGB<byte>(0,0,0),SimpleFont::FIXED(8));
// d->displayImage(displayImage, true, PixRGB<byte>(), -2);
SDL_Surface *surf2 = d->makeBlittableSurface(displayImage, true);
d->displaySurface(surf2, -2);
SDL_FreeSurface(surf2);
// i++;
}
//.........这里部分代码省略.........