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

**URL:** <https://forum.opencv.org/t/i-am-unable-to-rotate-or-deskew-the-image-it-is-not-rotating-correctly-in-opencvsharp/17825>\
**Category:** Uncategorized\
**Tags:** csharp\
**Created:** [June 2, 2024, 11:43pm UTC](https://forum.opencv.org/t/i-am-unable-to-rotate-or-deskew-the-image-it-is-not-rotating-correctly-in-opencvsharp/17825 "2024-06-02T23:43:57Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [June 8, 2024, 6:24am UTC](https://forum.opencv.org/t/i-am-unable-to-rotate-or-deskew-the-image-it-is-not-rotating-correctly-in-opencvsharp/17825/8 "2024-06-08T06:24:28Z")

</div>

> [@kraytonian](#):
>
> That adjusts the angle of the image

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])

---

_[View the full topic](https://forum.opencv.org/t/i-am-unable-to-rotate-or-deskew-the-image-it-is-not-rotating-correctly-in-opencvsharp/17825)._
