Forum

Author Topic: Bit Depth Not Recognized  (Read 3762 times)

wojtek

  • Sr. Member
  • ****
  • Posts: 284
    • View Profile
Bit Depth Not Recognized
« on: August 07, 2023, 11:31:36 AM »
I reported this bug to support a couple months ago but crickets so I'm reposting:

When changing image paths bit depth is not updated, sometimes it gets completely stuck, sometimes you can reset it by using Check Paths command. This was not an issue pre version 2.


Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14968
    • View Profile
Re: Bit Depth Not Recognized
« Reply #1 on: August 08, 2023, 12:20:13 PM »
Hello wojtek,

What code lines you are using to change paths from 8 bit to 16 bit images?
Best regards,
Alexey Pasumansky,
Agisoft LLC

wojtek

  • Sr. Member
  • ****
  • Posts: 284
    • View Profile
Re: Bit Depth Not Recognized
« Reply #2 on: August 10, 2023, 01:30:36 PM »
Code: [Select]
   
 for camera in chunk.cameras:
       
        path = camera.photo.path
        new_path = path.replace('JPEG', 'TIFF16')
        new_path = new_path.replace('.JPG', '.TIF')
       
        photo = camera.photo.copy()
        photo.path = new_path
        camera.photo = photo

Like I said, this has caused no issues in previous versions.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14968
    • View Profile
Re: Bit Depth Not Recognized
« Reply #3 on: August 15, 2023, 03:44:02 PM »
Hello wojtek,

You may need to add datatype assignment to the sensor:

Code: [Select]
DATATYPES =  {"U8": Metashape.DataType8u, "U16": Metashape.DataType16u, "U32": Metashape.DataType32u, "F16": Metashape.DataType16f, "F32": Metashape.DataType32f, "F64": Metashape.DataType64f}

   sensor = camera.sensor
   sensor.bands = ['' for i in range(photo.image().cn)]
   dt = photo.image().data_type
   if dt in DATATYPES.keys():
      sensor.data_type = DATATYPES[dt]
Best regards,
Alexey Pasumansky,
Agisoft LLC