-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_image_receive2.cc
46 lines (30 loc) · 821 Bytes
/
test_image_receive2.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
34
35
36
37
38
39
40
41
42
43
44
45
46
#include<iostream>
#include"hansolo_node_new.h"
#include"hansolo_publisher.h"
#include <opencv2/opencv.hpp>
#include"image_tools.h"
#include"hansolo_image_msg.h"
void sub_callback(const hansolo_imageMsg &msg)
{
hansoloImageTools tool;
cv::Mat img = tool.binaryImage2Mat(msg.data);
if(img.empty()){
return;
}
hDebug(Color::BG_DEFAULT) << msg.frameId;
// cv::resize(img, img, cv::Size(img.size[1]/6,img.size[0]/6));
cv::imshow("Image", img);
if(cv::waitKey(30)>=0){
return;
}
}
int main(int argc,char **argv)
{
// absl::ParseCommandLine(argc, argv);
hansolo_node client{"hansolo video2",argc,argv};
auto sub = client.create_subscriber<hansolo_imageMsg>("/image_pub", sub_callback);
cv::namedWindow("Image",cv::WINDOW_NORMAL);
while(1){
}
return 0;
}