32 lines
606 B
C
32 lines
606 B
C
|
|
#ifndef _CAPTURE_H__
|
||
|
|
#define _CAPTURE_H__
|
||
|
|
|
||
|
|
#include <thread>
|
||
|
|
#include <iostream>
|
||
|
|
#include <opencv2/highgui.hpp>
|
||
|
|
#include <zmq.hpp>
|
||
|
|
|
||
|
|
class capture
|
||
|
|
{
|
||
|
|
public:
|
||
|
|
int index;
|
||
|
|
int port;
|
||
|
|
int width;
|
||
|
|
int height;
|
||
|
|
int fps;
|
||
|
|
bool status = false;
|
||
|
|
char zmq_bind_addr[40] = "tcp://*:";
|
||
|
|
std::thread *thread;
|
||
|
|
cv::VideoCapture *cap;
|
||
|
|
cv::Mat frame;
|
||
|
|
zmq::context_t *context;
|
||
|
|
zmq::socket_t *socket;
|
||
|
|
|
||
|
|
capture(int camera_index, int zmq_port, int width_set = 320, int height_set = 240, int fps_set = 20);
|
||
|
|
void start(void);
|
||
|
|
void run(void);
|
||
|
|
bool is_open(void);
|
||
|
|
};
|
||
|
|
|
||
|
|
#endif
|