Visualizers
This section covers all the visualizer classes provided by ImgVisFeat.
Base Visualizer
imvf.Visualizer
Module for image visualization in the ImgVisFeat package.
This module contains the Visualizer class, which provides functionality for loading, processing, and displaying or saving visualized images. It supports various visualization parameters and options to enhance image representation for analysis and presentation purposes.
Classes:
| Name | Description |
|---|---|
Visualizer |
Main class for image visualization operations. |
Visualizer
A class for visualizing images.
This class provides functionality to visualize images, with options to display them on screen or save them to a specified directory.
Attributes:
| Name | Type | Description |
|---|---|---|
params |
dict
|
Additional parameters for visualization. |
Example
vis = Visualizer() vis.visualize('path/to/image.jpg', dst_root='output_folder')
Source code in src/imvf/Visualizer.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |
__init__
__init__(**params: dict) -> None
Initialize the Visualizer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**params
|
dict
|
Additional parameters for visualization. These can include color maps, scaling factors, etc. |
{}
|
Source code in src/imvf/Visualizer.py
visualize
visualize(src_image_path: str) -> None
Visualize the image.
This method loads an image from the given path, applies any visualization parameters, and either displays the image or saves it to the specified destination.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
src_image_path
|
str
|
Path to the source image file. |
required |
Example
visualizer = Visualizer() visualizer.visualize('input.jpg', dst_root='output')
Source code in src/imvf/Visualizer.py
check_image_assertions
check_image_assertions(src_image_path: str) -> None
Check if the image path is valid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
src_image_path
|
str
|
Path to the image. |
required |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If the image is not found. |
IsADirectoryError
|
If the image path is not a file. |
ValueError
|
If the image path is not a image. |
Source code in src/imvf/Visualizer.py
options: show_root_heading: true show_source: true
Color Channel Visualizer
imvf.ColorChannelVisualizer
ColorChannelVisualizer
Bases: AbstractVisualizer
A class for splitting the color channels of an image.
Source code in src/imvf/ColorChannelVisualizer.py
__init__
__call__
__call__(source: NDArray[uint8]) -> ColorChannelResult
Split the color channels of an image.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
NDArray[uint8]
|
The source image. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ColorChannelResult |
ColorChannelResult
|
The blue, green, and red color channels. |
Source code in src/imvf/ColorChannelVisualizer.py
options: show_root_heading: true show_source: true
Gradient Visualizers
Color Gradient Visualizer
imvf.ColorGradientVisualizer
Bases: AbstractVisualizer
A class for computing the gradient of a color image.
Source code in src/imvf/GradientVisualizer.py
__init__
__call__
__call__(source: NDArray[uint8]) -> GradientResult
Compute the gradient of a color image.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
NDArray[uint8]
|
The source image. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
GradientResult |
GradientResult
|
The gradient in the x, y, and xy directions. |
Source code in src/imvf/GradientVisualizer.py
options: show_root_heading: true show_source: true
Gray Gradient Visualizer
imvf.GrayGradientVisualizer
Bases: AbstractVisualizer
A class for computing the gradient of a grayscale image.
Source code in src/imvf/GradientVisualizer.py
__init__
__call__
__call__(source: NDArray[uint8]) -> GradientResult
Compute the gradient of a grayscale image.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
NDArray[uint8]
|
The source image. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
GradientResult |
GradientResult
|
The gradient in the x, y, and xy directions. |
Source code in src/imvf/GradientVisualizer.py
options: show_root_heading: true show_source: true
HoG Visualizer
imvf.HoGVisualizer
HoGVisualizer
Bases: AbstractVisualizer
A class for visualizing the HoG features of an image.
Source code in src/imvf/HoGVisualizer.py
__init__
__call__
Compute the HoG features of an image.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
NDArray[uint8]
|
The source image. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
HogResult |
HogResult
|
The HoG features of the image. |
Source code in src/imvf/HoGVisualizer.py
options: show_root_heading: true show_source: true
Keypoint Visualizer
imvf.KeypointVisualizer
KeypointVisualizer
Bases: AbstractVisualizer
A class for visualizing keypoints in an image.
Source code in src/imvf/KeypointVisualizer.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | |
__init__
__init__(algorithm_name: str) -> None
Initialize the KeypointVisualizer class.
Source code in src/imvf/KeypointVisualizer.py
__call__
__call__(source: NDArray[uint8]) -> KeypointResult
Visualize keypoints in an image.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
NDArray[uint8]
|
The source image. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
KeyPointResult |
KeypointResult
|
The image with keypoints and the image with rich keypoints. |
Source code in src/imvf/KeypointVisualizer.py
make_akaze_image
Create an image with keypoints using the AKAZE algorithm.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
color
|
NDArray[uint8]
|
The source image. |
required |
Returns:
| Type | Description |
|---|---|
tuple[NDArray[uint8], NDArray[uint8]]
|
tuple[NDArray[np.uint8], NDArray[np.uint8]]: The image with keypoints and the image with rich keypoints. |
Source code in src/imvf/KeypointVisualizer.py
make_sift_image
Create an image with keypoints using the SIFT algorithm.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
color
|
NDArray[uint8]
|
The source image. |
required |
Returns:
| Type | Description |
|---|---|
tuple[NDArray[uint8], NDArray[uint8]]
|
tuple[NDArray[np.uint8], NDArray[np.uint8]]: The image with keypoints and the image with rich keypoints. |
Source code in src/imvf/KeypointVisualizer.py
make_orb_image
Create an image with keypoints using the ORB algorithm.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
color
|
NDArray[uint8]
|
The source image. |
required |
Returns:
| Type | Description |
|---|---|
tuple[NDArray[uint8], NDArray[uint8]]
|
tuple[NDArray[np.uint8], NDArray[np.uint8]]: The image with keypoints and the image with rich keypoints. |
Source code in src/imvf/KeypointVisualizer.py
options: show_root_heading: true show_source: true
LBP Visualizer
imvf.LBPVisualizer
LBPVisualizer
Bases: AbstractVisualizer
A class for computing the Local Binary Pattern (LBP) of an image.
Source code in src/imvf/LBPVisualizer.py
__init__
__call__
Compute the Local Binary Pattern (LBP) of an image.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
NDArray[uint8]
|
The source image. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
LBPResult |
LBPResult
|
The LBP image. |
Source code in src/imvf/LBPVisualizer.py
options: show_root_heading: true show_source: true
Power Spectrum Visualizer
imvf.PowerSpectrumVisualizer
PowerSpectrumVisualizer
Bases: AbstractVisualizer
A class for computing the power spectrum of an image.
Source code in src/imvf/PowerSpectrumVisualizer.py
__init__
__call__
__call__(source: NDArray[uint8]) -> PowerSpectrumResult
Compute the power spectrum of an image.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
NDArray[uint8]
|
The source image. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
PowerSpectrumResult |
PowerSpectrumResult
|
The power spectrum of the image. |
Source code in src/imvf/PowerSpectrumVisualizer.py
options: show_root_heading: true show_source: true