Im having problems of making rectangle in aforge blobcountingobjectprocessing.
the motion is detected however it does not draw rectangle when moving.
hope anyone can give me some advice.
this is the code im trying to work so far
video = (Bitmap)eventArgs.Frame.Clone();
if (pix > 0.02)
{
if (motionProcessing.ObjectsCount > 1)
{
motionProcessing.MinObjectsHeight = 10;
motionProcessing.MinObjectsWidth = 10;
Rectangle[] rects = motionProcessing.ObjectRectangles;
if (rects.Length > 0)
{
Graphics graphic = Graphics.FromImage(video);
Rectangle objec = rects[0];
using (Pen pen = new Pen(Color.White, 3))
{
graphic.DrawRectangle(pen, objec);
PointF drawPoin = new PointF(objec.X, objec.Y);
String widthofimage = "width: " + objec.Width.ToString();
String heightofimage = "height: " + objec.Height.ToString();
callsetFrmtext(label1, label2, widthofimage, heightofimage);
}
}
}
}
else
{
callsetFrmtext(label1, label2, Convert.ToString(0), Convert.ToString(0));
}
pix = motiondetector.ProcessFrame(video);
What I have tried:
i've tried using blobcounter and colorfiltering and it works but in this problem
blobcountingobjectprocessing is not working for me.
anyone please help :(