2013-01-21 30 views
0

EDIT Human walk motion Detect鏈接說明如何在Visual Studio 2010中檢測人體運動與Opencv 2.3與C++。我下載了源代碼motemp9.c以及文本文件walkImgs.txtoutput.txt和標頭filter.h,但不明白以下內容。運動檢測代碼{編輯}

我很難執行此程序。有人能幫我澄清這些問題嗎?

  1. motiontemp9.c文件中,主要文件中的行不存在。或者這些文件是否爲walkImgs和輸出?上運行的代碼

    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); 
  • 以下錯誤。

  • 回答

    1

    你能否重新表達你的第一個問題,因爲我真的不明白。

    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您從提取的圖像的路徑你自己的視頻。

    希望它有幫助

    +0

    嘿,謝謝你的答覆。第一個問題意味着網頁中提供的文件是walkImgs.txt和output.txt,if語句檢查if((ReadFP = fopen(「walk2.txt」,「r」))== NULL)ErrorExit( ER_READ_OPEN); if((WriteFP = fopen(「output2.txt」,「w」))== NULL)ErrorExit(ER_WRITE_OPEN);所以,我認爲它應該是((ReadFP = fopen(「walkImgs.txt」,「r」))== NULL)ErrorExit(ER_READ_OPEN);如果((WriteFP = fopen(「output.txt」,「w」))== NULL)ErrorExit(ER_WRITE_OPEN);(B)我需要捕獲&框架我自己的視頻。如何將提取的圖像的路徑walkImgs.txt,而不是wakl2.txt。 – Chaitali

    +0

    是的,你只需要改變你的價值即可。 – ThiS

    +0

    這意味着代碼中的if語句中提到的文件名是不正確的?我如何在文件中寫入幀號?此外,使用CV_RGB時出現此錯誤>>「#define CV_RGB(r,g,b )cvScalar((b),(g),(r),0)錯誤:沒有合適的從cvScalar到int的轉換函數存在「。該怎麼辦?請多解釋一下。 – Chaitali