Forum

Author Topic: Identifying bands from multispectral images in folder structure  (Read 7692 times)

roberto

  • Guest
Identifying bands from multispectral images in folder structure
« on: December 20, 2017, 12:48:09 AM »
I've imported multispectral images using the folder structure following the instruction from section "To create a chunk from multifolder layout" in document www.agisoft.com/pdf/photoscan-pro_1_3_en.pdf

It works perfectly, except that I can't find a way to identify output bands. I imported a folder containing 5 folders names: "blue", "green", "red", "rededge" and "nir", but Photoscan produces a Band 1, Band 2, Band 3, Band 4, Band 5 structure when I export a GeoTIFF and I don't know the correspondence between my folders and the band numbers.

Thanks!

selimerguden

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Identifying bands from multispectral images in folder structure
« Reply #1 on: December 21, 2017, 07:31:53 PM »
Hey Robert,

I am guessing you are using the MicaSense Red Edge camera since it has 5 bands. Are you trying to export the reflectance maps manually or are you using a script to export them? If you are not specifying individual bands while exporting, it would export the RGB output as default. You need to specify each bands separately if you want 5 different reflectance outputs, it would correspond to Band 1, Band 2, Band 3, Band 4 and Band 5.   

It would be something like this for the Band 2 and similar for the other bands as well:
chunk.raster_transform.formula = ["(B2)"]
chunk.raster_transform.calibrateRange()
chunk.exportOrthomosaic("Path"mosaic_.tif", image_format = PhotoScan.ImageFormatTIFF, raster_transform = PhotoScan.RasterTransformValue, write_world=True, write_alpha=False, tiff_big=False, white_background=True)

Or alternatively you can do it manually by using the Raster Calculator and specify each band then export and repeat it for each band. Just type B1 under Output Bands then hit apply and export and do it for the other bands as well.
I have spend a lot of time trying to figure that out but it seems to be working now. Please let me know if you need more info. FYI what version of Agisoft Photoscan are you using?
 

roberto

  • Guest
Re: Identifying bands from multispectral images in folder structure
« Reply #2 on: December 22, 2017, 05:25:22 AM »
Thanks for the answer =)!
I'm in fact using the Micasense Rededge camera. Photoscan version: 1.3.2.

Everything you said should work fine, but let me rephrase my problem.

Once I export the GeoTiff with the default options, the output is a single file with the 5 bands in it (so far so good). If I use visualize it using QGIS or a similar software I can see the 5 bands, but I don't know if "Band 1" is blue, green, red, rededge or NIR (I had to manually find the RGB order to get the correct visualization colors). Photoscan also uses the B1 to B5 notation, so what I want to do is figure out which band is which color.

Since I used a custom script to transform the raw camera images to reflectance images (and some exif data lost in the way), I had to use the folder structure to create the multispectral cameras in Photoscan (Worflow menu -> Add folder -> I select a folder containing 5 folders named "blue", "green", "red", "rededge", "nir"). The result is correctly created cameras, but can't find the correspondence between original folder name and band number assigned in Photoscan.

selimerguden

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Identifying bands from multispectral images in folder structure
« Reply #3 on: December 22, 2017, 04:58:42 PM »
Hey Robert,

The easiest way to to verify  if "Band 1" is blue, green, red, rededge or NIR would be using the Raster Calculator in Agisoft Photoscan. The bands should correspond to whatever the output mosaic is. Please take a look at the image that I have attached. 


roberto

  • Guest
Re: Identifying bands from multispectral images in folder structure
« Reply #4 on: December 22, 2017, 07:10:34 PM »
That is exactly what I need! But my Raster Calculator window does not display the band color (maybe because of what I said previously about the exif data). I've attached a screenshot of it.


Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15124
    • View Profile
Re: Identifying bands from multispectral images in folder structure
« Reply #5 on: December 22, 2017, 10:10:10 PM »
Hello robertomstocker,

PhotoScan is reading the following information from the image XMP meta-data for MicaSense cameras:

CentralWavelength
BandName
WavelengthFWHM
RigName
RigCameraIndex

If you have lost all the EXIF information, then the order of bands in PhotoScan will be identical to alphabetic order of the individual folders in the "master folder". So if you name them 1-RED, 2-GREEN, 3-BLUE, 4-NIR, 5-REDEDGE, then you will know the order of the bands in the stitched orthomosaic.
Best regards,
Alexey Pasumansky,
Agisoft LLC

roberto

  • Guest
Re: Identifying bands from multispectral images in folder structure
« Reply #6 on: December 23, 2017, 04:21:45 AM »
Perfect! Thanks a lot Alexey!