I've a problem with how to make rubber sheet model from circle in emgu cv , this is my code in 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();
I solve it with my own code. This code return value from input image to sheet model 116 x 360 pixel.
// 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;
}