vsi package
Subpackages
- vsi.console package
- vsi.format package
- vsi.io package
- vsi.tools package
- Subpackages
- Submodules
- vsi.tools.commonpath module
- vsi.tools.diff module
- vsi.tools.dir_util module
- vsi.tools.docker_token module
- vsi.tools.file_util module
- vsi.tools.iter module
- vsi.tools.logging_helper module
- vsi.tools.mpl module
- vsi.tools.mpl_zoom module
- vsi.tools.natural_sort module
- vsi.tools.patch_wheel module
- vsi.tools.python module
ARGS
ArgvContext
KWARGS
OptionalArgumentDecorator
Try
_BasicArgumentDecorator
_BasicDecorator
_meta_generate_class()
args_to_kwargs()
args_to_kwargs_easy()
args_to_kwargs_unbound()
args_to_kwargs_unbound_easy()
command_list_to_string()
get_file()
is_class_method()
is_static_method()
is_string_like()
nested_in_dict()
nested_patch()
nested_patch_inplace()
nested_update()
reloadModules()
static()
unwrap_wraps()
update_wrapper_class()
- vsi.tools.redirect module
- vsi.tools.stdout_profile module
- vsi.tools.subprocess_util module
- vsi.tools.time_utils module
- vsi.tools.vdb module
- vsi.tools.vdb_ipdb module
- vsi.tools.vdb_rpdb module
- vsi.tools.vdb_rpdb2 module
- vsi.tools.watch_dog module
- Module contents
- vsi.vendored package
- vsi.vxl package
- vsi.windows package
Submodules
vsi.iglob module
Filename globbing utility with optional case sensitive override.
- vsi.iglob.glob(pathname, case=None)[source]
Return a list of paths matching a pathname pattern.
- Parameters:
pathname (str) – The Path Name
- Returns:
A list of paths matching a pathname pattern
- Return type:
The pattern may contain simple shell-style wildcards a la fnmatch. However, unlike fnmatch, filenames starting with a dot are special cases that are not matched by ‘*’ and ‘?’ patterns.
Set case to true to force case sensitive, false to force case insensitive or None(default) to run glob natively
- vsi.iglob.iglob(pathname, case=None)[source]
Return an iterator which yields the paths matching a pathname pattern.
- Parameters:
pathname (str) – The Path Name
The pattern may contain simple shell-style wildcards a la fnmatch. However, unlike fnmatch, filenames starting with a dot are special cases that are not matched by ‘*’ and ‘?’ patterns.
Set case to true to force case sensitive, false to force case insensitive or None(default) to run glob natively
vsi.image module
- vsi.image.find_template_offset(template: numpy.floating, image: numpy.floating, debug_dir: str | None = None) Tuple[int, int, float] [source]
Uses 2-D normalized cross correlation to find the offset of the upper right corners of the template and image
- Parameters:
template (
numpy.ndarray
) – N-D array of template or filter you are using for cross-correlation. Must be less or equal dimensions to image. Length of each dimension must be less than length of image. Array should be floating point numbers.image (
numpy.ndarray
) – Image array should be floating point numbers.debug_dir (
str
) – Optional directory to write debugging visualization images to.
- Returns:
- vsi.image.find_template_offset_centered(template_image: numpy.floating, image: numpy.floating, template_center: Tuple[int, int], image_center: Tuple[int, int], template_radius: int | Tuple[int, int] = 50, image_radius: int | Tuple[int, int] = 200, adjust_template: Callable[[numpy.ndarray, int, int, int, int], Tuple[int, int, int, int]] | None = None, debug_dir: str | None = None)[source]
Uses 2-D normalized cross correlation to find the offset of a point of interest between in two images. This is a convenient form of the
find_template_offset()
function, that will handle boundary conditions and do the math to tell you the offset of specific point of interest at the centers- Parameters:
template_image (
numpy.ndarray
) – The image containing the template patchimage (
numpy.ndarray
) – Image array should be floating point numbers.template_center (
tuple
) – The location of the POI in the template image, (y,x) coordinateimage_center (
tuple
) – The location of the POI in the image, (y,x) coordinatetemplate_radius (
int
ortuple
, optional) – The radius around the template used for the cross correlation. Can be a single number (in which case the same number is used in both the x and y direction), or a tuple of two numbers (y radius, x radius). E.g.:50
will create a patch 101 by 101, unless it is too close to the edge in which case it will be smaller. Default is50
, and must be smaller than image_radius.image_radius (
int
ortuple
, optional) – The radius around the image. Default:200
adjust_template (
Callable
) – Function to call to warp the template image before correlation.debug_dir (
str
) – Optional directory to write debugging visualization images to.
- Returns:
- vsi.image.normalized_cross_correlation_2d(template: numpy.floating.~T, image: numpy.floating.~T, mode: str = 'full')[source]
Computes the 2-D normalized cross correlation (Aka:
normxcorr2
) between the template and image.- Parameters:
template (
numpy.ndarray
) – N-D array of template or filter you are using for cross-correlation. Length of each dimension must be less than equal to the corresponding dimension of the image. Array should be floating point numbers.image (
numpy.ndarray
) – Image array should be floating point numbers.mode (
str
, optional) –full (Default): The output of fftconvolve is the full discrete linear convolution of the inputs. Output size will be image size + 1/2 template size in each dimension.
valid: The output consists only of those elements that do not rely on the zero-padding.
same: The output is the same size as image, centered with respect to the “full” output.
- Returns:
N-D array of same dimensions as image. Size depends on mode parameter.
- Return type:
- vsi.image.visualize_cross_correlation(debug_dir: str, template: numpy.floating, image: numpy.floating, xc: numpy.floating, peak: Tuple[int, int], peak_magnitude: float, offset: Tuple[int, int]) None [source]
Save out visualization images to the provided debugging directory.
- Parameters:
debug_dir (
str
) – Debugging directory to write visualization images to.template (
numpy.ndarray
) – N-D array of template or filter used for cross-correlation. Array should be floating point numbers between 0 and 1.image (
numpy.ndarray
) – Image array should be floating point numbers between 0 and 1.xc (
numpy.ndarray
) – The 2-D normalized cross correlation of the template and image.peak (
tuple
) – The (y, x) pixel coordinate of the peak of the correlation surface.peak_magnitude (
float
) – The scalar magnitude of the correlation peak.offset (
tuple
) – The (y, x) offset to translate the image by to match the image.
- Return type:
None