def classify(self, M):
"""
Classify a hyperspectral cube using the ROIs defined clusters by the fit method.
Parameters:
M: `numpy array`
A HSI cube (m x n x p).
Returns: `numpy array`
A class map (m x n x 1).
"""
img = self._convert2D(M)
image_scaled = preprocessing.scale(img)
cls = self.clf.predict(image_scaled)
self.cmap = self._convert3d(cls, M.shape[0], M.shape[1])
return self.cmap
评论列表
文章目录