Go to the documentation of this file.
1 #ifndef CVTESTBED_H
2 #define CVTESTBED_H
4 #include "Alvar.h"
5 #include <vector>
6 #include <string>
7 #include "cv.h"
8 #include "highgui.h"
9 #include "CaptureFactory.h"
11 using namespace alvar;
66 class CvTestbed {
67 protected:
70  CvTestbed();
72  CvTestbed(const CvTestbed&);
74  CvTestbed& operator=(const CvTestbed&);
76  ~CvTestbed();
78  bool running;
81  void (*videocallback)(IplImage *image);
83  int (*keycallback)(int key);
85  std::string wintitle;
87  std::string filename;
89  struct Image {
90  IplImage *ipl;
91  std::string title;
92  bool visible;
94  Image(IplImage *_ipl, std::string _title, bool _visible, bool _release_at_exit)
95  :ipl(_ipl),title(_title),visible(_visible),release_at_exit(_release_at_exit) {}
96  };
98  std::vector<Image> images;
101  static void default_videocallback(IplImage *image);
103  void WaitKeys();
105  void ShowVisibleImages();
106 public:
107  //CameraDescription camera_description;
112  static CvTestbed& Instance();
117  void SetVideoCallback(void (*_videocallback)(IplImage *image));
127  void SetKeyCallback(int (*_keycallback)(int key));
132  bool StartVideo(Capture *_cap, const char *_wintitle=0/*"Capture"*/);
136  void StopVideo() { running = false; }
143  size_t SetImage(const char *title, IplImage *ipl, bool release_at_exit=false);
148  IplImage *CreateImage(const char *title, CvSize size, int depth, int channels);
153  IplImage *CreateImageWithProto(const char *title, IplImage *proto, int depth=0, int channels=0);
157  IplImage *GetImage(size_t index);
161  size_t GetImageIndex(const char *title);
165  IplImage *GetImage(const char *title);
169  bool ToggleImageVisible(size_t index, int flags=1);
170 };
172 #endif
Capture * cap
Definition: CvTestbed.h:68
Main ALVAR namespace.
Definition: Alvar.h:174
Image structure to store the images internally.
Definition: CvTestbed.h:89
int keycallback(int key)
std::vector< Image > images
Vector of images stored internally.
Definition: CvTestbed.h:98
bool running
Boolean indicating are we still running. We exit from the WaitKeys when this is false.
Definition: CvTestbed.h:78
unsigned char * image
Definition: GlutViewer.cpp:155
Image(IplImage *_ipl, std::string _title, bool _visible, bool _release_at_exit)
Definition: CvTestbed.h:94
std::string wintitle
The window title for the video view.
Definition: CvTestbed.h:85
std::string filename
The filename if we are reading an AVI file.
Definition: CvTestbed.h:87
IplImage * ipl
Definition: CvTestbed.h:90
This file implements a capture factory with a plugin interface to allow for different capture backend...
bool release_at_exit
Definition: CvTestbed.h:93
Capture interface that plugins must implement.
Definition: Capture.h:46
void videocallback(IplImage *image)
This file defines library export definitions, version numbers and build information.
CvTestbed is a class for making quick OpenCV test applications
Definition: CvTestbed.h:66
std::string title
Definition: CvTestbed.h:91
void StopVideo()
Stop video.
Definition: CvTestbed.h:136

Author(s): Scott Niekum
autogenerated on Mon Jun 10 2019 12:47:04