UWARG Computer Vision
pixel_object.h
Go to the documentation of this file.
1 
16 #ifndef PIXEL_OBJECT_H_INCLUDED
17 #define PIXEL_OBJECT_H_INCLUDED
18 
27 #include <opencv2/core/core.hpp>
28 #include <vector>
29 #include "frame.h"
30 
32 public:
33  PixelObject(cv::Mat & crop, std::vector<cv::Point> & contour, cv::Point2d centroid, double area, double perimeter, cv::Scalar colour, cv::Point2d error, double errorAngle);
34 
39  std::vector<cv::Point> & get_contour();
40 
46  cv::Point2d get_centroid();
47 
53  double get_area();
54 
60  double get_perimeter();
61 
67  cv::Scalar get_colour();
68 
74  cv::Point2d get_error();
75 
81  double get_error_angle();
82 
88  Frame * get_image();
89 
95  cv::Mat & get_cropped_image();
96 
98  friend void Frame::add_object(PixelObject * o);
99 private:
103  std::vector<cv::Point> contour;
104 
108  cv::Point2d centroid;
109 
113  double area;
114 
118  double perimeter;
119 
123  cv::Scalar colour;
124 
128  cv::Point2d error;
129 
133  double errorAngle;
134 
138  Frame * image;
139 
140  /*
141  * @brief Cropped picture of object
142  */
143  cv::Mat crop;
144 };
145 
146 
147 #endif // PIXEL_OBJECT_H_INCLUDED
double get_perimeter()
Getter for perimeter.
Definition: pixel_object.cpp:38
std::vector< cv::Point > & get_contour()
Getter for contour.
Definition: pixel_object.cpp:26
cv::Point2d get_error()
Getter for error.
Definition: pixel_object.cpp:46
void add_object(PixelObject *o)
Adds given object to the list of objects in the frame.
Definition: frame.cpp:66
double get_error_angle()
Getter for error angle.
Definition: pixel_object.cpp:50
cv::Scalar get_colour()
Getter for colour.
Definition: pixel_object.cpp:42
double get_area()
Getter for area.
Definition: pixel_object.cpp:34
Container class for storing photos or frames of video to be processed and analyzed.
Container class for storing information about interesting objects in photos or video frames using pix...
Definition: pixel_object.h:31
cv::Point2d get_centroid()
Getter for centroid.
Definition: pixel_object.cpp:30
Definition: frame.h:49
Frame * get_image()
Getter for image.
Definition: pixel_object.cpp:54
cv::Mat & get_cropped_image()
Getter for cropped image.
Definition: pixel_object.cpp:58