-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
4,971 additions
and
2,920 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
####################################################### | ||
# Author: David Dowd | ||
# Email: [email protected] | ||
# Author: David Dowd | ||
# Email: [email protected] | ||
####################################################### | ||
|
||
import os | ||
import copy | ||
from PIL import Image, ImageDraw | ||
from scipy.spatial import Delaunay # pip install scipy | ||
from scipy.interpolate import RectBivariateSpline # pip install scipy | ||
from matplotlib.path import Path # pip install matplotlib | ||
import numpy as np # pip install numpy | ||
import itertools | ||
|
||
# Module level Variables | ||
####################################################### | ||
|
@@ -126,7 +124,6 @@ def interpolatePoints(self, leftTriangle, rightTriangle, alpha): | |
rightYParam = np.arange(np.amin(rightTriangle.vertices[:, 0]), np.amax(rightTriangle.vertices[:, 0]), 1) | ||
rightImageValues = self.rightImage[int(rightXParam[0]):int(rightXParam[-1] + 1), int(rightYParam[0]):int(rightYParam[-1] + 1)] | ||
|
||
# This is where performance skyrockets. Again, credit goes to zhifeichen097 for discovering the .ev() method! | ||
self.newLeftImage[xp, yp] = RectBivariateSpline(leftXParam, leftYParam, leftImageValues, kx=1, ky=1).ev(leftXValues, leftYValues) | ||
self.newRightImage[xp, yp] = RectBivariateSpline(rightXParam, rightYParam, rightImageValues, kx=1, ky=1).ev(rightXValues, rightYValues) | ||
except: | ||
|
Oops, something went wrong.