menpo/image/base.py
def constrain_landmarks_to_bounds(self):
        r"""
        Move landmarks that are located outside the image bounds on the bounds.
        """
        if self.has_landmarks_outside_bounds:
            for l_group in self.landmarks:
                l = self.landmarks[l_group]
                for k in range(l.lms.points.shape[1]):
                    tmp = l.lms.points[:, k]
                    tmp[tmp < 0] = 0
                    tmp[tmp > self.shape[k] - 1] = self.shape[k] - 1
                    l.lms.points[:, k] = tmp
                self.landmarks[l_group] = l
r"""
        Move landmarks that are located outside the image bounds on the bounds.
        
r"""
Move landmarks that are located outside the image bounds on the bounds.
r " " " Move landmarks that are located outside the image bounds on the bounds .
def constrain_landmarks_to_bounds(self):
        if self.has_landmarks_outside_bounds:
            for l_group in self.landmarks:
                l = self.landmarks[l_group]
                for k in range(l.lms.points.shape[1]):
                    tmp = l.lms.points[:, k]
                    tmp[tmp < 0] = 0
                    tmp[tmp > self.shape[k] - 1] = self.shape[k] - 1
                    l.lms.points[:, k] = tmp
                self.landmarks[l_group] = l
def constrain_landmarks_to_bounds ( self ) : if self . has_landmarks_outside_bounds : for l_group in self . landmarks : l = self . landmarks [ l_group ] for k in range ( l . lms . points . shape [ 1 ] ) : tmp = l . lms . points [ : , k ] tmp [ tmp < 0 ] = 0 tmp [ tmp > self . shape [ k ] - 1 ] = self . shape [ k ] - 1 l . lms . points [ : , k ] = tmp self . landmarks [ l_group ] = l
r"""
Move landmarks that are located outside the image bounds on the bounds.
r " " " Move landmarks that are located outside the image bounds on the bounds .
r"""
        Move landmarks that are located outside the image bounds on the bounds.
        """
self