gpt4 book ai didi

visual-studio-2010 - 运动检测代码{EDIT}

转载 作者:行者123 更新时间:2023-12-02 17:53:17 25 4
gpt4 key购买 nike

编辑
Human walk motion Detect链接介绍了如何在带有C++的Visual Studio 2010中使用Opencv 2.3检测人体运动。我下载了源代码motemp9.c以及文本文件walkImgs.txtoutput.txt以及 header filter.h,但不了解以下内容。

我很难执行此程序。有人可以帮我澄清这些观点吗?

  • motiontemp9.c文件中,主行下的文件不存在。还是这些文件
    walkImgs和输出?
    if((ReadFP=fopen("walk2.txt", "r")) == NULL) ErrorExit(ER_READ_OPEN);
    if((WriteFP=fopen("output2.txt", "w")) == NULL) ErrorExit(ER_WRITE_OPEN);
  • 运行代码时发生以下错误
    error C2660: 'cvGetSeqElem' : function does not take 3 arguments
    motemp9.cpp(186): error C2227: left of '->rect' must point to class/struct/union/generic type
    motemp9.cpp(189): error C2440: '=' : cannot convert from 'CvScalar' to 'int'
    1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
    motemp9.cpp(218): error C2664: 'cvCircle' : cannot convert parameter 4 from 'int' to 'CvScalar'
    1> No constructor could take the source type, or constructor overload resolution was ambiguous
    motemp9.cpp(220): error C2664: 'cvLine' : cannot convert parameter 4 from 'int' to 'CvScalar'
    1> No constructor could take the source type, or constructor overload resolution was ambiguous
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

  • 请指导运行此代码需要做什么。

    最佳答案

    您能不能重新提出第一个问题,因为我真的不明白。

    if((ReadFP=fopen("walk2.txt", "r")) == NULL) ErrorExit(ER_READ_OPEN);
    if((WriteFP=fopen("output2.txt", "w")) == NULL) ErrorExit(ER_WRITE_OPEN);

    这两行只是在运行程序时检查文件是否存在。如果其中之一不存在,则返回ErrorExit

    对于第二个问题,在本示例中,

    Create the motion history image. This includes converting the image to grayscale, finding the difference between two frames at a time in sequence order, which creates a silhouette image of the layered history of the motion. Implementation



    因此,您需要在walk2.txt中放置从自己的视频中提取的图像的路径。

    希望能帮助到你

    关于visual-studio-2010 - 运动检测代码{EDIT},我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14431615/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com