hello!
i need your help,and sorry about my poor English.
I using YOLOv4 to get detection object.
yolov4 can get object like cars, motorcycles, buses, etc.
and I want to using the result to check if car accident happen.
my perspective:
i think can check the all object in image
and try to detect whether two objects overlap.
And start to calculate the time at the same time.
If the two objects overlap for more than a period of time, it is judged as a car accident.
Describe the problem:
does anyone know how to check if the multiple if overlap each other
i try to using that in C#
What I have tried:
for (int i = 0; i < itemRectCar.Count - 1; i++)
{
if (itemRectCar[i].IntersectsWith(itemRectCar[i + 1]))
{
rectangle3 = Rectangle.Intersect(itemRectCar[i], itemRectCar[i + 1]);
itemRectCar[i].Intersect(itemRectCar[i + 1]);
if (!itemRectCar[i].IsEmpty)
{
graphics.DrawRectangle(penRed, rectangle3);
}
}
}
but this method only can work in a image can't be work in video
I need someone to inspire me.
thank you read my problem,hope you have a nice day