From 25a5a92463b7b2f61fb0ce5f9b1416198af5f23e Mon Sep 17 00:00:00 2001 From: haraldhv Date: Thu, 1 Mar 2007 13:42:32 +0000 Subject: [PATCH] Fixing mask circle --- lib/mask.cpp | 14 ++++++++++++++ lib/mask.h | 1 + qt/aigoqt.cpp | 3 ++- 3 files changed, 17 insertions(+), 1 deletion(-) 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);