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

Stulgies Dirk d.stulgies at npz-innovation.de
Thu Oct 5 04:30:03 PDT 2023


Hello Johannes,
I added the GDAL information for both files as an attachment. My steps for creating the exported file were:

  1.  Open GeoTiff with QGIS.
  2.  Right-click on the layer of this GeoTiff.
  3.  Choose the option “Export -> Save As...".
  4.  Options:
     *   Output mode: raw data
     *   Format: GeoTiff
     *   CRS: The same as the original file.
     *   Extent: Taken from the current layer.
     *   Resolution: taken from the current layer.
     *   Create Options: Disabled
     *   Pyramids: Disabled

Kind regards,

i.A. Dirk Stulgies
**********************************
[cid:image001.png at 01D9F78E.97AEC3D0]

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

Von: Johannes Kröger (WhereGroup) <johannes.kroeger at wheregroup.com>
Gesendet: Donnerstag, 5. Oktober 2023 11:57
An: Stulgies Dirk <d.stulgies at npz-innovation.de>; qgis-user at lists.osgeo.org
Betreff: Re: [Qgis-user] Unexpected change in pixel values during processing (Metashape/QGIS)

ACHTUNG: Diese E-Mail stammt von außerhalb der NPZ. Klicken sie auf keine Links und öffnen sie keine Anhänge außer sie erwarten diese und sie sind sich sicher, dass der Inhalt ungefährlich ist.


Hi Dirk,

there is no such thing as "just exporting". What exactly do you do? What does gdalinfo say about the original file and the exported file?

Cheers, Hannes
Am 05.10.23 um 10:10 schrieb Stulgies Dirk via QGIS-User:
# 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 01D9F78E.97AEC3D0]

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


_______________________________________________

QGIS-User mailing list

QGIS-User at lists.osgeo.org<mailto:QGIS-User at lists.osgeo.org>

List info: https://lists.osgeo.org/mailman/listinfo/qgis-user

Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

--

Johannes Kröger / GIS-Entwickler/-Berater



---------------------------------------------

Aufwind durch Wissen!

Web-Seminare und Online-Schulungen

bei der www.foss-academy.com<http://www.foss-academy.com>

---------------------------------------------



WhereGroup GmbH

c/o KK03 GmbH

Lange Reihe 29

20099 Hamburg

Germany



Tel: +49 (0)228 / 90 90 38 - 36

Fax: +49 (0)228 / 90 90 38 - 11



johannes.kroeger at wheregroup.com<mailto:johannes.kroeger at wheregroup.com>

www.wheregroup.com<http://www.wheregroup.com>

Geschäftsführer:

Olaf Knopp, Peter Stamm

Amtsgericht Bonn, HRB 9885

-------------------------------

________________________________
This email was scanned by Bitdefender
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20231005/457cf57b/attachment-0001.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/457cf57b/attachment-0001.png>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20231005/457cf57b/attachment-0002.html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20231005/457cf57b/attachment-0003.html>


More information about the QGIS-User mailing list