#msrtanagarwal, #python, #imagemanipulation #rotate #flip #crop #resize #contrast
How To Display 360 Rotate Flip Crop Resize Contrast Image In Python Project
What about the video?
How To Display 360 Rotate Flip Crop Resize Contrast Image In Python Project
Project Prerequisites
1.you can install cv2 , numpy module
2.Some jpg pictures to manipulate
3. Methods
1.Display image
Imread() – read image
Type (image) – show type
Imshow() –show image
Waitkey() -to halt
2. Rotate 360 degree
Read image
Image.shape[0:2]- return the height and width of image matrix
rotationMatrix =cv2.getRotationMatrix2D(center, angle, scale)
center- Center point of rotation
angle – Angle in degree
scale - The scale property which makes the image fit on the screen
The next step is to rotate our image with the help of the rotation matrix.
rotatedImage = cv2.warpAffine(img rotationMatrix (width height))
Then we show rotated image.
3Flip image
Using flip metod in cv2
Cv2.flip(image,0) for vertical
Cv2.flip(image,1) for hirizontal
4.Cropped image
Read image
Get height and width of image,
find start row and colume and end row and colume by %,
map the image
croppedImage = img[startRow:endRow startCol:endCol]
show image
5.Resize image
Resize()
a. With axis value
b.Using row and column value
6.Contrast Image
OpenCV suggests an equation that can perform image brightness and image contrast both at the same time.
new_img = a * original_img + b
Here a is alpha which defines contrast of the image .If a is greater than 1, there will be higher contrast.
If the value of a is between 0 and 1 ,there would be lower contrast.
If a is 1, there will be no contrast effect on the image.
b stands for beta. The values of b vary from -127 to +127.
To implement this equation in Python OpenCV, you can use the addWeighted() method.
"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.”
User id- x0auwxIXi1mnmBBv8Cgmyg
CHANNEL id - / @ratanagarwalitinformer
Customize channel id - / ratanagarwalitinformer
short link of channel http://bit.ly/3eH6m5d
join on Telegram- https://t.me/techratanagarwal
OUR SOCIAL MEDIA Watch us on
Facebook page- / msratanagarwal write
Facebook group- / 229087104980049
Peep us on Instagram: / ratanagarwal67
Fly with us on Twitter: / msratanagarwal
PLAYLIST-
Windows 10- / playlist,list=pluclt6s7bsrpnr8gso5e49godeh...
YouTube assets- • YouTube Tips
Python - • python
Animation in C - • animation in c
HTML • html and css
JavaScript • JAVASCRIPT
Quiz and story • quiz and story general topics
Message and blog https://www.youtube.com/playlist?list...
Latest technology • latest technology
app and security • apps and security
Network • network
access • ACCESS SERIES
excel • EXCEL SERIES
word • ms word
power point • power point
Skill education • skill education
Short video • shorts
daily use app- • daily use apps
Phone • PHONE
flash • flash
Quiz and story • quiz and story general topics
outlook • outlook
information technology • INFORMATION TECHNOLOGY(backup)