OpenCvSharp 编写多线程CircularCaliper找圆心函数 , 输入图像、找圆扇形区域的最小半径和最大半径、找圆扇形中心点、设定扇形区域起始角度、扇形区域结束角度 先剪出找圆扇形区域图像 输入Caliper个数,宽度、长度、 输入从内到外找圆心、从黑到白找圆 并行计Caliper区域 中心圆可设定请编写函数
时间: 2023-07-31 18:09:47 浏览: 89
以下是使用OpenCvSharp编写多线程CircularCaliper找圆心函数的示例代码:
```csharp
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using OpenCvSharp;
public class CircularCaliperFinder
{
private readonly Mat _srcImage;
private readonly int _minRadius;
private readonly int _maxRadius;
private readonly Point _center;
private readonly double _startAngle;
private readonly double _endAngle;
private readonly int _caliperCount;
private readonly int _caliperWidth;
private readonly int _caliperLength;
private readonly bool _findFromInside;
private readonly bool _findFromBlackToWhite;
public CircularCaliperFinder(Mat srcImage, int minRadius, int maxRadius, Point center, double startAngle, double endAngle, int caliperCount, int caliperWidth, int caliperLength, bool findFromInside, bool findFromBlackToWhite)
{
_srcImage = srcImage;
_minRadius = minRadius;
_maxRadius = maxRadius;
_center = center;
_startAngle = startAngle;
_endAngle = endAngle;
_caliperCount = caliperCount;
_caliperWidth = caliperWidth;
_caliperLength = caliper
阅读全文