Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from subprocess import call | |
from pylab import * | |
from mpl_toolkits.axes_grid1 import make_axes_locatable | |
from matplotlib.patches import Rectangle | |
from time import sleep | |
import cv2 | |
# Read template image | |
templateImageGray = cv2.imread("./images/templateImage.png", cv2.IMREAD_GRAYSCALE) | |
templateImageGray = cv2.resize(templateImageGray, (0, 0), fx=16, fy=16, interpolation=cv2.INTER_CUBIC) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from glob import glob | |
import cv2 | |
import numpy as np | |
from numpy import arange | |
import matplotlib.pyplot as plt | |
from matplotlib.figure import Figure | |
from matplotlib.backend_bases import key_press_handler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# convert image to numpy array | |
im = array(Image.open('./data/empire.jpg')) #return numpy array | |
# show | |
imshow(im, interpolation='nearest')#or interpolation='None' | |
# star point | |
x = [100,100,400,400] | |
y = [200,500,200,500] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
pil_im = Image.open('./data/empire.jpg').convert('L') | |
#rotate clockwise | |
out = pil_im.rotate(45) | |
#show | |
out.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
pil_im = Image.open('./data/empire.jpg').convert('L') | |
#be careful it may change aspect ratio | |
out = pil_im.resize((128,128)) | |
#show | |
out.show() |