Forum

Author Topic: Error: can't read image  (Read 25195 times)

ferdywallinx

  • Newbie
  • *
  • Posts: 28
    • View Profile
Error: can't read image
« on: January 27, 2016, 10:46:30 AM »
I'm currently trying to process a large orthomosaic. the whole thing was processed (the second to last processing step stated 'Finished Processing' and right after that I got the error 'Error: can't read image: 2688'. How can this error come about and how can i prevent it from happening again. This were the two final lines of build orthomosaic. The chunk in which i build this orthomosaic contains a suitable DEM on which the orthomosaic is based. The error occurred both with and without color correction. The disk space did increase during the building of the orthomosaic so something was made in the meantime.

Edit: the result was that the entire orthomosaic was not showing up in my chunk and seeing from the save-file size it was entirely removed.
« Last Edit: January 28, 2016, 12:10:47 PM by ferdywallinx »

gatsri

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
Re: Error: can't read image
« Reply #1 on: March 17, 2016, 09:01:28 AM »
I got the same problem
got someone any idea?!

Gall

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
Re: Error: can't read image
« Reply #2 on: March 17, 2016, 05:54:24 PM »
Usually, it means that one (or more) of the cameras has an invalid path (or maybe the file is corrupted).

You can try this script to disable any camera with an invalid path:
Code: [Select]
import os
import PhotoScan

chunk = PhotoScan.app.document.chunk
for c in chunk.cameras:
    if(not os.path.exists(c.photo.path)):
        c.enabled = False

Patribus

  • Full Member
  • ***
  • Posts: 170
    • View Profile
Re: Error: can't read image
« Reply #3 on: May 09, 2016, 03:41:06 PM »
Hello,

I'm having the same problem.

All paths are correct, so I suppose the file is corrupt,

but how do I know which image is the one named in the error? Where can I see the internal ID of the images?

Cheers

Gall

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
Re: Error: can't read image
« Reply #4 on: May 09, 2016, 03:48:18 PM »
I think you can retrieve the path with
Code: [Select]
chunk.cameras[id].photo.path
Here id is the one mentioned by the error message.

Patribus

  • Full Member
  • ***
  • Posts: 170
    • View Profile
Re: Error: can't read image
« Reply #5 on: May 09, 2016, 04:24:01 PM »
Hello Gall, thanks for the info,

I tried your command, but I get the following error
Code: [Select]
2016-05-09 15:21:56 Error: Can't read image: 8785
>>> chunk.cameras[8785].photo.path

2016-05-09 15:22:15   File "<console>", line 1
2016-05-09 15:22:15     chunk.cameras[8785].photo.path
2016-05-09 15:22:15                                 
^
2016-05-09 15:22:15 SyntaxError: invalid character in identifier
>>>

What is wrong?

Cheers

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15282
    • View Profile
Re: Error: can't read image
« Reply #6 on: May 09, 2016, 04:30:22 PM »
Hello Patrick,

You need to define chunk variable as
Code: [Select]
chunk = PhotoScan.app.document.chunk first, than use the line suggested by Gall, but without new line symbol in the end of the line.

Also you can try to use Check Image Paths option in the Photos menu.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Patribus

  • Full Member
  • ***
  • Posts: 170
    • View Profile
Re: Error: can't read image
« Reply #7 on: May 09, 2016, 05:07:20 PM »
Hello Alexey, thank you for the hint.

So, the paths are Ok as I said, also the file, which I found now, is OK and readable.

But the error persists.

There is still a point to check.
I had problems with file permissions in Windows since they still possess some permissions from the former win installation.

I tried to clean up the 'cadaver' permissions.

What I noticed, is that there were no permission for the 'normal' user (i.e. non admin) set. I suppose that this will also block PS when wanting to read files (images). Can this be?

I just changed this, but I'm not really aware about the user permission PS needs to operate smoothly.
Can someone give me some info on this?

Thanks


Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15282
    • View Profile
Re: Error: can't read image
« Reply #8 on: May 09, 2016, 05:46:10 PM »
Hello Patrick,

The issue can also appear if PhotoScan cannot access individually orthorectified images in the .files folder related to the project.
For example, if the images.zip file is corrupted, removed or inaccessible.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Patribus

  • Full Member
  • ***
  • Posts: 170
    • View Profile
Re: Error: can't read image
« Reply #9 on: May 09, 2016, 06:38:00 PM »
ok, that's true.

I'm checking the Zip file, this will take another hour.

The zip file cannot be completely corrupted since I'm editing the orthomap and updating it. The error just appears when putting shapes at one or two spots on the map.

My question is, without loosing the editions of the orthomap, can I recreate the orthoretified images? In order to rewrite the (apparently) defect images inside the zip file?

Cheers

Patribus

  • Full Member
  • ***
  • Posts: 170
    • View Profile
Re: Error: can't read image
« Reply #10 on: May 09, 2016, 08:43:21 PM »
OK, the images.zip file has indeed an error somewhere.

To repeat my question above: is there a way to repair it? E.g. by ortho-rectifying the images again?

Cheers

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15282
    • View Profile
Re: Error: can't read image
« Reply #11 on: May 09, 2016, 10:02:28 PM »
Hello Patrick,

At the moment it is only possible to restart the orthorectification procedure again for all the images.
Before doing that I can suggest to remove corrupted images.zip file and make sure that there's sufficient disk space in the target folder.
Best regards,
Alexey Pasumansky,
Agisoft LLC

linda

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Error: can't read image
« Reply #12 on: May 31, 2016, 06:19:21 PM »
Hello there,
i have the same problem with building an orthomosaic:
 "the whole thing was processed (the second to last processing step stated 'Finished Processing' and right after that I got the error 'Error: can't read image: 157"

As i could find out the image paths are ok.
Where do I find the images.zip file?

Thanks for your help...
« Last Edit: May 31, 2016, 06:24:23 PM by linda »

linda

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Error: can't read image
« Reply #13 on: June 03, 2016, 05:01:48 PM »
Dear Forum,

did some testing on the Orthomosaic generation

With regard to my previous post, the images are acquired by a MicaSense. So in the general workflow I imported the images as multispectral images. Processed everything correctly untill the Orthomosaics - which failed with the given message -> can't read images XX

However, when imprting only one band per chunk (having five chunks at the end - each correspond to one channel of the MicaSense) then everything works fine.
In addition I noticed, that with the first method only a subset of the images is imported!

Any ideas on this?

Best regards ...

James

  • Hero Member
  • *****
  • Posts: 769
    • View Profile
Re: Error: can't read image
« Reply #14 on: May 04, 2017, 01:37:24 PM »
I'm getting this problem now.

I have a project with a few chunks, and am building orthomosaics in a batch process with a mesh surface.

The first failed with the error:
Code: [Select]
2017-05-04 10:28:34 Error: Can't read image: 407I have checked this corresponds to an image file which exists and is at least readable in windows photo viewer.

and the second failed with:
Code: [Select]
2017-05-04 11:19:31 Error: Can't open mask: 2994Don't know what mask it means? i haven't created any image masks.

In the .files folder there is no image.zip file or orthomosaic folder for either chunk (there was an orthomosaic folder and images.zip + tiles.tif files in at least the 2nd chunk while the orthomosaic was building but after it failed the 2nd one i cancelled the batch (13 chunks total) and there it was gone again.

Is there any way to check the integrity of the entire .files folder and image set to find what is missing/broken before i try this again? I've tried rebuilding the project from scratch and realigning images but still this is happening.

The project and source images are on a file server which i suspect may be at fault, but need ideas of what to look for get the IT guy involved! We have been working this way for a few months before this started happening this weekend.

Ideally these would be stored and processed locally, but the project overall involves tens of terabytes of source image data (each photoscan project contains 5,000-40,000 images, typically ~1000 per chunk, and i just want it to be over!)
« Last Edit: May 04, 2017, 01:39:23 PM by James »