machinevision-toolbox-python 2.2.0__py3-none-any.whl → 2.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {machinevision_toolbox_python-2.2.0.dist-info → machinevision_toolbox_python-2.4.0.dist-info}/METADATA +18 -14
- {machinevision_toolbox_python-2.2.0.dist-info → machinevision_toolbox_python-2.4.0.dist-info}/RECORD +21 -21
- {machinevision_toolbox_python-2.2.0.dist-info → machinevision_toolbox_python-2.4.0.dist-info}/WHEEL +1 -1
- machinevisiontoolbox/BagOfWords.py +13 -1
- machinevisiontoolbox/BundleAdjust.py +11 -1
- machinevisiontoolbox/Camera.py +101 -18
- machinevisiontoolbox/ImageConstants.py +27 -6
- machinevisiontoolbox/ImageCore.py +69 -8
- machinevisiontoolbox/ImageIO.py +8 -0
- machinevisiontoolbox/ImagePointFeatures.py +13 -2
- machinevisiontoolbox/ImageWholeFeatures.py +18 -5
- machinevisiontoolbox/Kernel.py +29 -0
- machinevisiontoolbox/PointCloud.py +17 -4
- machinevisiontoolbox/Sources.py +4 -5
- machinevisiontoolbox/base/__init__.py +1 -0
- machinevisiontoolbox/base/color.py +42 -16
- machinevisiontoolbox/base/imageio.py +541 -443
- machinevisiontoolbox/base/types.py +14 -0
- machinevisiontoolbox/bin/mvtbtool.py +2 -1
- {machinevision_toolbox_python-2.2.0.dist-info → machinevision_toolbox_python-2.4.0.dist-info}/entry_points.txt +0 -0
- {machinevision_toolbox_python-2.2.0.dist-info → machinevision_toolbox_python-2.4.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -8,6 +8,20 @@ import numpy as np
|
|
|
8
8
|
|
|
9
9
|
from machinevisiontoolbox.mvtb_types import Dtype
|
|
10
10
|
|
|
11
|
+
#: Short-name aliases for dtype strings accepted throughout the Toolbox
|
|
12
|
+
#: (e.g. Image(..., dtype='float'), VideoFile(..., dtype='float')).
|
|
13
|
+
#: NumPy's own np.dtype('float') resolves to float64, not float32 -- these
|
|
14
|
+
#: aliases exist specifically so 'float'/'int' mean the Toolbox's own
|
|
15
|
+
#: default single-precision/8-bit types, not NumPy's C-double/C-long
|
|
16
|
+
#: defaults. Single source of truth: resolve any dtype string through this
|
|
17
|
+
#: table (dtype_alias.get(dtype, dtype)) before passing it to np.dtype().
|
|
18
|
+
DTYPE_ALIASES: dict[str, str] = {
|
|
19
|
+
"int": "uint8",
|
|
20
|
+
"float": "float32",
|
|
21
|
+
"double": "float64",
|
|
22
|
+
"half": "float16",
|
|
23
|
+
}
|
|
24
|
+
|
|
11
25
|
|
|
12
26
|
def int_image(
|
|
13
27
|
image: np.ndarray, intclass: Dtype = "uint8", maxintval: int | None = None
|
|
@@ -391,7 +391,8 @@ def main():
|
|
|
391
391
|
code = [
|
|
392
392
|
f"%matplotlib{' '+args.backend if args.backend is not None else ''}",
|
|
393
393
|
"import matplotlib.pyplot as plt",
|
|
394
|
-
"
|
|
394
|
+
"_prec = get_ipython().run_line_magic('precision', '%.3g'); "
|
|
395
|
+
"print(f'Default numeric formatting: {_prec}')",
|
|
395
396
|
]
|
|
396
397
|
if args.base:
|
|
397
398
|
code.append("from machinevisiontoolbox.base import *")
|
|
File without changes
|
|
File without changes
|