How do I apply SVD (Singular Value Decomposition) to an image?

51 vues (au cours des 30 derniers jours)
buddy
buddy le 2 Mar 2011
Commenté : Neelam Yadav le 18 Sep 2020
The syntax given for singular value decomposition is svd(x).
I tried it with my image, but it didn't work. Can you tell me how to work with svd for images please?
  2 commentaires
David Young
David Young le 2 Mar 2011
Please could you say what the error message was, and also show any other parts of your code that might be relevant.
Andreas Goser
Andreas Goser le 2 Mar 2011
While I agree with David on the need for specifics, my crystal ball tells my this is about data types and will craft an answer for that...

Connectez-vous pour commenter.

Réponse acceptée

Andreas Goser
Andreas Goser le 2 Mar 2011
This sounds like it is about data types or sizes. Example
pout = imread('pout.tif');
svd(pout) % does not work
??? Undefined function or method 'svd' for input arguments of type 'uint8'.
svd(double(pout)) % works
I can however not comment on the mathematical sense of this. I you have another image format like here, you need to think about what you actually like to achieve
I = imread('board.tif');
svd(double(I))
??? Undefined function or method 'svd' for input arguments of type 'double' and
attributes 'full 3d real'.
  1 commentaire
buddy
buddy le 2 Mar 2011
thank u sir.. i understand it is bcos of datatype..

Connectez-vous pour commenter.

Plus de réponses (5)

meenakshi
meenakshi le 6 Sep 2011
HELLO GOSER
i=imread('pout.tif');
i=im2double(i)
[u s v]=svd(i);
you can try like this.
k.meenakshi
  1 commentaire
Walter Roberson
Walter Roberson le 6 Sep 2011
That would not have any more success than svd(double(I)) if I is a truecolor (3D) image. Remember, images can be stored as pseudocolor (2D arrays in which the values indicate which index to use out of a color map), or as truecolor (3D arrays in which the values directly indicate the color information for each pixel without any map.) The problem is that svd() of a pseudocolor image is not meaningful, and svd() of a 3D array is not allowed. The only choice available to get anything useful out is to convert the image to grayscale and svd() the grayscale image.

Connectez-vous pour commenter.


slama najla
slama najla le 21 Avr 2012
Hello, can some body help me with the code of SVD decomposition in 3d medical data in matlab please.
  1 commentaire
Walter Roberson
Walter Roberson le 21 Avr 2012
No. SVD is only for 2D.
You could take the svd() of each plane.

Connectez-vous pour commenter.


slama najla
slama najla le 28 Avr 2012
But many approaches use it us decomposition for 3d data in watermarking,this is why i reask this question.thanks
  2 commentaires
Walter Roberson
Walter Roberson le 28 Avr 2012
SVD is *defined* in terms of rectangular matrices. There is no method to apply SVD to a 3D matrix. I looked at some of the articles about color image watermarking using svd, and of the ones I could access, not one of them attempted to apply SVD to a 3D matrix.
Neelam Yadav
Neelam Yadav le 18 Sep 2020
Hello, can anyone help me how I get different image for U,S,V in svd

Connectez-vous pour commenter.


Ayesha Iftikhar
Ayesha Iftikhar le 19 Sep 2018
Hello can any one help me how to use SVD for feature extraction

vasanthi Muniasamy
vasanthi Muniasamy le 24 Mai 2019
i=imread('pout.tif');
i=im2double(i)
[u s v]=svd(rgb2gray(i));

Catégories

En savoir plus sur Eigenvalues dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by