2
* Copyright (C) 2009 Pablo d'Angelo
4
* This file is part of Panomatic.
6
* Panomatic is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* Panomatic is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with Panomatic; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22
#ifndef __lfeat_KeyPointIO_h
23
#define __lfeat_KeyPointIO_h
29
#include "KeyPointDetector.h"
34
struct LFIMPEX ImageInfo
37
: width(0), height(0), dimensions(0)
40
ImageInfo(const std::string & filename, int width, int height)
41
: filename(filename), width(width), height(height), dimensions(0)
51
// functions to read keypoints
52
//bool identifySIFTKeypoints( const std::string & filename);
53
//ImageInfo loadSIFTKeypoints( const std::string & filename, KeyPointInsertor & insertor);
55
ImageInfo LFIMPEX loadKeypoints( const std::string & filename, KeyPointVect_t & insertor);
58
/// Base class for a keypoint writer
59
class LFIMPEX KeypointWriter
67
KeypointWriter(std::ostream & out=std::cout)
72
virtual void writeHeader ( const ImageInfo & imageinfo, int nKeypoints, int dims ) = 0;
74
virtual void writeKeypoint ( double x, double y, double scale, double orientation, int dims, double * vec ) = 0;
76
virtual void writeFooter() = 0;
79
class LFIMPEX SIFTFormatWriter : public KeypointWriter
85
SIFTFormatWriter(std::ostream & out=std::cout)
90
void writeHeader (const ImageInfo & imageinfo, int nKeypoints, int dims );
92
void writeKeypoint ( double x, double y, double scale, double orientation, int dims, double * vec );
97
class LFIMPEX DescPerfFormatWriter : public KeypointWriter
103
DescPerfFormatWriter(std::ostream & out=std::cout)
104
: KeypointWriter(out)
108
void writeHeader (const ImageInfo & imageinfo, int nKeypoints, int dims );
110
void writeKeypoint ( double x, double y, double scale, double orientation, int dims, double * vec );
116
class LFIMPEX AutopanoSIFTWriter : public KeypointWriter
120
AutopanoSIFTWriter(std::ostream & out=std::cout)
121
: KeypointWriter(out)
125
void writeHeader ( const ImageInfo & imageinfo, int nKeypoints, int dims );
127
void writeKeypoint ( double x, double y, double scale, double orientation, int dims, double * vec );