mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-10 00:35:19 +08:00
BUG: Fix homography.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import numpy as np
|
||||
from ._geometric import warp, SimilarityTransform, AffineTransform
|
||||
from ._geometric import (warp, SimilarityTransform, AffineTransform,
|
||||
ProjectiveTransform)
|
||||
|
||||
|
||||
def resize(image, output_shape, order=1, mode='constant', cval=0.):
|
||||
|
||||
@@ -5,7 +5,7 @@ from scipy.ndimage import map_coordinates
|
||||
from skimage.transform import (warp, warp_coords, rotate, resize,
|
||||
AffineTransform,
|
||||
ProjectiveTransform,
|
||||
SimilarityTransform)
|
||||
SimilarityTransform, homography)
|
||||
from skimage import transform as tf, data, img_as_float
|
||||
from skimage.color import rgb2gray
|
||||
|
||||
@@ -34,11 +34,15 @@ def test_homography():
|
||||
[0, 0, 1]])
|
||||
|
||||
x90 = warp(x,
|
||||
inverse_map=ProjectiveTransform(M).inverse,
|
||||
order=1)
|
||||
inverse_map=ProjectiveTransform(M).inverse,
|
||||
order=1)
|
||||
assert_array_almost_equal(x90, np.rot90(x))
|
||||
|
||||
|
||||
def test_homography_basic():
|
||||
homography(np.random.random((25, 25)), np.eye(3))
|
||||
|
||||
|
||||
def test_fast_homography():
|
||||
img = rgb2gray(data.lena()).astype(np.uint8)
|
||||
img = img[:, :100]
|
||||
|
||||
Reference in New Issue
Block a user