{"id":4615,"date":"2014-03-30T14:00:38","date_gmt":"2014-03-30T14:00:38","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/opencv-with-network-cameras-collection-of-common-programming-errors\/"},"modified":"2014-03-30T14:00:38","modified_gmt":"2014-03-30T14:00:38","slug":"opencv-with-network-cameras-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/opencv-with-network-cameras-collection-of-common-programming-errors\/","title":{"rendered":"OpenCV with Network Cameras-Collection of common programming errors"},"content":{"rendered":"<p>I enclosed C++ code for grabbing frames. It requires OpenCV version 2.0 or higher. The code uses cv::mat structure which is preferred to old IplImage structure.<\/p>\n<pre><code>#include \"cv.h\"\n#include \"highgui.h\"\n#include \n\nint main(int, char**) {\n    cv::VideoCapture vcap;\n    cv::Mat image;\n\n    const std::string videoStreamAddress = \"rtsp:\/\/cam_address:554\/live.sdp\"; \n    \/* it may be an address of an mjpeg stream, \n    e.g. \"http:\/\/user:pass@cam_address:8081\/cgi\/mjpg\/mjpg.cgi?.mjpg\" *\/\n\n    \/\/open the video stream and make sure it's opened\n    if(!vcap.open(videoStreamAddress)) {\n        std::cout<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I enclosed C++ code for grabbing frames. It requires OpenCV version 2.0 or higher. The code uses cv::mat structure which is preferred to old IplImage structure. #include &#8220;cv.h&#8221; #include &#8220;highgui.h&#8221; #include int main(int, char**) { cv::VideoCapture vcap; cv::Mat image; const std::string videoStreamAddress = &#8220;rtsp:\/\/cam_address:554\/live.sdp&#8221;; \/* it may be an address of an mjpeg stream, e.g. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4615","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4615","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4615"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4615\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4615"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4615"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4615"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}