Hugin trunk 0.1
Loading...
Searching...
No Matches
KeyPointIO.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2009 Pablo d'Angelo
3 *
4 * This file is part of Panomatic.
5 *
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.
10 *
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.
15 *
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 * <http://www.gnu.org/licenses/>.
19 */
20
21
22#ifndef __lfeat_KeyPointIO_h
23#define __lfeat_KeyPointIO_h
24
25#include <iostream>
26#include <string>
27
28#include "KeyPoint.h"
29#include "KeyPointDetector.h"
30
31namespace lfeat
32{
33
35{
37 : width(0), height(0), dimensions(0)
38 { }
39
40 ImageInfo(const std::string& filename, int width, int height)
41 : filename(filename), width(width), height(height), dimensions(0)
42 { }
43
44 std::string filename;
45 int width;
46 int height;
48};
49
50
51// functions to read keypoints
52//bool identifySIFTKeypoints( const std::string & filename);
53//ImageInfo loadSIFTKeypoints( const std::string & filename, KeyPointInsertor & insertor);
54
55ImageInfo LFIMPEX loadKeypoints( const std::string& filename, KeyPointVect_t& insertor);
56
57
60{
61
62protected:
63 std::ostream& o;
64
65public:
66
67 explicit KeypointWriter(std::ostream& out=std::cout)
68 : o ( out )
69 {
70 }
71
72 virtual void writeHeader ( const ImageInfo& imageinfo, int nKeypoints, int dims ) = 0;
73
74 virtual void writeKeypoint ( double x, double y, double scale, double orientation, double score, int dims, double* vec ) = 0;
75
76 virtual void writeFooter() = 0;
77};
78
80{
81
83
84public:
85 explicit SIFTFormatWriter(std::ostream& out=std::cout)
87 {
88 }
89
90 void writeHeader (const ImageInfo& imageinfo, int nKeypoints, int dims );
91
92 void writeKeypoint ( double x, double y, double scale, double orientation, double score, int dims, double* vec );
93
94 void writeFooter();
95};
96
98{
99
101
102public:
103 explicit DescPerfFormatWriter(std::ostream& out=std::cout)
105 {
106 }
107
108 void writeHeader (const ImageInfo& imageinfo, int nKeypoints, int dims );
109
110 void writeKeypoint ( double x, double y, double scale, double orientation, double score, int dims, double* vec );
111
112 void writeFooter();
113};
114
115
117{
118
119public:
120 explicit AutopanoSIFTWriter(std::ostream& out=std::cout)
122 {
123 }
124
125 void writeHeader ( const ImageInfo& imageinfo, int nKeypoints, int dims );
126
127 void writeKeypoint ( double x, double y, double scale, double orientation, double score, int dims, double* vec );
128
129 void writeFooter();
130};
131
132}
133
134#endif
AutopanoSIFTWriter(std::ostream &out=std::cout)
Definition KeyPointIO.h:120
DescPerfFormatWriter(std::ostream &out=std::cout)
Definition KeyPointIO.h:103
Base class for a keypoint writer.
Definition KeyPointIO.h:60
virtual void writeFooter()=0
KeypointWriter(std::ostream &out=std::cout)
Definition KeyPointIO.h:67
std::ostream & o
Definition KeyPointIO.h:63
virtual void writeHeader(const ImageInfo &imageinfo, int nKeypoints, int dims)=0
virtual void writeKeypoint(double x, double y, double scale, double orientation, double score, int dims, double *vec)=0
SIFTFormatWriter(std::ostream &out=std::cout)
Definition KeyPointIO.h:85
#define LFIMPEX
ImageInfo loadKeypoints(const std::string &filename, KeyPointVect_t &vec)
std::vector< KeyPointPtr > KeyPointVect_t
Definition KeyPoint.h:111
std::string filename
Definition KeyPointIO.h:44
ImageInfo(const std::string &filename, int width, int height)
Definition KeyPointIO.h:40
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.
Definition threshold.h:41