Implements Impala::Visualization::AppControlSrc. Definition at line 79 of file mainBackground.cpp. References Impala::Core::Array::Abs(), Impala::Core::Array::Add(), Impala::Core::Array::ArraySystem::CheckMemoryUsageSinceMark(), Impala::Core::Stream::RgbDataSrc::DataPtr(), Impala::Core::Stream::RgbDataSrc::FrameHeight(), Impala::Core::Stream::RgbDataSrc::FrameWidth(), Impala::Visualization::AppControlSrc::GetSrc(), Impala::Core::Array::GreaterThan(), Impala::Core::Array::ArraySystem::Instance(), Impala::Core::Array::ArraySystem::MarkMemoryUsage(), Impala::Core::Array::MaximumVal(), mBackground, mBorderSize, mCountdown, mMinimumThres, mSigma, mStat, Impala::Core::Array::Mul(), Impala::Core::Array::MulVal(), mViewScale, Impala::Core::Array::ProjectRange(), Impala::Core::Array::RecGauss(), Impala::Core::Array::Rgb2Ooo(), Impala::Core::Array::Set(), and Impala::Core::Array::Sub(). 00080 { 00081 int view = 0; 00082 bool startBackground = ! mStat.IsDoingStat(); 00083 if (!startBackground) 00084 UpdateView(view++, GetSrc()->DataPtr(), GetSrc()->FrameWidth(), 00085 GetSrc()->FrameHeight(), mViewScale); 00086 00087 ArraySystem& aSys = ArraySystem::Instance(); 00088 aSys.MarkMemoryUsage(false); 00089 00090 Array2dVec3UInt8* srcWrap = ArrayCreate<Array2dVec3UInt8> 00091 (GetSrc()->FrameWidth(), GetSrc()->FrameHeight(), 0, 0, 00092 GetSrc()->DataPtr(), true); 00093 Array2dVec3Real64* srcV3R64 = ArrayCreate<Array2dVec3Real64> 00094 (GetSrc()->FrameWidth(), GetSrc()->FrameHeight(), mBorderSize, 00095 mBorderSize); 00096 00097 mCountdown--; 00098 if (mCountdown == 0) 00099 Set(mBackground, srcWrap); 00100 00101 Array2dScalarReal64* lum = 0; 00102 Array2dScalarReal64* col = 0; 00103 Array2dScalarReal64* tmp = 0; 00104 00105 // RGB 00106 //MakeFromData2<Array2dVec3Real64,Array2dVec3UInt8>(srcV3R64, 00107 // GetSrc()->DataPtr()); 00108 //RGB2Intensity(lum, srcV3R64); 00109 00110 // Lab 00111 //ColorSpace(srcV3R64, srcV3R64, RGB, Lab); 00112 //ProjectRange(lum, srcV3R64, 1); 00113 00114 // OOO 00115 Rgb2Ooo(srcV3R64, srcWrap); 00116 ProjectRange(lum, srcV3R64, 1); 00117 ProjectRange(col, srcV3R64, 2); 00118 ProjectRange(tmp, srcV3R64, 3); 00119 Add(col, col, tmp); 00120 00121 RecGauss(lum, lum, mSigma, mSigma, 0, 0, 3); 00122 RecGauss(col, col, mSigma, mSigma, 0, 0, 3); 00123 00124 //UpdateView(view++, lum, "Direct", mViewScale); 00125 00126 Array2dScalarReal64* crit = col; 00127 mStat.DoArray(crit); 00128 00129 Array2dScalarReal64* diff = 0; 00130 Sub(diff, mStat.GetMean(), crit); 00131 Abs(diff, diff); 00132 //UpdateView(view++, diff, "Stretch", mViewScale); 00133 00134 Array2dScalarUInt8* binIm = 0; 00135 Array2dScalarReal64* thr = 0; 00136 MulVal(thr, mStat.GetStDev(), 3.0); 00137 MaximumVal(thr, thr, mMinimumThres); 00138 GreaterThan(binIm, diff, thr); 00139 //UpdateView(view++, binIm, "Binary", mViewScale); 00140 00141 /* 00142 Array2dScalarReal64* ker = ArrayCreate<Array2dScalarReal64>(9, 9); 00143 Matrix::MatSet(ker, 0); 00144 Array2dScalarUInt8* binImClosed = 0; 00145 Dilation(binImClosed, binIm, ker); 00146 delete ker; 00147 UpdateView(view++, binImClosed, "Binary", mViewScale); 00148 */ 00149 00150 //UpdateView(view++, mStat.GetMinimum(), "Stretch", mViewScale); 00151 //UpdateView(view++, mStat.GetMaximum(), "Stretch", mViewScale); 00152 //UpdateView(view++, mStat.GetMean(), "Direct", mViewScale); 00153 //UpdateView(view++, mStat.GetStDev(), "Stretch", mViewScale); 00154 00155 if (startBackground) 00156 { 00157 Array2dVec3UInt8* theBack = 0; 00158 Mul(theBack, mBackground, binIm); 00159 UpdateView(view++, theBack, "Direct", mViewScale); 00160 delete theBack; 00161 } 00162 00163 delete diff; 00164 delete thr; 00165 delete binIm; 00166 //delete binImClosed; 00167 delete lum; 00168 delete col; 00169 delete tmp; 00170 delete srcV3R64; 00171 aSys.CheckMemoryUsageSinceMark(false); 00172 }
Here is the call graph for this function:
|