update reader.cpp
This commit is contained in:
parent
9ecddd91af
commit
55814cb408
@ -10,9 +10,6 @@
|
|||||||
#include <opencv2/opencv.hpp>
|
#include <opencv2/opencv.hpp>
|
||||||
|
|
||||||
#define FIFO_NAME "cvMat"
|
#define FIFO_NAME "cvMat"
|
||||||
#define MAX_BUF 150 * 150 * 4
|
|
||||||
|
|
||||||
using namespace cv;
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
unsigned int timeout_seconds = 2;
|
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);
|
while ((bytesRead = read(fd, tempBuff, sizeof(tempBuff))) > 0) buff.insert(buff.end(), tempBuff, tempBuff + bytesRead);
|
||||||
printf("Received: %d\n", buff.size());
|
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);
|
cv::imwrite("received.jpg", img);
|
||||||
} else if (waiter.revents & POLLERR) {
|
} else if (waiter.revents & POLLERR) {
|
||||||
puts("Got a POLLERR");
|
puts("Got a POLLERR");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user