Skip to content

Instantly share code, notes, and snippets.

@fehlfarbe
fehlfarbe / templatematching_ORB.py
Last active February 1, 2019 20:32
Some simple templatematching with ORB
import sys
import cv2
import numpy as np
from math import sqrt, acos
from optparse import OptionParser
#FULL = "full.jpg"
#CROP = "crop.jpg"
#FULL = "pleiades_hyades_50percent.jpg"
#CROP = "pleiades_hyades_50percent_crop.jpg"
@fehlfarbe
fehlfarbe / templatematching.py
Created July 19, 2018 17:54
Some simple templatematching
import sys
import cv2
import numpy as np
FULL = "full.jpg"
CROP = "crop.jpg"
def template_matching(full, template, start=0.1, stop=1.0, step=0.1):
crop_full = cv2.resize(template, tuple(np.roll(full.shape, 1)))