Menu

[r3313]: / trunk / py4science / book / examples / scipy / lowrank.py  Maximize  Restore  History

Download this file

15 lines (11 with data), 225 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
"""Low-rank approximations for images"""
import scipy as S
import pylab as P
from scipy.plt import lena
# Set grayscale colormap
P.gray()
# load lena into array
lena = lena()
U,s,Vh = S.linalg.svd(lena)
P.plot(s)
P.show()
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.