0

I am trying to read an image, but it gives me errors as such. I have tried to read other formats, which work fine. I could not find much online, so I am posting the question here. Any ideas would be helpful!

>> A = imread('C:\Users\5460\Desktop\CV2\Apple\image001.pbm', 'pbm')
Error using impnminfo (line 72)
Invalid magic number. File is not a PPM, PGM, or PBM file.

Error in readpnm (line 25)
   info = impnminfo(filename);

Error in imread (line 434)
    [X, map] = feval(fmt_s.read, filename, extraArgs{:});

Thanks in advance!

student001
  • 533
  • 1
  • 7
  • 20
  • 1
    it is possible this image file is corrupt. Have you succeeded in opening this image using a different software, an image viewer perhaps? – Shai Mar 25 '14 at 11:16
  • The PBM file should start with P and then an integer. Have a look at the file. How does it start? – ypnos Mar 25 '14 at 11:36
  • Its just image001.pbm and so on..Does that mean it is corrupt? I am not able to view the file otherwise as well. – student001 Mar 25 '14 at 11:37
  • @student001: Can you upload an example? – Daniel Mar 25 '14 at 12:08

0 Answers0