forked from lucasw/vimjay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
misc_nodes.h
73 lines (49 loc) · 1.14 KB
/
misc_nodes.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#ifndef __MISC_NODES_H__
#define __MISC_NODES_H__
#include <iostream>
#include <stdio.h>
#include <boost/thread.hpp>
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
//#include <random>
#include <deque>
#include <map>
#include "nodes.h"
namespace bm {
class Webcam : public ImageNode
{
cv::VideoCapture capture; //CV_CAP_OPENNI );
void runThread();
bool is_thread_dirty;
bool do_capture;
bool run_thread;
boost::thread cam_thread;
int error_count;
public:
Webcam(const std::string name);
virtual ~Webcam();
virtual bool update();
};
/////////////////////////////////
class ImageDir : public Buffer
{
std::deque<cv::Mat> frames_orig;
std::vector<std::string> all_files;
bool resizeImages();
public:
ImageDir(const std::string name);
bool loadImages();
virtual bool update();
virtual bool load(cv::FileNodeIterator nd);
virtual bool save(cv::FileStorage& fs);
};
/////////////////////////////////
class BrowseDir : public ImageNode
{
public:
BrowseDir(const std::string name);
virtual bool handleKey(int key);
virtual bool update();
};
} // bm
#endif // MISC_NODES