7 #include <wx/filepicker.h>
8 #include <wx/propgrid/propgrid.h>
10 #include <opencv2/core.hpp>
11 #include <opencv2/highgui.hpp>
12 #include <opencv2/imgproc.hpp>
39 wxWindowID
id = wxID_ANY,
40 const wxPoint &pos = wxDefaultPosition,
41 const wxSize &size = wxDefaultSize,
42 long style = wxTAB_TRAVERSAL,
43 const wxString &name = wxPanelNameStr
52 #pragma region cv::VideoCapture
53 bool open(
const std::string& filename);
56 bool isOpened(){
return m_videoCapture.isOpened(); };
59 void release(){
return m_videoCapture.release(); };
62 bool grab(){
return m_videoCapture.grab(); }
65 bool retrieve(cv::Mat& image,
int channel = 0);
68 bool read(cv::Mat& image){
return m_videoCapture.read(image); };
71 double get(
int propId){
return m_videoCapture.get(propId); };
74 bool set(
int propId,
double value){
return m_videoCapture.set(propId, value); };
82 #pragma endregion cv::VideoCapture
85 const static std::map <int, std::string> PROPERTY_MAP;
86 const std::map < int, wxPGProperty*> m_properties;
87 static const std::string CLASS_NAME;
88 cv::VideoCapture m_videoCapture;
92 void initFilePicker(wxSizer*);
93 void initPropertyGrid(wxSizer*);
94 void initButtons(wxSizer*);
95 #pragma endregion layout
97 #pragma region event handling
98 void evtFilePickerChanged(wxFileDirPickerEvent&);
99 void evtOK(wxCommandEvent&);
100 void evtCancel(wxCommandEvent&);
101 #pragma endregion event handling
103 wxFilePickerCtrl* m_filePickerCtrl;
104 wxPropertyGrid* m_propertyGrid;
105 std::tr2::sys::path m_filename;
109 void loadProperties();
110 void clearProperties();
bool retrieve(cv::Mat &image, int channel=0)
Decodes and returns the grabbed video frame.
bool set(int propId, double value)
Sets a property in the VideoCapture.
Definition: VideoCapture.hpp:74
void release()
Closes video file or capturing device.
Definition: VideoCapture.hpp:59
bool isOpened()
Returns true if video capturing has been initialized already.
Definition: VideoCapture.hpp:56
friend void operator>>(VideoCapture &, ImagePanel &)
Retrieves a image frame from the opened media into an xv::Image.
bool read(cv::Mat &image)
Grabs, decodes and returns the next video frame.
Definition: VideoCapture.hpp:68
bool grab()
Grabs the next frame from video file or capturing device.
Definition: VideoCapture.hpp:62
Class used to display images and as container of widgets.
Definition: ImagePanel.hpp:32
VideoCapture()
Default constructor.
GUI component to capture video from files and devices.
Definition: VideoCapture.hpp:30
bool open(const std::string &filename)
Open video file or a capturing device for video capturing.