Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

int Impala::Application::Src::mainSrc ( int  argc,
char *  argv[] 
)

Definition at line 610 of file mainSrc.cpp.

References Impala::Core::Stream::RgbDataSrcFactory::Construct(), Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::CW(), Impala::Core::Stream::RgbDataSrc::FrameHeight(), Impala::Core::Stream::RgbDataSrc::FrameWidth(), gBorderSize, gCmd, gDispMode(), Impala::CmdOptions::GetArg(), Impala::CmdOptions::GetBool(), Impala::CmdOptions::GetDouble(), Impala::CmdOptions::GetInstance(), Impala::CmdOptions::GetInt(), Impala::CmdOptions::GetString(), gLogScale, gPrecision, gSigma, gSigmaA, gUseRecGauss, gVerbose, Impala::CmdOptions::Initialise(), Impala::Core::Stream::RgbDataSrcFactory::Instance(), Impala::Core::Stream::RgbDataSrc::LastFrame(), Impala::Core::Array::MakeGaussian1d(), Impala::Core::Array::MakeGaussIIR1d(), Impala::Max(), Impala::Application::DemoCamera2d::oglWnd, Impala::CmdOptions::ParseArgs(), OglGui::OglWindow::Valid(), and Impala::Core::Stream::RgbDataSrc::Valid().

Referenced by main().

00611 {
00612     OglInit(&argc, &argv[0]);
00613     CmdOptions& options = CmdOptions::GetInstance();
00614     options.Initialise(true, true);
00615     String usageStr = "cmd camera|filename\n\n";
00616     usageStr += "  cmd = stretch|pgm|png|jpg|rotate|skiz|geodesic|watershed|\n";
00617     usageStr += "        label|threshold|dilation|erosion|write|inv|segment|\n";
00618     usageStr += "        tgauss|keypoints\n";
00619     if (! options.ParseArgs(argc, argv, usageStr, 2))
00620         return 1;
00621 
00622     gCmd = options.GetArg(0);
00623     String srcName = options.GetArg(1);
00624 
00625     gVerbose = options.GetInt("verb");
00626     gSigma = options.GetDouble("sigma");
00627     gPrecision = options.GetDouble("precision");
00628     gUseRecGauss = options.GetBool("recGauss");
00629     gDispMode = options.GetString("disp");
00630     gLogScale = options.GetDouble("logScale");
00631 
00632     Array2dScalarReal64* g = 0;
00633     if (gUseRecGauss)
00634         g = MakeGaussIIR1d(Max(gSigma,gSigmaA), 1, gPrecision);
00635     else
00636         g = MakeGaussian1d(Max(gSigma,gSigmaA), 1, gPrecision, 100);
00637     int gw = g->CW();
00638     if (gw > gBorderSize)
00639     {
00640         std::cout << "Adjusting bordersize to " << gw << std::endl;
00641         gBorderSize = gw;
00642     }
00643     delete g;
00644 
00645     RgbDataSrcFactory& factory = RgbDataSrcFactory::Instance();
00646     RgbDataSrc* src = factory.Construct(srcName, options.GetString("src"));
00647     if (! src->Valid())
00648     {
00649         std::cout << "RgbDataSrc failed" << std::endl;
00650         return 0;
00651     }
00652     std::cout << src->LastFrame()+1 << " frames of " << src->FrameWidth() 
00653             << " x " << src->FrameHeight() << std::endl;
00654 
00655     WindowSrc* oglWnd = new WindowSrc(src);
00656     if (! oglWnd->Valid())
00657     {
00658         std::cout << "WindowSrc failed" << std::endl;
00659         return 0;
00660     }
00661 
00662     return 1;
00663 }

Here is the call graph for this function:


Generated on Fri Mar 19 10:50:38 2010 for ImpalaSrc by  doxygen 1.5.1