You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""Projective transform by given coordinates, usually 4 coordinates. see `scikit-image <http://scikit-image.org/docs/dev/auto_examples/applications/plot_geometric.html>`_.
846
+
847
+
Parameters
848
+
-----------
849
+
x : numpy array
850
+
An image with dimension of [row, col, channel] (default).
851
+
src : list or numpy
852
+
The original coordinates, usually 4 coordinates of (x, y).
853
+
dst : list or numpy
854
+
The coordinates after transformation, the number of coordinates is the same with src.
855
+
map_args : dict, optional
856
+
Keyword arguments passed to inverse_map.
857
+
output_shape : tuple (rows, cols), optional
858
+
Shape of the output image generated. By default the shape of the input image is preserved. Note that, even for multi-band images, only rows and columns need to be specified.
859
+
order : int, optional
860
+
The order of interpolation. The order has to be in the range 0-5:
Points outside the boundaries of the input are filled according to the given mode. Modes match the behaviour of numpy.pad.
869
+
cval : float, optional
870
+
Used in conjunction with mode ‘constant’, the value outside the image boundaries.
871
+
clip : bool, optional
872
+
Whether to clip the output to the range of values of the input image. This is enabled by default, since higher order interpolation may produce values outside the given input range.
873
+
preserve_range : bool, optional
874
+
Whether to keep the original range of values. Otherwise, the input image is converted according to the conventions of img_as_float.
875
+
876
+
Examples
877
+
--------
878
+
>>> Assume X is an image from CIFAR 10, i.e. shape == (32, 32, 3)
879
+
>>> src = [[0,0],[0,32],[32,0],[32,32]]
880
+
>>> dst = [[10,10],[0,32],[32,0],[32,32]]
881
+
>>> x = projective_transform_by_points(X, src, dst)
0 commit comments