-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_image.cc
33 lines (25 loc) · 681 Bytes
/
test_image.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "hansolo_node_new.h"
#include <iostream>
#include <string>
#include <fstream>
#include <opencv2/opencv.hpp>
#include"image_tools.h"
#include"hansolo_image_msg.h"
int main(int argc,char **argv)
{
std::string videoPath{"/home/hansolo/CplusplusLearn/hansolo_toy_core/test/2.mp4"};
hansoloImageTools imgTool{videoPath};
hansolo_node node{"image_node",argc,argv};
auto pub = node.create_publisher<hansolo_imageMsg>("/image_pub");
hansolo_imageMsg img;
int frameId = 0;
img = imgTool.getImage();
img.frameId = frameId;
while (img.data.length()>0)
{
pub.publish(img);
img = imgTool.getImage();
frameId++;
img.frameId = frameId;
}
}