Skip to content

Instantly share code, notes, and snippets.

View diegolrs's full-sized avatar

Diego Reis diegolrs

View GitHub Profile
@diegolrs
diegolrs / dct2d.py
Last active December 23, 2022 19:34
DCT - Two-Dimensional Discrete Cosine Transform and its inverse
import math
import numpy as np
#@title Direct DCT1D
def dct1d(x, array_length=-1):
if array_length == -1:
length = len(x)
else:
length = array_length
@diegolrs
diegolrs / compare_images.py
Last active December 23, 2022 20:42
Compare two images using python and google colab
import numpy as np
from matplotlib import image
from matplotlib import pyplot
import numpy as np
import cv2
from google.colab.patches import cv2_imshow
def compare(image1, image2):
if(image1.shape != image2.shape):