haraldhv
/
aigo
Archived
1
0
Fork 0

Added more checkbuttons and really fixed circle mask

This commit is contained in:
Harald Hvaal 2007-03-01 17:07:54 +00:00
parent 25a5a92463
commit 04216fbec2
3 changed files with 12 additions and 5 deletions

View File

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

View File

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

View File

@ -185,6 +185,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkThreshold" >
<property name="text" >
<string>Threshold</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
@ -247,7 +254,7 @@
<x>0</x>
<y>0</y>
<width>942</width>
<height>29</height>
<height>31</height>
</rect>
</property>
<widget class="QMenu" name="menu_File" >