(self, x, y)
return self.distance_mask[py, px]
Get the distance of a point to the nearest foreground in perception GT semantic prior mask (dilated).
        :param x: <float>. Global x.
        :param y: <float>. Global y.
        :return: <float>. Distance to nearest foreground, if not in distance mask, return -1.
Get the distance of a point to the nearest foreground in perception GT semantic prior mask (dilated).
        :param x: <float>. Global x.
        :param y: <float>. Global y.
        :return: <float>. Distance to nearest foreground, if not in distance mask, return -1.
Get the distance of a point to the nearest foreground in perception GT semantic prior mask ( dilated ) . : param x : <float > . Global x . : param y : <float > . Global y . : return : <float > . Distance to nearest foreground if not in distance mask return - 1 .
def dist_to_mask(self, x, y):
        """
        Get the distance of a point to the nearest foreground in perception GT semantic prior mask (dilated).
        :param x: <float>. Global x.
        :param y: <float>. Global y.
        :return: <float>. Distance to nearest foreground, if not in distance mask, return -1.
        """
        px, py = self.get_pixel(x, y)

        if px < 0 or px >= self.distance_mask.shape[1] or py < 0 or py >= self.distance_mask.shape[0]:
            return -1

        return self.distance_mask[py, px]
def dist_to_mask ( self , x , y ) : px , py = self . get_pixel ( x , y ) if px < 0 or px >= self . distance_mask . shape [ 1 ] or py < 0 or py >= self . distance_mask . shape [ 0 ] : return - 1 return self . distance_mask [ py , px ]