machinevision-toolbox-python 1.0.1__tar.gz → 1.0.3__tar.gz

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.
Files changed (135) hide show
  1. machinevision_toolbox_python-1.0.3/.gitignore +74 -0
  2. machinevision_toolbox_python-1.0.3/CHANGELOG.md +103 -0
  3. machinevision_toolbox_python-1.0.3/Makefile +43 -0
  4. machinevision_toolbox_python-1.0.3/NOTES +19 -0
  5. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3}/PKG-INFO +30 -30
  6. machinevision_toolbox_python-1.0.3/bun.png +0 -0
  7. machinevision_toolbox_python-1.0.3/camtest.py +76 -0
  8. machinevision_toolbox_python-1.0.3/dependencies.pdf +0 -0
  9. machinevision_toolbox_python-1.0.3/examples/README.md +26 -0
  10. machinevision_toolbox_python-1.0.3/examples/blobs1.py +15 -0
  11. machinevision_toolbox_python-1.0.3/examples/blobs2.py +21 -0
  12. machinevision_toolbox_python-1.0.3/examples/bunny.py +9 -0
  13. machinevision_toolbox_python-1.0.3/examples/color.py +27 -0
  14. machinevision_toolbox_python-1.0.3/examples/corners.py +35 -0
  15. machinevision_toolbox_python-1.0.3/examples/matching.py +14 -0
  16. machinevision_toolbox_python-1.0.3/examples/monalisa.py +7 -0
  17. machinevision_toolbox_python-1.0.3/examples/morphdemo.py +38 -0
  18. machinevision_toolbox_python-1.0.3/examples/mwe.py +15 -0
  19. machinevision_toolbox_python-1.0.3/examples/randomdots.py +10 -0
  20. machinevision_toolbox_python-1.0.3/examples/ransac_line.py +94 -0
  21. machinevision_toolbox_python-1.0.3/examples/readme.py +79 -0
  22. machinevision_toolbox_python-1.0.3/examples/showzip.py +9 -0
  23. machinevision_toolbox_python-1.0.3/findimages.py +16 -0
  24. machinevision_toolbox_python-1.0.3/ilabel.c +15230 -0
  25. machinevision_toolbox_python-1.0.3/ilabel.py-unopt +271 -0
  26. machinevision_toolbox_python-1.0.3/notebooks/IBVS.ipynb +472 -0
  27. machinevision_toolbox_python-1.0.3/notebooks/ImageMotion.ipynb +694 -0
  28. machinevision_toolbox_python-1.0.3/notebooks/Untitled.ipynb +497 -0
  29. machinevision_toolbox_python-1.0.3/notebooks/Untitled1.ipynb +4182 -0
  30. machinevision_toolbox_python-1.0.3/notebooks/blob.ipynb +378 -0
  31. machinevision_toolbox_python-1.0.3/notebooks/calibration-fixture.png +0 -0
  32. machinevision_toolbox_python-1.0.3/notebooks/calibration.ipynb +2862 -0
  33. machinevision_toolbox_python-1.0.3/notebooks/camera.ipynb +1494 -0
  34. machinevision_toolbox_python-1.0.3/notebooks/chap10.ipynb +969 -0
  35. machinevision_toolbox_python-1.0.3/notebooks/color-images.ipynb +2191 -0
  36. machinevision_toolbox_python-1.0.3/notebooks/cones.ipynb +1188 -0
  37. machinevision_toolbox_python-1.0.3/notebooks/fiducuals.ipynb +2344 -0
  38. machinevision_toolbox_python-1.0.3/notebooks/finding-blobs.ipynb +4307 -0
  39. machinevision_toolbox_python-1.0.3/notebooks/gamma.ipynb +2054 -0
  40. machinevision_toolbox_python-1.0.3/notebooks/greyscale-images.ipynb +8116 -0
  41. machinevision_toolbox_python-1.0.3/notebooks/homogeneous-coords.ipynb +696 -0
  42. machinevision_toolbox_python-1.0.3/notebooks/homography.ipynb +385 -0
  43. machinevision_toolbox_python-1.0.3/notebooks/image-features.ipynb +836 -0
  44. machinevision_toolbox_python-1.0.3/notebooks/image.ipynb +723 -0
  45. machinevision_toolbox_python-1.0.3/notebooks/imageprocessing.ipynb +591 -0
  46. machinevision_toolbox_python-1.0.3/notebooks/images/apriltags.png +0 -0
  47. machinevision_toolbox_python-1.0.3/notebooks/images/aruco.png +0 -0
  48. machinevision_toolbox_python-1.0.3/notebooks/images/butterfly.jpg +0 -0
  49. machinevision_toolbox_python-1.0.3/notebooks/images/calib-image.png +0 -0
  50. machinevision_toolbox_python-1.0.3/notebooks/images/calibration-fixture.png +0 -0
  51. machinevision_toolbox_python-1.0.3/notebooks/images/coordinate-frames.png +0 -0
  52. machinevision_toolbox_python-1.0.3/notebooks/images/output_9.png +0 -0
  53. machinevision_toolbox_python-1.0.3/notebooks/point-features.ipynb +11637 -0
  54. machinevision_toolbox_python-1.0.3/notebooks/sift.ipynb +213 -0
  55. machinevision_toolbox_python-1.0.3/notebooks/unknown_camera.py +40 -0
  56. machinevision_toolbox_python-1.0.3/phone.py +17 -0
  57. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3}/pyproject.toml +22 -16
  58. machinevision_toolbox_python-1.0.3/setup.cfg +2 -0
  59. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/ImageBlobs.py +177 -87
  60. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/ImageCore.py +181 -35
  61. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/ImageFiducials.py +208 -51
  62. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/ImageIO.py +3 -5
  63. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/ImagePointFeatures.py +2 -2
  64. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/ImageReshape.py +51 -12
  65. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/PointCloud.py +2 -3
  66. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/Sources.py +0 -1
  67. machinevision_toolbox_python-1.0.3/src/machinevisiontoolbox/aruco0.pdf +0 -0
  68. machinevision_toolbox_python-1.0.3/src/machinevisiontoolbox/aruco50.pdf +0 -0
  69. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/base/color.py +25 -18
  70. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/base/graphics.py +324 -243
  71. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/base/imageio.py +99 -20
  72. machinevision_toolbox_python-1.0.3/src/machinevisiontoolbox/bin/ce.py +27 -0
  73. machinevision_toolbox_python-1.0.3/src/machinevisiontoolbox/bin/imtool.py +161 -0
  74. machinevision_toolbox_python-1.0.3/src/machinevisiontoolbox/bin/mvtbtool.py +192 -0
  75. machinevision_toolbox_python-1.0.3/src/machinevisiontoolbox/bin/tagtool.py +250 -0
  76. machinevision_toolbox_python-1.0.3/src/machinevisiontoolbox/blocks/Icons/camera.png +0 -0
  77. machinevision_toolbox_python-1.0.3/src/machinevisiontoolbox/blocks/Icons/estpose_p.png +0 -0
  78. machinevision_toolbox_python-1.0.3/src/machinevisiontoolbox/blocks/Icons/icons.sh +4 -0
  79. machinevision_toolbox_python-1.0.3/src/machinevisiontoolbox/blocks/Icons/imageplane.png +0 -0
  80. machinevision_toolbox_python-1.0.3/src/machinevisiontoolbox/blocks/Icons/visjac_p.png +0 -0
  81. machinevision_toolbox_python-1.0.3/src/machinevisiontoolbox/machinevision-toolbox-python.code-workspace +7 -0
  82. machinevision_toolbox_python-1.0.3/symbolic/README.md +8 -0
  83. machinevision_toolbox_python-1.0.3/symbolic/bundle-adjust.py +53 -0
  84. machinevision_toolbox_python-1.0.1/machinevision_toolbox_python.egg-info/PKG-INFO +0 -427
  85. machinevision_toolbox_python-1.0.1/machinevision_toolbox_python.egg-info/SOURCES.txt +0 -64
  86. machinevision_toolbox_python-1.0.1/machinevision_toolbox_python.egg-info/dependency_links.txt +0 -1
  87. machinevision_toolbox_python-1.0.1/machinevision_toolbox_python.egg-info/entry_points.txt +0 -3
  88. machinevision_toolbox_python-1.0.1/machinevision_toolbox_python.egg-info/requires.txt +0 -28
  89. machinevision_toolbox_python-1.0.1/machinevision_toolbox_python.egg-info/top_level.txt +0 -1
  90. machinevision_toolbox_python-1.0.1/setup.cfg +0 -7
  91. machinevision_toolbox_python-1.0.1/tests/test_base_color.py +0 -98
  92. machinevision_toolbox_python-1.0.1/tests/test_blobs.py +0 -108
  93. machinevision_toolbox_python-1.0.1/tests/test_camera.py +0 -188
  94. machinevision_toolbox_python-1.0.1/tests/test_color.py +0 -80
  95. machinevision_toolbox_python-1.0.1/tests/test_constants.py +0 -498
  96. machinevision_toolbox_python-1.0.1/tests/test_core.py +0 -753
  97. machinevision_toolbox_python-1.0.1/tests/test_image_io.py +0 -186
  98. machinevision_toolbox_python-1.0.1/tests/test_imageprocessing_kernel.py +0 -85
  99. machinevision_toolbox_python-1.0.1/tests/test_imageprocessing_morph.py +0 -257
  100. machinevision_toolbox_python-1.0.1/tests/test_pointcloud.py +0 -37
  101. machinevision_toolbox_python-1.0.1/tests/test_processing.py +0 -342
  102. machinevision_toolbox_python-1.0.1/tests/test_reshape.py +0 -741
  103. machinevision_toolbox_python-1.0.1/tests/test_wholefeature.py +0 -203
  104. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3}/LICENSE +0 -0
  105. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3}/README.md +0 -0
  106. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/BagOfWords.py +0 -0
  107. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/BundleAdjust.py +0 -0
  108. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/Camera.py +0 -0
  109. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/ImageColor.py +0 -0
  110. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/ImageConstants.py +0 -0
  111. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/ImageLineFeatures.py +0 -0
  112. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/ImageMorph.py +0 -0
  113. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/ImageMultiview.py +0 -0
  114. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/ImageProcessing.py +0 -0
  115. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/ImageRegionFeatures.py +0 -0
  116. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/ImageSpatial.py +0 -0
  117. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/ImageWholeFeatures.py +0 -0
  118. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/VisualServo.py +0 -0
  119. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/__init__.py +0 -0
  120. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/base/__init__.py +0 -0
  121. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/base/data.py +0 -0
  122. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/base/esttheta.py +0 -0
  123. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/base/findpeaks.py +0 -0
  124. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/base/meshgrid.py +0 -0
  125. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/base/shapes.py +0 -0
  126. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/base/types.py +0 -0
  127. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/base/version.py +0 -0
  128. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/blocks/__init__.py +0 -0
  129. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/blocks/camera.py +0 -0
  130. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/blocks/test_blocks.py +0 -0
  131. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/camera_derivatives.py +0 -0
  132. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/decorators.py +0 -0
  133. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/fiducial.py +0 -0
  134. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/mvtb_types.py +0 -0
  135. {machinevision_toolbox_python-1.0.1 → machinevision_toolbox_python-1.0.3/src}/machinevisiontoolbox/newcameras.py +0 -0
@@ -0,0 +1,74 @@
1
+
2
+ ### Python ###
3
+ # Byte-compiled / optimized / DLL files
4
+ __pycache__/
5
+ *.py[cod]
6
+ *$py.class
7
+
8
+ # C extensions
9
+ *.so
10
+
11
+ # Distribution / packaging
12
+ build/
13
+ develop-eggs/
14
+ dist/
15
+ downloads/
16
+ eggs/
17
+ .eggs/
18
+ wheels/
19
+ pip-wheel-metadata/
20
+ *.egg-info/
21
+ *.egg
22
+ MANIFEST
23
+
24
+ # Installer logs
25
+ pip-log.txt
26
+ pip-delete-this-directory.txt
27
+
28
+ # Unit test / coverage reports
29
+ htmlcov/
30
+ .tox/
31
+ .nox/
32
+ .coverage
33
+ .coverage.*
34
+ .cache
35
+ nosetests.xml
36
+ coverage.xml
37
+ *.cover
38
+ .hypothesis/
39
+ .pytest_cache/
40
+
41
+ # Sphinx documentation
42
+ docsrc/build/
43
+ docsrc/source/generated
44
+
45
+ # PyBuilder
46
+ target/
47
+
48
+ # pyenv
49
+ .python-version
50
+
51
+ # Pyre type checker
52
+ .pyre/
53
+
54
+ ### VisualStudioCode ###
55
+ .vscode/
56
+
57
+ ### VisualStudioCode Patch ###
58
+ # Ignore all local history of files
59
+ .history
60
+
61
+ ### PyCharm ###
62
+ .idea
63
+
64
+ .ipynb_checkpoints/
65
+
66
+ ### Figures generated by Python notebooks ###
67
+ *.eps
68
+
69
+ *.zip
70
+
71
+ docs/source/stubs/*
72
+ # latex products
73
+ .log
74
+ .aux
@@ -0,0 +1,103 @@
1
+
2
+ 1.0.2 January 2026
3
+
4
+ * `Image` class
5
+
6
+ - `warp_affine` can now warp an image into a given output image
7
+ - graphic primitives
8
+ - create an ArUco marker
9
+ - save as PDF
10
+
11
+ - all the draw_xxx() functions in base now have wrappers as methods of `Image`
12
+ - draw_xxx() now handle floating point arguments, rounding them to the neares int
13
+ - improvements in name2color to handle image datatypes and colororder
14
+
15
+ * FiducialCollection class, represent a generalized calibration board with AR tags
16
+
17
+ * ArUcoBoard class, represent a generalized ArUco calibration board
18
+
19
+ * changed to src folder layout, code is in src/machinevisiontoolbox
20
+ * changed from setuptools to hatch
21
+ * works if Open3D is not installed, it's always well behind in Python version support
22
+ * removed numpy < 2.0 constraint, OpenCV now suppports numpy 2.x
23
+ * working with Python 3.12 (except for Open3D)
24
+ * added command line tools:
25
+ * `imtool` for displaying images, exploring pixels, picking points, showing metadata etc. Works with your own images or those provided with MVTB
26
+ * `tagtool` for highlighting AR tags in images
27
+
28
+ 1.0.1 March 2025
29
+
30
+ * `Image` class
31
+ - `.dice` method, chops an image up into tiles, can be overlapping
32
+ - `.Tile(columns=0)` will arrange the tiles into a roughly square layout
33
+ - Constant images, previously many of these could only generate square images, this is now generalized
34
+ - `.Chequerboard` creates a chequerboard pattern
35
+ - set background color for image warp undefined pixels
36
+ - single plane images can have a colorplane name
37
+ - deprecate `colordict()`, use `colororder2dict()` instead
38
+ - `String` now supports two string formats, can create color images
39
+ - fixed bug with gamma="sRGB" which always returned a float image, type is now the same as passed
40
+
41
+ * Blobs
42
+
43
+ - new methods for blob aligned box, plot_aligned_box,
44
+ - `plot_perimeter` options
45
+ - `perimeter_hull` convex hull
46
+ - fixed bug with runt blobs
47
+
48
+ * Kernels
49
+
50
+ - added `Kernel.HGauss` for Hessian of Gaussian
51
+ - added `Kernel` repr method, `disp` method
52
+ ArUcoBoard class
53
+
54
+ * Camera models
55
+ - Fixed errors in some camera projection models
56
+
57
+ * Point clouds
58
+
59
+ - `PointCloud` now has a "constructor" for depth images, `PointCloud.DepthImage()`
60
+
61
+ * Miscellaneous
62
+
63
+ - Lots more code examples and plots
64
+ - Move decoratores scalar_result and array_result to machinevisiontoolbox.decorators.py
65
+ - improved unit testing
66
+
67
+
68
+
69
+ 1.0.0 January 2025
70
+
71
+ * `Kernel` methods now return `Kernel` instances rather than NumPy arrays. Methods that
72
+ accept a kernel can accept a `Kernel` instance or a NumPy array. Methods exist to
73
+ stringify or print a kernel.
74
+
75
+ * The indexing order of an `Image` object (using square bracket `__getitem__` access) has
76
+ changed and is now `img[u,v]` where `u` is the column coordinate and `v` is the row
77
+ coordinate. This is consistent with the column-first convention used across the
78
+ Toolbox and is consistent with the $(u,v)$ coordinate system for images. But, this
79
+ is the __opposite__ order to that used for NumPy index on the underlying array, and
80
+ to earlier versions of the Toolbox.
81
+
82
+ - a 2-tuple of integers, select this pixel. If the image has multiple planes, the
83
+ result is a vector over planes.
84
+ - a 3-tuple of integers, for a multiplane image select this pixel from the specified
85
+ plane.
86
+ - a 2-tuple of slice objects, select this region. If the image has multiple planes,
87
+ the result is a 3D array.
88
+ - a 3-tuple of slice objects, select this region of uv and planes
89
+ - an int, select this plane
90
+ - a string, select this named plane or planes
91
+
92
+ * added `pixel(u,v)` method for faster access to a single pixel value, scalar or vector.
93
+
94
+ * the children of a `Blob` is now given as a list of `Blob` objects, not their indices
95
+ within the overall list of blobs. This simplies traversing the blob hierarchy tree.
96
+ Similarly, the parent is a reference to the parent `Blob` object rather than an index,
97
+ and is `None` if the blob has no parent (its parent is the background).
98
+
99
+ * Documentation overhaul, both in-code docstrings, and the organization of the overall Sphinx document.
100
+
101
+ * Additional unit tests
102
+
103
+ * Myriad minor bug fixes, see commit history.
@@ -0,0 +1,43 @@
1
+ .FORCE:
2
+
3
+ BLUE=\033[0;34m
4
+ BLACK=\033[0;30m
5
+
6
+ help:
7
+ @echo "$(BLUE) make test - run all unit tests"
8
+ @echo " make coverage - run unit tests and coverage report"
9
+ @echo " make docs - build Sphinx documentation"
10
+ @echo " make view - open Sphinx doco build (uses open for MacOS)"
11
+ @echo " make dist - build dist files"
12
+ @echo " make upload - upload to PyPI"
13
+ @echo " make clean - remove dist and docs build files"
14
+ @echo " make help - this message$(BLACK)"
15
+
16
+ test:
17
+ pytest
18
+
19
+ coverage:
20
+ coverage run --source='machinevisiontoolbox' -m pytest
21
+ coverage report
22
+ coverage html
23
+ open htmlcov/index.html
24
+
25
+ docs: .FORCE
26
+ (cd docs; make html)
27
+
28
+ view: .FORCE
29
+ open docs/build/html/index.html
30
+
31
+ dist: .FORCE
32
+ # $(MAKE) test
33
+ python -m build
34
+ ls -lh dist/*
35
+
36
+ upload: .FORCE
37
+ twine upload dist/*
38
+
39
+ clean: .FORCE
40
+ (cd docs; make clean)
41
+ -rm -r *.egg-info
42
+ -rm -r dist build
43
+
@@ -0,0 +1,19 @@
1
+ needs to install mvtb, opencv-contrib-python-headless
2
+ ansitable, pgraph, spatialmath
3
+
4
+ extras for open3d
5
+ extras for data
6
+
7
+ pip install
8
+
9
+
10
+ ---
11
+
12
+ 8/3/2025
13
+
14
+ unit test for plane, check all argument possibilities
15
+ use random pattern for testing dice
16
+
17
+ checkin blob
18
+ fixup sphinx build errors
19
+ test __eq__ logic, copy size check to other equality tests
@@ -1,51 +1,51 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: machinevision-toolbox-python
3
- Version: 1.0.1
3
+ Version: 1.0.3
4
4
  Summary: Python tools for machine vision - education and research
5
- Author: Dorian Tsai
6
- Author-email: Peter Corke <rvc@petercorke.com>
7
5
  Project-URL: Homepage, https://github.com/petercorke/machinevision-toolbox-python
8
6
  Project-URL: Bug Tracker, https://github.com/pypa/sampleproject/issues
9
7
  Project-URL: Documentation, https://petercorke.github.io/machinevision-toolbox-python
10
8
  Project-URL: GitHub Source, https://github.com/petercorke/machinevision-toolbox-python
11
9
  Project-URL: Changelog, https://github.com/petercorke/machinevision-toolbox-python/blob/master/CHANGELOG.md
12
- Keywords: machine vision,computer vision,multiview geometry,stereo vision,bundle adjustment,visual servoing,image features,color,blobs,morphology,image segmentation,opencv,open3d
10
+ Author: Dorian Tsai
11
+ Author-email: Peter Corke <rvc@petercorke.com>
12
+ License-File: LICENSE
13
+ Keywords: blobs,bundle adjustment,color,computer vision,image features,image segmentation,machine vision,morphology,multiview geometry,open3d,opencv,stereo vision,visual servoing
13
14
  Classifier: Development Status :: 5 - Production/Stable
14
15
  Classifier: Intended Audience :: Developers
15
- Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Operating System :: OS Independent
16
18
  Classifier: Programming Language :: Python :: 3.10
17
19
  Classifier: Programming Language :: Python :: 3.11
18
20
  Classifier: Programming Language :: Python :: 3.12
19
- Classifier: License :: OSI Approved :: MIT License
20
- Classifier: Operating System :: OS Independent
21
- Requires-Python: >=3.7
22
- Description-Content-Type: text/markdown
23
- License-File: LICENSE
24
- Requires-Dist: numpy<2.0.0,>=1.17.4
25
- Requires-Dist: scipy
21
+ Requires-Python: >=3.10
22
+ Requires-Dist: ansitable
26
23
  Requires-Dist: matplotlib
27
- Requires-Dist: opencv-python
28
- Requires-Dist: open3d
24
+ Requires-Dist: mvtb-data
25
+ Requires-Dist: numpy
29
26
  Requires-Dist: opencv-contrib-python
30
- Requires-Dist: spatialmath-python
27
+ Requires-Dist: opencv-python
31
28
  Requires-Dist: pgraph-python
32
- Requires-Dist: ansitable
33
- Requires-Dist: mvtb-data
29
+ Requires-Dist: scipy
30
+ Requires-Dist: spatialmath-python
34
31
  Provides-Extra: dev
35
- Requires-Dist: pytest; extra == "dev"
36
- Requires-Dist: coverage; extra == "dev"
37
- Requires-Dist: flake8; extra == "dev"
32
+ Requires-Dist: coverage; extra == 'dev'
33
+ Requires-Dist: flake8; extra == 'dev'
34
+ Requires-Dist: pytest; extra == 'dev'
38
35
  Provides-Extra: docs
39
- Requires-Dist: sphinx; extra == "docs"
40
- Requires-Dist: recommonmark; extra == "docs"
41
- Requires-Dist: sphinx-rtd-theme; extra == "docs"
42
- Requires-Dist: sphinx-autorun; extra == "docs"
43
- Requires-Dist: sphinxcontrib-jsmath; extra == "docs"
44
- Requires-Dist: sphinx-markdown-tables; extra == "docs"
45
- Requires-Dist: sphinx-favicon; extra == "docs"
36
+ Requires-Dist: recommonmark; extra == 'docs'
37
+ Requires-Dist: sphinx; extra == 'docs'
38
+ Requires-Dist: sphinx-autorun; extra == 'docs'
39
+ Requires-Dist: sphinx-favicon; extra == 'docs'
40
+ Requires-Dist: sphinx-markdown-tables; extra == 'docs'
41
+ Requires-Dist: sphinx-rtd-theme; extra == 'docs'
42
+ Requires-Dist: sphinxcontrib-jsmath; extra == 'docs'
46
43
  Provides-Extra: jupyter
47
- Requires-Dist: ipywidgets; extra == "jupyter"
48
- Requires-Dist: ipympl; extra == "jupyter"
44
+ Requires-Dist: ipympl; extra == 'jupyter'
45
+ Requires-Dist: ipywidgets; extra == 'jupyter'
46
+ Provides-Extra: open3d
47
+ Requires-Dist: open3d-python; extra == 'open3d'
48
+ Description-Content-Type: text/markdown
49
49
 
50
50
  # Machine Vision Toolbox for Python
51
51
 
@@ -0,0 +1,76 @@
1
+ import machinevisiontoolbox as mvtb
2
+ import matplotlib.pyplot as plt
3
+ import numpy as np
4
+ import scipy
5
+ from spatialmath import SE3
6
+ from spatialmath import base
7
+
8
+
9
+ def mkgrid(N, s, pose=None):
10
+
11
+ s = base.getvector(s)
12
+ if len(s) == 1:
13
+ sx = s[0]
14
+ sy = s[0]
15
+ elif len(s) == 2:
16
+ sx = s[0]
17
+ sy = s[1]
18
+ else:
19
+ raise ValueError('bad s')
20
+
21
+ N = base.getvector(N)
22
+ if len(N) == 1:
23
+ nx = N[0]
24
+ ny = N[0]
25
+ elif len(N) == 2:
26
+ nx = N[0]
27
+ ny = N[1]
28
+ else:
29
+ raise ValueError('bad N')
30
+
31
+ if N == 2:
32
+ # special case, we want the points in specific order
33
+ p = np.array([
34
+ [-sx, -sy, 0],
35
+ [-sx, sy, 0],
36
+ [ sx, sy, 0],
37
+ [ sx, -sy, 0],
38
+ ]).T / 2
39
+ else:
40
+ X, Y = np.meshgrid(np.arange(nx), np.arange(ny), sparse=False, indexing='ij')
41
+ X = ( X / (nx-1) - 0.5 ) * sx
42
+ Y = ( Y / (ny-1) - 0.5 ) * sy
43
+ Z = np.zeros(X.shape)
44
+ P = np.column_stack((X.flatten(), Y.flatten(), Z.flatten())).T
45
+
46
+ # optionally transform the points
47
+ if pose is not None:
48
+ P = pose * P
49
+
50
+ return P
51
+
52
+
53
+
54
+
55
+ cam = mvtb.CentralCamera(imagesize=(1280,1024), f=0.015, rho=10e-6)
56
+ print(cam)
57
+
58
+ P = [0.3, 0.4, 3]
59
+ print(cam.project(P))
60
+ print(cam.project(P, pose=SE3(0.1,0.2,0.3) * SE3.RPY([0.1,0.2,0.3])))
61
+ print(cam.K)
62
+ print(cam.C)
63
+
64
+ P = mkgrid([3], [0.2], pose=SE3(0, 0, 1))
65
+ print(P)
66
+ print(cam.project(P))
67
+
68
+ # C = cam.C
69
+ # f, s, K, R, t = invcamcal(C)
70
+ # print(f, s)
71
+ # print(K)
72
+ # print('pose')
73
+ # print(R, R@t)
74
+
75
+ # p = cam.project(P.T)
76
+ # print('image plane points\n', p)
@@ -0,0 +1,26 @@
1
+ # Example files
2
+
3
+ ## Read and display files
4
+
5
+ * [monalisa.py](monalisa.py) load the included Mona Lisa image and display it
6
+ * [showzip.py](showzip.py) display images within a zip file as an animation
7
+ * [bunny.py](bunny.py) load the Stanford bunny point cloud from a PLY file and display it
8
+
9
+
10
+ ## Image processing
11
+
12
+ * [morphdemo.py](morphdemo.py) Visualization of moving window performing morphological operation
13
+ * [randomdots.py](randomdots.py) display random dot pattern and interactively adjust the density
14
+
15
+ ## Feature extraction
16
+
17
+ * [blobs1.py](blobs1.py) blob/region features
18
+ * [blobs2.py](blobs2.py) nested blob/region features
19
+ * [corners.py](corners.py) SIFT, ORB etc. corner features
20
+ * [matching.py](matching.py) SIFT matching points between images
21
+
22
+
23
+ ## Miscalleneous
24
+
25
+ [ransac_line.py](ransac_line.py) demo of RANSAC fitting line to badly corrupted data
26
+
@@ -0,0 +1,15 @@
1
+ from machinevisiontoolbox import Image
2
+ import matplotlib.pyplot as plt
3
+
4
+ mb = Image.Read("shark2.png")
5
+ print(mb)
6
+ mb.disp()
7
+ blobs = mb.blobs()
8
+ print(len(blobs))
9
+
10
+ blobs.plot_labelbox(color="yellow")
11
+
12
+
13
+ print(blobs)
14
+
15
+ plt.show(block=True)
@@ -0,0 +1,21 @@
1
+ from machinevisiontoolbox import Image
2
+ import matplotlib.pyplot as plt
3
+
4
+
5
+ mb = Image.Read("multiblobs.png")
6
+ mb.disp()
7
+
8
+ blobs = mb.blobs()
9
+ print(f"there are {len(blobs)} in this image")
10
+
11
+ print(blobs)
12
+
13
+ print("we can slice out a single blob")
14
+ b5 = blobs[5]
15
+ print(b5)
16
+ print(f"it has {len(b5.children)} child blobs")
17
+
18
+ blobs.dotfile(show=True)
19
+
20
+ labels, n = mb.labels_binary()
21
+ labels.disp(title="label image", colorbar=True, block=True)
@@ -0,0 +1,9 @@
1
+ # display images within a zip file as an animation
2
+
3
+ from machinevisiontoolbox import PointCloud
4
+
5
+ # load bunny point cloud from the included data files
6
+ pcd = PointCloud.Read("bunny.ply")
7
+
8
+ print(pcd)
9
+ pcd.disp(block=True)
@@ -0,0 +1,27 @@
1
+ from machinevisiontoolbox import Image
2
+ import matplotlib.pyplot as plt
3
+
4
+ im = Image.Read("flowers1.png")
5
+ im.disp()
6
+ print(im)
7
+
8
+ red = im.red()
9
+ blue = im.blue()
10
+ print(red)
11
+
12
+ red.disp(title="red channel of flowers1.png")
13
+
14
+ grey = im.mono()
15
+ print(grey)
16
+ grey.disp(title="grey scale version of flowers1.png")
17
+
18
+ f = im.to("float")
19
+ f.disp(title="float version of flowers1.png")
20
+
21
+ im.stats()
22
+
23
+ hist = im.hist()
24
+ plt.figure()
25
+ hist.plot(title="histogram of flowers1.png")
26
+
27
+ plt.show(block=True)
@@ -0,0 +1,35 @@
1
+ from machinevisiontoolbox import Image
2
+ import matplotlib.pyplot as plt
3
+
4
+ # load an image, Fig 14.1a in RVC3e
5
+ im = Image.Read("eiffel-1.png")
6
+ print("Eiffel tower:", im)
7
+
8
+ ## compute SIFT features
9
+ features = im.SIFT()
10
+
11
+ # print the summary
12
+ print(features)
13
+
14
+ # print the first 10 features
15
+ for feature in features[:10]:
16
+ print(feature)
17
+
18
+ # overlay the 50 largest features on the image, sorted by decreasing strength
19
+ im.disp(title="Eiffel tower + SIFT features", block=False)
20
+ features.sort().filter(minscale=10)[:50].plot(filled=True, color="red", alpha=0.5)
21
+
22
+ ## compute ORB features, these have no scale
23
+ features = im.ORB()
24
+ # print the summary
25
+ print(features)
26
+
27
+ # print the first 10 features
28
+ for feature in features[:10]:
29
+ print(feature)
30
+
31
+ # overlay the 50 largest features on the image, sorted by decreasing strength
32
+ im.disp(title="Eiffel tower + ORB features", block=False)
33
+ features.sort()[:50].plot(color="yellow", alpha=0.3)
34
+
35
+ plt.show(block=True)
@@ -0,0 +1,14 @@
1
+ import matplotlib.pyplot as plt
2
+ from machinevisiontoolbox import *
3
+
4
+ # load two different views of the Eiffel tower and compute SIFT features
5
+ sf1 = Image.Read("eiffel-1.png").SIFT()
6
+ sf2 = Image.Read("eiffel-2.png").SIFT()
7
+
8
+ # match the features, the result is a list of matching pairs
9
+ m = sf1.match(sf2)
10
+ print(m[:5])
11
+
12
+ m[:100].plot("y", width=200, linewidth=0.7)
13
+
14
+ plt.show(block=True)
@@ -0,0 +1,7 @@
1
+ from machinevisiontoolbox import Image
2
+
3
+ mona = Image.Read("monalisa.png")
4
+ mona.disp(title=f"monalisa from file {mona.name}")
5
+
6
+ mona = Image.Read("http://petercorke.com/files/images/monalisa.png")
7
+ mona.disp(title="monalisa from URL", block=True)
@@ -0,0 +1,38 @@
1
+ from machinevisiontoolbox import Image, set_window_title
2
+ import matplotlib.pyplot as plt
3
+ import numpy as np
4
+
5
+ morph_op = np.min
6
+ # morph_op = np.max
7
+
8
+ # pause = None
9
+ pause = 0.5
10
+
11
+ a = Image.Random(10) # random input image
12
+ b = Image.Zeros(10) # "empty" output image
13
+
14
+ # create two adjacent subplots, and display the input image on the left
15
+ fig, ax = plt.subplots(1, 2, figsize=(10, 5))
16
+ set_window_title("Morphological operation demonstration")
17
+
18
+ wa = a.showpixels(textcolors="blue", ax=ax[0], windowsize=1)
19
+ b.showpixels(ax=ax[1])
20
+
21
+ # wa is an object that can highlight windows in the corresponding image
22
+
23
+ # loop over all pixels in the input image, excluding the border
24
+ for v in range(1, a.shape[0] - 1):
25
+ for u in range(1, a.shape[1] - 1):
26
+ window = wa.move(u, v, "red") # highlight the window
27
+
28
+ # window is the 3x3 window centered on (u,v)
29
+ b.image[v, u] = morph_op(window) # perform the morphological operation
30
+
31
+ # update the display of the output image
32
+ ax[1].cla()
33
+ b.showpixels(ax=ax[1])
34
+
35
+ if pause is None:
36
+ plt.waitforbuttonpress()
37
+ else:
38
+ plt.pause(pause)
@@ -0,0 +1,15 @@
1
+ import matplotlib.pyplot as plt
2
+ from traitlets.config import Config
3
+
4
+ import IPython
5
+
6
+ c = Config()
7
+ c.InteractiveShell.confirm_exit = False
8
+
9
+ code = [
10
+ "%matplotlib osx",
11
+ "print('hello')",
12
+ ]
13
+
14
+ c.InteractiveShellApp.exec_lines = code
15
+ IPython.start_ipython(config=c, user_ns=globals())
@@ -0,0 +1,10 @@
1
+ # create random greyscale pixel pattern and allow interactive threshold
2
+ # to change the dot density
3
+ #
4
+ # could be the basis of texture for stereo calibration
5
+
6
+ from machinevisiontoolbox import Image
7
+ import matplotlib.pyplot as plt
8
+
9
+ image = Image.Random(200)
10
+ image.threshold_interactive()