ipfml.processing.compression¶
Functions for image compression and extraction
Functions
get_SVD (image) |
Transforms Image using SVD compression |
get_SVD_U (image) |
Transforms Image into SVD and returns only ‘U’ part |
get_SVD_V (image) |
Transforms Image into SVD and returns only ‘V’ part |
get_SVD_s (image) |
Transforms Image into SVD and returns only ‘s’ part |
-
ipfml.processing.compression.
get_SVD
(image)[source]¶ Transforms Image using SVD compression
Parameters: image – image to convert into SVD compression Returns: U, s, V obtained from SVD compression Usage:
>>> from PIL import Image >>> from ipfml.processing import compression >>> img = Image.open('./images/test_img.png') >>> U, s, V = compression.get_SVD(img) >>> U.shape (200, 200, 3) >>> len(s) 200 >>> V.shape (200, 3, 3)
-
ipfml.processing.compression.
get_SVD_U
(image)[source]¶ Transforms Image into SVD and returns only ‘U’ part
Parameters: image – image to convert Returns: U matrix from SVD compression Usage:
>>> from PIL import Image >>> from ipfml.processing import compression >>> img = Image.open('./images/test_img.png') >>> U = compression.get_SVD_U(img) >>> U.shape (200, 200, 3)
-
ipfml.processing.compression.
get_SVD_V
(image)[source]¶ Transforms Image into SVD and returns only ‘V’ part
Parameters: image – image to convert Returns: V matrix obtained from SVD compression Usage :
>>> from PIL import Image >>> from ipfml.processing import compression >>> img = Image.open('./images/test_img.png') >>> V = compression.get_SVD_V(img) >>> V.shape (200, 3, 3)
-
ipfml.processing.compression.
get_SVD_s
(image)[source]¶ Transforms Image into SVD and returns only ‘s’ part
Parameters: image – image to convert Returns: vector of singular values obtained from SVD compression Usage:
>>> from PIL import Image >>> from ipfml.processing import compression >>> img = Image.open('./images/test_img.png') >>> s = compression.get_SVD_s(img) >>> len(s) 200