0

我对如何从 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();
4

1 回答 1

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;
        }
于 2015-08-13T03:39:44.330 回答