Added more checkbuttons and really fixed circle mask
This commit is contained in:
parent
25a5a92463
commit
04216fbec2
|
@ -15,7 +15,7 @@ namespace Mask
|
||||||
for (int y = 0; y < size; ++y)
|
for (int y = 0; y < size; ++y)
|
||||||
{
|
{
|
||||||
newMask->mask[y*size+x] =
|
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;
|
? 255 : 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,11 +27,11 @@ void AigoQt::updateImage( void )
|
||||||
cam->update();
|
cam->update();
|
||||||
SDL_Surface *s = cam->getSurface();
|
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);
|
SDL_BlitSurface(s, NULL, copy, NULL);
|
||||||
|
|
||||||
Mask::mask *mask = Mask::createCircleMask(10);
|
Mask::mask *mask = Mask::createCircleMask(19);
|
||||||
Mask::printMask(mask);
|
//Mask::printMask(mask);
|
||||||
|
|
||||||
if (checkErosion->isChecked()) Image::erosion(s, copy, mask);
|
if (checkErosion->isChecked()) Image::erosion(s, copy, mask);
|
||||||
if (checkDilation->isChecked()) Image::dilation(s, copy, mask);
|
if (checkDilation->isChecked()) Image::dilation(s, copy, mask);
|
||||||
|
|
|
@ -185,6 +185,13 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="checkThreshold" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Threshold</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer>
|
<spacer>
|
||||||
<property name="orientation" >
|
<property name="orientation" >
|
||||||
|
@ -247,7 +254,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>942</width>
|
<width>942</width>
|
||||||
<height>29</height>
|
<height>31</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menu_File" >
|
<widget class="QMenu" name="menu_File" >
|
||||||
|
|
Reference in New Issue