Skip to content
Snippets Groups Projects
Commit de6ba883 authored by Stéphane Albert's avatar Stéphane Albert
Browse files

ENH: Improved FastSIFTKeyPointSetFilterOutputInterestPointAscii test.

parent a04d49a5
No related branches found
No related tags found
No related merge requests found
......@@ -36,9 +36,9 @@ bool CMP(std::vector<float> a, std::vector<float> b)
return lexicographical_compare(a.begin(), a.begin() + 2, b.begin(), b.begin() + 2);
}
int otbImageToFastSIFTKeyPointSetFilterOutputInterestPointAscii(int itkNotUsed(argc), char * argv[])
int
otbImageToFastSIFTKeyPointSetFilterOutputInterestPointAscii( int itkNotUsed( argc ), char * argv[] )
{
const char * infname = argv[1];
const char * outfname = argv[2];
......@@ -59,7 +59,7 @@ int otbImageToFastSIFTKeyPointSetFilterOutputInterestPointAscii(int itkNotUsed(a
typedef PointSetType::PointDataContainer PointDataContainerType;
typedef PointDataContainerType::Iterator PointDataIteratorType;
typedef std::vector<float> siftDataVector;
typedef std::vector< RealType > siftDataVector;
typedef std::vector<siftDataVector> ImageDataType; //Kind of PointSet with vectors
// Instantiating object
......@@ -76,10 +76,29 @@ int otbImageToFastSIFTKeyPointSetFilterOutputInterestPointAscii(int itkNotUsed(a
PointsIteratorType pIt = filter->GetOutput()->GetPoints()->Begin();
PointDataIteratorType pDataIt = filter->GetOutput()->GetPointData()->Begin();
assert(
filter->GetOutput()->GetPoints()->Size() ==
filter->GetOutput()->GetPointData()->Size() );
std::ofstream outfile(outfname);
outfile << "Number of scales: " << scales << std::endl;
outfile << "Number of SIFT key points: " << filter->GetOutput()->GetNumberOfPoints() << std::endl;
outfile << "Number of SIFT key points: "
<< filter->GetOutput()->GetNumberOfPoints()
<< std::endl;
outfile << "Number of points: "
<< filter->GetOutput()->GetPoints()->Size()
<< std::endl;
outfile << "Number of points data: "
<< filter->GetOutput()->GetPointData()->Size()
<< std::endl;
if( filter->GetOutput()->GetPoints()->Size() !=
filter->GetOutput()->GetPointData()->Size() )
return EXIT_FAILURE;
// Copy the PointSet to std::vector< std::vector >
while (pIt != filter->GetOutput()->GetPoints()->End())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment