Пример #1
0
 private Point GetPoint(Mat img, BlobSpot spot, int offsetX, int offsetY)
 {
     return(new Point(
                spot.Position.x * (float)img.width() + offsetX,
                spot.Position.y * (float)img.height() + offsetY
                ));
 }
Пример #2
0
    private void MatchShape(Mat img, List <BlobSpot> spots)
    {
        spots.Sort();

        Imgproc.putText(img, "OK?", new Point(50, 50), face[0], 1.2, new Scalar(255, 255, 0), 2, Imgproc.LINE_AA, false);

        Point lastPoint = GetPoint(img, spots[0], 0, 0);

        for (int i = 1; i < spots.Count; i++)
        {
            BlobSpot spot = spots[i];

            Point nextPoint = GetPoint(img, spot, 0, 0);

            Imgproc.line(img, lastPoint, nextPoint, new Scalar(0, 255, 255), 3);

            lastPoint = nextPoint;
        }
    }