friendblend package

Submodules

friendblend.global_vars module

Stores all global values

friendblend.global_vars.initialize()[source]

Add all global variables here and give an initial value

friendblend.helpers module

Helper stuff, non core logic functions

friendblend.helpers.fmt_print(string, thresh_len=70)[source]

Formats stuff for printing ensures that len(output) is around thresh_len

friendblend.helpers.imshow(img)[source]

Displays an image press q to quit the window

friendblend.helpers.log_all_in_module(module, log_entry=True, log_exit=True)[source]

Adds the logging decorator to all methods in class

friendblend.helpers.log_all_methods(log_entry=True, log_exit=True)[source]

A decorator which logs all methods in a class

friendblend.helpers.log_call(f, log_entry=True, log_exit=True)[source]

Wrapper for logging every function call

friendblend.helpers.stringify_call_params(*args, **kwargs) → str[source]

Returns a string generated from call params

friendblend.main module

The FriendBlend pipeline

class friendblend.main.Blend(**kwargs)[source]

Bases: object

Blend two images with friends into one

blend()[source]

Performs the FriendBlend algorithm

color_correction(clip_limit=3.0, n_bins=256, grid=(7, 7))[source]

Color correction using CLAHE

get_alpha_blend(img_r, bb_l, bb_r)[source]

blends the images using alpha blending

get_face_body_bounds()[source]

Calculates face and body bounds

get_grabcut(img_r, fb_l)[source]
get_grabcut_order(img2, fb1, fb2, bb1, bb2)[source]

orders the images such that

get_homography(img2, bb1, bb2)[source]

Calculates and filters ORB descriptors

imload(img_path, mode: int = 1, ensure_success: bool = False) → numpy.ndarray[source]

Loads an image Dies if ensure_success is true and image read error occurs

order_images(img1, img2, fb1, fb2, bb1, bb2, boxed1, boxed2)[source]

Orders images and related variables such that the first image has face on the left

resize(w: int, h: int) → numpy.ndarray[source]

Resizes image to (w, h)

Module contents