简体   繁体   English

C ++需要有关OpenCV教程中代码的帮助

[英]C++ Need Help about code from OpenCV Tutorials

So, I just tried to run the code from this tutorial http://docs.opencv.org/master/d1/dc5/tutorial_background_subtraction.html#gsc.tab=0 on my machine but when I run the command prompt show up and terminate itself immediately and the problem I think is coming from this: 因此,我只是尝试在本机上运行本教程中的代码http://docs.opencv.org/master/d1/dc5/tutorial_background_subtraction.html#gsc.tab=0 ,但是当我运行命令提示符时,立即终止自身,我认为问题出在此:

if (argc != 3) {
    cerr << "Incorret input list" << endl;
    cerr << "exiting..." << endl;
    return EXIT_FAILURE;
}`

and in output window it shows this message 并在输出窗口中显示此消息

***** VIDEOINPUT LIBRARY - 0.1995 - TFW07 *****

The program '[26932] ConsoleApplication7.exe' has exited with code 1 (0x1).

Can anyone tell me how can I fix it? 谁能告诉我该如何解决? I'm using visual studio 2013 and OpenCV 3.0. 我正在使用Visual Studio 2013和OpenCV 3.0。

This means the code is telling you to pass three arguments to your program. 这意味着代码告诉您将三个参数传递给程序。 Read the documentation, where it clealry is giving an example... "./bs -vid video.avi" 阅读文档,该文档提供了示例...“ ./bs -vid video.avi”

In visual studio, you need to pass three arguments to the command line Visual Studio 2013, right-click the project, choose properties, go to the Debugging section and you will fine there is a box for command line arguments. 在Visual Studio中,您需要将三个参数传递给命令行Visual Studio 2013,右键单击该项目,选择属性,转到“调试”部分,然后将在命令行中找到一个框。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM