Commit 21a55e19 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Fixed reshape error within KMeansRSImage.


Former-commit-id: 799e34de
parent de536db0
......@@ -174,7 +174,7 @@ class KMeansRSImage(object):
def compute_clusters(self):
# implement like this: https://www.pyimagesearch.com/2014/05/26/opencv-python-k-means-color-clustering/
pixels2d = self.im.reshape(self.im.rows * self.im.cols, 3)
pixels2d = self.im.reshape((self.im.rows * self.im.cols, self.im.bands))
kmeans = KMeans(n_clusters=self.n_clusters, random_state=0)
out = kmeans.fit(pixels2d)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment