swtloc.utils

Description

Functions

auto_canny(img[, sigma])

Autocanny Function.

deprecated_wrapper(reason, in_favour_of, ...)

A decorator to mark the deprecated functions and give the reason of deprecation. Alongside the reason, also inform in which version will the function be removed. If the function is being relocated then also inform in favour of which function will this function will be relocated :param reason: Reason for relocation/deprecation :type reason: str :param in_favour_of: If relocated, in favour of which function is this function being relocated :type in_favour_of: str :param removed_in: In which version will the function be removed :type removed_in: str :param relocated: Is the deprecation for being relocated :type relocated: Optional[bool].

generate_random_swtimage_names(n)

Generates random image names made of random numbers :param n: Number of names to generate :type n: int

get_connected_components_with_stats(img)

Function to find the connected components alongside their stats using oepncv's connectedComponentWithStats function for any given image.

image_1C_to_3C(image_1C[, all_colors, ...])

Prepare the RGB channel image from a single channel image (gray-scale).

perform_type_sanity_checks(cfg, cfg_of)

Perform type sanity checks for the values provided in cfg for a particular cfg_of configuration type.

print_in_red(text)

Print a red color text.

show_N_images(images, individual_titles[, ...])

Display n (<=4) images in a grid.

unique_value_counts(image[, remove_0])

Calculate unique integers in an image and their counts

Exceptions

SWTImageProcessError

Raised when functions don't follow a proper flow for SWTImage

SWTLocExceptions

Base class for SWTLoc Exceptions

SWTLocalizerValueError

Raised when wrong input is provided to the SWTLocalizer class

SWTTypeError

Raised when non-acceptable type is received in the parameters

SWTValueError

Raised when non-acceptable value is received in the parameters