viqa.utils.visualize_2d¶
- viqa.utils.visualize_2d(img, export_path=None, **kwargs)[source]¶
Visualize a 2D image.
The function visualizes a 2D image. If export_path is provided, the visualization is saved to the specified path.
- Parameters:
img (np.ndarray) – The 2D image to visualize.
export_path (str or Path, optional) – The path to save the visualization.
kwargs – Additional keyword arguments for the plot. Passed to
matplotlib.pyplot.imshow
.
- Raises:
ValueError – If the image is not 2D.
- Return type:
None