26 #include <Base/Image/ImageConvert.hh>
36 template <
class InputStorageType,
class OutputStorageType>
39 :
Convolution<InputStorageType, OutputStorageType>()
48 template <
class InputStorageType,
class OutputStorageType>
51 : _GaussSigma(other._GaussSigma),
52 _GaussRatio(other._GaussRatio),
53 _LastSigma(other._LastSigma),
54 _LastRatio(other._LastRatio)
62 template <
class StorageType,
class KernelType>
65 if (_GaussIO!=NULL)
delete _GaussIO;
66 if (_GaussOO!=NULL)
delete _GaussOO;
70 void DecreaseROI(
const ROI& RoiIn,
ROI& RoiOut,
72 unsigned minx, miny, maxx, maxy;
79 if (minx>maxx) minx = maxx = (minx+maxx)/2;
80 if (miny>maxy) miny = maxy = (miny+maxy)/2;
87 template <
class InputStorageType,
class OutputStorageType>
91 BIASCDOUT(D_FILTERBASE_CALLSTACK,
"Gauss::Filter\n");
92 if ((_GaussSigma != _LastSigma)||(_GaussRatio != _LastRatio))
93 _CalculateKernels(_GaussSigma, _GaussRatio);
98 if ((src.
GetChannelCount()==1) && (this->GetBorderHandling() == TBH_valid))
99 return FilterGrey(src, dst);
103 template <
class InputStorageType,
class OutputStorageType>
107 BIASCDOUT(D_FILTERBASE_CALLSTACK,
"Gauss::Filter\n");
108 if ((_GaussSigma != _LastSigma)||(_GaussRatio != _LastRatio))
109 _CalculateKernels(_GaussSigma, _GaussRatio);
113 template <
class InputStorageType,
class OutputStorageType>
117 BIASCDOUT(D_FILTERBASE_CALLSTACK,
"Gauss::Filter\n");
118 if ((_GaussSigma != _LastSigma)||(_GaussRatio != _LastRatio))
119 _CalculateKernels(_GaussSigma, _GaussRatio);
124 template <
class InputStorageType,
class OutputStorageType>
136 double smoothsigma = _GaussSigma;
142 const double sqrtlogratio = 1.0 / sqrt(-2.0 * log(_GaussRatio));
143 const double maxsigma3x3 = sqrtlogratio;
144 const double maxsigma5x5 = 2.0 * sqrtlogratio;
145 const double maxsigma7x7 = 3.0 * sqrtlogratio;
146 const double maxsigma9x9 = 4.0 * sqrtlogratio;
147 const double maxsigma11x11 = 5.0 * sqrtlogratio;
148 const double maxsigma13x13 = 6.0 * sqrtlogratio;
149 const double maxsigmaperpass = maxsigma13x13;
152 int MultiPass = (int)rint(smoothsigma * smoothsigma /
153 (maxsigmaperpass*maxsigmaperpass));
156 smoothsigma /= sqrtf(
float(MultiPass));
157 BIASDOUT(D_GAUSS_FAST_GREY,
"MultiPass="<<MultiPass);
159 BIASDOUT(D_GAUSS_FAST_GREY,
"Single pass is sufficient.");
161 _GaussIO->SetSigma(smoothsigma);
162 _GaussIO->SetRatio(_GaussRatio);
163 _GaussOO->SetSigma(smoothsigma);
164 _GaussOO->SetRatio(_GaussRatio);
165 if (_GaussSigma<maxsigma3x3) {
166 BIASDOUT(D_GAUSS_FAST_GREY,
"Run 3x3");
167 _GaussIO->Filter3x3Grey(src, dst);
168 }
else if (_GaussSigma<maxsigma5x5) {
169 BIASDOUT(D_GAUSS_FAST_GREY,
"Run 5x5");
170 _GaussIO->Filter5x5Grey(src, dst);
171 }
else if (_GaussSigma<maxsigma7x7) {
172 BIASDOUT(D_GAUSS_FAST_GREY,
"Run 7x7");
173 _GaussIO->Filter7x7Grey(src,dst);
174 }
else if (_GaussSigma<maxsigma9x9){
175 BIASDOUT(D_GAUSS_FAST_GREY,
"Run 9x9");
176 _GaussIO->Filter9x9Grey(src, dst);
177 }
else if (_GaussSigma<maxsigma11x11){
178 BIASDOUT(D_GAUSS_FAST_GREY,
"Run 11x11");
179 _GaussIO->Filter11x11Grey(src, dst);
181 BIASDOUT(D_GAUSS_FAST_GREY,
"Run 13x13");
182 _GaussIO->Filter13x13Grey(src, dst);
184 while (MultiPass-->1) {
186 if (_GaussSigma<maxsigma3x3) {
187 BIASDOUT(D_GAUSS_FAST_GREY,
"MultiPass: Run 3x3");
188 _GaussOO->Filter3x3Grey(dst, dst);
189 }
else if (_GaussSigma<maxsigma5x5) {
190 BIASDOUT(D_GAUSS_FAST_GREY,
"MultiPass: Run 5x5");
191 _GaussOO->Filter5x5Grey(dst, dst);
192 }
else if (_GaussSigma<maxsigma7x7) {
193 BIASDOUT(D_GAUSS_FAST_GREY,
"MultiPass: Run 7x7");
194 _GaussOO->Filter7x7Grey(dst, dst);
195 }
else if (_GaussSigma<maxsigma9x9) {
196 BIASDOUT(D_GAUSS_FAST_GREY,
"MultiPass: Run 9x9");
197 _GaussOO->Filter9x9Grey(dst, dst);
198 }
else if (_GaussSigma<maxsigma11x11){
199 BIASDOUT(D_GAUSS_FAST_GREY,
"MultiPass: Run 11x11");
200 _GaussOO->Filter11x11Grey(dst, dst);
202 BIASDOUT(D_GAUSS_FAST_GREY,
"MultiPass: Run 13x13");
203 _GaussOO->Filter13x13Grey(dst, dst);
210 template <
class InputStorageType,
class OutputStorageType>
215 BIASCDOUT(D_FILTERBASE_CALLSTACK,
"Gauss::Filter3x3\n");
216 SetHalfWinSize(1,
false);
217 if ((_GaussSigma != _LastSigma)||(_GaussRatio != _LastRatio))
218 _CalculateKernels(_GaussSigma, _GaussRatio);
220 const FM_FLOAT h0 = (
const FM_FLOAT)((*_fm.GetSepfh())[1]);
221 const FM_FLOAT h1 = (
const FM_FLOAT)((*_fm.GetSepfh())[0]);
222 const FM_FLOAT v0 = (
const FM_FLOAT)((*_fm.GetSepfv())[1]);
223 const FM_FLOAT v1 = (
const FM_FLOAT)((*_fm.GetSepfv())[0]);
227 BIASERR(
"image with multiple channels. stopping.");
235 if(!_tmpFloat.SamePixelAndChannelCount(src)) {
236 if (!_tmpFloat.IsEmpty()) _tmpFloat.Release();
243 CONV_FLOAT* pD = _tmpFloat.GetImageData();
245 *pD++ = CONV_FLOAT(*pS);
247 const InputStorageType* pEndH = src.
GetImageData() + width*height-1;
249 if(pS[0] <= threshold ||
250 pS[-1] <= threshold ||
252 *pD++ = CONV_FLOAT(pS[0]);
254 *pD++ = CONV_FLOAT(h0*pS[0]+h1*(pS[-1]+pS[1]));
257 *pD = CONV_FLOAT(*pS);
260 const CONV_FLOAT* pEndV = _tmpFloat.GetImageData() + width*(height-1);
261 CONV_FLOAT* pI = _tmpFloat.GetImageData();
263 const CONV_FLOAT* pEndFirst2 = _tmpFloat.GetImageData() + width;
264 const CONV_FLOAT* pEndLast2 = _tmpFloat.GetImageData() + width*height;
266 while (pI<pEndFirst2) *pO++ = OutputStorageType(*pI++);
270 if(pI[0] <= threshold ||
271 pI[width] <= threshold ||
272 pI[-width] <= threshold) {
273 *pO++ = OutputStorageType(pI[0]);
275 *pO++ = OutputStorageType(v0*pI[0] + v1*(pI[-width]+pI[width]));
278 while (pI<pEndLast2) *pO++ = OutputStorageType(*pI++);
287 template <
class InputStorageType,
class OutputStorageType>
291 BIASCDOUT(D_FILTERBASE_CALLSTACK,
"Gauss::Filter3x3\n");
292 SetHalfWinSize(1,
false);
293 if ((_GaussSigma != _LastSigma)||(_GaussRatio != _LastRatio))
294 _CalculateKernels(_GaussSigma, _GaussRatio);
296 const FM_FLOAT h0 = (
const FM_FLOAT)((*_fm.GetSepfh())[1]);
297 const FM_FLOAT h1 = (
const FM_FLOAT)((*_fm.GetSepfh())[0]);
298 const FM_FLOAT v0 = (
const FM_FLOAT)((*_fm.GetSepfv())[1]);
299 const FM_FLOAT v1 = (
const FM_FLOAT)((*_fm.GetSepfv())[0]);
303 BIASERR(
"image with multiple channels. stopping.");
311 if(!_tmpFloat.SamePixelAndChannelCount(src)) {
312 if (!_tmpFloat.IsEmpty()) _tmpFloat.Release();
319 CONV_FLOAT* pD = _tmpFloat.GetImageData();
321 *pD++ = CONV_FLOAT(*pS);
323 const InputStorageType* pEndH = src.
GetImageData() + width*height-1;
325 *pD++ = CONV_FLOAT(h0*pS[0]+h1*(pS[-1]+pS[1]));
328 *pD = CONV_FLOAT(*pS);
331 const CONV_FLOAT* pEndV = _tmpFloat.GetImageData() + width*(height-1);
332 CONV_FLOAT* pI = _tmpFloat.GetImageData();
334 const CONV_FLOAT* pEndFirst2 = _tmpFloat.GetImageData() + width;
335 const CONV_FLOAT* pEndLast2 = _tmpFloat.GetImageData() + width*height;
337 while (pI<pEndFirst2) *pO++ = OutputStorageType(*pI++);
341 *pO++ = OutputStorageType(v0*pI[0] + v1*(pI[-width]+pI[width]));
344 while (pI<pEndLast2) *pO++ = OutputStorageType(*pI++);
353 template <
class InputStorageType,
class OutputStorageType>
358 BIASCDOUT(D_FILTERBASE_CALLSTACK,
"Gauss::Filter5x5\n");
359 SetHalfWinSize(2,
false);
360 if ((_GaussSigma != _LastSigma)||(_GaussRatio != _LastRatio))
361 _CalculateKernels(_GaussSigma, _GaussRatio);
363 const FM_FLOAT h0 = (
const FM_FLOAT)((*_fm.GetSepfh())[2]);
364 const FM_FLOAT h1 = (
const FM_FLOAT)((*_fm.GetSepfh())[1]);
365 const FM_FLOAT h2 = (
const FM_FLOAT)((*_fm.GetSepfh())[0]);
366 const FM_FLOAT v0 = (
const FM_FLOAT)((*_fm.GetSepfv())[2]);
367 const FM_FLOAT v1 = (
const FM_FLOAT)((*_fm.GetSepfv())[1]);
368 const FM_FLOAT v2 = (
const FM_FLOAT)((*_fm.GetSepfv())[0]);
373 BIASERR(
"image with multiple channels. stopping.");
381 if(!_tmpFloat.SamePixelAndChannelCount(src)) {
382 if (!_tmpFloat.IsEmpty()) _tmpFloat.Release();
389 CONV_FLOAT* pD = _tmpFloat.GetImageData();
391 *pD++ = CONV_FLOAT(*pS++);
392 *pD++ = CONV_FLOAT(*pS);
394 const int width2 = 2*width;
395 const InputStorageType* pEndH = src.
GetImageData() + width*height-2;
397 if(pS[0] <= threshold ||
398 pS[-1] <= threshold ||
399 pS[1] <= threshold ||
400 pS[-2] <= threshold ||
402 *pD++ = CONV_FLOAT(pS[0]);
404 *pD++ = CONV_FLOAT(h0*pS[0]+h1*(pS[-1]+pS[1])+h2*(pS[-2]+pS[2]));
407 *pD++ = CONV_FLOAT(*pS++);
408 *pD = CONV_FLOAT(*pS);
411 const CONV_FLOAT* pEndV = _tmpFloat.GetImageData() + width*(height-2);
412 CONV_FLOAT* pI = _tmpFloat.GetImageData();
414 const CONV_FLOAT* pEndFirst2 = _tmpFloat.GetImageData() + 2*width;
415 const CONV_FLOAT* pEndLast2 = _tmpFloat.GetImageData() + width*height;
417 while (pI<pEndFirst2) *pO++ = OutputStorageType(*pI++);
421 if(pI[0] <= threshold ||
422 pI[width] <= threshold ||
423 pI[-width] <= threshold ||
424 pI[width2] <= threshold ||
425 pI[-width2] <= threshold )
426 *pO++ = OutputStorageType(pI[0]);
428 *pO++ = OutputStorageType(v0*pI[0] + v1*(pI[-width]+pI[width])
429 + v2*(pI[-width2]+pI[width2]));
433 while (pI<pEndLast2) *pO++ = OutputStorageType(*pI++);
441 template <
class InputStorageType,
class OutputStorageType>
445 BIASCDOUT(D_FILTERBASE_CALLSTACK,
"Gauss::Filter5x5\n");
446 SetHalfWinSize(2,
false);
447 if ((_GaussSigma != _LastSigma)||(_GaussRatio != _LastRatio))
448 _CalculateKernels(_GaussSigma, _GaussRatio);
450 const FM_FLOAT h0 = (
const FM_FLOAT)((*_fm.GetSepfh())[2]);
451 const FM_FLOAT h1 = (
const FM_FLOAT)((*_fm.GetSepfh())[1]);
452 const FM_FLOAT h2 = (
const FM_FLOAT)((*_fm.GetSepfh())[0]);
453 const FM_FLOAT v0 = (
const FM_FLOAT)((*_fm.GetSepfv())[2]);
454 const FM_FLOAT v1 = (
const FM_FLOAT)((*_fm.GetSepfv())[1]);
455 const FM_FLOAT v2 = (
const FM_FLOAT)((*_fm.GetSepfv())[0]);
460 BIASERR(
"image with multiple channels. stopping.");
468 if(!_tmpFloat.SamePixelAndChannelCount(src)) {
469 if (!_tmpFloat.IsEmpty()) _tmpFloat.Release();
476 CONV_FLOAT* pD = _tmpFloat.GetImageData();
478 *pD++ = CONV_FLOAT(*pS++);
479 *pD++ = CONV_FLOAT(*pS);
481 const int width2 = 2*width;
482 const InputStorageType* pEndH = src.
GetImageData() + width*height-2;
484 *pD++ = CONV_FLOAT(h0*pS[0]+h1*(pS[-1]+pS[1])+h2*(pS[-2]+pS[2]));
487 *pD++ = CONV_FLOAT(*pS++);
488 *pD = CONV_FLOAT(*pS);
491 const CONV_FLOAT* pEndV = _tmpFloat.GetImageData() + width*(height-2);
492 CONV_FLOAT* pI = _tmpFloat.GetImageData();
494 const CONV_FLOAT* pEndFirst2 = _tmpFloat.GetImageData() + 2*width;
495 const CONV_FLOAT* pEndLast2 = _tmpFloat.GetImageData() + width*height;
497 while (pI<pEndFirst2) *pO++ = OutputStorageType(*pI++);
501 *pO++ = OutputStorageType(v0*pI[0] + v1*(pI[-width]+pI[width])
502 + v2*(pI[-width2]+pI[width2]));
506 while (pI<pEndLast2) *pO++ = OutputStorageType(*pI++);
514 template <
class InputStorageType,
class OutputStorageType>
519 BIASCDOUT(D_FILTERBASE_CALLSTACK,
"Gauss::Filter7x7\n");
520 SetHalfWinSize(3,
false);
521 if ((_GaussSigma != _LastSigma)||(_GaussRatio != _LastRatio))
522 _CalculateKernels(_GaussSigma, _GaussRatio);
524 const FM_FLOAT h0 = (
const FM_FLOAT)((*_fm.GetSepfh())[3]);
525 const FM_FLOAT h1 = (
const FM_FLOAT)((*_fm.GetSepfh())[2]);
526 const FM_FLOAT h2 = (
const FM_FLOAT)((*_fm.GetSepfh())[1]);
527 const FM_FLOAT h3 = (
const FM_FLOAT)((*_fm.GetSepfh())[0]);
528 const FM_FLOAT v0 = (
const FM_FLOAT)((*_fm.GetSepfv())[3]);
529 const FM_FLOAT v1 = (
const FM_FLOAT)((*_fm.GetSepfv())[2]);
530 const FM_FLOAT v2 = (
const FM_FLOAT)((*_fm.GetSepfv())[1]);
531 const FM_FLOAT v3 = (
const FM_FLOAT)((*_fm.GetSepfv())[0]);
535 BIASERR(
"image with multiple channels. stopping.");
543 if(!_tmpFloat.SamePixelAndChannelCount(src)) {
544 if (!_tmpFloat.IsEmpty()) _tmpFloat.Release();
551 CONV_FLOAT* pD = _tmpFloat.GetImageData();
553 *pD++ = CONV_FLOAT(*pS++);
554 *pD++ = CONV_FLOAT(*pS++);
555 *pD++ = CONV_FLOAT(*pS);
557 const int width2 = 2*width, width3=3*width;
558 const InputStorageType* pEndH = src.
GetImageData() + width*height-3;
560 *pD++ = CONV_FLOAT(h0*pS[0]+h1*(pS[-1]+pS[1])
561 +h2*(pS[-2]+pS[2])+h3*(pS[-3]+pS[3]));
564 *pD++ = CONV_FLOAT(*pS++);
565 *pD++ = CONV_FLOAT(*pS++);
566 *pD = CONV_FLOAT(*pS);
569 const CONV_FLOAT* pEndV = _tmpFloat.GetImageData() + width*(height-3);
570 CONV_FLOAT* pI = _tmpFloat.GetImageData();
572 const CONV_FLOAT* pEndFirst3 = _tmpFloat.GetImageData() + 3*width;
573 const CONV_FLOAT* pEndLast3 = _tmpFloat.GetImageData() + width*height;
575 while (pI<pEndFirst3) *pO++ = OutputStorageType(*pI++);
579 *pO++ = OutputStorageType(v0*pI[0] + v1*(pI[-width]+pI[width])
580 + v2*(pI[-width2]+pI[width2])
581 + v3*(pI[-width3]+pI[width3]));
584 while (pI<pEndLast3) *pO++ = OutputStorageType(*pI++);
592 template <
class InputStorageType,
class OutputStorageType>
597 BIASCDOUT(D_FILTERBASE_CALLSTACK,
"Gauss::Filter7x7\n");
598 SetHalfWinSize(3,
false);
599 if ((_GaussSigma != _LastSigma)||(_GaussRatio != _LastRatio))
600 _CalculateKernels(_GaussSigma, _GaussRatio);
602 const FM_FLOAT h0 = (
const FM_FLOAT)((*_fm.GetSepfh())[3]);
603 const FM_FLOAT h1 = (
const FM_FLOAT)((*_fm.GetSepfh())[2]);
604 const FM_FLOAT h2 = (
const FM_FLOAT)((*_fm.GetSepfh())[1]);
605 const FM_FLOAT h3 = (
const FM_FLOAT)((*_fm.GetSepfh())[0]);
606 const FM_FLOAT v0 = (
const FM_FLOAT)((*_fm.GetSepfv())[3]);
607 const FM_FLOAT v1 = (
const FM_FLOAT)((*_fm.GetSepfv())[2]);
608 const FM_FLOAT v2 = (
const FM_FLOAT)((*_fm.GetSepfv())[1]);
609 const FM_FLOAT v3 = (
const FM_FLOAT)((*_fm.GetSepfv())[0]);
613 BIASERR(
"image is not 3-channel interleaved! stopping."
622 if(!_tmpFloat.SamePixelAndChannelCount(src)) {
623 if (!_tmpFloat.IsEmpty()) _tmpFloat.Release();
630 CONV_FLOAT* pD = _tmpFloat.GetImageData();
632 *pD++ = CONV_FLOAT(*pS++);
633 *pD++ = CONV_FLOAT(*pS++);
634 *pD++ = CONV_FLOAT(*pS++);
636 *pD++ = CONV_FLOAT(*pS++);
637 *pD++ = CONV_FLOAT(*pS++);
638 *pD++ = CONV_FLOAT(*pS++);
640 *pD++ = CONV_FLOAT(*pS++);
641 *pD++ = CONV_FLOAT(*pS++);
642 *pD++ = CONV_FLOAT(*pS);
646 const int widthstep=3*width, widthstep2 = 6*width, widthstep3=9*width;
647 const InputStorageType* pEndH = src.
GetImageData() + width*height*3-9;
649 *pD++ = CONV_FLOAT(h0*pS[0]+h1*(pS[-3]+pS[3])
650 +h2*(pS[-6]+pS[6])+h3*(pS[-9]+pS[9]));
653 *pD++ = CONV_FLOAT(*pS++);
654 *pD++ = CONV_FLOAT(*pS++);
655 *pD++ = CONV_FLOAT(*pS++);
656 *pD++ = CONV_FLOAT(*pS++);
657 *pD++ = CONV_FLOAT(*pS++);
658 *pD++ = CONV_FLOAT(*pS++);
659 *pD++ = CONV_FLOAT(*pS++);
660 *pD++ = CONV_FLOAT(*pS++);
661 *pD = CONV_FLOAT(*pS);
664 const CONV_FLOAT* pEndV = _tmpFloat.GetImageData() + width*(height-9);
665 CONV_FLOAT* pI = _tmpFloat.GetImageData();
667 const CONV_FLOAT* pEndFirst3 = _tmpFloat.GetImageData() + 9*width;
668 const CONV_FLOAT* pEndLast3 = _tmpFloat.GetImageData() + 3*width*height;
670 while (pI<pEndFirst3) *pO++ = OutputStorageType(*pI++);
674 *pO++ = OutputStorageType(v0*pI[0] + v1*(pI[-widthstep]+pI[widthstep])
675 + v2*(pI[-widthstep2]+pI[widthstep2])
676 + v3*(pI[-widthstep3]+pI[widthstep3]));
679 while (pI<pEndLast3) *pO++ = OutputStorageType(*pI++);
687 template <
class InputStorageType,
class OutputStorageType>
692 BIASCDOUT(D_FILTERBASE_CALLSTACK,
"Gauss::Filter7x7\n");
693 SetHalfWinSize(3,
false);
694 if ((_GaussSigma != _LastSigma)||(_GaussRatio != _LastRatio))
695 _CalculateKernels(_GaussSigma, _GaussRatio);
697 const FM_FLOAT h0 = (
const FM_FLOAT)((*_fm.GetSepfh())[3]);
698 const FM_FLOAT h1 = (
const FM_FLOAT)((*_fm.GetSepfh())[2]);
699 const FM_FLOAT h2 = (
const FM_FLOAT)((*_fm.GetSepfh())[1]);
700 const FM_FLOAT h3 = (
const FM_FLOAT)((*_fm.GetSepfh())[0]);
701 const FM_FLOAT v0 = (
const FM_FLOAT)((*_fm.GetSepfv())[3]);
702 const FM_FLOAT v1 = (
const FM_FLOAT)((*_fm.GetSepfv())[2]);
703 const FM_FLOAT v2 = (
const FM_FLOAT)((*_fm.GetSepfv())[1]);
704 const FM_FLOAT v3 = (
const FM_FLOAT)((*_fm.GetSepfv())[0]);
708 BIASERR(
"image is not 3-channel interleaved! stopping."
717 if(!_tmpFloat.SamePixelAndChannelCount(src)) {
718 if (!_tmpFloat.IsEmpty()) _tmpFloat.Release();
725 CONV_FLOAT* pD = _tmpFloat.GetImageData();
727 *pD++ = CONV_FLOAT(*pS++);
728 *pD++ = CONV_FLOAT(*pS++);
729 *pD++ = CONV_FLOAT(*pS++);
731 *pD++ = CONV_FLOAT(*pS++);
732 *pD++ = CONV_FLOAT(*pS++);
733 *pD++ = CONV_FLOAT(*pS++);
735 *pD++ = CONV_FLOAT(*pS++);
736 *pD++ = CONV_FLOAT(*pS++);
737 *pD++ = CONV_FLOAT(*pS++);
739 *pD++ = CONV_FLOAT(*pS++);
740 *pD++ = CONV_FLOAT(*pS++);
741 *pD++ = CONV_FLOAT(*pS);
745 const int widthstep=4*width, widthstep2 = 8*width, widthstep3=12*width;
746 const InputStorageType* pEndH = src.
GetImageData() + width*height*4-12;
748 *pD++ = CONV_FLOAT(h0*pS[0]+h1*(pS[-4]+pS[4])
749 +h2*(pS[-8]+pS[8])+h3*(pS[-12]+pS[12]));
752 *pD++ = CONV_FLOAT(*pS++);
753 *pD++ = CONV_FLOAT(*pS++);
754 *pD++ = CONV_FLOAT(*pS++);
755 *pD++ = CONV_FLOAT(*pS++);
756 *pD++ = CONV_FLOAT(*pS++);
757 *pD++ = CONV_FLOAT(*pS++);
758 *pD++ = CONV_FLOAT(*pS++);
759 *pD++ = CONV_FLOAT(*pS++);
760 *pD++ = CONV_FLOAT(*pS++);
761 *pD++ = CONV_FLOAT(*pS++);
762 *pD++ = CONV_FLOAT(*pS++);
763 *pD = CONV_FLOAT(*pS);
766 const CONV_FLOAT* pEndV = _tmpFloat.GetImageData() + width*(height-12);
767 CONV_FLOAT* pI = _tmpFloat.GetImageData();
769 const CONV_FLOAT* pEndFirst3 = _tmpFloat.GetImageData() + 12*width;
770 const CONV_FLOAT* pEndLast3 = _tmpFloat.GetImageData() + 4*width*height;
772 while (pI<pEndFirst3) *pO++ = OutputStorageType(*pI++);
776 *pO++ = OutputStorageType(v0*pI[0] + v1*(pI[-widthstep]+pI[widthstep])
777 + v2*(pI[-widthstep2]+pI[widthstep2])
778 + v3*(pI[-widthstep3]+pI[widthstep3]));
781 while (pI<pEndLast3) *pO++ = OutputStorageType(*pI++);
790 template <
class InputStorageType,
class OutputStorageType>
795 BIASCDOUT(D_FILTERBASE_CALLSTACK,
"Gauss::Filter9x9\n");
796 SetHalfWinSize(4,
false);
797 if ((_GaussSigma != _LastSigma)||(_GaussRatio != _LastRatio))
798 _CalculateKernels(_GaussSigma, _GaussRatio);
799 const FM_FLOAT h0 = (
const FM_FLOAT)((*_fm.GetSepfh())[4]);
800 const FM_FLOAT h1 = (
const FM_FLOAT)((*_fm.GetSepfh())[3]);
801 const FM_FLOAT h2 = (
const FM_FLOAT)((*_fm.GetSepfh())[2]);
802 const FM_FLOAT h3 = (
const FM_FLOAT)((*_fm.GetSepfh())[1]);
803 const FM_FLOAT h4 = (
const FM_FLOAT)((*_fm.GetSepfh())[0]);
804 const FM_FLOAT v0 = (
const FM_FLOAT)((*_fm.GetSepfv())[4]);
805 const FM_FLOAT v1 = (
const FM_FLOAT)((*_fm.GetSepfv())[3]);
806 const FM_FLOAT v2 = (
const FM_FLOAT)((*_fm.GetSepfv())[2]);
807 const FM_FLOAT v3 = (
const FM_FLOAT)((*_fm.GetSepfv())[1]);
808 const FM_FLOAT v4 = (
const FM_FLOAT)((*_fm.GetSepfv())[0]);
812 BIASERR(
"image with multiple channels. stopping.");
820 if(!_tmpFloat.SamePixelAndChannelCount(src)) {
821 if (!_tmpFloat.IsEmpty()) _tmpFloat.Release();
829 CONV_FLOAT* pD = _tmpFloat.GetImageData();
831 *pD++ = CONV_FLOAT(*pS++);
832 *pD++ = CONV_FLOAT(*pS++);
833 *pD++ = CONV_FLOAT(*pS++);
834 *pD++ = CONV_FLOAT(*pS);
837 const int width2 = 2*width, width3=3*width, width4=4*width;
838 const InputStorageType* pEndH = src.
GetImageData() + width*height-4;
840 *pD++ = CONV_FLOAT(h0*pS[0]+h1*(pS[-1]+pS[1])+h2*(pS[-2]+pS[2])
841 +h3*(pS[-3]+pS[3])+h4*(pS[-4]+pS[4]));
844 *pD++ = CONV_FLOAT(*pS++);
845 *pD++ = CONV_FLOAT(*pS++);
846 *pD++ = CONV_FLOAT(*pS++);
847 *pD = CONV_FLOAT(*pS);
850 const CONV_FLOAT* pEndV = _tmpFloat.GetImageData() + width*(height-4);
851 CONV_FLOAT* pI = _tmpFloat.GetImageData();
853 const CONV_FLOAT* pEndFirst4 = _tmpFloat.GetImageData() + 4*width;
854 const CONV_FLOAT* pEndLast4 = _tmpFloat.GetImageData() + width*height;
856 while (pI<pEndFirst4) *pO++ = OutputStorageType(*pI++);
860 *pO++ = OutputStorageType(v0*pI[0] + v1*(pI[-width]+pI[width])
861 + v2*(pI[-width2]+pI[width2])
862 + v3*(pI[-width3]+pI[width3])
863 + v4*(pI[-width4]+pI[width4]));
866 while (pI<pEndLast4) *pO++ = OutputStorageType(*pI++);
874 template <
class InputStorageType,
class OutputStorageType>
879 BIASCDOUT(D_FILTERBASE_CALLSTACK,
"Gauss::Filter11x11\n");
880 SetHalfWinSize(5,
false);
881 if ((_GaussSigma != _LastSigma)||(_GaussRatio != _LastRatio))
882 _CalculateKernels(_GaussSigma, _GaussRatio);
883 const FM_FLOAT h0 = (
const FM_FLOAT)((*_fm.GetSepfh())[5]);
884 const FM_FLOAT h1 = (
const FM_FLOAT)((*_fm.GetSepfh())[4]);
885 const FM_FLOAT h2 = (
const FM_FLOAT)((*_fm.GetSepfh())[3]);
886 const FM_FLOAT h3 = (
const FM_FLOAT)((*_fm.GetSepfh())[2]);
887 const FM_FLOAT h4 = (
const FM_FLOAT)((*_fm.GetSepfh())[1]);
888 const FM_FLOAT h5 = (
const FM_FLOAT)((*_fm.GetSepfh())[0]);
890 const FM_FLOAT v0 = (
const FM_FLOAT)((*_fm.GetSepfv())[5]);
891 const FM_FLOAT v1 = (
const FM_FLOAT)((*_fm.GetSepfv())[4]);
892 const FM_FLOAT v2 = (
const FM_FLOAT)((*_fm.GetSepfv())[3]);
893 const FM_FLOAT v3 = (
const FM_FLOAT)((*_fm.GetSepfv())[2]);
894 const FM_FLOAT v4 = (
const FM_FLOAT)((*_fm.GetSepfv())[1]);
895 const FM_FLOAT v5 = (
const FM_FLOAT)((*_fm.GetSepfv())[0]);
899 BIASERR(
"image with multiple channels. stopping.");
907 if(!_tmpFloat.SamePixelAndChannelCount(src)) {
908 if (!_tmpFloat.IsEmpty()) _tmpFloat.Release();
915 CONV_FLOAT* pD = _tmpFloat.GetImageData();
917 *pD++ = CONV_FLOAT(*pS++);
918 *pD++ = CONV_FLOAT(*pS++);
919 *pD++ = CONV_FLOAT(*pS++);
920 *pD++ = CONV_FLOAT(*pS++);
921 *pD++ = CONV_FLOAT(*pS);
924 const int width2 = 2*width, width3=3*width, width4=4*width, width5=5*width;
925 const InputStorageType* pEndH = src.
GetImageData() + width*height-5;
927 *pD++ = CONV_FLOAT(h0*pS[0]+h1*(pS[-1]+pS[1])+h2*(pS[-2]+pS[2])
928 +h3*(pS[-3]+pS[3])+h4*(pS[-4]+pS[4])+h5*(pS[-5]+pS[5]));
931 *pD++ = CONV_FLOAT(*pS++);
932 *pD++ = CONV_FLOAT(*pS++);
933 *pD++ = CONV_FLOAT(*pS++);
934 *pD++ = CONV_FLOAT(*pS++);
935 *pD = CONV_FLOAT(*pS);
938 const CONV_FLOAT* pEndV = _tmpFloat.GetImageData() + width*(height-5);
939 CONV_FLOAT* pI = _tmpFloat.GetImageData();
941 const CONV_FLOAT* pEndFirst5 = _tmpFloat.GetImageData() + 5*width;
942 const CONV_FLOAT* pEndLast5 = _tmpFloat.GetImageData() + width*height;
944 while (pI<pEndFirst5) *pO++ = OutputStorageType(*pI++);
948 *pO++ = OutputStorageType(v0*pI[0] + v1*(pI[-width]+pI[width])
949 + v2*(pI[-width2]+pI[width2])
950 + v3*(pI[-width3]+pI[width3])
951 + v4*(pI[-width4]+pI[width4])
952 + v5*(pI[-width5]+pI[width5]));
955 while (pI<pEndLast5) *pO++ = OutputStorageType(*pI++);
963 template <
class InputStorageType,
class OutputStorageType>
968 BIASCDOUT(D_FILTERBASE_CALLSTACK,
"Gauss::Filter13x13\n");
969 SetHalfWinSize(6,
false);
970 if ((_GaussSigma != _LastSigma)||(_GaussRatio != _LastRatio))
971 _CalculateKernels(_GaussSigma, _GaussRatio);
972 const FM_FLOAT h0 = (
const FM_FLOAT)((*_fm.GetSepfh())[6]);
973 const FM_FLOAT h1 = (
const FM_FLOAT)((*_fm.GetSepfh())[5]);
974 const FM_FLOAT h2 = (
const FM_FLOAT)((*_fm.GetSepfh())[4]);
975 const FM_FLOAT h3 = (
const FM_FLOAT)((*_fm.GetSepfh())[3]);
976 const FM_FLOAT h4 = (
const FM_FLOAT)((*_fm.GetSepfh())[2]);
977 const FM_FLOAT h5 = (
const FM_FLOAT)((*_fm.GetSepfh())[1]);
978 const FM_FLOAT h6 = (
const FM_FLOAT)((*_fm.GetSepfh())[0]);
980 const FM_FLOAT v0 = (
const FM_FLOAT)((*_fm.GetSepfv())[6]);
981 const FM_FLOAT v1 = (
const FM_FLOAT)((*_fm.GetSepfv())[5]);
982 const FM_FLOAT v2 = (
const FM_FLOAT)((*_fm.GetSepfv())[4]);
983 const FM_FLOAT v3 = (
const FM_FLOAT)((*_fm.GetSepfv())[3]);
984 const FM_FLOAT v4 = (
const FM_FLOAT)((*_fm.GetSepfv())[2]);
985 const FM_FLOAT v5 = (
const FM_FLOAT)((*_fm.GetSepfv())[1]);
986 const FM_FLOAT v6 = (
const FM_FLOAT)((*_fm.GetSepfv())[0]);
990 BIASERR(
"image with multiple channels. stopping.");
998 if(!_tmpFloat.SamePixelAndChannelCount(src)) {
999 if (!_tmpFloat.IsEmpty()) _tmpFloat.Release();
1006 CONV_FLOAT* pD = _tmpFloat.GetImageData();
1008 *pD++ = CONV_FLOAT(*pS++);
1009 *pD++ = CONV_FLOAT(*pS++);
1010 *pD++ = CONV_FLOAT(*pS++);
1011 *pD++ = CONV_FLOAT(*pS++);
1012 *pD++ = CONV_FLOAT(*pS++);
1013 *pD++ = CONV_FLOAT(*pS);
1016 const int width2 = 2*width, width3=3*width, width4=4*width,
1017 width5=5*width, width6=6*width;
1018 const InputStorageType* pEndH = src.
GetImageData() + width*height-6;
1019 while (++pS<pEndH) {
1020 *pD++ = CONV_FLOAT(h0*pS[0]+h1*(pS[-1]+pS[1])+h2*(pS[-2]+pS[2])
1021 +h3*(pS[-3]+pS[3])+h4*(pS[-4]+pS[4])
1022 +h5*(pS[-5]+pS[5])+h6*(pS[-6]+pS[6]));
1025 *pD++ = CONV_FLOAT(*pS++);
1026 *pD++ = CONV_FLOAT(*pS++);
1027 *pD++ = CONV_FLOAT(*pS++);
1028 *pD++ = CONV_FLOAT(*pS++);
1029 *pD++ = CONV_FLOAT(*pS++);
1030 *pD = CONV_FLOAT(*pS);
1033 const CONV_FLOAT* pEndV = _tmpFloat.GetImageData() + width*(height-6);
1034 CONV_FLOAT* pI = _tmpFloat.GetImageData();
1036 const CONV_FLOAT* pEndFirst6 = _tmpFloat.GetImageData() + 6*width;
1037 const CONV_FLOAT* pEndLast6 = _tmpFloat.GetImageData() + width*height;
1039 while (pI<pEndFirst6) *pO++ = OutputStorageType(*pI++);
1042 while (++pI<pEndV) {
1043 *pO++ = OutputStorageType(v0*pI[0] + v1*(pI[-width]+pI[width])
1044 + v2*(pI[-width2]+pI[width2])
1045 + v3*(pI[-width3]+pI[width3])
1046 + v4*(pI[-width4]+pI[width4])
1047 + v5*(pI[-width5]+pI[width5])
1048 + v6*(pI[-width6]+pI[width6]));
1051 while (pI<pEndLast6) *pO++ = OutputStorageType(*pI++);
1061 template <
class InputStorageType,
class OutputStorageType>
1065 const int hws = (int)(floor(sqrt(-2.0*Sigma*Sigma*log(Ratio))));
1066 const int size = (hws<<1)+1;
1069 BIASCDOUT(D_CONV_KERNEL,
"Sigma = "<<Sigma<<
"\tRatio = "<<Ratio<<endl);
1070 BIASCDOUT(D_CONV_KERNEL,
"size = "<<size<<
"\thws = "<<hws<<endl);
1077 double fac=1.0/(2.0*Sigma*Sigma);
1080 for (i=0; i<=hws; i++){
1083 g = expf((
float)(-(
double)(i*i)*fac));
1084 V[ip] = V[im] = H[im] = H[ip] = (FM_FLOAT)g;
1089 BIASCDOUT(D_CONV_KERNEL,
"sum = "<<sum<<endl);
1093 BIASCDOUT(D_CONV_KERNEL,
"sum = "<<sum<<endl);
1094 for (i=0; i<=hws; i++){
1097 H[ip] = H[im] = V[ip] = V[im] = V[im] * (FM_FLOAT)sum;
1098 BIASCDOUT(D_CONV_KERNEL, H[im]<<
" "<<endl);
1103 int thebits = _fm.ComputeIntPrecisionBits(
sizeof(InputStorageType)*8,
1104 sizeof(CONV_INT)*8-1);
1105 _fm.CreateIntFilter(thebits,thebits,thebits);
1111 if (this->DebugLevelIsSet(D_CONV_KERNEL)){
1113 for (i=-hws; i<=hws; i++){
1115 BIASCDOUT(D_CONV_KERNEL, H[i+hws]<<
" ");
1117 BIASCDOUT(D_CONV_KERNEL,
" sum = "<<sum<<endl);
1123 fprintf(stdout,
"gauss: \n");
1124 for (i=-hws; i<=hws; i++){
1125 fprintf(stdout,
"%f ",HVec[i+hws]);
1127 fprintf(stdout,
"\n");
1131 #define MIN_NORM 0.7
1133 template <
class InputStorageType,
class OutputStorageType>
1137 const InputStorageType& thresh)
1139 BIASCDOUT(D_FILTERBASE_CALLSTACK,
"Gauss::Filter7x7\n");
1140 SetHalfWinSize(3,
false);
1141 if ((_GaussSigma != _LastSigma)||(_GaussRatio != _LastRatio))
1142 _CalculateKernels(_GaussSigma, _GaussRatio);
1144 const FM_FLOAT h0 = (
const FM_FLOAT)((*_fm.GetSepfh())[3]);
1145 const FM_FLOAT h1 = (
const FM_FLOAT)((*_fm.GetSepfh())[2]);
1146 const FM_FLOAT h2 = (
const FM_FLOAT)((*_fm.GetSepfh())[1]);
1147 const FM_FLOAT h3 = (
const FM_FLOAT)((*_fm.GetSepfh())[0]);
1148 const FM_FLOAT v0 = (
const FM_FLOAT)((*_fm.GetSepfv())[3]);
1149 const FM_FLOAT v1 = (
const FM_FLOAT)((*_fm.GetSepfv())[2]);
1150 const FM_FLOAT v2 = (
const FM_FLOAT)((*_fm.GetSepfv())[1]);
1151 const FM_FLOAT v3 = (
const FM_FLOAT)((*_fm.GetSepfv())[0]);
1158 BIASERR(
"image with multiple channels. stopping.");
1166 if(!_tmpFloat.SamePixelAndChannelCount(src)) {
1167 if (!_tmpFloat.IsEmpty()) _tmpFloat.Release();
1174 CONV_FLOAT* pD = _tmpFloat.GetImageData();
1176 *pD++ = CONV_FLOAT(thresh);
1178 *pD++ = CONV_FLOAT(thresh);
1180 *pD++ = CONV_FLOAT(thresh);
1183 const int width2 = 2*width, width3=3*width;
1184 const InputStorageType* pEndH = src.
GetImageData() + width*height-3;
1186 while (++pS<pEndH) {
1187 register CONV_FLOAT normalization = 0;
1188 register CONV_FLOAT accumulator = 0;
1189 if (pS[-3]>thresh) {
1190 normalization += h3;
1191 accumulator += h3*CONV_FLOAT(pS[-3]);
1193 if (pS[-2]>thresh) {
1194 normalization += h2;
1195 accumulator += h2*CONV_FLOAT(pS[-2]);
1197 if (pS[-1]>thresh) {
1198 normalization += h1;
1199 accumulator += h1*CONV_FLOAT(pS[-1]);
1202 normalization += h0;
1203 accumulator += h0*CONV_FLOAT(pS[0]);
1206 normalization += h1;
1207 accumulator += h1*CONV_FLOAT(pS[1]);
1211 normalization += h2;
1212 accumulator += h2*CONV_FLOAT(pS[2]);
1215 normalization += h3;
1216 accumulator += h3*CONV_FLOAT(pS[3]);
1218 if (normalization>MIN_NORM)
1219 *pD++ = CONV_FLOAT(accumulator / normalization);
1221 *pD++ = CONV_FLOAT(thresh);
1224 *pD++ = CONV_FLOAT(thresh);pS++;
1225 *pD++ = CONV_FLOAT(thresh);pS++;
1226 *pD = CONV_FLOAT(thresh);pS++;
1228 const CONV_FLOAT cfthresh = CONV_FLOAT(thresh);
1231 const CONV_FLOAT* pEndV = _tmpFloat.GetImageData() + width*(height-3);
1232 CONV_FLOAT* pI = _tmpFloat.GetImageData();
1234 const CONV_FLOAT* pEndFirst3 = _tmpFloat.GetImageData() + 3*width;
1235 const CONV_FLOAT* pEndLast3 = _tmpFloat.GetImageData() + width*height;
1237 while (pI<pEndFirst3) {
1238 *pO++ = OutputStorageType(thresh);
1243 while (++pI<pEndV) {
1244 register CONV_FLOAT normalization = 0;
1245 register CONV_FLOAT accumulator = 0;
1247 if (pI[-width3]>cfthresh) {
1248 normalization += v3;
1249 accumulator += v3*CONV_FLOAT(pI[-width3]);
1251 if (pI[-width2]>cfthresh) {
1252 normalization += v2;
1253 accumulator += v2*CONV_FLOAT(pI[-width2]);
1255 if (pI[-width]>cfthresh) {
1256 normalization += v1;
1257 accumulator += v1*CONV_FLOAT(pI[-width]);
1259 if (pI[0]>cfthresh) {
1260 normalization += v0;
1261 accumulator += v0*CONV_FLOAT(pI[0]);
1263 if (pI[width]>cfthresh) {
1264 normalization += v1;
1265 accumulator += v1*CONV_FLOAT(pI[width]);
1268 if (pI[width2]>cfthresh) {
1269 normalization += v2;
1270 accumulator += v2*CONV_FLOAT(pI[width2]);
1272 if (pI[width3]>cfthresh) {
1273 normalization += v3;
1274 accumulator += v3*CONV_FLOAT(pI[width3]);
1277 if (normalization>MIN_NORM)
1278 *pO++ = OutputStorageType(accumulator / normalization);
1280 *pO++ = OutputStorageType(thresh);
1284 while (pI<pEndLast3) {
1285 *pO++ = OutputStorageType(thresh);
1302 #define FILTER_INSTANTIATION_CLASS Gauss
1303 #include "Filterinst.hh"
void Release()
reimplemented from ImageBase
double _GaussSigma
the parameter sigma of gaussian kernel
virtual int Filter13x13Grey(const Image< InputStorageType > &src, Image< OutputStorageType > &dst)
fast, approximate, direct implementation, ignoring wrap-arounds, roi is updated but ignored ...
virtual int Filter7x7Grey(const Image< InputStorageType > &src, Image< OutputStorageType > &dst)
fast, approximate, direct implementation, ignoring wrap-arounds, roi is updated but ignored ...
virtual int Filter11x11Grey(const Image< InputStorageType > &src, Image< OutputStorageType > &dst)
fast, approximate, direct implementation, ignoring wrap-arounds, roi is updated but ignored ...
class for handling different region of interest (ROI) representations...
Gauss< InputStorageType, OutputStorageType > * _GaussIO
generic convolution class.
int SetCorners(unsigned UpperLeftX, unsigned UpperLeftY, unsigned LowerRightX, unsigned LowerRightY)
Sets a rectangular region of interest.
void GetCorners(unsigned &UpperLeftX, unsigned &UpperLeftY, unsigned &LowerRightX, unsigned &LowerRightY) const
Return the region of interest, by saving the coordinates within the variables defined by the paramete...
virtual int FilterFloat(const Image< InputStorageType > &src, Image< OutputStorageType > &dst)
do the convolution using floating point calculations
bool IsEmpty() const
check if ImageData_ points to allocated image buffer or not
virtual int FilterGrey(const Image< InputStorageType > &src, Image< OutputStorageType > &dst, bool ResetROI=false)
wrapper around FilterNxNGrey, which decides on sigma and cutoffratio which filter to apply and how of...
bool IsInterleaved() const
int Filter7x7GreyIgnoreBelowThreshold(const Image< InputStorageType > &src, Image< OutputStorageType > &dst, const InputStorageType &thresh)
7x7 gauss filtering, values below threshold are ignored useful for depth map filtering ...
virtual int Filter(const Image< InputStorageType > &src, Image< OutputStorageType > &dst)
decides on the image types which FilterFunction should be called
virtual int Filter3x3GreyThreshold(const Image< InputStorageType > &src, Image< OutputStorageType > &dst, float threshold=0.0)
fast, approximate, direct implementation, ignoring wrap-arounds, roi is updated but ignored Keep src ...
double _GaussRatio
minimum ratio of 1D kernel center and border, ignore smaller entries
virtual int Filter3x3Grey(const Image< InputStorageType > &src, Image< OutputStorageType > &dst)
fast, approximate, direct implementation, ignoring wrap-arounds, roi is updated but ignored ...
unsigned int GetWidth() const
virtual int Filter7x7RGB(const Image< InputStorageType > &src, Image< OutputStorageType > &dst)
fast, approximate, direct implementation, ignoring wrap-arounds, roi is updated but ignored ...
smoothing with gaussian kernel
ROI * GetROI()
Returns a pointer to the roi object.
virtual int Filter5x5GreyThreshold(const Image< InputStorageType > &src, Image< OutputStorageType > &dst, float threshold=0.0)
fast, approximate, direct implementation, ignoring wrap-arounds, roi is updated but ignored...
void _CalculateKernels(double Sigma, double Ratio)
calculates the kernel
virtual Gauss< InputStorageType, OutputStorageType > * Clone() const
static int ConvertST(const BIAS::ImageBase &source, BIAS::ImageBase &dest, ImageBase::EStorageType targetST)
Function to convert the storage type of images e.g.
unsigned int GetChannelCount() const
returns the number of Color channels, e.g.
virtual int FilterInt(const Image< InputStorageType > &src, Image< OutputStorageType > &dst)
sets gauss kernel if params changed and calls convolution
unsigned int GetHeight() const
bool SamePixelAndChannelCount(const ImageBase &Image) const
checks if data area has same "size" as Image of other type
Gauss< OutputStorageType, OutputStorageType > * _GaussOO
to allow for iterated gauss convolution saving the intermediate image we need a different instance...
virtual int Filter(const Image< InputStorageType > &src, Image< OutputStorageType > &dst)
sets gauss kernel if params changed and calls convolution or fast grey implementation if possible ...
void Init(unsigned int Width, unsigned int Height, unsigned int channels=1, enum EStorageType storageType=ST_unsignedchar, const bool interleaved=true)
calls Init from ImageBase storageType is ignored, just dummy argument
const StorageType * GetImageData() const
overloaded GetImageData() from ImageBase
virtual int Filter7x7RGBA(const Image< InputStorageType > &src, Image< OutputStorageType > &dst)
fast, approximate, direct implementation, ignoring wrap-arounds, roi is updated but ignored ...
enum EStorageType GetStorageType() const
virtual int Filter9x9Grey(const Image< InputStorageType > &src, Image< OutputStorageType > &dst)
fast, approximate, direct implementation, ignoring wrap-arounds, roi is updated but ignored ...
virtual int Filter5x5Grey(const Image< InputStorageType > &src, Image< OutputStorageType > &dst)
fast, approximate, direct implementation, ignoring wrap-arounds, roi is updated but ignored ...
virtual int FilterFloat(const Image< InputStorageType > &src, Image< OutputStorageType > &dst)
sets gauss kernel if params changed and calls convolution
virtual int FilterInt(const Image< InputStorageType > &src, Image< OutputStorageType > &dst)
do the convolution using integer arithmetics and shifts
void UnsetROI()
deprecated, use GetROI()->UnsetROI()