how to find size of image compressed by principal component analysis??

i have compressed images/data by PCA,now i want to find size of the image that i have compressed by PCA????

 Risposta accettata

Each PC image will be the same number of rows and columns, though each pixel might be as many as 8 bytes instead of 1 if you're getting double arrays out and starting with uint8. So it may not be compressed at all. Anyway, it would depend on how many PC components there are. There could be 1, 2, 3, 4, 5, or whatever. How many are you calculating and keeping?

5 Commenti

36x36 is my input image and i have 14 images to compressed by PCA.In feature extraction i put only 13 eigen faces so my final data become 13x14 so how to find it... totalimage{1} upto totalimage{14} are my input images..
s=size(totalimage{1});
datamatrix=zeros(s(1)*s(2),numel(images));
for i= 1:numel(images)
datamatrix(:,i)=totalimage{i}(:);
end;
meanf=mean(datamatrix,2);
centermatrix=datamatrix-repmat(meanf,[1,numel(images)]);
%newcentermatrix=centermatrix';
[v,s,u]=princomp(centermatrix);
[u positions]=dsort(u);
%v=centermatrix*v;
eigenfaces=centermatrix*v;
for i=1:numel(images)
eigenfaces(:,i)=eigenfaces(:,i)/(norm(eigenfaces(:,i)));
end;
[m,n]=size(eigenfaces);
m=sqrt(m);
for i=1:18
%figure('name','Eigenfaces')
% figure(3),subplot(6,3,i),imshow(mat2gray(reshape(eigenfaces(:,i),m,m))),
%title('Eigenfaces');
end;
%figure('name','Eigen values'),plot(u);
%significantvalue=input('enter significant values=');
feature=eigenfaces(:,positions(1:1:numel(images)-1));
final=feature'*centermatrix;
now how to find that how much data i have compressed????thanks in advance...
Use "whos" to find out how many bytes your original image takes up and how many bytes all of your eigenfaces images take up. I'm pretty sure the eigenfaces won't take up less space than the original image. Also, read this: http://www.mathworks.com/matlabcentral/answers/13205-tutorial-how-to-format-your-question-with-markup
In PCA , what we called compression?how i can find the size of the compressed images ?my question is that where is that compressed images ?can we call eigen face the compressed image of the original? Original image is the combination of different eigenfaces with different intensities plus mean?? so how i find that how much compression has occurred?
The eigen images are computed just once for all images you want to model. Then for each image, you just need to save the weights applied to each eigenface image. So compression is happening because you're just saving a 1D vector of weights, not all the images. If you're taking 50 eigen images, then each image only needs to save 50 numbers. The eigen images themselves are not considered when you compute compression because they are just the same set of permanent images for all images you want to synthesize.
thanks sir,but i now want to plot compression vs threshold graph.So how i can change compression?

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by