?
Demo : Read a video, then play, ESC exit.
?
- #include? " StdAfx.h "??
- #include?<opencv2/core/core.hpp>??
- #include?<opencv2/contrib/contrib.hpp>??
- #include?<opencv2/highgui/highgui.hpp>??
- #include?<opencv2/imgproc/imgproc.hpp>??
- #include?<opencv2/objdetect/objdetect.hpp>??
- ???
- using ? namespacecv;??
- using ? namespacestd;??
- #pragma? COMMENT (linker,? " /subsystem:\ "windows\"?/entry:\ "Maincrtstartup\" ")? ??
- int ? Main (intargc,? Char **?argv[])??
- {??
- ???? Cvnamedwindow ("Example2",? cv_window_autosize);??
- ???? cvcapture*?capture?=?cvcreatefilecapture ("F:\\life\\opencv\\buildingcordovaappswithvs_high.mp4" );??
- ???
- ???? Iplimage*?frame;??
- ???? While ? ( 1)??
- ???? {??
- ???????? Frame?=? Cvqueryframe (capture);??
- ???????? if? (! frame)? Break ;??
- ???????? Cvshowimage ("Example2", "frame");??
- ???????? CharC?=?cvwaitkey (33);??
- ???????? if? ( c?==?27)? Break ;??
- ????}??
- ???
- ???? cvreleasecapture (&capture);??
- ???? Cvdestroywindow ("Example2");??
- ???
- ???? return? 0;??
- }??
|
?
?
Open CV Play Video (2)