UWARG Computer Vision
frame.h
Go to the documentation of this file.
1 /*
2  This file is part of WARG's computer-vision
3  Copyright (c) 2015, Waterloo Aerial Robotics Group (WARG)
4  All rights reserved.
5 
6  Redistribution and use in source and binary forms, with or without
7  modification, are permitted provided that the following conditions are met:
8  1. Redistributions of source code must retain the above copyright
9  notice, this list of conditions and the following disclaimer.
10  2. Redistributions in binary form must reproduce the above copyright
11  notice, this list of conditions and the following disclaimer in the
12  documentation and/or other materials provided with the distribution.
13  3. Usage of this code MUST be explicitly referenced to WARG and this code
14  cannot be used in any competition against WARG.
15  4. Neither the name of the WARG nor the names of its contributors may be used
16  to endorse or promote products derived from this software without specific
17  prior written permission.
18 
19  THIS SOFTWARE IS PROVIDED BY WARG ''AS IS'' AND ANY
20  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22  DISCLAIMED. IN NO EVENT SHALL WARG BE LIABLE FOR ANY
23  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
26  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30 
31 #ifndef FRAME_H_INCLUDED
32 #define FRAME_H_INCLUDED
33 
42 #include <opencv2/core/core.hpp>
43 #include "metadata.h"
44 #include <vector>
45 #include "camera.h"
46 
47 class PixelObject;
48 
49 class Frame{
50 public:
51  Frame(cv::Mat * img, std::string id, Metadata m, Camera &camera);
52 
53  ~Frame();
59  std::string get_id();
60 
66  cv::Mat & get_img();
67 
72  cv::Mat & orig_img();
73 
79  void add_object(PixelObject * o);
80 
86  std::vector<PixelObject *> & get_objects();
87 
93  const Metadata * get_metadata();
94 
99  void save(std::string dir);
100 
107  cv::Mat* undistort(Camera &camera);
108 
109 private:
110 
114  cv::Mat * img;
115 
119  cv::Mat * origImg;
120 
124  std::string id;
125 
129  Metadata data;
130 
134  std::vector<PixelObject *> objects;
135 
136  /*
137  * @brief Camera used to capture the frame
138  */
139  Camera &camera;
140 };
141 
142 
143 #endif // FRAME_H_INCLUDED
void save(std::string dir)
Stores the frame as an image file.
Definition: frame.cpp:79
Definition: metadata.h:43
std::vector< PixelObject * > & get_objects()
getter for targets
Definition: frame.cpp:71
std::string get_id()
Definition: frame.cpp:54
Structure for storing plane status information from the time that an image was taken.
void add_object(PixelObject *o)
Adds given object to the list of objects in the frame.
Definition: frame.cpp:66
cv::Mat * undistort(Camera &camera)
returns a new undistorted image using the given camera Intended for testing purposes, Does not modify the Frame.
Definition: frame.cpp:45
cv::Mat & get_img()
Definition: frame.cpp:58
Container class for storing information about interesting objects in photos or video frames using pix...
Definition: pixel_object.h:31
cv::Mat & orig_img()
Original Image.
Definition: frame.cpp:62
Definition: frame.h:49
Container class for storing information about the camera used to capture an image *...
Definition: camera.h:28
const Metadata * get_metadata()
getter for metadata
Definition: frame.cpp:75