Not sure if that effects the error I'm seeing below:
I'm getting the following error when trying to process images:
File "C:\Anaconda2\lib\site-packages\scipy\cluster\vq.py", line 436, in _kmeans
code_book, has_members = _vq.update_cluster_means(obs, obs_code, nc)
File "scipy\cluster_vq.pyx", line 347, in scipy.cluster._vq.update_cluster_means (scipy\cluster_vq.c:4550)
TypeError: type other than float or double not supported
Thanks. As I said in #8, apologies for not getting to this in a timely fashion. In my re-write for v0.2.0, I use skimage.img_as_float to address this problem.
Windows 10 Anaconda 2.7.10 SciPy 0.16.0
In order to get it to run I had to change:
import Image import ImageFilter
to
from PIL import Image from PIL import ImageFilter
Not sure if that effects the error I'm seeing below:
I'm getting the following error when trying to process images:
File "C:\Anaconda2\lib\site-packages\scipy\cluster\vq.py", line 436, in _kmeans code_book, has_members = _vq.update_cluster_means(obs, obs_code, nc) File "scipy\cluster_vq.pyx", line 347, in scipy.cluster._vq.update_cluster_means (scipy\cluster_vq.c:4550) TypeError: type other than float or double not supported
It doesn't like the following line of code:
colors, dist = vq.kmeans(imgarr, clusters)
Fix seems to be:
colors, dist = vq.kmeans(imgarr.astype(np.float), clusters)