2015-04-04 77 views
0

我已经与如何从emgu CV圈使橡胶板模型的一个问题,这是我的代码在c#执行Dougman't方法(橡胶板型号)

// 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(); 
+0

堆栈溢出不是一个来调试你的代码的地方。如果你有一个特定的问题,并提出这个问题,你更有可能得到帮助。 – jmarkmurphy 2015-04-04 15:09:50

+0

好吧,对不起,我只是一个新手。我认为堆栈溢出是一个论坛,我可以解决我的问题。非常感谢 – 2015-04-08 11:44:57

+0

好的,具体是什么你的问题?这是什么,你认为是不正确的?你想要发生什么? – jmarkmurphy 2015-04-08 12:53:09

回答

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; 
     }