Juan Nunez-Iglesias
ea1566fffb
Fix image dimension sanitizing at function start
...
`np.atleast_3d` will add a singleton dimension at the end of an array
if needed. This is not the correct thing to do if `multichannel=False`
based on the subsequent lines. If the input image was 2D with shape
`(40, 50)` and `multichannel=False`, then `np.atleast_3d` gives it
shape `(40, 50, 1)`, and then, because `multichannel=False`, the rest
of the code gives it shape `(40, 50, 1, 1)`. This results in the final
returned array having shape `(40, 50, 1)` instead of the desired
`(40, 50)`.
This commit fixes that and updates the test to detect this failure.
2013-09-16 16:02:24 +10:00
Johannes Schönberger
05aaeef5ac
Change default value of sigma
2013-09-14 10:08:07 +02:00
Johannes Schönberger
22ca0ae457
Fix indentation
2013-09-03 20:31:24 +02:00
Johannes Schönberger
8137c41e22
Add optional description to parameters
2013-09-03 10:48:53 +02:00
Johannes Schönberger
770e28d2bb
Rename clusters to segments
2013-09-03 10:47:49 +02:00
Johannes Schönberger
d9e64b43e6
Make image C-contiguous
2013-09-03 08:40:18 +02:00
Johannes Schönberger
80ed875147
Add missing rgb2lab import
2013-09-01 17:12:10 +02:00
Johannes Schönberger
a6d1b10e25
Use absolute imports
2013-09-01 16:53:05 +02:00
Johannes Schönberger
eeddd9e35f
Revert multichannel magic and improve parameter docs
2013-09-01 16:46:01 +02:00
Johannes Schönberger
e5eea8e135
Improve documentation of sigma
2013-09-01 16:46:01 +02:00
Johannes Schönberger
f5cfbcfe97
Reorder variable declarations
2013-09-01 16:46:01 +02:00
Johannes Schönberger
bd388383a0
Fix bug in window extent determination
2013-09-01 16:46:01 +02:00
Johannes Schönberger
bc7efb01e4
Fix dtype bug
2013-09-01 16:46:01 +02:00
Johannes Schönberger
84579a6c2c
Remove legacy comment
2013-09-01 16:46:01 +02:00
Johannes Schönberger
471b293a9e
Remove unnecessary parameters and update doc string
2013-09-01 16:46:00 +02:00
Johannes Schönberger
6b5556b279
Reduce memory footprint
2013-09-01 16:46:00 +02:00
Johannes Schönberger
fd729a4e30
Improve SLIC
2013-09-01 16:46:00 +02:00
Juan Nunez-Iglesias
13e83be692
Update PyAMG URL (no longer in Google Code)
2013-08-25 12:44:19 +02:00
Johannes Schönberger
c8f619e384
Use typed memoryviews in transform package
2013-08-19 19:22:28 +02:00
Juan Nunez-Iglesias
4edf227869
Change 'long' to 'int' in Cython docs
2013-08-10 11:17:18 +10:00
Juan Nunez-Iglesias
fe02c18f3d
Use Py_ssize_t instead of int in _slic_cython
2013-08-09 18:43:24 +10:00
Juan Nunez-Iglesias
72833f1729
Do not use 'ratio' in test_slic.py either
2013-07-29 00:30:51 +10:00
Juan Nunez-Iglesias
878c562a45
Replace 'ratio' kwarg with 'compactness' in SLIC
2013-07-29 00:28:38 +10:00
Juan Nunez-Iglesias
3e99079107
Precision issues appear to have vanished
2013-07-25 00:24:04 +10:00
Juan Nunez-Iglesias
af3ea5f817
Remove unused 'ratio' argument from _slic_cython
2013-07-25 00:23:01 +10:00
Juan Nunez-Iglesias
aadd346964
Fix ratio scaling in SLIC
2013-07-22 20:19:24 +10:00
Juan Nunez-Iglesias
df2233cc6a
Remove old commented-out code
2013-07-03 00:49:36 +02:00
Juan Nunez-Iglesias
cd197527fb
Speed up initialising 'distance' in SLIC
2013-07-02 13:22:14 +02:00
Juan Nunez-Iglesias
578876eff8
Bug fix: correctly initialize distance in slic
2013-07-02 13:22:14 +02:00
Juan Nunez-Iglesias
a338618967
Remove diagnostic print
2013-07-02 13:22:14 +02:00
Juan Nunez-Iglesias
524255c0a2
Improve _slic.pyx doc, bug fixes, debug print
2013-07-02 13:22:14 +02:00
Juan Nunez-Iglesias
6e64515ea9
Fix build errors with memoryviews
2013-07-02 13:22:14 +02:00
Juan Nunez-Iglesias
b1b70631bd
Initial attempt at updating SLIC for memoryviews
2013-07-02 13:22:14 +02:00
Juan Nunez-Iglesias
cba821d5e3
Suppress warning of ambiguous array dim in test
2013-07-02 13:22:14 +02:00
Juan Nunez-Iglesias
8c2011d4f9
Add UTF8 coding declaration to slic_superpixels.py
2013-07-02 13:22:14 +02:00
Juan Nunez-Iglesias
69fb3fb7ba
Make means array contiguous for numpy <= 1.6.1
2013-07-02 13:22:13 +02:00
Juan Nunez-Iglesias
55fe6ce2d6
Bug fix: spatial vs image dimension comparison reversed
2013-07-02 13:22:13 +02:00
Juan Nunez-Iglesias
5a43e03061
Bug fix: add z dimension regardless of multichannel
2013-07-02 13:22:13 +02:00
Juan Nunez-Iglesias
e9c5f666ae
Use educated guesses for presence of color channels in SLIC
2013-07-02 13:22:13 +02:00
Juan Nunez-Iglesias
e757b9ae06
Rename slic.py to avoid name conflicts
2013-07-02 13:22:13 +02:00
Juan Nunez-Iglesias
99f905bc54
Always convert image to float in [0, 1]
2013-07-02 13:22:13 +02:00
Juan Nunez-Iglesias
5c4d0218ce
bug fix: 3d test working
2013-07-02 13:22:13 +02:00
Juan Nunez-Iglesias
215439b43c
Add 3D slic tests (gray not working yet)
2013-07-02 13:22:13 +02:00
Juan Nunez-Iglesias
57cc86d7c8
Bug fix: remove unnecessary __get__ in test_slic
2013-07-02 13:22:13 +02:00
Juan Nunez-Iglesias
e9aa78b937
Bug fix: don't add singleton dimension to 3D gray images
2013-07-02 13:22:13 +02:00
Juan Nunez-Iglesias
8e4ab32ed9
Bug fixes: concatenation order and shape assignments
2013-07-02 13:22:13 +02:00
Juan Nunez-Iglesias
6dc8e6300b
Separate inner loop of SLIC computation
2013-07-02 13:22:12 +02:00
Juan Nunez-Iglesias
620210025f
Modify SLIC to allow uneven step sizes
2013-07-02 13:22:12 +02:00
Juan Nunez-Iglesias
a2e32cc90c
Add initial 3D modifications (not working)
2013-07-02 13:21:17 +02:00
François Boulogne
a48de8dea9
add optional + default in pyx docstring
2013-05-29 20:18:19 +02:00