c# - 凸包中的最远点

标签 c# opencv image-processing computer-vision emgucv

我正在做一个手部识别项目。此时,我能够检测到手,并使用以下代码找到了手的轮廓和凸包点:

Contour<Point> contours = imageThreshold.FindContours(Emgu.CV.CvEnum.CHAIN_APPROX_METHOD.CV_CHAIN_APPROX_SIMPLE,
   Emgu.CV.CvEnum.RETR_TYPE.CV_RETR_LIST, storage);
   Contour<Point> largestcontour = contours;
   while (contours != null)
   {
      if(largestcontour.Area < contours.Area)
      {
         largestcontour = contours;
      }

      contours = contours.HNext;
   }
   if (largestcontour != null)
   {
      Seq<Point> convexHull = largestcontour.GetConvexHull(Emgu.CV.CvEnum.ORIENTATION.CV_CLOCKWISE);
      foreach (var hullPoint in convexHull)
      {
         CvInvoke.cvCircle(ColorFrame, hullPoint, 3, new MCvScalar(255), 2, Emgu.CV.CvEnum.LINE_TYPE.EIGHT_CONNECTED, 0);
      }

      CvInvoke.cvDrawContours(ColorFrame, convexHull, new MCvScalar(255),
                        new MCvScalar(128), 1, 1, Emgu.CV.CvEnum.LINE_TYPE.EIGHT_CONNECTED, new Point(0, 0));

   }

在输出中,每个指尖上都有一个以上的点。我想要的是在每个指尖上得一分。

经过研究后,我了解到要在每个指尖上获得一个点,我需要找到距凸包中每个顶点最远的点。

如何在凸包中获得最远的点?

最佳答案

您可以看一下:
http://geomalgorithms.com/a14-_extreme_pts.html

它包含可能有助于您的说明和代码示例。

关于c# - 凸包中的最远点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41533809/

相关文章:

c# - 将图像文件保存到数据库中

c# - Entity Framework : adding to one-to-many relationship gives concurrency exception

c++ - Opencv 程序退出,代码为 -1073741819

c# - 用openCv将轮廓填充为黑色

python - wxWidgets:BoxSizer 内的面板未按预期运行

python - 获取错误 : Cannot reshape array of size 122304 into shape (52, 28,28)

python - 如何使用 OpenCV 从扫描图像中去除阴影?

python - 生成小于 10KB 且不丢失比例的图像缩略图

c# - 根据图像大小动态分配水印文本大小c#

c# - 尽管数据库中有数据,MySQL 查询数据检索却给出所有内容为空