I am unable to rotate or deskew the image it is not rotating correctly in opencvsharp

Github issue using opencvsharp for rotation/deskewing an Image is not rotating correctly · Issue #1672 · shimat/opencvsharp · GitHub

Hello I would really appreciate if we keep the conversation in the forum I don’t like receiving emails.

People submit questions to repos all the time this person has a history of answering people’s questions.

What I did is not spam and I don’t appreciate you for inferring that. Know if you where one of the 66 contributors of the library that would be a different story and I would apologize and delete my question


oh, apologies for mistaking this for the opencv repo,
so post was removed immediately …

i’m also not ‘one of the 66 contributers of the library’ …

This is the OpenCV forum.

you filed an issue with opencvsharp, not OpenCV.

opencvsharp is a third-party wrapper. we are the wrong place to debate issues with opencvsharp.

if you have an issue with OpenCV, reproduce it with OpenCV (official bindings, i.e. C++, Python, etc). then we have something to debate.

if you can’t reproduce your issue with OpenCV itself, it’s not an OpenCV issue, hence off topic.

btw, what’s this ?

                   float angle = minAreaRect.Angle;
                    if (angle < -45)
                        angle = 90 + angle;

please explain the motivation for it

That adjusts the angle of the image I am not sure how to find this message in the forum. Thanks for asking me I really appreciate your engagement

so, which problem does it solve, and why cut off at pi/4 ?

indeed, using the angle from a rotatedrect has a few problems:

  • angle is derived via atan , so pole at ±pi/2
  • implementation changed (somewhere about 4.3)
    (today, you get the angle towards the longer one of two rect edges, so the input is always in [-1,1])