- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Prasad Naik has Published 74 Articles
Prasad Naik
1K+ Views
In this article, we will learn how to read and display images using the OpenCV library.OpenCV is a library of programming functions mainly aimed at real time computer vision. Before reading an image, make sure that the image is in the same directory as your program.AlgorithmStep 1: Import OpenCV. Step ... Read More
Prasad Naik
346 Views
In this program, we will write an image or save an image to a file using OpenCV.AlgorithmStep 1: Import cv2 Step 2: Read the image using opencv.imread() Step 3: Save the image using opencv.imwrite(filename, image)Example Codeimport cv2 import os image = cv2.imread('testimage.jpg') directory = r'C:\Users\prasa\Desktop' os.chdir(directory) cv2.imwrite('CAMERAMAN.jpg', image)OutputThis program will ... Read More
Prasad Naik
14K+ Views
In this program, we will change the color scheme of an image from rgb to grayscaleAlgorithmStep 1: Import OpenCV. Step 2: Read the original image using imread(). Step 3: Convert to grayscale using cv2.cvtcolor() function.Example Codeimport cv2 image = cv2.imread('colourful.jpg') cv2.imshow('Original', image) grayscale = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) cv2.imshow('Grayscale', grayscale)OutputOriginal Image:Grayscale Image:Read More
Prasad Naik
7K+ Views
In this program, we will draw a filled polygon using the opencv function fillPoly(). The function takes in an image and the endpoints of the polygon.AlgorithmStep 1: Import cv2 and numpy. Step 2: Define the endpoints. Step 3: Define the image using zeros. Step 4: Draw the polygon using the ... Read More
Prasad Naik
788 Views
In this article, we will draw a circle on an image using the OpenCV function circle().Original ImageAlgorithmStep 1: Import OpenCV. Step 2: Define the radius of circle. Step 3: Define the center coordinates of the circle. Step 4: Define the color of the circle. Step 5: Define the thickness. Step ... Read More
Prasad Naik
4K+ Views
In this program, we will draw a rectangle using the OpenCV function rectangle(). This function takes some parameters like starting coordinates, ending coordinates, color and thickness and the image itself.Original ImageAlgorithmStep 1: Import cv2. Step 2: Read the image using imread(). Step 3: Define the starting coordinates. Step 5: Define ... Read More
Prasad Naik
655 Views
In this program, we will draw an ellipse on an image in using the OpenCV library. We will use the OpenCV function ellipse() for the same.Original ImageAlgorithmStep 1: Import cv2. Step 2: Read the image using imread(). Step 3: Set the center coordinates. Step 4: Set the axes length. Step ... Read More
Prasad Naik
382 Views
In this program, will blur an image using the openCV function GaussianBlur(). Gaussian blur is the process of blurring an image using the gaussian function. It is widely used in graphics software to remove noise from the image and reduce detail.AlgorithmStep 1: Import cv2. Step 2: Read the original image. ... Read More
Prasad Naik
311 Views
In this program, we will blur an image using the opencv function blur().AlgorithmStep 1: Import OpenCV. Step 2: Import the image. Step 3: Set the kernel size. Step 4: Call the blur() function and pass the image and kernel size as parameters. Step 5: Display the results.Original ImageExample Codeimport cv2 ... Read More
Prasad Naik
4K+ Views
In this program, we will write text on an image using the opencv function putText(). This function takes in the image, font, coordinates of where to put the text, color, thickness, etc.Original ImageAlgorithmStep 1: Import cv2 Step 2: Define the parameters for the puttext( ) function. Step 3: Pass the ... Read More