diff --git a/lib/mask.cpp b/lib/mask.cpp index bcb0c9b..2508b9b 100644 --- a/lib/mask.cpp +++ b/lib/mask.cpp @@ -1,5 +1,6 @@ #include "mask.h" #include +#include namespace Mask { @@ -21,4 +22,17 @@ namespace Mask return newMask; } + void printMask( mask * mask) + { + for (int i = 0; i < mask->size; ++i) + { + for (int j = 0; j < mask->size; ++j) + { + printf("%d\t", mask->mask[mask->size * i + j]); + } + printf("\n"); + } + printf("\n"); + } + } diff --git a/lib/mask.h b/lib/mask.h index bcb4013..c33c028 100644 --- a/lib/mask.h +++ b/lib/mask.h @@ -12,6 +12,7 @@ namespace Mask }; mask * createCircleMask(int size, bool gradient = false); + void printMask(mask *mask); } #endif /* ifndef _MASK_H_ */ diff --git a/qt/aigoqt.cpp b/qt/aigoqt.cpp index ed527e9..4b8ab6d 100644 --- a/qt/aigoqt.cpp +++ b/qt/aigoqt.cpp @@ -30,7 +30,8 @@ void AigoQt::updateImage( void ) Image::threshold(s, blackImageThreshold->value(), whiteImageThreshold->value()); SDL_BlitSurface(s, NULL, copy, NULL); - Mask::mask *mask = Mask::createCircleMask(4); + Mask::mask *mask = Mask::createCircleMask(10); + Mask::printMask(mask); if (checkErosion->isChecked()) Image::erosion(s, copy, mask); if (checkDilation->isChecked()) Image::dilation(s, copy, mask);