Matlab

Moderators: None (Apply to moderate this forum)
Number of threads: 1467
Number of posts: 2144

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
First time help Posted by mingwersen on 12 May 2011 at 10:53 AM
Need major help on an assignment. ANy help would be nice. I have a image compression bonus assignment as follows



"1. Download the image.mat file from blackboard and load this into matlab. Do this by
typing "load image.mat" in the command prompt. There should now be the variable
A in your workspace. A has 3 dimensions. The rst two are the height and width
of the image, the last dimension is of length 3. This is because images have 3 color
planes.
2. View the image with the command "image(A)"
3. Turn A into a matrix of doubles with the command "double(A)".
4. Since each color plane can be considered a square matrix, we can perform an eigenvalue
decomposition to each plane. Do this with the function "eig(A)".
5. Try sorting the eigenvalues of each plane by magnitude (absolute value of the values).
Approximate each bit plane by only using the 100 most in
uential eigenvalues and
eigenvectors. Repeat this for 50, 25, 10, and 5. Reconstruct all 3 color planes with
each approximation. Name the reconstruction B.
6. There are likely to be imaginary values in B. Get rid of these with the command
"real(B)". Round the values of B into integers with "round(B)". Turn B into a matrix
of uint8's with "uint8(B)". View all the images. How good is the approximation? Plot
the mean squared error between A and B as a function of the number of eigenvalues
you keep.
7. Repeat steps 5 and 6 by using the eigenvalues of smallest magnitude."


I have been able to import the image, make it doubles, then i seperated it into 3 matrices so i could apply eig() onto it. thats where im lost.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.