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
offsets = model.offsets(psa_angles) | |
plt.plot(offsets[:, 1], offsets[:, 0], '.-') | |
# plt.plot(offsets_bicubic[:, 1], offsets_bicubic[:, 0], '.-') | |
plt.plot(offsets[0, 1], offsets[0, 0], 'o') | |
plt.axis('equal') | |
plt.gca().invert_yaxis() | |
plt.xlabel(r"$\Delta{}x$ (px)", fontsize=14) | |
plt.ylabel(r"$\Delta{}y$ (px)", fontsize=14) |
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 numpy as np | |
import maxflow | |
from matplotlib import pyplot as plt | |
import networkx as nx | |
def plot_graph(nxgraph): | |
X, Y = np.mgrid[:5, :5] |
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
#include <iostream> | |
int main() | |
{ | |
double val1 = -10.0 + 0.4*14 + 0.4; | |
double val2 = -10.0 + 0.4*15; | |
std::cout << "val1 = " << val1 << "; val2 = " << val2 << std::endl; | |
std::cout << (val1 == val2 ? "Equal" : "Not equal") << std::endl; |
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 sys | |
import numpy as np | |
from scipy import ndimage | |
from scipy.misc import imread, imsave | |
def transform(X, Y, scale1, scale2): | |
shape = np.float_(X.max()), np.float_(Y.max()) | |
X = X - shape[0]/2 |