Image registration plug-in

Description

In MW4 we had a plug-in that could register your image, i.e. create the world file.
First you opened a shapefile in the right projection.
Next you open the image, which was opened at 0,0.
Next you click on a location in the shapefile and secondly click on the same location on the image. When a few points we clicked (I believe a minimum of 3) the image was warped used the coordinates and reloaded. By now the image was close to the shapefile.
Now the user could add more points making the world file even more precise.

For MW5 I think we can use GCPsToGeoTransform as explained here: http://lists.osgeo.org/pipermail/gdal-dev/2015-November/043107.html

For the user experience it would be good if the image with no world file would be loaded in the current view instead of at 0,0. Then he doesn't needs to switch between and zoom to the layers all the time.

Activity

Show:
Sergei Leschinsky
November 28, 2015, 9:10 AM

I've moved it to a separate plugin project. Perhaps it may better serve as an example in such way. I also added it to the Tools menu like suggested. It's still present in toolbox though. I see no problem with that.

Paul Meems
November 27, 2015, 9:32 PM

I just had a quick look. Because the tool opens a complete new dialog it is better to have it as a plug-in instead of a tool in the toolbox.
In the Tools menu an item called 'Image registration' could be added to open the dialog. But this is just cosmetic.

I'll try to look for some unreferenced image files and properly test this great tool/plug-in.

Sergei Leschinsky
November 27, 2015, 12:24 PM

The tool has been committed. Currently it's in MW5.Plugins.Toolbox project (can be moved to a separate plugin if needed). The functioning depends on format:

  • bmp - not supported (we don't use GDAL for them and therefore can't set rotation coefficients);

  • tif - transformation coefficients will be written directly to the file (GDAL's SetGeoTranform);

  • other GDAL formats: world file with "w" postifx will be created.
    Perhaps other formats can use GDAL's SetGeoTranform as well. Testing is needed. For some reason it didn't work for me with png format.
    Projection of the project will be assigned to the raster, since transformation coefficients are relevant only for chosen the projection.

Paul Meems
November 19, 2015, 1:35 PM

Great. Please add it when you have the time. I scheduled it for v5.0.4.
Perhaps it is better to work on the v5.0.3 issues first.

Sergei Leschinsky
November 19, 2015, 1:29 PM

In fact I have my own image registration tool. It consists of a dialog with 2 map controls. There are data layers & tiles in one, and image to be registered in other. User needs to choose matching points on both maps. Transformation coefficients are calculated with least squares method on each step and the standard error and deviations for each point are displayed. It's less than 1000 lines of code, so would be quite fast to port to MW5.

Done

Assignee

Sergei Leschinsky

Reporter

Paul Meems

Labels

Fix versions

Priority

Medium