New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detect Text direction #9
Comments
Angle is correct but with 50 percent. It should be fixed |
Can you provide the failing image? |
@sbrunner import numpy as np
from skimage import io
from skimage.transform import rotate
from skimage.color import rgb2gray
import cv2
from deskew import determine_skew
filename = 'Acord25.png'
image_orig = cv2.imread(filename)
image_orig = rgb2gray(image_orig)
image_orig1 = rotate(image_orig, 90,resize = True,cval=1)*255 ## i have done custom rotation for check code
image_orig1 = image_orig1.astype(np.uint8)
image_orig1.shape
image = rgb2gray(image_orig1)
angle = determine_skew(image)
print(angle)
if angle != 0:
image_orig1 = rotate(image_orig1, angle, resize=True,cval=1) * 255 actual angle is 90 but it gives me 0.0 . |
hey @sbrunner can you help me in this.
|
angle += 90 if angle < -88 else 0 |
|
I used this condition before rotating, now it works fine. all the images are correctly rotated. But I did not understand the logic behind it. |
Can u send ur final code. |
|
I have an image which is rotated 90 degrees. The program rotates it back 90 degrees but in wrong direction - text is on reverse direction.
Do you have any idea how to fix this?
The text was updated successfully, but these errors were encountered: