def asmatrix(self):
"""
Return the sparse matrix representation of the separable filter.
"""
h_matrix = NP.array([1])
for i in range(self.ndim):
if self.mode == 'circ':
h_i = Convmtx([self.k[i]], self.h_list[i], mode=self.mode)
else:
h_i = Convmtx([self.n[i]], self.h_list[i], mode=self.mode)
h_matrix = scipy.sparse.kron(h_matrix, h_i)
return h_matrix
评论列表
文章目录