25 #include "StructureTensor.hh"
28 #include <Base/Image/ImageIO.hh>
31 #include <Base/Common/BIASpragma.hh>
37 #include <Base/Debug/TimeMeasure.hh>
47 template <
class InputStorageType,
class OutputStorageType>
57 template <
class InputStorageType,
class OutputStorageType>
60 : _HalfWinSize(other._HalfWinSize),
61 _InternalMemWidth(other._InternalMemWidth),
62 _InternalMemHeight(other._InternalMemHeight)
70 template <
class InputStorageType,
class OutputStorageType>
73 if (_grad)
delete _grad;
76 template <
class InputStorageType,
class OutputStorageType>
80 BIASCDOUT(D_FILTERBASE_CALLSTACK,
"StructureTensor::Filter(src, dst)\n");
81 BIASERR(
"unfinished");
86 template <
class InputStorageType,
class OutputStorageType>
90 BIASCDOUT(D_FILTERBASE_CALLSTACK,
"StructureTensor::FilterInt(src, dst)\n");
91 BIASERR(
"unfinished");
96 template <
class InputStorageType,
class OutputStorageType>
100 BIASCDOUT(D_FILTERBASE_CALLSTACK,
"StructureTensor::FilterFloat(src, dst)\n");
101 BIASERR(
"unfinished");
106 template <
class InputStorageType,
class OutputStorageType>
113 BIASCDOUT(D_FILTERBASE_CALLSTACK,
"StructureTensor::Filter(src, d1, d2, d3)\n");
114 BIASERR(
"unfinished");
119 template <
class InputStorageType,
class OutputStorageType>
126 BIASCDOUT(D_FILTERBASE_CALLSTACK,
"StructureTensor::FilterInt(src, d1, d2, d3)\n");
127 BIASERR(
"unfinished");
132 template <
class InputStorageType,
class OutputStorageType>
139 BIASCDOUT(D_FILTERBASE_CALLSTACK,
"StructureTensor::FilterFloat(src, d1, d2, d3)\n");
141 BIASERR(
"unfinished");
167 template <
class InputStorageType,
class OutputStorageType>
174 int gres=_grad->Filter(image, _gx, _gy);
176 if (DebugLevelIsSet(D_ST_WRITE_DEBUG_IM)){
179 BIASERR(
"error writing gx");
183 BIASERR(
"error writing gy");
188 int sres = CalcStructureTensor(_gx, _gy, sgxx, sgxy, sgyy);
191 if (DebugLevelIsSet(D_ST_WRITE_DEBUG_IM)){
192 _WriteDebugImage(sgxx,
"sgxx.mip");
193 _WriteDebugImage(sgxy,
"sgxy.mip");
194 _WriteDebugImage(sgyy,
"sgyy.mip");
197 return (sres==0 && gres==0)?0:-1;
200 template <
class InputStorageType,
class OutputStorageType>
224 switch (_HalfWinSize){
226 sres=CalcStructureTensor3x3(gx, gy, sgxx, sgxy, sgyy);
229 sres=CalcStructureTensor5x5(gx, gy, sgxx, sgxy, sgyy);
232 sres=CalcStructureTensor7x7(gx, gy, sgxx, sgxy, sgyy);
235 sres=CalcStructureTensorValid(gx, gy, sgxx, sgxy, sgyy);
243 template <
class InputStorageType,
class OutputStorageType>
262 if (width>_InternalMemWidth || height>_InternalMemHeight){
264 _AllocInternalMem(width, height);
267 _GradientProducts(gx, gy);
270 int tlx, tly, brx, bry;
271 _gxx.GetROI()->GetCorners(tlx, tly, brx, bry);
272 const int hws=_HalfWinSize;
273 const int minx=tlx+hws;
274 const int maxx=brx-hws;
275 const int miny=tly+hws;
276 const int maxy=bry-hws;
281 register int x, y, ix, iy, mx, my;
285 register OutputStorageType **igxx=_gxx.GetImageDataArray();
286 register OutputStorageType **igxy=_gxy.GetImageDataArray();
287 register OutputStorageType **igyy=_gyy.GetImageDataArray();
289 for (y=miny; y<maxy; y++){
290 for (x=minx; x<maxx; x++){
291 isgxx[y][x]=isgxy[y][x]=isgyy[y][x]=(OutputStorageType)0.0;
292 for (iy=-hws; iy<=hws; iy++){
294 for (ix=-hws; ix<=hws; ix++){
296 isgxx[y][x]+=igxx[my][mx];
297 isgxy[y][x]+=igxy[my][mx];
298 isgyy[y][x]+=igyy[my][mx];
302 if (DebugLevelIsSet(D_ST_FEATURES) && y<miny+2 && x<minx+2){
303 cerr <<
"( "<<x<<
", "<<y<<
") sgxx "<<isgxx[y][x]<<
" sgxy "
304 <<isgxy[y][x]<<
" sgyy "<<isgyy[y][x]<<endl;
313 template <
class InputStorageType,
class OutputStorageType>
331 if (width>_InternalMemWidth || height>_InternalMemHeight){
333 _AllocInternalMem(width, height);
336 _GradientProducts(gx, gy);
339 int tlx, tly, brx, bry;
340 _gxx.GetROI()->GetCorners(tlx, tly, brx, bry);
341 const int minx=tlx+1;
342 const int maxx=brx-1;
343 const int miny=tly+1;
344 const int maxy=bry-1;
349 register int x, y, xm, xp, ym, yp;
353 register OutputStorageType **igxx=_gxx.GetImageDataArray();
354 register OutputStorageType **igxy=_gxy.GetImageDataArray();
355 register OutputStorageType **igyy=_gyy.GetImageDataArray();
356 for (y=miny; y<maxy; y++){
357 for (x=minx; x<maxx; x++){
361 igxx[ym][xm]+igxx[ym][x]+igxx[ym][xp]+
362 igxx[y][xm]+igxx[y][x]+igxx[y][xp]+
363 igxx[yp][xm]+igxx[yp][x]+igxx[yp][xp];
365 igxy[ym][xm]+igxy[ym][x]+igxy[ym][xp]+
366 igxy[y][xm]+igxy[y][x]+igxy[y][xp]+
367 igxy[yp][xm]+igxy[yp][x]+igxy[yp][xp];
369 igyy[ym][xm]+igyy[ym][x]+igyy[ym][xp]+
370 igyy[y][xm]+igyy[y][x]+igyy[y][xp]+
371 igyy[yp][xm]+igyy[yp][x]+igyy[yp][xp];
375 if (DebugLevelIsSet(D_ST_WRITE_DEBUG_IM)){
376 _WriteDebugImage(sgxx,
"sgxx-3x3.mip");
377 _WriteDebugImage(sgxy,
"sgxy-3x3.mip");
378 _WriteDebugImage(sgyy,
"sgyy-3x3.mip");
380 CalcStructureTensorValid(gx, gy, sgxx, sgxy, sgyy);
381 _WriteDebugImage(sgxx,
"sgxx-st.mip");
382 _WriteDebugImage(sgxy,
"sgxy-st.mip");
383 _WriteDebugImage(sgyy,
"sgyy-st.mip");
390 template <
class InputStorageType,
class OutputStorageType>
413 if (width>_InternalMemWidth || height>_InternalMemHeight){
415 _AllocInternalMem(width, height);
418 _GradientProducts(gx, gy);
422 cerr <<
"_GradientProducts took "<<timer.
GetRealTime()<<
" us\n";
428 int tlx, tly, brx, bry;
429 _gxx.GetROI()->GetCorners(tlx, tly, brx, bry);
432 const int minxp=tlx+2;
433 const int maxxm=brx-2;
434 const int minyp=tly+2;
435 const int maxym=bry-2;
440 register int x, y, xm, xmm, xp, xpp, ym, ymm, yp, ypp;
444 register OutputStorageType **itsgxx=_tsgxx.GetImageDataArray();
445 register OutputStorageType **itsgxy=_tsgxy.GetImageDataArray();
446 register OutputStorageType **itsgyy=_tsgyy.GetImageDataArray();
447 register OutputStorageType **igxx=_gxx.GetImageDataArray();
448 register OutputStorageType **igxy=_gxy.GetImageDataArray();
449 register OutputStorageType **igyy=_gyy.GetImageDataArray();
451 for (y=miny; y<maxy; y++){
452 for (x=minxp; x<maxxm; x++){
453 xmm=x-2; xm=x-1; xp=x+1; xpp=x+2;
455 igxx[y][xmm]+igxx[y][xm]+igxx[y][x]+igxx[y][xp]+igxx[y][xpp];
458 for (y=minyp; y<maxym; y++){
459 for (x=minxp; x<maxxm; x++){
460 ymm=y-2; ym=y-1; yp=y+1; ypp=y+2;
462 itsgxx[ymm][x]+itsgxx[ym][x]+itsgxx[y][x]+itsgxx[yp][x]+itsgxx[ypp][x];
465 for (y=miny; y<maxy; y++){
466 for (x=minxp; x<maxxm; x++){
467 xmm=x-2; xm=x-1; xp=x+1; xpp=x+2;
469 igxy[y][xmm]+igxy[y][xm]+igxy[y][x]+igxy[y][xp]+igxy[y][xpp];
472 for (y=minyp; y<maxym; y++){
473 for (x=minxp; x<maxxm; x++){
474 ymm=y-2; ym=y-1; yp=y+1; ypp=y+2;
476 itsgxy[ymm][x]+itsgxy[ym][x]+itsgxy[y][x]+itsgxy[yp][x]+itsgxy[ypp][x];
479 for (y=miny; y<maxy; y++){
480 for (x=minxp; x<maxxm; x++){
481 xmm=x-2; xm=x-1; xp=x+1; xpp=x+2;
483 igyy[y][xmm]+igyy[y][xm]+igyy[y][x]+igyy[y][xp]+igyy[y][xpp];
486 for (y=minyp; y<maxym; y++){
487 for (x=minxp; x<maxxm; x++){
488 ymm=y-2; ym=y-1; yp=y+1; ypp=y+2;
490 itsgyy[ymm][x]+itsgyy[ym][x]+itsgyy[y][x]+itsgyy[yp][x]+itsgyy[ypp][x];
495 if (DebugLevelIsSet(D_ST_WRITE_DEBUG_IM)){
496 _WriteDebugImage(sgxx,
"sgxx-5x5.mip");
497 _WriteDebugImage(sgxy,
"sgxy-5x5.mip");
498 _WriteDebugImage(sgyy,
"sgyy-5x5.mip");
500 CalcStructureTensorValid(gx, gy, sgxx, sgxy, sgyy);
501 _WriteDebugImage(sgxx,
"sgxx-st.mip");
502 _WriteDebugImage(sgxy,
"sgxy-st.mip");
503 _WriteDebugImage(sgyy,
"sgyy-st.mip");
509 cerr <<
"CalcStructureTensor5x5 without _GradientProducts took "<<timer.
GetRealTime()<<
" us\n";
514 template <
class InputStorageType,
class OutputStorageType>
536 if (width>_InternalMemWidth || height>_InternalMemHeight){
537 _AllocInternalMem(width, height);
540 _GradientProducts(gx, gy);
544 cerr <<
"_GradientProducts took "<<timer.
GetRealTime()<<
" us\n";
550 int tlx, tly, brx, bry;
551 _gxx.GetROI()->GetCorners(tlx, tly, brx, bry);
554 const int minxp=tlx+3;
555 const int maxxm=brx-3;
556 const int minyp=tly+3;
557 const int maxym=bry-3;
563 register OutputStorageType *ptsgxx, *ptmsgxx, *pmgxx, *ppgxx, *lend, *end;
564 register OutputStorageType *ptsgxy, *ptmsgxy, *pmgxy, *ppgxy;
565 register OutputStorageType *ptsgyy, *ptmsgyy, *pmgyy, *ppgyy;
566 register const int tstep=width-(maxxm-minxp);
567 const int offset=(width*miny)+minxp;
568 ptmsgxx = _tsgxx.GetImageData() + offset;
569 ptmsgxy = _tsgxy.GetImageData() + offset;
570 ptmsgyy = _tsgyy.GetImageData() + offset;
571 pmgxx = _gxx.GetImageData() + offset-3;
572 pmgxy = _gxy.GetImageData() + offset-3;
573 pmgyy = _gyy.GetImageData() + offset-3;
574 lend = _tsgxx.GetImageData() + (width*miny)+maxxm;
575 end = _tsgxx.GetImageData() + ((maxy-1)*width)+maxxm;
579 *ptsgxx=(OutputStorageType)0.0;
591 *ptsgxy=(OutputStorageType)0.0;
603 *ptsgyy=(OutputStorageType)0.0;
613 *ptsgxx++ = *ptmsgxx++ - *pmgxx++ + *ppgxx++;
614 *ptsgxy++ = *ptmsgxy++ - *pmgxy++ + *ppgxy++;
615 *ptsgyy++ = *ptmsgyy++ - *pmgyy++ + *ppgyy++;
629 cerr <<
"first convolution took "<<timer.
GetRealTime()<<
" us\n";
725 register int x, y, myp, mym, my1;
726 register const int ymmm=minyp-3, ymm=minyp-2, ym=minyp-1, yp=minyp+1,
727 ypp=minyp+2, yppp=minyp+3;
731 register OutputStorageType **itsgxx=_tsgxx.GetImageDataArray();
732 register OutputStorageType **itsgxy=_tsgxy.GetImageDataArray();
733 register OutputStorageType **itsgyy=_tsgyy.GetImageDataArray();
735 if (width*height>153600){
737 const int medy=((maxym-minyp)>>1)+minyp;
738 const int eymmm=medy-3, eymm=medy-2, eym=medy-1, eyp=medy+1,
739 eypp=medy+2, eyppp=medy+3;
740 for (x=minxp; x<maxxm; x++){
741 isgxy[minyp][x]=itsgxy[ymmm][x]+itsgxy[ymm][x]+itsgxy[ym][x]+
742 itsgxy[minyp][x]+itsgxy[yp][x]+itsgxy[ypp][x]+itsgxy[yppp][x];
743 for (y=minyp+1; y<medy; y++){
744 myp=y+3; mym=y-4; my1=y-1;
745 isgxy[y][x]=isgxy[my1][x]-itsgxy[mym][x]+itsgxy[myp][x];
748 for (x=minxp; x<maxxm; x++){
749 isgxy[medy][x]=itsgxy[eymmm][x]+itsgxy[eymm][x]+itsgxy[eym][x]+
750 itsgxy[medy][x]+itsgxy[eyp][x]+itsgxy[eypp][x]+itsgxy[eyppp][x];
751 for (y=medy+1; y<maxym; y++){
752 myp=y+3; mym=y-4; my1=y-1;
753 isgxy[y][x]=isgxy[my1][x]-itsgxy[mym][x]+itsgxy[myp][x];
757 for (x=minxp; x<maxxm; x++){
758 isgxx[minyp][x]=itsgxx[ymmm][x]+itsgxx[ymm][x]+itsgxx[ym][x]+
759 itsgxx[minyp][x]+itsgxx[yp][x]+itsgxx[ypp][x]+itsgxx[yppp][x];
760 for (y=minyp+1; y<medy; y++){
761 myp=y+3; mym=y-4; my1=y-1;
762 isgxx[y][x]=isgxx[my1][x]-itsgxx[mym][x]+itsgxx[myp][x];
765 for (x=minxp; x<maxxm; x++){
766 isgxx[medy][x]=itsgxx[eymmm][x]+itsgxx[eymm][x]+itsgxx[eym][x]+
767 itsgxx[medy][x]+itsgxx[eyp][x]+itsgxx[eypp][x]+itsgxx[eyppp][x];
768 for (y=medy+1; y<maxym; y++){
769 myp=y+3; mym=y-4; my1=y-1;
770 isgxx[y][x]=isgxx[my1][x]-itsgxx[mym][x]+itsgxx[myp][x];
774 for (x=minxp; x<maxxm; x++){
775 isgyy[minyp][x]=itsgyy[ymmm][x]+itsgyy[ymm][x]+itsgyy[ym][x]+
776 itsgyy[minyp][x]+itsgyy[yp][x]+itsgyy[ypp][x]+itsgyy[yppp][x];
777 for (y=minyp+1; y<medy; y++){
778 myp=y+3; mym=y-4; my1=y-1;
779 isgyy[y][x]=isgyy[my1][x]-itsgyy[mym][x]+itsgyy[myp][x];
782 for (x=minxp; x<maxxm; x++){
783 isgyy[medy][x]=itsgyy[eymmm][x]+itsgyy[eymm][x]+itsgyy[eym][x]+
784 itsgyy[medy][x]+itsgyy[eyp][x]+itsgyy[eypp][x]+itsgyy[eyppp][x];
785 for (y=medy+1; y<maxym; y++){
786 myp=y+3; mym=y-4; my1=y-1;
787 isgyy[y][x]=isgyy[my1][x]-itsgyy[mym][x]+itsgyy[myp][x];
791 for (x=minxp; x<maxxm; x++){
792 isgxy[minyp][x]=itsgxy[ymmm][x]+itsgxy[ymm][x]+itsgxy[ym][x]+
793 itsgxy[minyp][x]+itsgxy[yp][x]+itsgxy[ypp][x]+itsgxy[yppp][x];
794 for (y=minyp+1; y<maxym; y++){
795 myp=y+3; mym=y-4; my1=y-1;
796 isgxy[y][x]=isgxy[my1][x]-itsgxy[mym][x]+itsgxy[myp][x];
800 for (x=minxp; x<maxxm; x++){
801 isgxx[minyp][x]=itsgxx[ymmm][x]+itsgxx[ymm][x]+itsgxx[ym][x]+
802 itsgxx[minyp][x]+itsgxx[yp][x]+itsgxx[ypp][x]+itsgxx[yppp][x];
803 for (y=minyp+1; y<maxym; y++){
804 myp=y+3; mym=y-4; my1=y-1;
805 isgxx[y][x]=isgxx[my1][x]-itsgxx[mym][x]+itsgxx[myp][x];
809 for (x=minxp; x<maxxm; x++){
810 isgyy[minyp][x]=itsgyy[ymmm][x]+itsgyy[ymm][x]+itsgyy[ym][x]+
811 itsgyy[minyp][x]+itsgyy[yp][x]+itsgyy[ypp][x]+itsgyy[yppp][x];
812 for (y=minyp+1; y<maxym; y++){
813 myp=y+3; mym=y-4; my1=y-1;
814 isgyy[y][x]=isgyy[my1][x]-itsgyy[mym][x]+itsgyy[myp][x];
820 cerr <<
"second convolution took "<<timer.
GetRealTime()<<
" us\n";
826 if (DebugLevelIsSet(D_ST_WRITE_DEBUG_IM)){
827 _WriteDebugImage(sgxx,
"sgxx-7x7.mip");
828 _WriteDebugImage(sgxy,
"sgxy-7x7.mip");
829 _WriteDebugImage(sgyy,
"sgyy-7x7.mip");
831 CalcStructureTensorValid(gx, gy, sgxx, sgxy, sgyy);
832 _WriteDebugImage(sgxx,
"sgxx-st.mip");
833 _WriteDebugImage(sgxy,
"sgxy-st.mip");
834 _WriteDebugImage(sgyy,
"sgyy-st.mip");
840 cerr <<
"CalcStructureTensor7x7 without _GradientProducts took "<<timer.
GetRealTime()<<
" us\n";
849 template <
class InputStorageType,
class OutputStorageType>
853 if (!_gxx.IsEmpty()) _gxx.Release();
854 _gxx.Init(width, height, 1);
855 if (!_gxy.IsEmpty()) _gxy.Release();
856 _gxy.Init(width, height, 1);
857 if (!_gyy.IsEmpty()) _gyy.Release();
858 _gyy.Init(width, height, 1);
859 if (!_tsgxx.IsEmpty()) _tsgxx.Release();
860 _tsgxx.Init(width, height, 1);
861 if (!_tsgxy.IsEmpty()) _tsgxy.Release();
862 _tsgxy.Init(width, height, 1);
863 if (!_tsgyy.IsEmpty()) _tsgyy.Release();
864 _tsgyy.Init(width, height, 1);
866 _InternalMemWidth=width;
867 _InternalMemHeight=height;
870 template <
class InputStorageType,
class OutputStorageType>
877 BIASERR(
"error wrting "<<name);
883 template <
class InputStorageType,
class OutputStorageType>
890 if (width>_InternalMemWidth || height>_InternalMemHeight){
892 _AllocInternalMem(width, height);
901 int xtlx, xtly, xbrx, xbry, ytlx, ytly, ybrx, ybry;
905 const int minx=((xtlx<ytlx)?(ytlx):(xtlx));
906 const int maxx=((xbrx<ybrx)?(xbrx):(ybrx));
907 const int miny=((xtly<ytly)?(ytly):(xtly));
908 const int maxy=((xbrx<ybry)?(xbry):(ybry));
910 _gxx.GetROI()->SetCorners(minx, miny, maxx, maxy);
911 _gxy.GetROI()->SetCorners(minx, miny, maxx, maxy);
912 _gyy.GetROI()->SetCorners(minx, miny, maxx, maxy);
935 register const int step=width-(maxx-minx);
936 const int offset=miny*width+minx;
937 register const OutputStorageType *igx=gx.
GetImageData()+offset;
938 register const OutputStorageType *igy=gy.
GetImageData()+offset;
939 register OutputStorageType *igxx=_gxx.GetImageData()+offset;
940 register OutputStorageType *igxy=_gxy.GetImageData()+offset;
941 register OutputStorageType *igyy=_gyy.GetImageData()+offset;
943 register const OutputStorageType *end=gx.
GetImageData()+(maxy-1)*width+maxx;
944 const OutputStorageType *lend=gx.
GetImageData()+miny*width+maxx;
950 *igxy++=*igx++ * *igy++;
963 template <
class InputStorageType,
class OutputStorageType>
967 _grad->GetBorders(border_x, border_y);
968 border_x += _HalfWinSize;
969 border_y += _HalfWinSize;
976 #define FILTER_INSTANTIATION_CLASS StructureTensor
977 #define FILTER_INSTANTIATION_NO_UNSIGNED_OUTPUT
978 #include "Filterinst.hh"
void Release()
reimplemented from ImageBase
gradient calculation with separated gauss masks
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 FilterInt(const Image< InputStorageType > &src, Image< OutputStorageType > &dst)
virtual void GetBordersValid_(int &border_x, int &border_y) const
bool IsEmpty() const
check if ImageData_ points to allocated image buffer or not
virtual int FilterFloat(const Image< InputStorageType > &src, Image< OutputStorageType > &dst)
void _AllocInternalMem(const int width, const int height)
allocates _gxx, _gyy, _gxy, _tsgxx, _tsgxy, _tsgyy and sets InternalMemWidth and _InternalMemHeight ...
unsigned int GetWidth() const
basic class for structure tensor calculation
int CalcStructureTensor(const Image< InputStorageType > &src, Image< OutputStorageType > &sgxx, Image< OutputStorageType > &sgxy, Image< OutputStorageType > &sgyy)
Calculates the gradients uses internal gradient class and calls CalcStructureTensor with these gradie...
int CalcStructureTensor3x3(const Image< OutputStorageType > &gx, const Image< OutputStorageType > &gy, Image< OutputStorageType > &sgxx, Image< OutputStorageType > &sgxy, Image< OutputStorageType > &sgyy)
Uses _HalfWinSize=1 Destination images must be initialized.
void _GradientProducts(const Image< OutputStorageType > &gx, const Image< OutputStorageType > &gy)
fills up _gxx, _gxy, _gyy from gx and gy
FilterNTo2N< InputStorageType, OutputStorageType > * _grad
pointer to gradient filter actually used:
ROI * GetROI()
Returns a pointer to the roi object.
unsigned int GetHeight() const
virtual int Filter(const Image< InputStorageType > &src, Image< OutputStorageType > &dst)
calls the apropriate non virtual member function returns an 3 channel image where ...
int CalcStructureTensorValid(const Image< OutputStorageType > &gx, const Image< OutputStorageType > &gy, Image< OutputStorageType > &sgxx, Image< OutputStorageType > &sgxy, Image< OutputStorageType > &sgyy)
For any _HalfWinSize.
bool SamePixelAndChannelCount(const ImageBase &Image) const
checks if data area has same "size" as Image of other type
static int Save(const std::string &filename, const ImageBase &img, const enum TFileFormat FileFormat=FF_auto, const bool sync=BIAS_DEFAULT_SYNC, const int c_jpeg_quality=BIAS_DEFAULT_IMAGE_QUALITY, const bool forceNewID=BIAS_DEFAULT_FORCENEWID, const bool &writeMetaData=true)
Export image as file using extrnal libs.
int CalcStructureTensor7x7(const Image< OutputStorageType > &gx, const Image< OutputStorageType > &gy, Image< OutputStorageType > &sgxx, Image< OutputStorageType > &sgxy, Image< OutputStorageType > &sgyy)
Uses _HalfWinSize=3 Destination images must be initialized.
double GetRealTime() const
return real time (=wall time clock) in usec JW For Win32: real-time is measured differently from user...
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
void _WriteDebugImage(Image< OutputStorageType > &im, std::string name)
for debugging only
bool NotBiggerPixelAndSameChannelCount(const ImageBase &Image) const
checks if data area has bigger or the same "size" as Image of other type
class TimeMeasure contains functions for timing real time and cpu time.
int CalcStructureTensor5x5(const Image< OutputStorageType > &gx, const Image< OutputStorageType > &gy, Image< OutputStorageType > &sgxx, Image< OutputStorageType > &sgxy, Image< OutputStorageType > &sgyy)
Uses _HalfWinSize=2 Destination images must be initialized.
base class for simple n->3n filter implementations
const StorageType ** GetImageDataArray() const
overloaded GetImageDataArray() from ImageBase