Я видел этот код в некоторых статьях
using (VectorOfVectorOfPoint contours = new VectorOfVectorOfPoint())
{
CvInvoke.FindContours(img, contours, null, RetrType.External, ChainApproxMethod.ChainApproxSimple);
int count = contours.Size;
for (int i = 0; i < count; i++)
{
using (VectorOfPoint contour = contours[i])
using (VectorOfPoint approxContour = new VectorOfPoint())
{
CvInvoke.ApproxPolyDP(contour, approxContour, CvInvoke.ArcLength(contour, true) *0.5, true);
Rectangle BoundingBox = CvInvoke.BoundingRectangle(approxContour);
CvInvoke.Rectangle(img2, BoundingBox, new MCvScalar(255, 0, 255, 255), 3);
}
}
}
imageBox2.Image = img2;
Я хочу знать, что такое метод arcLenght в третьем параметре в ApproxPolyDP, я думаю, что он знает, что такое длина контура? Почему мы должны умножать с 0,05.