how to convert jpeg images to pgm format...can someone help

5 vues (au cours des 30 derniers jours)
geethi
geethi le 1 Mar 2013
Commenté : amit le 3 Mai 2018
this is my code
w=load_database();
prompt={'compare'}; title='IMAGE INPUT'; ans=inputdlg(prompt,title); if ~isempty(ans{1}) r1 = str2num(ans{1}); if isempty(r1) ri =round (400*rand(1,1)); end end
r=w(:,r1); v=w(:,[1:r1-1 r1+1:end]); N=20; O=uint8(ones(1,size(v,2))); m=uint8(mean(v,2)); vzm=v-uint8(single(m)*single(O)); L=single(vzm)'*single(vzm); [V,D]=eig(L); V=single(vzm)*V; V=V(:,end:-1:end-(N-1));
cv=zeros(size(v,2),N); for i=1:size(v,2); cv(i,:)=single(vzm(:,i))'*V; end
subplot(121); imshow(reshape(r,112,92)); title('Looking for ...','FontWeight','bold','Fontsize',16,'color','red');
subplot(122); p=r-m; s=single(p)'*V; z=[]; for i=1:size(v,2) z=[z,norm(cv(i,:)-s,2)]; if(rem(i,20)==0),imshow(reshape(v(:,i),112,92)),end; drawnow; end
[a,i]=min(z); subplot(122); imshow(reshape(v(:,i),112,92));title('Found!','FontWeight','bold','Fontsize',16,'color','red');

Réponse acceptée

ChristianW
ChristianW le 1 Mar 2013
X = imread('ngc6543a.jpg');
imwrite(X,'test.pgm')
  3 commentaires
Akash Anilkumar
Akash Anilkumar le 30 Juin 2016
Thanks !!
amit
amit le 3 Mai 2018
thanks

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Import, Export, and Conversion 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