static void
int
main(int , char * [])
{
CreateImage(fixedImage, 40);
CreateImage(movingImage, 50);
using PointSetType = BlockMatchingImageFilterType::FeaturePointsType;
using PointsContainerPointer = PointSetType::PointsContainerPointer;
PointsContainerPointer points = pointSet->GetPoints();
p0[0] = 40.0;
p0[1] = 40.0;
p1[0] = 40.0;
p1[1] = 60.0;
p2[0] = 60.0;
p2[1] = 40.0;
p3[0] = 60.0;
p2[1] = 60.0;
points->InsertElement(0, p0);
points->InsertElement(1, p1);
points->InsertElement(2, p2);
points->InsertElement(3, p3);
blockMatchingImageFilter->SetFixedImage(fixedImage);
blockMatchingImageFilter->SetMovingImage(movingImage);
blockMatchingImageFilter->SetFeaturePoints(pointSet);
blockMatchingImageFilter->UpdateLargestPossibleRegion();
typename BlockMatchingImageFilterType::DisplacementsType * displacements =
blockMatchingImageFilter->GetDisplacements();
std::cout << "There are " << displacements->GetNumberOfPoints() << " displacements." << std::endl;
return EXIT_SUCCESS;
}
void
{
image->SetRegions(region);
image->Allocate();
image->FillBuffer(0);
for (unsigned int r = x; r < x + 20; ++r)
{
for (unsigned int c = 40; c < 60; ++c)
{
pixelIndex[0] = r;
pixelIndex[1] = c;
image->SetPixel(pixelIndex, 255);
}
}
}