加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
camera.h 1.20 KB
一键复制 编辑 原始数据 按行查看 历史
拎壶葱 提交于 2023-11-06 10:11 . 1.add multi parkdet process
#ifndef __SHARERAM_CAMERA
#define __SHARERAM_CAMERA
#include <stdio.h>
#include <string>
#include <unistd.h>
#include <opencv2/opencv.hpp>
#include <iostream>
#include <vector>
#include <stdio.h>
#include <cmath>
#include <unistd.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <errno.h>
#include <stdio.h>
#define SHMNAME "shm_decoder_front"
#define SHMNAME1 "shm_decoder_middle"
#define SHMNAME2 "shm_decoder_back"
#define SHMNAME3 "shm_decoder_plate"
#define SHMNAME4 "shm_decoder_front1"
#define SHMNAME5 "shm_decoder_middle1"
#define SHMNAME6 "shm_decoder_back1"
#define SHMNAME7 "shm_decoder_plate1"
#define OPEN_FLAG O_RDWR|O_CREAT
#define OPEN_MODE 00777
typedef struct
{
volatile bool rLock;
volatile bool wLock;
volatile unsigned int counter;
unsigned char data[1920*1080*3];
}MatBuf;
class Camera
{
public:
Camera();
virtual ~Camera();
bool initShm(char *shmName);
bool getNewMat(cv::Mat &mat);
bool getNewMat(cv::Mat &mat, unsigned int &index);
bool getMatByIndex(cv::Mat &mat, unsigned int index);
private:
void* shareMatAddr = nullptr;
unsigned int historyCounter = 0;
};
#endif
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化