generated from LufsX/Experiment-kNN
This commit is contained in:
+3
-3
@@ -112,9 +112,9 @@ def img_to_vector(filename):
|
||||
- np.array: 二值图像向量。
|
||||
"""
|
||||
|
||||
with open(filename) as file:
|
||||
lines = file.readlines()
|
||||
image_vector = np.array([int(char) for line in lines for char in line.strip()])
|
||||
with open(filename) as file:
|
||||
lines = file.readlines()
|
||||
image_vector = np.array([int(char) for line in lines for char in line.strip()])
|
||||
|
||||
return image_vector
|
||||
|
||||
|
||||
Reference in New Issue
Block a user