TrcOpenCvDetector.java 文件源码

java
阅读 18 收藏 0 点赞 0 评论 0

项目:Ftc2018RelicRecovery 作者:
/**
 * This method is called to overlay rectangles on an image to the video output.
 *
 * @param image specifies the frame to be rendered to the video output.
 * @param detectedObjectRects specifies the detected object rectangles.
 * @param color specifies the color of the rectangle outline.
 * @param thickness specifies the thickness of the rectangle outline.
 */
public void drawRectangles(Mat image, Rect[] detectedObjectRects, Scalar color, int thickness)
{
    //
    // Overlay a rectangle on each detected object.
    //
    synchronized (image)
    {
        if (detectedObjectRects != null)
        {
            for (Rect r: detectedObjectRects)
            {
                //
                // Draw a rectangle around the detected object.
                //
                Imgproc.rectangle(
                    image, new Point(r.x, r.y), new Point(r.x + r.width, r.y + r.height), color, thickness);
            }
        }

        videoSource.putFrame(image);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号