Recommendations for optimizing accuracy and performance of automatic image registration?

113 views
Skip to first unread message

Thiago Sanna Freire Silva

unread,
Mar 21, 2017, 4:45:57 PM3/21/17
to RSGISLib Support
Hi all,

I have started to test the automatic registration algorithms of RSGISlib on RGB UAV imagery (~5cm pixel sizes).  I've tested a first run on a pair of images with 17137 by 17137 pixels, using the following:

#Set GCP extraction parameters
pixelGap
= 300
threshold
= 0.4
window
= 35
search
= 200
stddevRef
= 2
stddevFloat
= 2
subpixelresolution
= 4
metric
= imageregistration.METRIC_CORELATION
outputType
= imageregistration.TYPE_RSGIS_IMG2MAP
outGCPs
= floating[:-4]+"GCP.txt"
imageregistration
.basicregistration(reference, floating, pixelGap, threshold, window, search, stddevRef, stddevFloat, subpixelresolution, metric, outputType, outGCPs)

The errors were reduced from about 6m (euclidean distance) to 1m, but considering the actual resolution there is room for improvement. Also, the process took around 24h to complete on a i7-4500U with 8GB RAM, and the number of matching points was very high (3225 points).

If anyone has suggestions of which parameters to tune to improve accuracy and reduce processing time, I'd really appreciate it. I imagine that the ideal solution would be to have less GCPs, but with higher accuracies.  Also, not sure if  I should try "singlelayerregistration" instead of basicregistration.

Any help appreciated!

Thanks,

Thiago

--
Thiago Sanna Freire Silva
Professor Assistente Doutor

Ecosystem Dynamics Observatory
Departamento de Geografia
Instituto de Geociências e Ciência Exatas (IGCE)
Universidade Estadual Paulista (UNESP)
Rio Claro, SP - Brasil

Pete Bunting [pfb]

unread,
Mar 21, 2017, 7:14:42 PM3/21/17
to Thiago Sanna Freire Silva, RSGISLib Support
Hi Thiago,

One of the things I find makes the biggest difference to the quality of the registration is the method of transformation. What were you using the transform the image to the new location?

It will take time to process but I’d recommend trying a rubber sheet (thin plated splines) method:

rsgislib.imageregistration.warpUseGCPsWithGDAL(inRefImg, inProcessImg, outImg, gdalFormat, interpMethod, useTPS=True, usePoly=False, polyOrder=3, useMutliThread=True)

Quite often, if you need to use an automatic tie point generation processing, such as this in rsgislib, the transformation which you are trying to represent is not represented by a polynomial and therefore the images are still offset even if the tie points are correct. Therefore, an approach which warps the image so it aligns to each tie point and doesn’t assume an underlying model of the transformation is needed. I have found the TPS method within gdal good for this - the function above is using the gdal implementation. However, I have previously used a triangulation based method (rsgislib.imageregistration.triangularwarp) which also produced good results - although last time I tried to use it the command seemed to process for a huge amount of time but without producing a result so there is probably a bug there somewhere which I haven’t had time to track down… And, the TPS method in gdal is probably a better approach.

In terms of the parameters, that is a difficult question is many ways. The main things will be:

1. The size of the window around each tie point which is used for the image matching - larger window more robust match - less false positives. However, long processing time and need to be careful that there isn’t a transformation between the images within the size of the window.

2. The search radius (i.e. the number of pixels either side of the starting point which will be searched). Ideally, this wants to be as small as possible, reducing the processing time and false positives. However, it needs to be large enough that the correct answer can be found.

3. The ‘threshold’ is used to remove tie points where the best match between the images is below that threshold (i.e., correlation of 0.4). Increasing that threshold can help to remove incorrect matches.

4. stddevRef and stddevFloat - these parameters are used to define whether it is even worth searching for a solution for a particular window given the starting point. If 1 standard within the window is below the threshold then no match is attempted as there is not enough variation within the window to reliably match too. Increasing the threshold will focus tie points on areas with higher texture and therefore are more likely to find a matching point. However, bare in mind that the threshold is in the same units as the image data so might need changing (e.g., if data was in range 0-1 then std dev of 2 is never going to be reached).

Hope that helps. Let us know how you get on.

Best wishes,

Pete

****************************************************
* Dr Pete Bunting
* Reader in Remote Sensing
* Earth Observation and Ecosystem Dynamics Group
* Department of Geography and Earth Sciences
* Aberystwyth University
* Aberystwyth
* Ceredigion
* SY23 3DB
* UK
*
* Ph: +44 (0) 1970 622615
* Mob: +44 (0) 7917 842743
* Email: p...@aber.ac.uk
* ORCID: http://orcid.org/0000-0002-7435-0148
****************************************************
"Please consider the environment before printing this email or any documents attached”
> --
> You received this message because you are subscribed to the Google Groups "RSGISLib Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rsgislib-suppo...@googlegroups.com.
> To post to this group, send email to rsgislib...@googlegroups.com.
> Visit this group at https://groups.google.com/group/rsgislib-support.
> For more options, visit https://groups.google.com/d/optout.



--------------------------------------------------------------------
Un o’r 4 prifysgol uchaf yn y DU a’r orau yng Nghymru am fodlonrwydd myfyrwyr.
(Arolwg Cenedlaethol y Myfyrwyr 2016)
www.aber.ac.uk

Top 4 UK university and best in Wales for student satisfaction
(National Student Survey 2016)
www.aber.ac.uk

Thiago Sanna Freire Silva

unread,
Mar 22, 2017, 7:11:02 AM3/22/17
to RSGISLib Support, tsca...@gmail.com, p...@aber.ac.uk
Hi Pete,

Thanks much, this is great! I used a 3rd degree polynomial.

Off to testing new parameters!

Cheers,

Thiago
Reply all
Reply to author
Forward
0 new messages