本文整理汇总了C++中Transporter::setSource方法的典型用法代码示例。如果您正苦于以下问题:C++ Transporter::setSource方法的具体用法?C++ Transporter::setSource怎么用?C++ Transporter::setSource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transporter
的用法示例。
在下文中一共展示了Transporter::setSource方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char ** argv){
//VideoSource vs(false, "./Various.avi");
VideoSource vs(true, "");
vs.enableDisplayWindow();
SupportedImageWidths siw = W512;
// Left to Right is bottom layer to top
//uint centroid_counts[] = {3,3,4,3,3,3,3,5};
uint centroid_counts[] = {4,3,5,3,3,2,3,4};
bool isUniform = true;
DestinNetworkAlt * network = new DestinNetworkAlt(siw, 8, centroid_counts, isUniform);
Transporter t;
vs.grab();//throw away first frame in case its garbage
int frameCount = 0;
while(vs.grab()){
frameCount++;
t.setSource(vs.getOutput());
t.transport(); //move video from host to card
testNan(t.getDest(), 512*512);
network->doDestin(t.getDest());
if(frameCount % 2 != 0 ){ //only print every 2rd so display is not so jumpy
printFPS(false);
continue;
}
// Old clear screen method
//printf("\033[2J");
// New clear screen method (might give less flickering...?)
printf("\033[2J\033[1;1H");
printf("Frame: %i\n", frameCount);
printFPS(true);
int layer = 1;
Node & n = *network->getNode(layer,0,0);
printf("Node %i,0,0 winner: %i\n",layer, n.winner);
printf("Node centroids: %i\n", n.nb);
printf("Node starv:");
printFloatArray(n.starv, n.nb);
printf("Starv coef: %f \n", n.starvCoeff);
printf("\n");
// 2013.4.5
// CZT
//
//printf("layer %i node 0 centroid locations:\n", layer);
//network->printNodeCentroidPositions(layer, 0, 0);
for(int l = 0 ; l < 8 ; l++){
printf("belief graph layer: %i\n",l);
network->printBeliefGraph(l,0,0);
}
}
delete network;
return 0;
}