camera.h
Go to the documentation of this file.
1 
2 /* Most of capture.cpp and capture.h are copied from http://jsk-enshu.svn.sourceforge.net/viewvc/jsk-enshu/trunk/keisanki/2009/ */
3 #include <opencv/cv.h>
4 #include <opencv/highgui.h>
5 #include <linux/videodev2.h>
6 #include <fcntl.h>
7 #include <errno.h>
8 #include <sys/ioctl.h>
9 
10 /* v4l2 capture class */
12 {
13  typedef struct _buffer {
14  void *start;
15  size_t length;
16  } buffer;
17  cv::Mat frame;
18  std::string dev_name;
19  int fd, width, height;
21  unsigned int n_buffers;
22  bool open_device();
23  bool init_device();
24  bool init_mmap();
25  bool start_capturing();
26  bool stop_capturing();
27  void uninit_device();
28  bool uninit_mmap();
29  bool close_device();
30  bool read_frame(void);
31  bool write_img(uchar * ret);
32  bool init_all(size_t _width, size_t _height, unsigned int _devId);
33  public:
34  v4l_capture();
35  ~v4l_capture();
36  uchar *capture ();
37  int getHeight ();
38  int getWidth ();
39  int init (size_t _width, size_t _height, unsigned int devId);
40 };
bool uninit_mmap()
Definition: camera.cpp:196
buffer * buffers
Definition: camera.h:20
int getHeight()
Definition: camera.cpp:45
bool close_device()
Definition: camera.cpp:76
int width
Definition: camera.h:19
int height
Definition: camera.h:19
~v4l_capture()
Definition: camera.cpp:15
int getWidth()
Definition: camera.cpp:40
bool init_mmap()
Definition: camera.cpp:140
int init(size_t _width, size_t _height, unsigned int devId)
Definition: camera.cpp:23
bool write_img(uchar *ret)
Definition: camera.cpp:86
struct v4l_capture::_buffer buffer
v4l_capture()
Definition: camera.cpp:10
bool open_device()
Definition: camera.cpp:63
bool init_device()
Definition: camera.cpp:209
std::string dev_name
Definition: camera.h:18
bool init_all(size_t _width, size_t _height, unsigned int _devId)
Definition: camera.cpp:50
int fd
Definition: camera.h:19
bool stop_capturing()
Definition: camera.cpp:323
cv::Mat frame
Definition: camera.h:17
void uninit_device()
Definition: camera.cpp:288
unsigned int n_buffers
Definition: camera.h:21
bool read_frame(void)
Definition: camera.cpp:117
uchar * capture()
Definition: camera.cpp:33
bool start_capturing()
Definition: camera.cpp:294


hrpsys
Author(s): AIST, Fumio Kanehiro
autogenerated on Thu May 6 2021 02:41:49