Posts

Wavelet Transform for Feature Extraction and Image Compression using Python and OpenCV

Wavelet Transform for Feature Extraction & Image Compression In this tutorial, we explore three important applications of the Discrete Wavelet Transform (DWT) using Python. You will learn how to: Extract features from an MRI image using wavelet decomposition. Perform image compression using DWT and hard thresholding. Compare compression results between FFT and DWT methods. This tutorial is based on the experiment documented in ​:contentReference[oaicite:0]{index=0} . Task 1: Feature Extraction using Wavelet Transform We first load an MRI image in grayscale and then apply a 2D Discrete Wavelet Transform (DWT) using the Haar wavelet. We also extract 1D signals from the approximation coefficients and display the wavelet decomposition components. Import Required Libraries import numpy as np import pywt import cv2 import matplotlib.pyplot as plt Load Image and Apply DWT # Load MRI image in grayscale de...

Texture Classification with GLCM and LBP Features in Python

Texture Classification with GLCM & LBP Features In this tutorial, we demonstrate how to perform texture classification using a combination of GLCM (Gray-Level Co-occurrence Matrix) and LBP (Local Binary Pattern) features. We’ll download a dataset, extract features from images, and then train a Random Forest classifier to predict texture categories. This tutorial is based on the experiment documented in ​:contentReference[oaicite:0]{index=0} . Step 1: Download and Extract the Dataset We use Python's requests and tarfile libraries to download and extract the Describable Textures Dataset (DTD). The dataset is stored as a compressed tar.gz file. import requests import tarfile import os # Download the dataset if not already downloaded url = "https://www.robots.ox.ac.uk/~vgg/data/dtd/download/dtd-r1.0.1.tar.gz" filename = "dtd-r1.0.1.tar.gz" if not os.path.exists(filename): print("Downloading dataset...") ...

Image segmentation Techniques in Python

Image
Image Segmentation Tutorial: Watershed & Graph Cut This tutorial demonstrates two powerful image segmentation techniques using Python and OpenCV. In the first part, you'll learn how to segment an image using the Watershed algorithm – a process that includes grayscale conversion, Gaussian blurring, thresholding, and distance transformation. In the second part, the Graph Cut algorithm is applied to segment an image by separating the foreground and background using a cost function based on edge weights. This tutorial is based on the experiment documented in ​:contentReference[oaicite:0]{index=0} . Task 1: Watershed Algorithm Segmentation The Watershed algorithm is used to separate overlapping objects in an image. In this example, we perform the following steps: Load the image using OpenCV Preprocess the image by converting it to grayscale, applying Gaussian blur, and thresholding Compute the distance transform and segmen...

Histogram Equalization & Edge Detection techniques using Python and OpenCV

Image
Histogram Equalization & Edge Detection Tutorial This tutorial walks you through two important tasks in image processing. In Task 1, you will learn how to implement histogram equalization from scratch to enhance the contrast of a grayscale image. Task 2 compares the performance of Sobel and Canny edge detection methods on images with simple and complex edges using OpenCV. Task 1: Histogram Equalization from Scratch This task enhances the contrast of a grayscale image by redistributing its intensity values without using OpenCV's built-in functions. Step 1: Import Required Libraries import matplotlib.pyplot as plt import numpy as np import time import cv2 Step 2: Define Helper Functions These functions load the image, compute its histogram, the cumulative distribution function (CDF), normalize the CDF, and finally perform histogram equalization. def load_image(path): """Load image using matplotlib"...

Contrast Enhancement Techniques in Image Processing using Python

Image
Image Processing Tutorial: Contrast Enhancement & Smoothing Methods In this tutorial, we will walk through two essential tasks in image processing. The first task demonstrates how to perform contrast enhancement without using OpenCV, and the second compares different smoothing methods using OpenCV. Both sections include detailed code explanations and visual results using Python libraries. Contrast Enhancement without OpenCV This task covers loading an image, converting it to grayscale manually, and then applying contrast enhancement through histogram stretching. Step 1: Import Required Libraries from PIL import Image import numpy as np import matplotlib.pyplot as plt Step 2: Load and Display the Original Image # Load the image using PIL img_pil = Image.open('/content/img2.jpg') plt.figure(figsize=(6, 6)) plt.imshow(img_pil) plt.title('Original Image (Task 1)') plt.axis('off') plt.show() Step 3: Convert...

Top Apps for better Mobile Privacy

Image
"Arguing that you don't care about the right to privacy because you have nothing to hide is no different than saying you don't care about free speech because you have nothing to say." - Edward Snowden. We all know that the apps we have on our mobile know about us better than we do about ourselves. Maybe it’s time for us to take up some steps towards better privacy. Have you ever wondered that the ads we get on YouTube or Facebook are very familiar with our searches or apps that we installed? It’s not a coincidence. Major platforms like Google, Facebook or Instagram sell our user data to show ads. That’s the reason they are free to use. Well, we cannot remove them completely from our lives due to our attachment with them, but we can take some better steps towards privacy. Read Google's Privacy Policy Read Facebook's Privacy Policy Read Instagram's Privacy Policy 1. Replacing GOOGLE with STARTPAGE: Well, we all know that Google is something we all use no...

Top Android Apps not available on Play Store

Image
     The Google Play Store is definitely the best place to get applications. There is a massive selection of the most popular developers, and its security features are top-notch. You simply can’t get the same experience anywhere. However, that isn’t to say that Google Play has every app or game available for download. We are sure that you know Fortnite and its problems to remain legit now. Other surprisingly decent sideloaded apps aren’t allowed in Google Play for one reason or another. Below are the best Android apps you might want to load. 1. Blockada: Are you irritated with annoying ads on your mobile? Then download Blockada. Blokada is one of the most useful apps, which is not available on the Google Play Store.  The app is a free and open-source Ad-blocker compatible with both Android and  iOS  devices.  The app is easy to operate, as it does not have a complex matrix. All you need to do is to open Blokada, and you are good to go. Not only from th...