#! python3
"""
@author: b04902053
"""

import numpy as np
from scipy.misc import imread

NDATA = 481

data = np.zeros((NDATA, 480, 512))
for i in range(1, NDATA+1):
    data[i-1] = imread('./hand/hand.seq{}.png'.format(i))
data = data.reshape(NDATA, 480*512)

# val, vec = np.linalg.eigh(np.cov(data.T))
val, vec = np.linalg.eigh(np.dot(data, data.T))
eig = val[:60].reshape(1, 60) / 10000

np.savetxt('./hand_eigh.csv', eig)

51fc3809e0dcfc8268e8cbc79e6f41b83ea81496
<mask token>

<mask token>
for i in range(1, NDATA + 1):
    data[i - 1] = imread('./hand/hand.seq{}.png'.format(i))
<mask token>
np.savetxt('./hand_eigh.csv', eig)

<mask token>
NDATA = 481
data = np.zeros((NDATA, 480, 512))
for i in range(1, NDATA + 1):
    data[i - 1] = imread('./hand/hand.seq{}.png'.format(i))
data = data.reshape(NDATA, 480 * 512)
val, vec = np.linalg.eigh(np.dot(data, data.T))
eig = val[:60].reshape(1, 60) / 10000
np.savetxt('./hand_eigh.csv', eig)

<mask token>
import numpy as np
from scipy.misc import imread
NDATA = 481
data = np.zeros((NDATA, 480, 512))
for i in range(1, NDATA + 1):
    data[i - 1] = imread('./hand/hand.seq{}.png'.format(i))
data = data.reshape(NDATA, 480 * 512)
val, vec = np.linalg.eigh(np.dot(data, data.T))
eig = val[:60].reshape(1, 60) / 10000
np.savetxt('./hand_eigh.csv', eig)

#! python3
"""
@author: b04902053
"""

import numpy as np
from scipy.misc import imread

NDATA = 481

data = np.zeros((NDATA, 480, 512))
for i in range(1, NDATA+1):
    data[i-1] = imread('./hand/hand.seq{}.png'.format(i))
data = data.reshape(NDATA, 480*512)

# val, vec = np.linalg.eigh(np.cov(data.T))
val, vec = np.linalg.eigh(np.dot(data, data.T))
eig = val[:60].reshape(1, 60) / 10000

np.savetxt('./hand_eigh.csv', eig)
