Feedback

C# - Hough Transformation

Veröffentlicht von am 5/22/2017
(0 Bewertungen)
using:


var listTheta = new List<double>() { -(Math.PI / 2), -(Math.PI / 4), 0, Math.PI / 4 };
var listX1 = new List<int>() { 2,1,2,1,2,4,3};
var listX2 = new List<int>() { 0,1,1,3,3,3,4};


for (int x = 0; x < listX1.Count; x++)
{
for (int i = 0; i < listTheta.Count; i++)
{
Console.WriteLine("r=" + HoughTransformation(listTheta[i], listX1[x], listX2[x]));
Console.WriteLine("Für r=cos(" + listTheta[i] + ") * " + listX1[x] + " + sin(" + listX2[x] + ") * " + listTheta[i]);
Console.WriteLine(" ");
}
}
private static double HoughTransformation(double theta, int x1, int x2)
        {
            var r = Math.Cos(theta) * x1 + Math.Sin(theta) * x2;
            return r;
        }
Abgelegt unter HoughTransformation.

Kommentare zum Snippet

 

Logge dich ein, um hier zu kommentieren!