update reader.cpp

This commit is contained in:
Alexander Popov 2025-03-30 03:10:20 +03:00
parent 9ecddd91af
commit 55814cb408
Signed by: iiiypuk
GPG Key ID: E47FE0AB36CD5ED6

View File

@ -10,9 +10,6 @@
#include <opencv2/opencv.hpp>
#define FIFO_NAME "cvMat"
#define MAX_BUF 150 * 150 * 4
using namespace cv;
int main() {
unsigned int timeout_seconds = 2;
@ -44,7 +41,7 @@ int main() {
while ((bytesRead = read(fd, tempBuff, sizeof(tempBuff))) > 0) buff.insert(buff.end(), tempBuff, tempBuff + bytesRead);
printf("Received: %d\n", buff.size());
Mat img(cv::Size(810, 1080), CV_8UC3, buff.data());
cv::Mat img(cv::Size(810, 1080), CV_8UC3, buff.data());
cv::imwrite("received.jpg", img);
} else if (waiter.revents & POLLERR) {
puts("Got a POLLERR");