Berkeley SfM
drawing_utils.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015, The Regents of the University of California (Regents).
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are
7  * met:
8  *
9  * 1. Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * 2. Redistributions in binary form must reproduce the above
13  * copyright notice, this list of conditions and the following
14  * disclaimer in the documentation and/or other materials provided
15  * with the distribution.
16  *
17  * 3. Neither the name of the copyright holder nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS
22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
25  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31  * POSSIBILITY OF SUCH DAMAGE.
32  *
33  * Please contact the author(s) of this library if you have any questions.
34  * Authors: Erik Nelson ( eanelson@eecs.berkeley.edu )
35  * David Fridovich-Keil ( dfk@eecs.berkeley.edu )
36  */
37 
38 ///////////////////////////////////////////////////////////////////////////////
39 //
40 // This file defines helpful drawing/debugging utilities for images, feature
41 // matching, and SFM.
42 //
43 ///////////////////////////////////////////////////////////////////////////////
44 
45 #ifndef BSFM_IMAGE_DRAWING_UTILS_H
46 #define BSFM_IMAGE_DRAWING_UTILS_H
47 
48 #include "image.h"
49 #include "../matching/feature_match.h"
50 
51 namespace bsfm {
52 namespace drawing {
53 
54 // Annotate an image by drawing features on it.
55 void AnnotateFeatures(const FeatureList& features, Image& image,
56  unsigned int radius = 3,
57  unsigned int line_thickness = 2);
58 
59 // Draw features as circles in an image.
60 void DrawImageFeatures(const FeatureList& features, const Image& image,
61  const std::string& window_name = std::string(),
62  unsigned int radius = 3,
63  unsigned int line_thickness = 2);
64 
65 // Given two images, and data containing their features and matches between
66 // those features, draw the two images side by side, with matches drawn as lines
67 // between them.
68 void DrawImageFeatureMatches(const Image& image1, const Image& image2,
69  const FeatureMatchList& feature_matches,
70  const std::string& window_name = std::string(),
71  unsigned int line_thickness = 1);
72 
73 } //\namespace drawing
74 } //\namespace bsfm
75 
76 #endif
void DrawImageFeatures(const FeatureList &features, const Image &image, const std::string &window_name, unsigned int radius, unsigned int line_thickness)
void AnnotateFeatures(const FeatureList &features, Image &image, unsigned int radius, unsigned int line_thickness)
std::vector< Feature > FeatureList
Definition: feature.h:65
Definition: camera.cpp:50
std::vector< FeatureMatch > FeatureMatchList
Definition: feature_match.h:99
void DrawImageFeatureMatches(const Image &image1, const Image &image2, const FeatureMatchList &feature_matches, const std::string &window_name, unsigned int line_thickness)