Skewed text image in python|ratan agarwal it informer
Channel: RATAN AGARWAL
Date: 2021-07-02

#msratanagarwal #skewimage #python #pythonprogramming #pythontutorial #python3 
Skewed text image in python
what bout the video?
Skewed text image in python
To Detect and correct text skew
Given an image containing a rotated block of text at an unknown angle, we need to correct the text skew by: 
• Detecting the block of text in the image.
• Computing the angle of the rotated text.
• Rotating the image to correct for the skew.
1. Import the modules cv2, NumPy and read the image:
2. Convert the image into a grayscale image:
3. Invert the grayscale image using bitwise_not:
4. Select the x and y coordinates of the pixels greater than zero by using the column_stack method of NumPy:
5. Now we have to calculate the skew angle. We will use the minAreaRect() method of cv2. 
    which returns an angle range from -90 to 0 degrees (where 0 is not included).
6. The rotated angle of the text region will be stored in the ang variable.
7. Now we add a condition for the angle; 
if the text region’s angle is smaller than -45,we will add a 90 degrees 
else we will multiply the angle with a minus to make the angle positive.
8. Calculate the center of the text region:
     Now we have the angle of text skew, we will apply the getRotationMatrix2D() to get the rotation matrix
     then we will use the wrapAffine() method to rotate the angle (explained earlier).
9. Display the rotated image

"Copyright Disclaimer under Section 107 of the copyright  act 1976, allowance is made for fair use for purposes such as criticism, comment, news reporting, scholarship, and research. Fair use is a use permitted by copyright statute that might otherwise be infringing."

Customize channel id -  https://www.youtube.com/c/RATANAGARWALITINFORMER
short link of channel  http://bit.ly/3eH6m5d  

join on Telegram- https://t.me/techratanagarwal

OUR SOCIAL MEDIA Watch us on
Facebook page- https://www.facebook.com/msratanagarwal write 
Facebook group- https://www.facebook.com/groups/229087104980049
Peep us on Instagram: https://www.instagram.com/ratanagarwal67/
Fly with us on Twitter: https://twitter.com/msratanagarwal

SHARE this video with your friends 

PLAYLIST-
Windows 10- https://www.youtube.com/playlist,list=PLUclT6s7BSrPNr8gso5E49GOdEH28vLEf
YouTube assets- https://www.youtube.com/playlist?list=PLUclT6s7BSrO6HLM8Oq2ChWonDS-j_vIy 
Python -https://www.youtube.com/playlist?list=PLUclT6s7BSrNB36fzjtA1lmzSNBzTxJeo 
Animation in C - https://www.youtube.com/playlist?list=PLUclT6s7BSrPgvE3eNxCz46YAtL9tZlMg
HTML   https://www.youtube.com/playlist?list=PLUclT6s7BSrN_hqZCTmN0CYRr32P3D8b9 
JavaScript   https://www.youtube.com/playlist?list=PLUclT6s7BSrMQowWfH3LXyZ0r0YLivoi0
Quiz and story https://www.youtube.com/playlist?list=PLUclT6s7BSrMYMSfDslna5M67w4IMFF53 
Message and blog https://www.youtube.com/playlist?list=PLUclT6s7BSrONG0SfsDqlVYAvkWzUffN    
Latest technology https://www.youtube.com/playlist?list=PLUclT6s7BSrNVD-VMNSSBMkVQv856Tu0g 
app and security https://www.youtube.com/playlist?list=PLUclT6s7BSrNXVnFdgFkSFILOS-HNm16K  
Network https://www.youtube.com/playlist?list=PLUclT6s7BSrPMgnqNeMqTCCTWDFTEz17n 
access https://www.youtube.com/playlist?list=PLUclT6s7BSrNC0Shgkmc6PN0zobzIe8Od   
excel https://www.youtube.com/playlist?list=PLUclT6s7BSrMzEMcxhCLCFBt1j0-vgE5z     
word https://www.youtube.com/playlist?list=PLUclT6s7BSrNYiKa3oyS_7spZ-ZEtjf6m 
power point https://www.youtube.com/playlist?list=PLUclT6s7BSrOcUBZXyICt662W2nCzNHRI   
Skill education https://www.youtube.com/playlist?list=PLUclT6s7BSrM0Vf05uYRUDCCNhw2NmWzl    
Short video https://www.youtube.com/playlist?list=PLUclT6s7BSrNku9f0IsaV6brCns5tPL5T 
daily use app- https://www.youtube.com/playlist?list=PLUclT6s7BSrPc1FGqDT7ntv08UTNR7AZA
Phone https://www.youtube.com/playlist?list=PLUclT6s7BSrNM-_KuKHomcjW-DkedNnI- 
flash https://www.youtube.com/playlist?list=PLUclT6s7BSrP4-QQDTkfQOVGIGyUAltrH 
Quiz and story https://www.youtube.com/playlist?list=PLUclT6s7BSrMYMSfDslna5M67w4IMFF53 
outlookhttps://www.youtube.com/playlist?list=PLUclT6s7BSrMmH8N41EUNWCWJvPbXjftL
information technology https://www.youtube.com/playlist?list=PLUclT6s7BSrOXEG_tdXDEJzCA8h9PXGSR