Definition at line 656 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(). 00657 { 00658 ILOG_VAR(Impala.Application.Im.DoColorSegmentation); 00659 CmdOptions& options = CmdOptions::GetInstance(); 00660 if (options.GetNrArg() < 3) 00661 { 00662 ILOG_ERROR("Need more arguments"); 00663 return; 00664 } 00665 Util::Database* db = &Util::Database::GetInstance(); 00666 00667 String dstName = options.GetArg(1); 00668 String srcName = options.GetArg(2); 00669 double minRegionFraction = 0.01; 00670 if (options.GetNrArg() >= 4) 00671 minRegionFraction = atof(options.GetArg(3)); 00672 double threshold = 6.0; 00673 if (options.GetNrArg() >= 5) 00674 threshold = atof(options.GetArg(4)); 00675 ILOG_INFO("minRegionFraction = " << minRegionFraction 00676 << ", threshold = " << threshold); 00677 00678 ColorSegmentationAlgorithm segAlg = TextureAddZero; 00679 ColorSegmentationInvariant invariantType = C; 00680 00681 Array2dVec3UInt8* srcIm = 0; 00682 ReadFile(srcIm, srcName, db); 00683 Array2dVec3Real64* srcV3R64 = 00684 ArrayCreate<Array2dVec3Real64>(srcIm->CW(), srcIm->CH(), 15, 15); 00685 //MakeFromData2<Array2dVec3Real64,Array2dVec3UInt8>(srcV3R64, 00686 // srcIm->DataPtr()); 00687 Set(srcV3R64, srcIm); 00688 Array2dVec3UInt8* dst = 0; 00689 ColorSegmentation(dst, srcV3R64, segAlg, invariantType, minRegionFraction, 00690 threshold, false, 0); 00691 WritePng(dst, dstName, db); 00692 delete dst; 00693 delete srcV3R64; 00694 delete srcIm; 00695 }
Here is the call graph for this function:
|