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

void Impala::Application::Im::DoColorSegmentation (  ) 

Definition at line 704 of file mainIm.cpp.

References Impala::atof(), Impala::Core::Array::C, Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::CH(), Impala::Core::Array::ColorSegmentation(), Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::CW(), Impala::CmdOptions::GetArg(), Impala::Util::Database::GetInstance(), Impala::CmdOptions::GetInstance(), Impala::CmdOptions::GetNrArg(), ILOG_ERROR, ILOG_INFO, ILOG_VAR, Impala::Core::Array::ReadFile(), Impala::Core::Array::Set(), Impala::Core::Array::TextureAddZero, and Impala::Core::Array::WritePng().

Referenced by mainIm().

00705 {
00706     ILOG_VAR(Impala.Application.Im.DoColorSegmentation);
00707     CmdOptions& options = CmdOptions::GetInstance();
00708     if (options.GetNrArg() < 3)
00709     {
00710         ILOG_ERROR("Need more arguments");
00711         return;
00712     }
00713     Util::Database* db = &Util::Database::GetInstance();
00714 
00715     String dstName = options.GetArg(1);
00716     String srcName = options.GetArg(2);
00717     double minRegionFraction = 0.01;
00718     if (options.GetNrArg() >= 4)
00719         minRegionFraction = atof(options.GetArg(3));
00720     double threshold = 6.0;
00721     if (options.GetNrArg() >= 5)
00722         threshold = atof(options.GetArg(4));
00723     ILOG_INFO("minRegionFraction = " << minRegionFraction
00724               << ", threshold = " << threshold);
00725 
00726     ColorSegmentationAlgorithm segAlg = TextureAddZero;
00727     ColorSegmentationInvariant invariantType = C;
00728 
00729     Array2dVec3UInt8* srcIm = 0;
00730     ReadFile(srcIm, srcName, db);
00731     Array2dVec3Real64* srcV3R64 =
00732         ArrayCreate<Array2dVec3Real64>(srcIm->CW(), srcIm->CH(), 15, 15);
00733     //MakeFromData2<Array2dVec3Real64,Array2dVec3UInt8>(srcV3R64,
00734     //                                                  srcIm->DataPtr());
00735     Set(srcV3R64, srcIm);
00736     Array2dVec3UInt8* dst = 0;
00737     ColorSegmentation(dst, srcV3R64, segAlg, invariantType, minRegionFraction,
00738                       threshold, false, 0);
00739     WritePng(dst, dstName, db);
00740     delete dst;
00741     delete srcV3R64;
00742     delete srcIm;
00743 }

Here is the call graph for this function:


Generated on Thu Jan 13 09:15:12 2011 for ImpalaSrc by  doxygen 1.5.1