{"id":9168,"date":"2016-11-30T21:03:22","date_gmt":"2016-12-01T02:03:22","guid":{"rendered":"httpss:\/\/www.powenko.com\/wordpress\/?p=9168"},"modified":"2016-11-30T21:03:22","modified_gmt":"2016-12-01T02:03:22","slug":"10-%e6%92%ad%e6%94%be%ef%bd%81%ef%bd%96%ef%bd%89","status":"publish","type":"post","link":"https:\/\/www.powenko.com\/wordpress\/?p=9168","title":{"rendered":"10 \u64ad\u653e\uff21\uff36\uff29"},"content":{"rendered":"<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n#include &lt;cstdio&gt;\r\n#include &lt;opencv2\/opencv.hpp&gt;\r\nusing namespace cv;\r\n\r\n\r\n\r\n\r\n\r\nint main( int argc, char** argv )\r\n{\r\n    \/\/VideoCapture cam(&quot;\/Users\/powenko\/Desktop\/\u975c\u5b9c\u5927\u5b78\/20161001-\u8ab2\u7a0b-\u7121\u4eba\u6a5f\u5b89\u5168\u76e3\u63a7\/OpenCV\/opencv\/XCode\/01\u57fa\u672c\/sample04E_PlayAVI\/test\/VideoTest.mov&quot;);\r\n    CvCapture *capture;\r\n    int key = 0;\r\n    \/\/ \u8def\u5f91\u4e0d\u80fd\u7528\u4e2d\u6587\r\n    \/\/char AviFileName&#x5B;]=&quot;\/Users\/powenko\/Desktop\/\u975c\u5b9c\u5927\u5b78\/20161001-\u8ab2\u7a0b-\u7121\u4eba\u6a5f\u5b89\u5168\u76e3\u63a7\/OpenCV\/opencv\/XCode\/01\u57fa\u672c\/sample04E_PlayAVI\/test\/big_buck_bunny_240p_1mb.mp4&quot;;\r\n    char AviFileName&#x5B;]=&quot;\/Users\/powenko\/Desktop\/big_buck_bunny_240p_1mb.mp4&quot;;\r\n    \/\/char AviFileName&#x5B;]=&quot;big_buck_bunny_240p_1mb.mp4&quot;;\r\n    capture = cvCaptureFromAVI(AviFileName);\r\n    IplImage* frame = cvQueryFrame( capture );\r\n    \r\n    \/\/ Check\r\n    if ( !capture )\r\n    {\r\n        fprintf( stderr, &quot;Cannot open AVI!\\n&quot; );\r\n        return 1;\r\n    }\r\n    \r\n    \/\/ Get the fps, needed to set the delay\r\n    int fps = ( int )cvGetCaptureProperty( capture, CV_CAP_PROP_FPS );\r\n    \r\n    \/\/ Create a window to display the video\r\n    cvNamedWindow( &quot;video&quot;, CV_WINDOW_AUTOSIZE );\r\n    \r\n    while( key != 'x' )\r\n    {\r\n        \/\/ get the image frame\r\n        frame = cvQueryFrame( capture );\r\n        \r\n        \/\/ exit if unsuccessful\r\n        if( !frame ) break;\r\n        \r\n        \/\/ display current frame\r\n        cvShowImage( &quot;video&quot;, frame );\r\n        \r\n        \/\/ exit if user presses 'x'\r\n        key = cvWaitKey( 1000 \/ fps );\r\n    }\r\n    \r\n    \/\/ Tidy up\r\n    cvDestroyWindow( &quot;video&quot; );\r\n    cvReleaseCapture( &amp;capture );\r\n    \r\n    return 0;\r\n}\r\n\r\n\r\n\r\n\r\n\r\n<\/pre>\n<p><a href=\"httpss:\/\/www.powenko.com\/wordpress\/wp-content\/uploads\/2016\/11\/Screen-Shot-2016-12-01-at-10.01.38-AM.png\"><img loading=\"lazy\" decoding=\"async\" src=\"httpss:\/\/www.powenko.com\/wordpress\/wp-content\/uploads\/2016\/11\/Screen-Shot-2016-12-01-at-10.01.38-AM.png\" alt=\"screen-shot-2016-12-01-at-10-01-38-am\" width=\"357\" height=\"262\" class=\"alignnone size-full wp-image-9169\" srcset=\"https:\/\/www.powenko.com\/wordpress\/wp-content\/uploads\/2016\/11\/Screen-Shot-2016-12-01-at-10.01.38-AM.png 357w, https:\/\/www.powenko.com\/wordpress\/wp-content\/uploads\/2016\/11\/Screen-Shot-2016-12-01-at-10.01.38-AM-300x220.png 300w, https:\/\/www.powenko.com\/wordpress\/wp-content\/uploads\/2016\/11\/Screen-Shot-2016-12-01-at-10.01.38-AM-193x141.png 193w, https:\/\/www.powenko.com\/wordpress\/wp-content\/uploads\/2016\/11\/Screen-Shot-2016-12-01-at-10.01.38-AM-316x232.png 316w, https:\/\/www.powenko.com\/wordpress\/wp-content\/uploads\/2016\/11\/Screen-Shot-2016-12-01-at-10.01.38-AM-120x88.png 120w, https:\/\/www.powenko.com\/wordpress\/wp-content\/uploads\/2016\/11\/Screen-Shot-2016-12-01-at-10.01.38-AM-210x154.png 210w, https:\/\/www.powenko.com\/wordpress\/wp-content\/uploads\/2016\/11\/Screen-Shot-2016-12-01-at-10.01.38-AM-140x103.png 140w\" sizes=\"(max-width: 357px) 100vw, 357px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>#include &lt;cstdio&gt; #include &lt;opencv2\/opencv.hpp [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":9169,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[247],"tags":[],"class_list":["post-9168","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ch01---ios--opencv"],"_links":{"self":[{"href":"https:\/\/www.powenko.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/9168"}],"collection":[{"href":"https:\/\/www.powenko.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.powenko.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.powenko.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.powenko.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9168"}],"version-history":[{"count":1,"href":"https:\/\/www.powenko.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/9168\/revisions"}],"predecessor-version":[{"id":9170,"href":"https:\/\/www.powenko.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/9168\/revisions\/9170"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.powenko.com\/wordpress\/index.php?rest_route=\/wp\/v2\/media\/9169"}],"wp:attachment":[{"href":"https:\/\/www.powenko.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9168"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.powenko.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9168"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.powenko.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9168"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}