【发布时间】:2021-06-27 23:50:09
【问题描述】:
我需要你的帮助,很抱歉我的英语不好。
我使用 YOLOv4 来获取检测对象。 yolov4 可以获取汽车、摩托车、公共汽车等对象。 我想用结果来检查是否发生车祸。
我的观点: 我认为可以检查图像中的所有对象 并尝试检测两个对象是否重叠。 同时开始计算时间。 如果两个物体重叠超过一段时间,则判断为车祸。
描述问题: 有谁知道如何检查多个矩形是否相互重叠 我尝试在 C# 中使用它
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);
}
}
}
但是这种方法只能在图像中工作,不能在视频中工作
我需要有人来激励我。 谢谢你阅读我的问题,希望你有一个愉快的一天
【问题讨论】: