用OpenCVSharp4.5 跑一遍OpenCV官方教程
原官方教程链接:OpenCV: Finding contours in your image
核心函数:findContours,drawContours
using System;
using OpenCvSharp;
namespace ConsoleApp1
{
class tutorial23 : ITutorial
{
static Mat src_gray = new Mat();
static int thresh = 100;
static RNG rng = new RNG(12345);
public void Run()
{
using (Mat src = new Mat("I:\\csharp\\images\\HappyFish.jpg"))
{
Cv2.CvtColor(src, src_gray, ColorConversionCodes.BGR2GRAY);
Cv2.Blur(src_gray, src_gray, new Size(3, 3));

本文介绍如何使用OpenCVSharp4.5实现图像中轮廓的检测与绘制,通过Canny边缘检测算法结合findContours和drawContours函数,实现了从灰度图像到轮廓提取的全过程。
最低0.47元/天 解锁文章
2061

被折叠的 条评论
为什么被折叠?



