Skip to content

Commit 9c58df6

Browse files
committed
weird error
1 parent 772bcdf commit 9c58df6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

unmap/unweave.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ def convert_imarray(imarray, colors=256):
4242
imp = Image.fromarray(np.uint8(imarray))
4343
imp = imp.quantize(colors=colors, dither=Image.NONE)
4444
imp.thumbnail((512, 512))
45-
imarray = np.asarray(imp)
46-
palette = np.asarray(imp.getpalette()).reshape(-1, 3)
45+
imarray = np.array(imp)
46+
palette = np.array(imp.getpalette()).reshape(-1, 3)
4747
unique = ordered_unique(tuple(i) for i in palette[:colors]/255)
4848
return imarray, np.array(unique)
4949

@@ -63,7 +63,7 @@ def construct_graph(imarray, colors=256, normed=True):
6363
Returns:
6464
G (nx.Graph): Value adjacency graph.
6565
"""
66-
glcm = graycomatrix(np.asarray(imarray),
66+
glcm = graycomatrix(imarray,
6767
distances=[1],
6868
angles=[0, np.pi/4, np.pi/2, 3*np.pi/4],
6969
levels=colors,

0 commit comments

Comments
 (0)