def compute_pointwise_distances(self, other, default=None):
import shapely.geometry<EOL>from .kps import Keypoint<EOL>if isinstance(other, Keypoint):<EOL><INDENT>other = shapely.geometry.Point((other.x, other.y))<EOL><DEDENT>elif isinstance(other, LineString):<EOL><INDENT>if len(other.coords) == <NUM_LIT:0>:<EOL><INDENT>return default<EOL><DEDENT>elif len(other.coords) == <NUM_LIT:1>:<EOL><INDENT>other = shapely.geometry.Point(other.coords[<NUM_LIT:0>, :])<EOL><DEDENT>else:<EOL><INDENT>other = shapely.geometry.LineString(other.coords)<EOL><DEDENT><DEDENT>elif isinstance(other, tuple):<EOL><INDENT>assert len(other) == <NUM_LIT:2><EOL>other = shapely.geometry.Point(other)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError(<EOL>("<STR_LIT>"<EOL>+ "<STR_LIT>") % (type(other),))<EOL><DEDENT>return [shapely.geometry.Point(point).distance(other)<EOL>for point in self.coords]<EOL>
Compute the minimal distance between each point on self and other.

Parameters
----------
other : tuple of number \
        or imgaug.augmentables.kps.Keypoint \
        or imgaug.augmentables.LineString
    Other object to which to compute the distances.

default
    Value to return if `other` contains no points.

Returns
-------
list of float
    Distances to `other` or `default` if not distance could be computed.