6 Rotating the Image Rotate the Image in Python using OpenCV¶ In [2]: import cv2 img = cv2.imread('machinelearning.png',1) cv2.imshow('Machine Learning',img) cv2.waitKey(0) cv2.destroyAllWindows() Rotating the Image¶There are a lot of steps involved in rotating an image. The 2 main functions used here are – getRotationMatrix2D() warpAffine() getRotationMatrix2D() : It takes 3 arguments …
Read More »Resizing the Image in Python using OpenCV
5 Resizing the Image Resizing the Image in Python using OpenCV¶ In [2]: import cv2 img = cv2.imread('machinelearning.png',cv2.IMREAD_COLOR) cv2.imshow('Machine Learning',img) cv2.waitKey(0) cv2.destroyAllWindows() Resize image to 200px 180px ( Width Height )¶ In [3]: import cv2 img = cv2.imread('machinelearning.png',cv2.IMREAD_COLOR) resize = cv2.resize(img, (200, 180)) cv2.imshow('Machine Learning',resize) cv2.waitKey(0) cv2.destroyAllWindows()
Read More »Extracting the Image Region of Interest (ROI) in Python using OpenCV
4 Extracting the Region of Interest (ROI) Extracting the Image Region of Interest (ROI) in Python using OpenCV¶ Read Actual Image¶ In [2]: import cv2 img = cv2.imread('machinelearning.png',1) cv2.imshow('Machine Learning',img) cv2.waitKey(0) cv2.destroyAllWindows() Read Image from Height 100-200 Pixel and Width 200-400 Pixel¶ In [3]: import cv2 img = cv2.imread('machinelearning.png',1) roi = img[100 …
Read More »Extracting The Image RGB Values of a Pixel in Python Using OpenCV
3 Extracting the RGB values of a pixel Extracting The Image RGB Values of a Pixel in Python Using OpenCV¶ In [2]: import cv2 img = cv2.imread('machinelearning.png',1) cv2.imshow('Machine Learning',img) cv2.waitKey(0) cv2.destroyAllWindows() Get RGB Value of a Single Pixel¶ In [3]: img[100,100] Out[3]: array([203, 190, 84], dtype=uint8) In [4]: B,G,R = img[100,100] print(B,G,R) 203 …
Read More »Reading Image as Color or GrayScale Image in Python using OpenCV
2 – Read Color and GrayScale Image Reading Image as Color or GrayScale Image in Python using OpenCV¶In this article, we’ll try to open an image by using OpenCV (Open Source Computer Vision). To use the OpenCV library in python, we need to install these libraries as a prerequisite: Numpy …
Read More »Introduction to OpenCV Python Tutorials
1 Introduction to OpenCV Introduction to OpenCV Python Tutorials¶Getting Started with OpenCV-Python OpenCV is a huge open-source library for computer vision, machine learning, and image processing. It can process images and videos to identify objects, faces, or even the handwriting of a human. OpenCV was started at Intel in 1999 …
Read More »Python Exceptions
Python – Exceptions Handling Python – Exceptions Handling¶Python provides very important features to handle any unexpected error in your Python programs and to add debugging capabilities in them − Here is a list all the standard Exceptions available in Python −¶1: Exception Base class for all exceptions 2: StopIteration Raised …
Read More »Python Files Handling
12 File Handling Python File Handling¶File handling is an important part of any web application.Python has several functions for creating, reading, updating, and deleting files. Functions used in File Handling¶ open() close() read() write() seek() tell() The key function for working with files in Python is the open() function.¶ The …
Read More »Python Modules
Python Modules What is a Module?¶Consider a module to be the same as a code library. A file containing a set of functions you want to include in your application. Create a Module¶ To create a module just save the code you want in a file with the file extension …
Read More »Python Functions
Python Functions Python Function¶ A function is a block of code which only runs when it is called. You can pass data, known as parameters, into a function. A function can return data as a resul A colon (:) to mark the end of the function header. An optional return …
Read More »
Machine Learning Tutorials, Courses and Certifications