in Education by
How to detect text orientation in an image? It doen't matter if the orientation is upside down (180 deg).. But if the text lines is vertical (90 or 270 deg) I need to rotate it 90 degrees. I hope its possible without OCR because it takes too much resources to process OCR on 4 different orientations of the same image The reason is that I use scantailor on images from a digital camera or smart phone and if the text orientation is 90 or 270 degree sometimes the image is cropped and text is lost JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
You can use the Hough Transform to detect the longest lines in your image and then find the predominant slope of those lines. If the slope is close to zero, your text is horizontal; if it's close to infinity, your text is vertical. You don't mention if you're using a library to do this, but in OpenCV you could use HoughLinesP. I used this tutorial on an image found on wikimedia: to get this image: Then I rotated the original image: to get this: Since you're only interested in horizontal or vertical, you can just test whether the difference in the x-coordinates of the line endpoints is close to zero (vertical) or the difference in the y-coordinates is close to zero (horizontal).

Related questions

0 votes
    I have been trying to use the Rekognition API to detect text in an image. I have enabled full ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 26, 2022 in Education by JackTerrance
0 votes
    I'm trying to implement a functionality that can determine which word in the text the user clicked on. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    Which is meant by assuming any two neighboring that are both edge pixels with consistent orientation? (a) Canny edge ... d) None of the mentioned Please answer the above question....
asked Oct 22, 2022 in Education by JackTerrance
0 votes
    To lock my orientation to portrait, I use: activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); I' ... Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    portrait and landscape are ……….. 1.paper layout 2. Page layout 3. Page orientation 4. Page margin . Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    Two options of orientation for page setup are ____ and ______. 1. left,Right 2. portrait,Landscape 3. Above,Below 4. Set,Wet Select the correct answer from above options...
asked Dec 14, 2021 in Education by JackTerrance
0 votes
    I need to open application when power and volume+ buttons long pressed. Does its possible to detect power ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 17, 2022 in Education by JackTerrance
0 votes
    I would like to code a Wordpress/WooCommerce plugin launching a function every time this is called : ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 26, 2022 in Education by JackTerrance
0 votes
    I would like to code a Wordpress/WooCommerce plugin launching a function every time this is called : ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 26, 2022 in Education by JackTerrance
0 votes
    On device with compute capability...
asked Apr 20, 2022 in Education by JackTerrance
0 votes
    I have a table structure like this : subscribers with attributes: id, status I want to have a way ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    I have a javascript heavy app which has widgets like autocomplete dropdowns and tabs and so forth. Sometimes ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    I have a javascript heavy app which has widgets like autocomplete dropdowns and tabs and so forth. Sometimes ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 10, 2022 in Education by JackTerrance
0 votes
    I have a javascript heavy app which has widgets like autocomplete dropdowns and tabs and so forth. Sometimes ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 10, 2022 in Education by JackTerrance
0 votes
    Is it possible for some Javascript to detect whether Skype is installed or not? The reason I ask is ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 7, 2022 in Education by JackTerrance
...