Welcome to pyimg’s documentation!

Combine

blend_images

def blend_images(img1, img2, alpha=0.5):

“”” Blend two images with alpha as ratio

“”“

overlay_contour

def overlay_contour(img, np_arr, rgb=(255, 0, 0), cnt_width=1):

“”“Overlay contour on image.

“”“

overlay_bbox

def overlay_bbox(im, boxes, rgb, stroke=1):

“”“Overlay bounding boxes on image.

“”“

overlay_box_label

def overlay_box_label(img, boxes, labels):

“”” Overlay paired boxes and lables on image.

“”“

stackgray2rgb

def stackgray2rgb(gray):

“”“Stack three same gray image to rgb image.

“”“

Convert

PIL2npArr

def PIL2npArr(pil_img):

“”” Convert Pillow image to numpy array.

“”“

Bool2Uint8

def Bool2Uint8(bool_img):

“”” Convert bool image to dtype uint8.

“”“

Binary2Bool

def Binary2Bool(bin_img):

“”” Convert binary image to dtype bool.

“”“

Refine

crop_center

def crop_center(img, crop_h, crop_w):

“”” Crop center part of image.

“”“

pad_image

def pad_image(img, ttl_h, ttl_w):

“”” Pad image to be with fixed-size.

“”“

remove_weak_connection

def remove_weak_connection(bin_img):

“”” Remove weak connection in binary image.

“”“

About pyimg