Image processing is ubiquitous these days. Its gets used in number of applications around us on daily basis. Here are few examples.
X-Ray enhancements: X-ray quality can be considerably improved by improving contrast using image processing techniques. This helps with better diagnosis of disease.
Hurdle detection: Autonomous car driving is becoming more and more popular. Car driving system processes images in and around the car in real time. By processing these images it can understand hurdles in its navigation track and avoid accidents.
License Plate recognition: Here techniques like OCR (optical character detection) is used to recognize characters in licence plat and convert it to a text. This is useful on toll booth or unmanned speed deterrents on freeway.
Face Detection and Recognition: In computer vision application identifying a face and drawing rectangle around it is crucial to understand if image contains image and if it does, who is that person. Once you understand fundamentals of drawing and image manipulation, you have a head start.
As you can see, as image processing gains more popularity, it is beneficial to understand fundamentals of how images are read and processed. Opencv and python offers quick way to learn image operations such as cropping, masking, flipping, rotating, resizing.
Here is simple code to crop an image
Here we use opencv to read and crop top left , top right , bottom left and bottom right part of the image.
Here is input image
And here are 4 cropped images
You can also perform resizing of images using few lines of code. And yes it is important to preserve aspect ratio during this resizing
#Resizing Width with preserving aspect ratio reSizedHeight = 200.0 * image.shape / image.shape dimNewImage = (200, int(reSizedHeight)) # perform the actual resizing of the image resizedImage = cv2.resize(image, dimNewImage, interpolation=cv2.INTER_AREA) displayImage(resizedImage,”Reduced width to 200")
Here is input and resized images
One of my favorite effect is flipping and masking
Here is horizontal flipping effect which creates mirror image
And here is masking which extracts just face by masking rest of the image
We can also rotate the image by any angle in clockwise or counterclockwise direction
All of these powerful operations can be done just by using few lines of code. If you would like to learn step by step on how to use opencv and python along with example, you can sign up for following course.
I am offering free enrollment for next 3 days. Enjoy. Here is the link with coupon code.
About Author Evergreen Technologies:
Active in teaching online courses in Computer vision , Natural Language Processing and SaaS system developmentOver 20 years of experience in fortune 500 companies
•Linked in: @evergreenllc2020
•Udemy: Evergreen Technologies