axis ptz ros節點
阿新 • • 發佈:2019-01-09
https://github.com/RobotnikAutomation/axis_camera
http://wiki.ros.org/axis_camera
opencv 開啟axis攝像頭
#include <stdio.h> #include <opencv2/opencv.hpp> #include <iostream> int main(int, char**) { cv::VideoCapture vcap; cv::Mat image; // This works on a D-Link CDS-932L //const std::string videoStreamAddress = "http://192.168.1.13/axis-cgi/jpg/image.cgi?resolution=qcif&text=0&date=0&clock=0&rotation=0&.jpg"; const std::string videoStreamAddress = "http://192.168.1.13/axis-cgi/mjpg/video.cgi?resolution=640x480&req_fps=30&.mjpg"; //open the video stream and make sure it's opened if (!vcap.open(videoStreamAddress) ) { std::cout << "Error opening video stream or file" << std::endl; return -1; } for (;;) { if (!vcap.read(image)) { std::cout << "No frame" << std::endl; cv::waitKey(); } cv::imshow("Output Window", image); if (cv::waitKey(1) >= 0) break; } }