I perform motion recognition using openCV and C ++, and I would like to create a mask or copied image to achieve the effect observed on the image.
. The following is an explanation of the images. It can be seen that the result is human walking. Then a mask image or a copied image of the original frame is created, now the binary human blob is masked, and unmasked pixels are now set to zero. The result is an extracted human body with a black background. The diagram below shows how a human drop is removed and then masked. This must be done for every fifth frame of the video sequence. My code so far is to get every fifth frame, make it a gray scale, find the areas of all the blocks, and apply the threshold value to get a binary image, where more or less, only a human drop is white and the rest of the image is black . Now I am trying to extract the human body, but I do not know how to proceed. Please help me.
#include "cv.h" #include "highgui.h" #include "iostream" using namespace std; int main( int argc, char* argv ) { CvCapture *capture = NULL; capture = cvCaptureFromAVI("C:\\walking\\lady walking.avi"); if(!capture){ return -1; } IplImage* color_frame = NULL; IplImage* gray_frame = NULL ; int thresh_frame = 28; CvMoments moments; int frameCount=0;
I would also like to download the video that I use in the code, but I donβt know how to upload it here, so if someone can help me with this. I want to provide as much information as possible wrt my question.
sue-ling
source share