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 <opencv2/core/core.hpp>
4 #include <linux/videodev2.h>
5 #include <fcntl.h>
6 #include <errno.h>
7 #include <sys/ioctl.h>
8 
9 /* v4l2 capture class */
11 {
12  typedef struct _buffer {
13  void *start;
14  size_t length;
15  } buffer;
16  cv::Mat frame;
17  std::string dev_name;
18  int fd, width, height;
20  unsigned int n_buffers;
21  bool open_device();
22  bool init_device();
23  bool init_mmap();
24  bool start_capturing();
25  bool stop_capturing();
26  void uninit_device();
27  bool uninit_mmap();
28  bool close_device();
29  bool read_frame(void);
30  bool write_img(uchar * ret);
31  bool init_all(size_t _width, size_t _height, unsigned int _devId);
32  public:
33  v4l_capture();
34  ~v4l_capture();
35  uchar *capture ();
36  int getHeight ();
37  int getWidth ();
38  int init (size_t _width, size_t _height, unsigned int devId);
39 };
bool uninit_mmap()
Definition: camera.cpp:196
buffer * buffers
Definition: camera.h:19
int getHeight()
Definition: camera.cpp:45
bool close_device()
Definition: camera.cpp:76
int width
Definition: camera.h:18
int height
Definition: camera.h:18
~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:17
bool init_all(size_t _width, size_t _height, unsigned int _devId)
Definition: camera.cpp:50
int fd
Definition: camera.h:18
bool stop_capturing()
Definition: camera.cpp:323
cv::Mat frame
Definition: camera.h:16
void uninit_device()
Definition: camera.cpp:288
unsigned int n_buffers
Definition: camera.h:20
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 Sat Dec 17 2022 03:52:20