κ°λ°π»/OpenCVSharp
[OpenCVSharp] λμμνμΌ μ¬μνκΈ°
VIP
2017. 2. 10. 10:03
728x90
λ°μν
- 쑰건
1. VisualStudio 2015
2. OpenCVSharp 2.4.10
- μ°Έμ‘°λΆλΆ
- μμ€μ½λ
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | using OpenCvSharp; using OpenCvSharp.CPlusPlus; using OpenCvSharp.Extensions; namespace WindowsFormsApplication3 { public partial class Form1 : Form { IplImage frame1; CvCapture capture1; public Form1() { InitializeComponent(); Video_Overlay(); } public void Video_Overlay() { capture1 = CvCapture.FromFile("C://drop.avi"); while (true) { frame1 = Cv.QueryFrame(capture1); if (frame1 == null) { capture1 = CvCapture.FromFile("C://drop.avi"); continue; } Cv.ShowImage("Test", frame1); if (Cv.WaitKey(33) == 27) break; } Cv.ReleaseCapture(capture1); Cv.DestroyWindow("Test"); } } } | cs |
- frame1 κ°μ΄ nullμ΄λ©΄ λ€μ capture1 λ³μμ λμμ νμΌμ ν λΉν¨μΌλ‘μ¨ λμμμ΄ λ¬΄νμΌλ‘ μ¬μλλλ‘ μ€μ
- λμμ νμΌμ νλ²λ§ μ¬μνκ³ μ’ λ£νκ³ μΆμΌλ©΄ μλμ κ°μ΄ ifλ¬Έ μμ
1 2 3 4 | if (frame1 == null) { break; } | cs |
- κ²°κ³Όνλ©΄
μΆμ² : http://dsnight.tistory.com/20
λμμ(avi) μΆμ² : http://www.engr.colostate.edu/me/facil/dynamics/avis.htm728x90
λ°μν