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

Read and Save an Image Using OpenCV in Python

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 Plot Using Python Matplotlib

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

1K+ Views

Matplotlib is free and open-source plotting library in python. It is used to create 2-Dimensional graphs and plots by using python scripts. To utilize the matplotlib functionalities we need to install the library first. Install using pip By execute the below command in the command prompt we can easily install the latest stable package for Matplotlib from PyPi. pip install Matplotlib You can install Matplotlib through conda, using the following command – conda install -c conda-forge matplotlib A Contour plot is used for visualizing three-dimensional data in a two-dimensional surface by plotting constant z slices, called contours. ... Read More

Contour Plots Using Plotly in Python

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

567 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

222 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 Image to 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

Conversion Functions in Pandas DataFrame

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

339 Views

Pandas is one of the most potent libraries in python that provide high-performance data manipulation and analysis tools, it allows us to work with tabular data like spreadsheets, CSV, and SQL data using DataFrame. A DataFrame is a 2-dimensional labeled data structure it represents the data in rows and columns format. Data present in each column may have different data types. DataFrame: Integers Floats Strings Dates 0 1.0 1.300 p 2023-05-07 1 2.0 NaN y 2023-05-14 2 5.0 4.600 t 2023-05-21 3 3.0 1.020 h 2023-05-28 4 6.0 0.300 o 2023-06-04 5 NaN 0.001 n 2023-06-11 The DataFrame demonstrated above is having 6 rows and 4 columns and the data present in each row has different datatypes. And Conversions functions ... Read More

Convert Nested For Loop to Map Equivalent in Python

Gireesha Devara
Updated on 30-May-2023 14:28:52

807 Views

In general, for loop is used to execute/iterate a block of code a fixed number of times. And nested for loop is nothing but, iterating a block of code for x number of times, then we need to run another block of code within that code for y number of times. Nested for loop syntax for x in sequence: for y in sequence: inner loop outer loop The map is a built-in function in python that is used to iterate the items of a sequence and ... Read More

Convert 'Unknown Format' Strings to Datetime Objects in Python

Gireesha Devara
Updated on 30-May-2023 13:25:44

2K+ Views

Dates can be in many formats like: “2009/05/13 19:19:30”, “May 13 2009 07:19PM", and “2009-05-13 19:19”. Python provides many modules to work with data related to date times. To read an unknown format of date strings into a python datetime object, we can use the python dateutil, datetime modules. The python datetime object is a single object that has all the information about the date and time objects. It represents the data related to the year, month, day, hours, mintunes, seconds, and time zones also. In this article below, we will see how to convert the unknown format strings to ... Read More

Convert Numpy Array to Pandas Series

Gireesha Devara
Updated on 30-May-2023 13:16:19

2K+ Views

A Numpy array is an N-dimensional array also called a ndarray, it is a main object of the NumPy library. In the same way, the pandas series is a one-dimensional data structure of the pandas library. Both pandas and NumPy are validly used open-source libraries in python. Below we can see the one-dimensional numpy array. NumPy array array([1, 2, 3, 4]) The pandas Series is a one-dimensional data structure with labeled indices and it is very similar to a one-dimensional NumPy array. Pandas Series: 0 1 1 2 2 3 ... Read More

Advertisements