Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 348

how can i capture an image from camera using opencv c++ code in ROS ?

$
0
0
This is my code: but I don't how to use it in ROS.Please help me step by step. #include "opencv2/opencv.hpp" using namespace cv; int main(int argc, char** argv) { VideoCapture cap; // open the default camera, use something different from 0 otherwise; // Check VideoCapture documentation. if(!cap.open(0)) return 0; for(;;) { Mat frame; cap >> frame; if( frame.empty() ) break; // end of video stream imshow("this is you, smile! :)", frame); if( waitKey(10) == 27 ) break; // stop capturing by pressing ESC } // the camera will be closed automatically upon exit // cap.close(); return 0; }

Viewing all articles
Browse latest Browse all 348

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>