【问题标题】:Perform Dougman't Method (Rubber Sheet Model) in Emgu CV在 Emgu CV 中执行 Dougman't 方法(橡胶板模型)
【发布时间】:2015-04-04 13:05:05
【问题描述】:

我对如何从 emgu cv 中的圆圈制作橡胶板模型有疑问,这是我在 c# 中的代码:

   // looking for iris

        CircleF[] circles = cannyEdges.HoughCircles(
                  cannyThreshold,
                  circleAccumulatorThreshold,
                  3.6, //Resolution of the accumulator used to detect centers of the circles
                  cannyEdges.Height / 2, //min distance 
                  2, //min radius
                  0 //max radius
               )[0]; //Get the circles from the first channel
        var img = myImage.Clone();
        var img2 = myImage.Clone();

        foreach (CircleF circle in circles)
            img.Draw(circle, new Bgr(Color.Brown), 10);
            pictureBox3.SizeMode = PictureBoxSizeMode.StretchImage;
            pictureBox3.Image = img.ToBitmap();

【问题讨论】:

  • Stack Overflow 不是调试代码的地方。如果您对此有特定问题并提出该问题,则更有可能获得帮助。
  • 好的,对不起,我只是一个新手。我认为 Stack Overflow 是一个论坛,我可以在其中解决我的问题。非常感谢
  • 好的,具体你的问题是什么?你认为不正确的做法是什么?你想发生什么?
  • 我想在 emgu cv 中执行 dougman 橡胶板模型(将甜甜圈形状变成橡胶形状),我可以从我的代码“foreach(CircleF circle圈子)”。我可以从 (doughnutRadian = first_circle _radian - sec_circle_radian) 获得甜甜圈弧度。现在,我得到了甜甜圈的弧度和甜甜圈的中心点。但我不知道如何在 emgu cv 中用甜甜圈形状制作橡胶形状。

标签: c# model geometry emgucv rubber


【解决方案1】:

我用自己的代码解决了这个问题。此代码将输入图像的值返回到 116 x 360 像素的图纸模型。

// Fungsi untuk merubah bentuk donnut menjadi lembaran
        public Image<Gray, Byte> dougman(Image<Gray,Byte> cit, Double radiris) 
        {
            double xP, yP, r, theta;
            Image<Gray, Byte> grayT = new Image<Gray, Byte>(360, 116);

            for (int i = 0; i < 116; i++)
            {
                for (int j = 0; j < 360; j++)
                {
                    r = i;
                    theta = 2.0 * Math.PI * j / 360;
                    xP = r * Math.Cos(theta);
                    yP = r * Math.Sin(theta);
                    xP = xP + radiris + 10; //sekitar 115
                    yP = yP + radiris + 10;
                    grayT[116 - 1- i, j] = cit[(int)xP, (int)yP];
                }
            }
            return grayT;
        }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多