Forum

Author Topic: Image bands being split into single cameras even with Metashape.MultiplaneLayout  (Read 5136 times)

Deepvision

  • Newbie
  • *
  • Posts: 21
    • View Profile
Hey,

So I have a set of .tif images that have 6 bands. The bands are however laystacked into one singlular .tif file.

Code: [Select]
chunk.addPhotos(["./Mcaw/TCR00010.TIF"])
So as usual I give in the path of the image file to the function addPhotos(), but instead of loading all bands into a singular camera, I get all bands split into their own individual cameras. These cameras then have the names:

 <Camera 'TCR00010'>,
 <Camera 'TCR00010 [2]'>,
 <Camera 'TCR00010 [3]'>,
 <Camera 'TCR00010 [4]'>,
 <Camera 'TCR00010 [5]'>,
 <Camera 'TCR00010 [6]'>

However, I want all bands within a single camera here. I also tried to add the MultiplaneLayout argument but this didn't change anything.

Code: [Select]
chunk.addPhotos(["./Mcaw/TCR00010.TIF"],  Metashape.MultiplaneLayout)
I have tried a more long winded approach with:

Code: [Select]
chunk.addCamera()
chunk.cameras[0].open("./Mcaw/TCR00005.TIF")

But this also doesn't work, it just loads the first band of the file.

Code: [Select]
print(chunk.cameras[0].photo.image().cn)
1

I have other images from a Sony camera which are in .png format and this problem does not happen there. In the case of the Sony images I give the path to the .png file and the addPhotos() function loads the image as a 3-band image within a single camera.

Any idea how I can fix this?

Thanks,
Sven

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15472
    • View Profile
Hello Sven,

How these TIFF files are stored? If they are multi-page TIFFs instead of multi-channel / multi-layer TIFF, then you cannot add them as cameras with 6 bands. Only multi-camera system approach would work (and MultiPlaneLayout serves for this matter).

So if all the bands are perfectly aligned, the TIFF file should not be stored in multi-page representation.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Deepvision

  • Newbie
  • *
  • Posts: 21
    • View Profile
Hey Alexey,

Thanks for the information. I looked on the website of the camera and the files are indeed mutli-page tiffs. The website says that alignment is performed "in the camera". As you said they should not be stored in multi-page format if they are aligned then should I try to convert them into a different format?

Thanks,
Sven

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15472
    • View Profile
Hello Sven,

According to my experience there was PixelWrench tool that allows for processing RAW TetraCam data into various outputs.

However, I'm not quite familiar with the latest TetraCam products. Maybe the sensors in the camera system are not accurately aligned and therefore it is not possible to get multilayer TIFF as a stack of the bands which perfectly fit each other.
I've just took a look on some manuals and it seems that now it is only possible to get multi-page TIFF or TIFFs separated by individual bands.

If PixelWrench doesn't support multilayer (6-band) TIFF creation, you may need to use some external tools like ImageMagic or GDAL tools to prepare proper input data for Metashape. Otherwise you should use multi-camera system approach. (or process single band data and then just substitute the images to create single-band orthomosaic for each image subset).
Best regards,
Alexey Pasumansky,
Agisoft LLC