3

Is there a method to calculate the RMSE between 2 raster layers in QGIS?

I have 2 point cloud files, 1 edited and the other not. After triangulation of each layer I have obtained 2 raster files.

I would like to find the RMSE in terms of their vertical height diff..

Is it possible to subtract one raster from the other and form a new raster and from export and calculate the RMSE in excel based on the z value?

  • If you're willing to switch to GRASS GIS, then there is the module r.regression.line to get the full set of linear regression coordinates between two rasters. This module is available in the Processing framework. – Micha Feb 18 at 10:39
3

WhiteBoxTools has RootMeanSquareError tool. QGIS 3.x can access WBT through WhiteBox for Processing plugin. Definitely worth a try.

Unfortunately this RootMeanSquareError tool did not work for me when I tested it in my environment (QGIS 3.4.4 on Windows10). So let me suggest another approach, using R through Processing R Provider plugin.

You will need to install R and Processing R Provider plugin, but its setup is really easy.

Then click on big R icon on top of the Processing Toolbox panel, to activate Create New R Script.

In the blank window, please copy and paste texts below:

##Raster Analysis=group
##Input_Raster= raster
##Base_Raster= raster
##Raster_Statistics= output table

delta <- (Input_Raster - Base_Raster)^2
RMSE <- sqrt(cellStats(delta, 'mean'))

Result <- data.frame(rbind(RMSE), row.names= c("RMSE"))
colnames(Result) <- c("Stats")
Raster_Statistics <- Result

enter image description here

If you click on green triangle icon (Run Script) you will get a new window. Assign each of your raster layer to Input Raster and Base Raster and run the tool.

enter image description here

It will add a new table layer Raster statistics with the calculated RMSE. Open its attribute table to see the result.

enter image description here

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.