[Qgis-user] Unexpected change in pixel values during processing (Metashape/QGIS)

Stulgies Dirk d.stulgies at npz-innovation.de
Thu Oct 5 01:10:14 PDT 2023


# Unexpected change in pixel values during processing (Metashape/QGIS)
## Software
* QGIS 3.28
* Agisoft Metashape 2.0.1

## Description
I used Agisoft Metashape to create RGB GeoTiff. The source for this GeoTiff are images taken with a UAV (DJI M3M).

When loading the GeoTiff into QGIS and processing the file, the pixel values for the same position differ between the original file and the process result.

My first thought was that I somehow resampled, converted, or transformed the pixel values during the processing.
So I simplified the process step by step to the bare minimum, but the result stayed the same.
Even just exporting the file leads to changed pixel values.

## CRS not recognized
Something I noticed while trying to solve this problem is that QGIS doesn't recognize the GeoTiffs CRS (EPSG:32632) as a predefined CRS but as a custom CRS. This is curious because I use a predefined CRS from Agisoft Metashape to create the GeoTiff.

I tried to reproject the file and also to just change the CRS in the file's QGIS properties, but the pixel values still differ after processing the file.

### CRS defined in Agisoft Metashape:
```
Projected Coordinate System: WGS 84 / UTM zone 32N (EPSG::32632)
Linear Units: metre (EPSG::9001)
Projection Method: Transverse Mercator
    Latitude of natural origin: 0
    Longitude of natural origin: 9
    Scale factor at natural origin: 0.9996
    False easting: 500000
    False northing: 0
Geographic Coordinate System: WGS 84 (EPSG::4326)
Angular Units: degree (EPSG::9102)
Geodetic Datum: World Geodetic System 1984 ensemble (EPSG::6326)
Ellipsoid: WGS 84 (EPSG::7030)
Prime Meridian: Greenwich (EPSG::8901)
```

### CRS regognized in QGIS:

```
BOUNDCRS[
                SOURCECRS[
                               PROJCRS[
                                               "WGS 84 / UTM zone 32N",
                                               BASEGEOGCRS[
                                                               "WGS 84",
                                                               DATUM[
                                                                               "World Geodetic System 1984",
                                                                               ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]]
                                                               ],
                                                               PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],
                                                               ID["EPSG",4326]
                                               ],
                                               CONVERSION[
                                                               "UTM zone 32N",
                                                               METHOD["Transverse Mercator",ID["EPSG",9807]],
                                                               PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],
                                                               PARAMETER["Longitude of natural origin",9,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],
                                                               PARAMETER["Scale factor at natural origin",0.9996,SCALEUNIT["unity",1],ID["EPSG",8805]],
                                                               PARAMETER["False easting",500000,LENGTHUNIT["metre",1],ID["EPSG",8806]],
                                                               PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]
                                               ],
                                               CS[Cartesian,2],
                                               AXIS["easting",east,ORDER[1],LENGTHUNIT["metre",1]],
                                               AXIS["northing",north,ORDER[2],LENGTHUNIT["metre",1]],
                                               ID["EPSG",32632]
                               ]
                ],
                TARGETCRS[
                               GEOGCRS[
                                               "WGS 84",
                                               DATUM[
                                                               "World Geodetic System 1984",
                                                               ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]]
                                               ],
                                               PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],
                                               CS[ellipsoidal,2],
                                               AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],
                                               AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],
                                               ID["EPSG",4326]
                               ]
                ],
                ABRIDGEDTRANSFORMATION[
                               "Transformation from WGS 84 to WGS84",
                               METHOD["Position Vector transformation (geog2D domain)",ID["EPSG",9606]],
                               PARAMETER["X-axis translation",0,ID["EPSG",8605]],
                               PARAMETER["Y-axis translation",0,ID["EPSG",8606]],
                               PARAMETER["Z-axis translation",0,ID["EPSG",8607]],
                               PARAMETER["X-axis rotation",0,ID["EPSG",8608]],
                               PARAMETER["Y-axis rotation",0,ID["EPSG",8609]],
                               PARAMETER["Z-axis rotation",0,ID["EPSG",8610]],
                               PARAMETER["Scale difference",1,ID["EPSG",8611]]
                ]
]
```

## Question
The questions I have are:
1. What could be the reason for this behavior?
2. How do I prevent the pixel values from changing?

Kind regards,

i.A. Dirk Stulgies
**********************************
[cid:image001.png at 01D9F773.F2644EA0]

NPZ Innovation GmbH
Hohenlieth-Hof, D-24363 Holtsee
Tel.        +49-4351-736 277 <tel:%2B49-4351-736%20277>
Fax         +49-4351-736 271<tel:%2B49-4351-736%20271>
Mail:      d.stulgies at npz-innovation.de<mailto:d.stulgies at npz-innovation.de>
Web:     www.npz-innovation.de<http://www.npz-innovation.de/>

Firmensitz Hohenlieth, Holtsee
Amtsgericht Kiel, HRB 15342 Kl
Geschäftsführer: Dr. Gunhild Leckband, Thorsten Pommer


________________________________
This email was scanned by Bitdefender
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20231005/70458e9c/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 6168 bytes
Desc: image001.png
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20231005/70458e9c/attachment.png>


More information about the QGIS-User mailing list