QuercusVL Programming Manual
virtual void OnIncidence(Incidence inc)
{
printf("OnIncidence (%d,%d), %d,"
,inc.get_Unit().get_Id(),inc.get_DetectorId(),inc.get_Id());
switch(inc.get_Type())
{
case IT_RED_LIGHT_VIOLATION:
printf("IT_RED_LIGHT_VIOLATION\n");
break;
case IT_STOPPED_CAR_VIOLATION:printf("IT_STOPPED_CAR_VIOLATION\n");
break;
}
if(inc.get_Images().Count()>0) printf("Image 0 secs:%d\n",
inc.get_Images().Item(0).get_Timestamp().get_Seconds());
else printf("Image NOT FOUND\n");
if(inc.get_Video().IsValid()) printf("Video %dx%d duration:%d frameRate:
%d\n",inc.get_Video().get_Width(),inc.get_Video().get_Height(),
inc.get_Video().get_Duration(),inc.get_Video().get_Framerate());
else printf("Video NOT FOUND\n");
}
virtual void OnSummary(Summary sum)
{
printf("OnSummary (%d ,%d) ",sum.get_Unit().get_Id(),sum.get_DetectorId());
switch(sum.get_DetectorType())
{
case DT_SPEED:
printf("DT_SPEED\n");
break;
case DT_QUEUE:
printf("DT_QUEUE\n");
break;
case DT_PRESENCE:
printf("DT_PRESENCE\n");
break;
default:break;
}
}
};
CEventHandler EventHandler;
int main(int argc, char *argv[])
{
if(VLLoad()==-1) return -1;
if(!System::Initialize("Central.ini","Central.log",&EventHandler))
{
printf("Can't initialize system.\n");
return -1;
}
printf("Press [RETURN] to exit\n");
getchar();
System::Terminate();
VLUnload();
return 0;
}
Parts of the sample code:
#include “VLWrapperCpp”
The only header file required to interact with QuercusVL
®
from C++.
using namespace VL;
Quercus Technologies
17