IVALab Python Libraries
Collection of code for computer vision and robotics with specific API.
Functions | Variables
Surveillance.utils.imgs Namespace Reference

Functions

def draw_contour (bm, img=None, color=(0, 255, 0), thick=3)
 
def draw_dots (img, coords, color=[0, 255, 0], radius=20)
 

Variables

 bm = np.zeros((100, 100), dtype=bool)
 
def contour_map = draw_contour(bm, thick=3)
 
def contour_map_2 = draw_contour(bm, img, thick=3)
 
 dot_coords
 
 img = np.round(np.random.rand(bm.shape[0], bm.shape[1], 3) * 255).astype(np.uint8)
 
def img_dots = draw_dots(img, dot_coords, radius=5)
 

Detailed Description

@brief          The image/plotting-related utility functions

@author:        Yiye Chen,          yychen2019@gatech.edu
@date:          04/20/2022

Function Documentation

◆ draw_contour()

def Surveillance.utils.imgs.draw_contour (   bm,
  img = None,
  color = (0, 255, 0),
  thick = 3 
)
Draw all the countours of a binary image

Args:
    bm (array, (H, W)):         The binary map
    img (array, (H, W, 3)):     The RGB image to plot the contour.
                                If None, then will plot on the binary mask
    color ((3, )):              The RGB color of the contour
    thick (int):                The thickness of the contour in pixel
Returns:
    im (array, (H, W, 3)):      An RGB image containing the contour

◆ draw_dots()

def Surveillance.utils.imgs.draw_dots (   img,
  coords,
  color = [0, 255, 0],
  radius = 20 
)
Draw a set of dots on the image 

Args:
    img (array): The image to draw the coordinates. Currently only accept rgb input
    coords (N, 2): The coordinates of the dots in the OpenCV style
    color (3,): The rgb color of the dots
    radius (int): The radius of the dots
Returns:
    img_plot (array): The image with the dots plotted

Variable Documentation

◆ bm

bm = np.zeros((100, 100), dtype=bool)

◆ contour_map

def contour_map = draw_contour(bm, thick=3)

◆ contour_map_2

def contour_map_2 = draw_contour(bm, img, thick=3)

◆ dot_coords

dot_coords
Initial value:
1 = np.array(
2  [
3  [10, 10],
4  [10, 20],
5  [20, 20]
6  ]
7  )

◆ img

img = np.round(np.random.rand(bm.shape[0], bm.shape[1], 3) * 255).astype(np.uint8)

◆ img_dots

def img_dots = draw_dots(img, dot_coords, radius=5)