3

I'm attempting to take 3 single bands (NIR, Red, and Green) and turn them into a single multiband tif image.

Someone working on the images was able to take this image which I merged...

enter image description here

And then using QGIS remove the transparency bands and turn it into this image...

enter image description here

Unfortuantely, the person that was able to complete this is not able to help us get to the final product, so I've been trying to find out how to merge single bands into the final product and have it come our looking like a normal CIR image.

I have each band processed separately without the transparency (using Pix4D) and have tried merging those, but still continue to get an image that looks nothing like the second image above. I need to be able to get these single bands into the multiband in NRG order.

EDIT: I followed Lukes advice below and did the following:

Raster -> Miscellaneous -> Build Virtual Raster, used visible raster layers (to make sure they were in order with NIR at top of layers, then Red, then Green.) Then set the output file and used separate to make sure the layers would stay as separate bands.

When I hit Ok, this error came up.

enter image description here

Pretty sure that was unrelated, but then the final image it created looked like this:

enter image description here

Then I did this path:

Raster menu -> Conversion -> Translate (Convert Format)...

Which was set up like this:

enter image description here

Then when I hit Ok, it came up with an image that looks like this: (The error didn't happen this time. Sweet!)

enter image description here

Still don't understand why my image looks so different from the one he created. I'm testing the upload now.

EDIT 2:

Here are the properties for the correct image that the other guy was able to create :

enter image description here

And here are the properties to my image after I've made it:

enter image description here

Why do my properties have a "Gray" Band at the top? Each of them should be coming through as color bands since it's NIR, Red, and Green, right?

EDIT 3 : Here is the txt of the VRT that I've created with my single bands.

<VRTDataset rasterXSize="2720" rasterYSize="2592">
  <SRS>PROJCS["WGS 84 / UTM zone 11N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","32611"]]</SRS>
  <GeoTransform> 3.5246044199000002e+005, 4.3333333333333335e-001, 0.0000000000000000e+000, 5.1834971052700002e+006, 0.0000000000000000e+000,-4.3333333333333335e-001</GeoTransform>
  <VRTRasterBand dataType="UInt16" band="1">
    <NoDataValue>-10000</NoDataValue>
    <ComplexSource>
      <SourceFilename relativeToVRT="0">A:/UpAngle eBee Flights/Crop Production Services/9.13.16 CPS Connell Johnson/Sequioa Images/Single Band Try/Merged 30cm/NO transparency/cps 6-14 nir_mosaic_nir.tif</SourceFilename>
      <SourceBand>1</SourceBand>
      <SourceProperties RasterXSize="3756" RasterYSize="3711" DataType="UInt16" BlockXSize="256" BlockYSize="256" />
      <SrcRect xOff="0" yOff="0" xSize="3756" ySize="3711" />
      <DstRect xOff="8.91590769237015" yOff="0" xSize="2600.30769230769" ySize="2569.15384615385" />
      <NODATA>-10000</NODATA>
    </ComplexSource>
  </VRTRasterBand>
  <VRTRasterBand dataType="UInt16" band="2">
    <NoDataValue>-10000</NoDataValue>
    <ComplexSource>
      <SourceFilename relativeToVRT="0">A:/UpAngle eBee Flights/Crop Production Services/9.13.16 CPS Connell Johnson/Sequioa Images/Single Band Try/Merged 30cm/NO transparency/cps 6-14 red_mosaic_red.tif</SourceFilename>
      <SourceBand>1</SourceBand>
      <SourceProperties RasterXSize="2357" RasterYSize="2239" DataType="UInt16" BlockXSize="256" BlockYSize="256" />
      <SrcRect xOff="0" yOff="0" xSize="2357" ySize="2239" />
      <DstRect xOff="0" yOff="8.97618461543551" xSize="2719.61538461538" ySize="2583.46153846154" />
      <NODATA>-10000</NODATA>
    </ComplexSource>
  </VRTRasterBand>
  <VRTRasterBand dataType="UInt16" band="3">
    <NoDataValue>-10000</NoDataValue>
    <ComplexSource>
      <SourceFilename relativeToVRT="0">A:/UpAngle eBee Flights/Crop Production Services/9.13.16 CPS Connell Johnson/Sequioa Images/Single Band Try/Merged 30cm/NO transparency/cps 6-14 green_mosaic_green.tif</SourceFilename>
      <SourceBand>1</SourceBand>
      <SourceProperties RasterXSize="2338" RasterYSize="2204" DataType="UInt16" BlockXSize="256" BlockYSize="256" />
      <SrcRect xOff="0" yOff="0" xSize="2338" ySize="2204" />
      <DstRect xOff="0.423092307666173" yOff="17.198976921634" xSize="2697.69230769231" ySize="2543.07692307692" />
      <NODATA>-10000</NODATA>
    </ComplexSource>
  </VRTRasterBand>
</VRTDataset>
  • The QCheckBox error is unrelated. I can get a similar looking output if I have the bands in the wrong order. Make sure you are certain you know which bands are which... Sometimes I get data from suppliers in RGBN order and sometimes in BGRN. – user2856 Oct 25 '16 at 1:34
  • In this case, I'm flying the Parrot Sequioa, which outputs each band separately after processed in Pix4D. Each band is outputted into it's own .tif which is what I'm using to build this multiband image for the client. That's the only reason I'm sure that the bands are correct. I'm going to try the different band orderings and see if that looks differently. – Bryan Monarch Oct 25 '16 at 3:31
  • No problem, posted above. – Bryan Monarch Oct 25 '16 at 9:13
  • Your nodata values look odd as the data type of the rasters is UInt16 (unsigned integer). – user2856 Oct 25 '16 at 9:23
  • Is there a way that I can fix that? – Bryan Monarch Oct 25 '16 at 21:56
2

In QGIS:

  • Raster menu -> Miscellaneous -> Build Virtual Raster (Catalog)...
  • Ensure the "Separate" option is ticked so each raster is put into a separate band
  • Raster menu -> Conversion -> Translate (Convert Format)...
  • Output to GeoTIFF

Command-line GDAL:

  • gdalbuildvrt -separate NRG.vrt NIR.tif RED.tif GREEN.tif
  • gdal_translate NRG.vrt NRG.tif

Note there are a few other options you could play around with, to set nodata values, compress the output, define projection etc.

Here's some screenshots. Note: output VRT and tif look the same as the original RGB tif. Also note that the order of the input rasters is important when building the VRT.

enter image description here enter image description here enter image description here enter image description here

  • Unfortunately, when I tried to do the Translation, it won't work with multiple band images. Throws an error up and won't complete it. Also, the image still is very colorful and layed, nothing like the final image that he completed. – Bryan Monarch Oct 25 '16 at 0:39
  • @BryanMonarch - works for me. Edit your question and specify exactly what you did and what the error message was. – user2856 Oct 25 '16 at 0:44
  • I added some more edits. Still can't get what I need to happen and I'm unsure what the Gray value is. – Bryan Monarch Oct 25 '16 at 3:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.