Test Code of Gaussian Background Model.

The performance in release mode is soso.
Could use BackgroundSubtractorMOG2 to try more parameters.
Use BackgroundSubtractorMOG2.

The MOG2 class can change more parameters to make the customed model.
Add an ACE connector and acceptor demo.

both of the two demo is rather simple. Need to change them to a server containing both connector and acceptor.
A simple server can recv and send data continuesly.

Change the type of acceptor or connector by specific the -i parameter to S or C.
Add read event handler to both acceptor and connector.
A project to track the teacher in the smart classroom.

Now only use the gaussian background model to calc the bary center.
But it is not accurate.
Now the barycenter is accurate.

The CV_8U's range is from 0 to 255, so if assign a number bigger than 255, it will be converted to x%255.
Change a Mat from CV_8U, please use Mat::ConvertTo.
The matlab code to do some experiments.

Calc the hist by cols. Use the avg value * 2 to judge whether it is a human or not. Looks good.
Then we can exclude those from 1-50 and 650-720. And force that peak must last for about 100 pixels.
Try to distinguish the enter event and leave event. But the result is not so good.
Add the hist calc of gauss foreground function. Need to mix this with the particle tracking.
save the origin frame and the bary centers.
Set a threshold to bary center's weight. Currently fixed threshold.
Directly save the video, not images.
Change the algorithm to fit more than one objects situation.

Need to mix this with the detect algorithm.
Use several rois to initial tracked object.

Remove some useless codes also.
Mix the detection and tracking.

Fisrt step. Handle the entering event of teacher.
But the leaving event is not handled yet.
Without tested.
Mix detection and tracking.

Step two. Detect the leaving event of teacher.
Without tested.
Tiny bug.

The program can't initialized with the object located in the middle in the first frame.
Forgot to add features.
Result is bad...

The detect is not so exactly, so the tracking would lose the object after a while.
The color feature can't track all the objects. As to the object cross the screen, the tracking alg can't track it.
The right side of image is a big noise to the tracking alg.