0

EDIT Human walk motion Detect link explains how to detect human motion with Opencv 2.3 on Visual Studio 2010 with C++. I downloaded the source code motemp9.c along with the text files walkImgs.txt and output.txt and the header filter.h but do not understand the following stuff.

I am having a hard time to execute this program. Can someone help me in clarifying these points?

  1. In motiontemp9.c file, under main the files in the lines are not present. Or are these files walkImgs and output?

    if((ReadFP=fopen("walk2.txt", "r")) == NULL) ErrorExit(ER_READ_OPEN);
    if((WriteFP=fopen("output2.txt", "w")) == NULL) ErrorExit(ER_WRITE_OPEN);
    
  2. The following errors occur on running the code

    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 ==========
    

Kindly guide in what needs to be done to run this code.

Fabian N.
  • 3,807
  • 2
  • 23
  • 46
Chaitali
  • 240
  • 2
  • 13

1 Answers1

1

Can you reformulate your first question because I don't really get it.

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

These two lines just check if the file exist when you run the program. If one of them doesn't exist, it returns ErrorExit

For your second question, in this example,

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

So you need to put in walk2.txt the path of the images that you extracted from your own video.

Hope it helps

ThiS
  • 947
  • 8
  • 16
  • Hey,thank you for the reply. The first QUestion meant that the files provided in the webpage are walkImgs.txt and output.txt, wheras the if statements check for if((ReadFP=fopen("walk2.txt", "r")) == NULL) ErrorExit(ER_READ_OPEN); if((WriteFP=fopen("output2.txt", "w")) == NULL) ErrorExit(ER_WRITE_OPEN); So, I think it should be if((ReadFP=fopen("walkImgs.txt", "r")) == NULL) ErrorExit(ER_READ_OPEN); if((WriteFP=fopen("output.txt", "w")) == NULL) ErrorExit(ER_WRITE_OPEN);(B)I need to capture & frame my own video.How do put the path of the images extracted in walkImgs.txt, instead of wakl2.txt. – Chaitali Jan 22 '13 at 21:41
  • Yeah you just need to change with your value that's all. – ThiS Jan 22 '13 at 21:51
  • That means the file names mentioned in the if statements in the code is incorrect?How do I write the frame numbers in the file?Also, there is this error now on using CV_RGB >> "#define CV_RGB(r,g,b) cvScalar((b),(g),(r),0) Error:no suitable conversion funtion from cvScalar to int exists". What to do? Please explain a bit more. – Chaitali Jan 22 '13 at 22:16
  • Well the filenames were just example. For OpenCV, I can't help you, I don't code in C. Sorry – ThiS Jan 22 '13 at 22:32