Add watermark to multiple images with Opencv and Python

We’re going to see right now how to add a watermark automatically to multiple images using Opencv with Python. So for example if this logo: And this image: Adding a watermark will look like this: First of all we import the libraries and on line 4 we load the logo using Opencv.On line 5 we […]

Scanning Qr Code – Opencv with Python

We’re going to see today how to scan Qr code using OpenCV.Below you can see the code read the Qr code from an image or a real-time video. For this project, we will obviously need our OpenCV library then NumPy and pyzbar. If you need to install pyzbar, I recommend that you go directly to […]

Real time shape detection – Opencv with Python 3

In this video tutorial we’re going to see how to detect shapes of geometric figures (like rectangles, triangles and circles) in a live video. We can detect shapes in real time in this three simple steps: Detect the objects, removing the background. Find the contours of the objects detected. Detect the shape of each of […]

How to create a cartoon effect – Opencv with Python

We’re going to see in this video how to create a cartoon effect. A cartoon has 2 important charateristics: Really clear edges Homogeneus colours Starting from an original image taken with a camera we’re going to give to it a cartoon effect keeping in mind these 2 charateristics.   Source code: import cv2 import numpy […]

Simple shape detection – Opencv with Python 3

We’ll se in this video how to perform a simple shape detection. Starting from an image with a few shapes, we’ll be able to detect exactly each shape (rectangle, circle, pentagon, etc.) and the position. As first thing we need to import the libraries, then on line 4 we also define the font that we […]

Fourier Transform – OpenCV 3.4 with python 3 Tutorial 35

Source code: import cv2 import numpy as np import glob list_images = glob.iglob(“letters/*”) for image_title in list_images: img = cv2.imread(image_title, cv2.IMREAD_GRAYSCALE) f = np.fft.fft2(img) fshift = np.fft.fftshift(f) magnitude_spectrum = 20*np.log(np.abs(fshift)) magnitude_spectrum = np.asarray(magnitude_spectrum, dtype=np.uint8) img_and_magnitude = np.concatenate((img, magnitude_spectrum), axis=1) cv2.imshow(image_title, img_and_magnitude) cv2.waitKey(0) cv2.destroyAllWindows()   Files: fourier_transform_files.zip Sergio CanuHi there, I’m the founder of Pysource. I’m […]

Detect how similar two images are with Opencv and Python

While in the previous tutorial we learnt to detect if there are similarities between two images, but what if we would like to know how similar they are? We are going to see in this tutorial, how starting from the features of the two images we can define a percentage of similarity from 0 to […]

Find similarities between two images with Opencv and Python

We have seen in the previous tutorial if two images are completely equal (same size, same channels, and same pixels values). But what if they’re not equal?The subtraction method doesn’t work anymore, as we can’t subtract pixels from images that have different sizes, we would get an error. In this article you will learn how […]

Check if two images are equal with Opencv and Python

Finding if two images are equal with Opencv, is a quite simple operation. There are 2 fundamental elements to consider: The images have both the same size and channels Each pixel has the same value We’re going first to load the images. If you want to download the images I used, you can go at […]