Uncompress Image - Multiple out truncated SVD (Python)

70 Views Asked by At

I have been given the SVD representation of an image (Sigma, Uk, Vk) - I need to reconstruct the image by multiplying out the truncated SVD.

I have tried: k = Uk.shape[1] return (Uk * Sigma[:k]).dot(VkT)

I have also used np.diag to convert Sigma from a 1D array to a diagonal matrix.

1

There are 1 best solutions below

1
Elemeno P On

close..

Uk.dot(np.diag(Sigma[:k])).dot(VkT)