Prasad Naik has Published 74 Articles

Downsampling an image using OpenCV

Prasad Naik

Prasad Naik

Updated on 17-Mar-2021 08:28:17

5K+ Views

In this program, we will down sample an image. Downsampling is decreasing the spatial resolution while keeping the 2D representation of an image. It is typically used for zooming out of an image. We will use the pyrdown() function in the openCV library to complete this task.Original ImageAlgorithmStep 1: Fead ... Read More

Calculating the mean of all pixels for each band in an image using the Pillow library

Prasad Naik

Prasad Naik

Updated on 17-Mar-2021 08:27:40

2K+ Views

In this program, we will calculate the mean of all the pixels in each channel using the Pillow library. There are a total three channels in an image and therefore, we will get a list of three values.Original ImageAlgorithmStep 1: Import the Image and ImageStat libraries. Step 2: Open the ... Read More

Upsampling an image using OpenCV

Prasad Naik

Prasad Naik

Updated on 17-Mar-2021 08:27:02

3K+ Views

In this program, we will up sample an image. Up sampling is increasing the spatial resolution while keeping the 2D representation of an image. It is typically used for zooming in on a small region of an image. We will use the pyrup() function in the openCV library to complete ... Read More

Performing white BlackHat operation on images using OpenCV

Prasad Naik

Prasad Naik

Updated on 17-Mar-2021 08:26:42

264 Views

In this program, we will perform the Blackhat operation on an image using OpenCV. BlackHat transform is used to enhance dark objects of interest in a bright background. We will use the morphologyEx(image, cv2.MORPH_BLACKHAT, kernel) function.Original ImageAlgorithmStep 1: Import cv2. Step 2: Read the image. Step 3: Define the kernel ... Read More

Performing white TopHat operation on images using OpenCV

Prasad Naik

Prasad Naik

Updated on 17-Mar-2021 08:26:06

400 Views

In this program, we will perform the TopHat operation on images. TopHat operation is a morphological operation that is used to extract small elements and details from given images. TopHat is used to enhance bright objects in a dark background. We will use the morphologyEx(image, cv2.MORPH_TOPHAT, kernel) functionOriginal ImageAlgorithmStep 1: ... Read More

Dilating images using the OpenCV function dilate()

Prasad Naik

Prasad Naik

Updated on 17-Mar-2021 08:18:49

318 Views

In this program, we will dilate an image using the dilate function in the OpenCV library. Dilation adds pixels to the boundaries of objects in an image, i.e., it expands the image on all sides.Original ImageAlgorithmStep 1: Import cv2 and numpy. Step 2: Read the image using opencv.imread(). Step 3: ... Read More

Performing an opening operation on an image using OpenCV

Prasad Naik

Prasad Naik

Updated on 17-Mar-2021 08:18:29

461 Views

In this program, we will perform the opening operation on image. Opening removes small objects from the foreground of an image, placing them in the background. This technique can also be used to find specific shapes in an image. Opening can be called erosion followed by dilation. The function we ... Read More

Performing a closing operation on an image using OpenCV

Prasad Naik

Prasad Naik

Updated on 17-Mar-2021 08:17:42

1K+ Views

In this program, we will perform the closing operation using the cv2.morphologyEx() function. Closing removes small holes in the foreground, changing small holes of background into foreground. This technique can also be used to find specific shapes in an image. The function we will use for this task is cv2.morphologyEx(image, ... Read More

Calculating the median of all pixels for each band in an image using the Pillow library

Prasad Naik

Prasad Naik

Updated on 17-Mar-2021 08:16:31

656 Views

In this program, we will calculate the MEDIAN of all the pixels in each channel using the Pillow library. There are a total 3 channels in an image and therefore we will get a list of three values.Original ImageAlgorithmStep 1: Import the Image and ImageStat libraries. Step 2: Open the ... Read More

Eroding an image using the OpenCV function erode()

Prasad Naik

Prasad Naik

Updated on 17-Mar-2021 08:05:10

380 Views

In this program, we will erode an image using the OpenCV function erode(). Erosion of image means to shrink the image. If any of the pixels in a kernel is 0, then all the pixels in the kernel are set to 0. One condition before applying an erosion function on ... Read More

Advertisements