Found 33676 Articles for Programming

Dividing Images Into Equal Parts Using OpenCV Python

Gireesha Devara
Updated on 30-May-2023 16:01:14

7K+ Views

The Python OpenCV library enables us to utilize a variety of image-processing tools, like image classification, face/object detection, tracking, and more. In this article, we will use python list slicing or numpy array slicing techniques to divide an image into equal parts, since OpenCV-python uses the Numpy array to store the image data/pixel values. Input Output Scenarios Assuming we have an input image and in the output, we will see the equally divide parts of the given image. Approach We will follow the below steps to divide the images into equal parts. Load the image. Extract ... Read More

White and black dot detection using OpenCV Python

Gireesha Devara
Updated on 30-May-2023 15:58:07

4K+ Views

OpenCV python is one of the image processing libraries in python and it uses the Numpy array to store the image data so that all the image arrays are represented as a ndarray type. The cv2.findContours() method in the python OpenCV module is used for detecting the objects in a binary image. In the article below, we will use this method to detect the White and Black dots (objects) in an image. Following is the syntax of this method – cv2.findContours(image, mode, method[, contours[, hierarchy[, offset]]]) Where, Image is an 8-bit single-channel image (binary image). Contours is ... Read More

Rotate image without cutting off sides using OpenCV Python

Gireesha Devara
Updated on 30-May-2023 15:55:23

2K+ Views

Rotating an image is the most basic operation in image editing. The python OpenCV library provides the methods cv2.getRotationMatrix2D(), cv2.rotate() to do this task very easily. The cv2.rotate() will rotate the image in 0 or 90 or 180 or 270 angles only where as Cv2.getRotationMatrix2D() will rotate the image to any specified angle. In the article below, we will rotate the image without cropping or cutting off sides using OpenCV Python. To rotate an image using the cv2.getRotationMatrix2D() method then we need to follow below three steps − First, we need to get the centre of rotation. Next ... Read More

Check if the image is empty using OpenCV Python

Gireesha Devara
Updated on 30-May-2023 15:48:46

2K+ Views

OpenCV is an Open Source Computer Vision Library in python. It is one of the image processing libraries in python and it uses the python Numpy library so that all the image arrays are represented as a ndarray type. OpenCV-python needs the numpy library, we need to make sure that the numpy is also installed in our python interpreter. In this article, we will see the different ways to check if the given image is empty or not using OpenCV Python. Let’s observe the input-output scenarios to understand how to check if the given image is empty or not ... Read More

Splitting and Merging Channels with OpenCV Python

Gireesha Devara
Updated on 30-May-2023 15:44:09

5K+ Views

A standard digital Color image is represented by pixels and each pixel is a combination of primary colors. And a channel is a grayscale image that is made up of only one of its primary colors of a colored image. For example, an RGB image has three channels: red, green, and blue. Observe the below colored images to see how each channel looks separately: Below grayscale images are the representation of each channel of the RGB image. In this article, we will discuss how to split and merge channels of an image using python openCV library. Splitting channels ... Read More

Top Hat and Black Hat Transform using OpenCV Python

Gireesha Devara
Updated on 30-May-2023 15:34:25

2K+ Views

Top Hat and Black Hat Transforms are the Morphological transformations operations on the binary images. Generally, the morphological operations process the image based on the morphology, structure, or shape. Top-hat transform is an operation that opens an image and then subtracts it from the original image (top hat = image - opening). It is used to extract small elements and details from given images which is nothing but feature extraction, image enhancement, and other operations. Whereas the Black Hat Transform operation is nothing but the difference between an image closing and the input image itself (black hat = closing ... Read More

OpenCV Python program to read and save an Image

Gireesha Devara
Updated on 30-May-2023 15:31:19

1K+ Views

OpenCV-python is an Open Source Computer Vision Library in python it is used to process images and videos for detecting faces and objects. It is one of the image processing libraries in python and uses the python Numpy library so that all the image arrays are represented as a ndarray type. Install OpenCV using pip Pip install opencv-python OpenCV needs the numpy library, we need to make sure that the numpy library is also installed. The Python OpenCV module provides functions cv2.imread() and cv2.imwrite() to read/load and write/save image files. In this article, we will see reading ... Read More

Contour Plots using Plotly in Python

Gireesha Devara
Updated on 30-May-2023 15:17:55

550 Views

In python Plotly referred as "plotly.py". It is a free and open-source plotting library that is built on top of “plotly.js”. It supports more than 40 unique chart types. This library is mainly used for financial, geographical, scientific, 3-dimensional, and data analysis applications. It can be used to plot various types of charts and graphs like scatter plots, line plots, bar charts, box plots, histograms, pie charts, area charts, box plots, histograms, heatmaps, subplots, multiple-axes, etc. Installing plotly Execute the below commands in the command prompt to install the plotly module. It is an easy way to install the ... Read More

Conversion between binary, hexadecimal and decimal numbers using Coden module

Gireesha Devara
Updated on 30-May-2023 14:57:06

213 Views

The coden is a python library developed by Tanmay Earappa, which is used for secret codes (decoding and encoding secret codes). This module provides functionalities to do the code conversions. Following are few functions and their functionalities provided by this module – coden.secret(): It is used for decode or encode the secret codes based on the input of the mode parameter. hex_to_bin(): It will do the Hexadecimal to Binary conversion. int_to_bin(): It will do the Decimal to Binary conversion. int_to_hex(): It will do the Decimal to Hexadecimal conversion Install Coden with pip With the pip command we can ... Read More

Convert an image into jpg format using Pillow in Python

Gireesha Devara
Updated on 30-May-2023 14:53:05

8K+ Views

In python pillow is one of the image processing libraries that is built on top of PIL (Python Image Library). It provides image processing functionalities to the python interpreter to work with image objects. And this library supports above 30 different image file formats. Install Pillow with pip By installing pillow using the pip command we can easily access the pillow functionalities. python3 -m pip install --upgrade pip python3 -m pip install --upgrade Pillow Just by running the above commands in the command prompt we will get the pillow module. In this article, we will discuss converting ... Read More

Advertisements