How to rconstruct image using eigenvectors and eigenvalues?

13 ビュー (過去 30 日間)
Hitendra
Hitendra 2015 年 9 月 30 日
コメント済み: Medha Sharma 2017 年 4 月 12 日
I am trying to reconstruct an image by evaluating its eigenvalues and eigenvectors. Some of the eigenvalues are negative and when I reconstruct the image using:
imge_rec = (eig_vec)*(eig_values)*(eig_vec)'
I do not obtain the same image. Following is my code and test image: img_in = double(rgb2gray(imread('input.jpg')));
[eig_vec,eig_val] = eig(img_in);
img_rec = eig_vec * eig_val * eig_vec';
figure;
imshow(img_rec,[]);
input image
output image

採用された回答

Bjorn Gustavsson
Bjorn Gustavsson 2015 年 9 月 30 日
I find it easier to work with the SVD-decomposition instead of the eigenvalue-decomposition. Since your matrix is not symmetric it gives complex-valued eigenvalues, which makes it much harder to use the eigenvalue-decomposition. The SVD gives you singular values that are real and >= 0. This makes it easier to implement straight filters and compressions and whatnot. So try:
[U,S,V] = svd(img_in);
imagesc(U*S*V.')
HTH
  2 件のコメント
Hitendra
Hitendra 2015 年 9 月 30 日
Hi Bjorn,
Thank you for your answer. I tried my code with square matrix also (cropped images). Even then I am not able to get good reconstruction. I wish to separate high frequency component of image, so, I believe use of eigenvalues will be more useful.
Medha Sharma
Medha Sharma 2017 年 4 月 12 日
Use inv function to take inverse, E' will take transpose.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLinear Algebra についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by