mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-13 17:45:20 +08:00
Merge pull request #292 from ahojnnes/geometric-coeffs
Hide coefficient variable of geometric transforms
This commit is contained in:
@@ -80,7 +80,7 @@ class ProjectiveTransform(GeometricTransform):
|
||||
|
||||
"""
|
||||
|
||||
coeffs = range(8)
|
||||
_coeffs = range(8)
|
||||
|
||||
def __init__(self, matrix=None):
|
||||
if matrix is None:
|
||||
@@ -187,14 +187,14 @@ class ProjectiveTransform(GeometricTransform):
|
||||
A[rows:, 8] = yd
|
||||
|
||||
# Select relevant columns, depending on params
|
||||
A = A[:, self.coeffs + [8]]
|
||||
A = A[:, self._coeffs + [8]]
|
||||
|
||||
_, _, V = np.linalg.svd(A)
|
||||
|
||||
H = np.zeros((3, 3))
|
||||
# solution is right singular vector that corresponds to smallest
|
||||
# singular value
|
||||
H.flat[self.coeffs + [8]] = - V[-1, :-1] / V[-1, -1]
|
||||
H.flat[self._coeffs + [8]] = - V[-1, :-1] / V[-1, -1]
|
||||
H[2, 2] = 1
|
||||
|
||||
self._matrix = H
|
||||
@@ -248,7 +248,7 @@ class AffineTransform(ProjectiveTransform):
|
||||
|
||||
"""
|
||||
|
||||
coeffs = range(6)
|
||||
_coeffs = range(6)
|
||||
|
||||
def __init__(self, matrix=None, scale=None, rotation=None, shear=None,
|
||||
translation=None):
|
||||
|
||||
Reference in New Issue
Block a user