MCPcopy Create free account
hub / github.com/PythonOT/POT / im2mat

Function im2mat

examples/domain-adaptation/plot_otda_linear_mapping.py:104–106  ·  view source on GitHub ↗

Converts and image to matrix (one pixel per line)

(img)

Source from the content-addressed store, hash-verified

102
103
104def im2mat(img):
105 """Converts and image to matrix (one pixel per line)"""
106 return img.reshape((img.shape[0] * img.shape[1], img.shape[2]))
107
108
109def mat2im(X, shape):

Callers 1

Calls 1

reshapeMethod · 0.45

Tested by

no test coverage detected