Opencvで動画ファイルを読み込んで, 顔認識などをしようとしているのですが
VideoCaptureの引数にファイル名を与えて実行するとエラーになってしまいます.
###発生している問題・エラーメッセージ
2017-06-11 23:24:10.351 Python[59273:3538635] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array' *** First throw call stack: ( 0 CoreFoundation 0x00007fffc8cd42cb __exceptionPreprocess + 171 1 libobjc.A.dylib 0x00007fffddadf48d objc_exception_throw + 48 2 CoreFoundation 0x00007fffc8bedadc -[__NSArrayM objectAtIndex:] + 204 3 libopencv_highgui.2.4.dylib 0x0000000109bbe280 _ZN13CvCaptureFileC2EPKc + 350 4 libopencv_highgui.2.4.dylib 0x0000000109bbccf2 _Z32cvCreateFileCapture_AVFoundationPKc + 34 5 libopencv_highgui.2.4.dylib 0x0000000109bb07ee cvCreateFileCapture + 14 6 libopencv_highgui.2.4.dylib 0x0000000109bb0a9e _ZN2cv12VideoCapture4openERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE + 64 7 libopencv_highgui.2.4.dylib 0x0000000109bb08fe _ZN2cv12VideoCaptureC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE + 42 8 cv2.so 0x000000010935abce _ZL34pyopencv_VideoCapture_VideoCaptureP7_objectS0_S0_ + 275 9 Python 0x0000000108f7f4d4 PyEval_EvalFrameEx + 14624 10 Python 0x0000000108f7b9be PyEval_EvalCodeEx + 1617 11 Python 0x0000000108f7b367 PyEval_EvalCode + 48 12 Python 0x0000000108f9b5dd PyParser_ASTFromFile + 297 13 Python 0x0000000108f9b680 PyRun_FileExFlags + 133 14 Python 0x0000000108f9b1d1 PyRun_SimpleFileExFlags + 702 15 Python 0x0000000108facb6a Py_Main + 3094 16 libdyld.dylib 0x00007fffde3c4235 start + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException Abort trap: 6
###試したこと
インカメラからの録画, すなわちVideoCapture(0)とすると正常どおり動作します.
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/06/12 12:24
2017/06/12 12:37
退会済みユーザー
2017/06/12 13:03
2017/06/14 07:18