Skip to content
Discussion options

You must be logged in to vote
    // getRotation(magickImages[i].MinimumBoundingBox().ToList()); 
    public int getRotation(List<PointD> p)
    {
        // Get differences top left minus bottom left
        double[] diffs = new double[8];
        diffs[0] = p[3].X; //top left
        diffs[1] = p[3].Y;

        diffs[2] = p[0].X; // top right 
        diffs[3] = p[0].Y;

        diffs[4] = p[1].X; //bottom right:
        diffs[5] = p[1].Y;

        diffs[6] = p[2].X; //bottom left:
        diffs[7] = p[2].Y;

        var diffsAngle = new double[2];
        diffsAngle[0] = diffs[0] - diffs[6];
        diffsAngle[1] = diffs[1] - diffs[7];

        // Get rotation in degrees
        var rotation = Math.Atan(diffsAngle[…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by smoketlt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
1 participant