Commit ff4f753d authored by Andy Regensky's avatar Andy Regensky
Browse files

Bugfix for motion models in block comparison BETA

parent 7fbfac82
......@@ -87,25 +87,13 @@ class BlockInterpolationWorker(QRunnable):
xs, ys, zs = self.viewport.to_viewport(xs, ys, zs)
yp, xp, vip = self.perspective.from_sphere(xs, ys, zs)
# rf, phi = coordinate_conversion.cartesian_to_polar(yf, xf)
# rp = self.perspective.radius(self.projection.theta(rf))
# yp, xp = coordinate_conversion.polar_to_cartesian(rp, phi)
# Block control points
block_center = np.asarray(self.origin) + (np.asarray(self.blocksize) - 1) / 2
cp0_xs, cp0_ys, cp0_zs = self.projection.to_sphere(block_center[1], block_center[0])
if self.viewport is not None:
xs, ys, zs = self.viewport.to_viewport(np.array([xs]), np.array([ys]), np.array([zs]))
xs, ys, zs = xs[0], ys[0], zs[0]
cp0_y, cp0_x, cp0_vip = self.perspective.from_sphere(xs, ys, zs)
# r_f, phi = coordinate_conversion.cartesian_to_polar(block_center[1] - self.center[1],
# block_center[0] - self.center[0])
# r_p = self.projection.transform_to(self.perspective, r_f)
# cp0_y, cp0_x = coordinate_conversion.polar_to_cartesian(r_p, phi)
# cp0_y = cp0_y - self.blocksize[1] / 2
# cp0_x = cp0_x - self.blocksize[0] / 2
cp0_xs, cp0_ys, cp0_zs = self.viewport.to_viewport(np.array([cp0_xs]), np.array([cp0_ys]), np.array([cp0_zs]))
cp0_xs, cp0_ys, cp0_zs = cp0_xs[0], cp0_ys[0], cp0_zs[0]
cp0_y, cp0_x, cp0_vip = self.perspective.from_sphere(cp0_xs, cp0_ys, cp0_zs)
# Motion
ypm, xpm = self.motion_model.perform_motion(yp, xp, (cp0_x, cp0_y), self.control_point_motion_vectors)
......@@ -115,12 +103,6 @@ class BlockInterpolationWorker(QRunnable):
if self.viewport is not None:
xsm, ysm, zsm = self.viewport.from_viewport(xsm, ysm, zsm)
yfm, xfm = self.projection.from_sphere(xsm, ysm, zsm)[:2]
# rpm, phi = coordinate_conversion.cartesian_to_polar(ypm, xpm)
# rfm = self.projection.radius(self.perspective.theta(rpm))
# yfm, xfm = coordinate_conversion.polar_to_cartesian(rfm, phi)
# yfm = yfm + self.center[1]
# xfm = xfm + self.center[0]
return yfm, xfm
def interpolateBlock(self, y, x):
......
......@@ -75,12 +75,6 @@ class InterpolationWorker(QRunnable):
xs, ys, zs = self.viewport.from_viewport(xsr, ysr, zsr)
yf, xf = self.projection.from_sphere(xs, ys, zs)
# rp, phi = coordinate_conversion.cartesian_to_polar(yp, xp)
# rf = self.projection.radius(self.perspective.theta(rp))
# yf, xf = coordinate_conversion.polar_to_cartesian(rf, phi)
# yf = yf + self.center[1]
# xf = xf + self.center[0]
# Nearest neighbor
ynn = np.round(yf).astype(np.int)
xnn = np.round(xf).astype(np.int)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment