Skip to content

Instantly share code, notes, and snippets.

View NikaTsanka's full-sized avatar
🚀
Focused

Nika Tsankashvili NikaTsanka

🚀
Focused
View GitHub Profile
@NikaTsanka
NikaTsanka / calibration_script.py
Last active November 15, 2024 05:01
Camera Calibration
import numpy as np
import cv2
import glob
import yaml
#import pathlib
# termination criteria
criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001)
# prepare object points, like (0,0,0), (1,0,0), (2,0,0) ....,(6,5,0)
objp = np.zeros((7*7,3), np.float32)
@NikaTsanka
NikaTsanka / canny.py
Created July 14, 2017 17:45
Canny Operator
import cv2
import matplotlib.pyplot as plt
# Open the image
img = cv2.imread('dancing-spider.jpg')
# Apply Canny
edges = cv2.Canny(img, 100, 200, 3, L2gradient=True)
plt.figure()
@NikaTsanka
NikaTsanka / lap.py
Created July 9, 2017 18:52
Laplacian Operator
import cv2
import matplotlib.pyplot as plt
# Open the image
img = cv2.imread('shapes.jpg')
# Apply gray scale
gray_img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
# Apply gaussian blur
@NikaTsanka
NikaTsanka / prewitt.py
Created July 4, 2017 18:26
Prewitt's Operator
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
# Open the image
img = np.array(Image.open('dancing-spider.jpg')).astype(np.uint8)
# Apply gray scale
gray_img = np.round(0.299 * img[:, :, 0] +
0.587 * img[:, :, 1] +
@NikaTsanka
NikaTsanka / rgb-sobel.py
Created July 2, 2017 18:33
RGB Sobel Operator
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
# Open the image
img = np.array(Image.open('dancing-spider.jpg')).astype(np.uint8)
# Sobel Operator
h, w, d = img.shape
@NikaTsanka
NikaTsanka / sobel.py
Created July 2, 2017 18:17
Sobel Operator
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
# Open the image
img = np.array(Image.open('dancing-spider.jpg')).astype(np.uint8)
# Apply gray scale
gray_img = np.round(0.299 * img[:, :, 0] +
0.587 * img[:, :, 1] +
@NikaTsanka
NikaTsanka / dft.py
Created July 2, 2017 17:31
Fourier Transform
import math
from matplotlib import pyplot as plt
# Let's initialize two lists with the real
# and imaginary numbers.
real_list = [36, 22, 45, 15]
imag_list = [0, 0, 0, 0]
results_f = [] # Forward
results_i = [] # Inverse