diff --git a/lib/mask.cpp b/lib/mask.cpp index 2508b9b..bd1f1c0 100644 --- a/lib/mask.cpp +++ b/lib/mask.cpp @@ -15,7 +15,7 @@ namespace Mask for (int y = 0; y < size; ++y) { newMask->mask[y*size+x] = - (sqrt( pow(x - x/2, 2) + pow(y - y/2, 2)) < size / 2) + (sqrt( pow(x - size/2, 2) + pow(y - size/2, 2)) <= size / 2 ) ? 255 : 0; } } diff --git a/qt/aigoqt.cpp b/qt/aigoqt.cpp index 4b8ab6d..db3fcc6 100644 --- a/qt/aigoqt.cpp +++ b/qt/aigoqt.cpp @@ -27,11 +27,11 @@ void AigoQt::updateImage( void ) cam->update(); SDL_Surface *s = cam->getSurface(); - Image::threshold(s, blackImageThreshold->value(), whiteImageThreshold->value()); + if (checkThreshold->isChecked()) Image::threshold(s, blackImageThreshold->value(), whiteImageThreshold->value()); SDL_BlitSurface(s, NULL, copy, NULL); - Mask::mask *mask = Mask::createCircleMask(10); - Mask::printMask(mask); + Mask::mask *mask = Mask::createCircleMask(19); + //Mask::printMask(mask); if (checkErosion->isChecked()) Image::erosion(s, copy, mask); if (checkDilation->isChecked()) Image::dilation(s, copy, mask); diff --git a/qt/main.ui b/qt/main.ui index e2cadd1..4d7abbf 100644 --- a/qt/main.ui +++ b/qt/main.ui @@ -185,6 +185,13 @@ + + + + Threshold + + + @@ -247,7 +254,7 @@ 0 0 942 - 29 + 31