Motion Detection in VC++
-
hye, i m trying to record video on motion detection in VC++. Can anybody tell the exact procedure i should apply motion detection has started but i dnt know how to write code for recording the video on motion detection..... Neha
-
There isn't a exact procedure to implementing motion detection. There are many algorithms for doing that, and searching the articles on this site anf google should bring up some results. Good luck
i have used following four functions for motion detection part only: 1)AdjustMotionDetectPrecision() 2)SetupMotionDetection() 3)StartMotionDetection() 4)MotionAnalyzer() using these four functions,motion detected has started. but i dnt knw how to start recording???? i m sending u some code : here it is:::: if(frameType > 0) { if(frameType == PktSysHeader) { memcpy(FileHeader[channelNum], DataBuf, Length); FileHeaderLen = Length; } if(frameType == PktIFrames || frameType ==PktSubIFrames) { status = 1; } else { status = 0; } if(frameType == PktMotionDetection) { int result[4]; if(bOverlayMode) { hkdlg->m_VideoWin.DrawVectEx(channelNum, (char *)DataBuf); } else { hkdlg->m_bMoving[channelNum] = TRUE; memcpy(motionData[channelNum],(char*)DataBuf,Length); } MotionAnalyzer(ChannelHandle[channelNum],(char*)DataBuf,15,result); if((result[0] + result[1] + result[2] + result[3])) { if (channelNum ==0) TRACE("!!!!!!!CH=%d motion detect result is %d %d %d %d\n",channelNum,result[0],\ result[1],result[2],result[3]); //The function Trigger() do the following operation: write the video&audio data which are before the motion frame to file if(!hkdlg->baftermotion[channelNum]) alarmFile[channelNum].Trigger(gFileHandle[channelNum]); //when the motion frame returns,clear ualreadywriteframes[channelNum] and set it as 0 ,be ready for writing the video&audio data after motion hkdlg->ualreadywriteframes[channelNum]=0; hkdlg->baftermotion[channelNum]=TRUE; } return 0; } if(frameType == PktOrigImage) { return 0; } In this code should i start recording after motionanalyser() function????????????? Neha
-
hye, i m trying to record video on motion detection in VC++. Can anybody tell the exact procedure i should apply motion detection has started but i dnt know how to write code for recording the video on motion detection..... Neha
I am searching about an object on the codeproject and sudden see Motion Detection Algorithms[^] and remembered that a OP aksed about motion detection so I repled to you.;)
WhiteSky