haraldhv
/
aigo
Archived
1
0
Fork 0

Fixing mask circle

This commit is contained in:
Harald Hvaal 2007-03-01 13:42:32 +00:00
parent 3a613c3903
commit 25a5a92463
3 changed files with 17 additions and 1 deletions

View File

@ -1,5 +1,6 @@
#include "mask.h"
#include <math.h>
#include <stdio.h>
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");
}
}

View File

@ -12,6 +12,7 @@ namespace Mask
};
mask * createCircleMask(int size, bool gradient = false);
void printMask(mask *mask);
}
#endif /* ifndef _MASK_H_ */

View File

@ -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);