static void
int
main()
{
CreateImage(image);
for (
unsigned int i = 0; i < neighborhood.
GetSize()[0] * neighborhood.
GetSize()[1]; ++i)
{
neighborhood[i] = 1;
}
neighborhoodOperatorImageFunction->SetOperator(neighborhood);
neighborhoodOperatorImageFunction->SetInputImage(image);
{
float output = neighborhoodOperatorImageFunction->EvaluateAtIndex(index);
std::cout << "Sum on border: " << output << std::endl;
}
{
float output = neighborhoodOperatorImageFunction->EvaluateAtIndex(index);
std::cout << "Sum in center: " << output << std::endl;
}
{
float output = neighborhoodOperatorImageFunction->EvaluateAtIndex(index);
std::cout << "Sum outside: " << output << std::endl;
}
return EXIT_SUCCESS;
}
void
{
image->SetRegions(region);
image->Allocate();
image->FillBuffer(0);
for (unsigned int r = 20; r < 80; ++r)
{
for (unsigned int c = 20; c < 80; ++c)
{
pixelIndex[0] = r;
pixelIndex[1] = c;
image->SetPixel(pixelIndex, 1);
}
}
}