Opened 14 years ago

Last modified 13 years ago

#2987 assigned patch

Auto GCP detection library

Reported by: jamesm6162 Owned by: timlinux
Priority: minor: annoyance Milestone: Version 1.7.0
Component: C++ Plugins Version: Trunk
Keywords: Cc:
Must Fix for Release: No Platform: Debian
Platform Version: Awaiting user input: no

Description

This is the patch for including the Auto GCP detection (AutoGCP) C++ library into the main QGIS build.

This library is required by the AutoGCP python plugin hosted at http://pyqgis.org/repo/contributed

The library facilitates the automated detection of Ground Control Points from a reference image and the cross-correlation of these points on a corresponding raw image.

The AutoGCP library is currently still being developed with plans to include Ortho-rectification functionality in the near future.

Currently the library installs parallel to the core, analysis etc. modules.

If experience any problems with the library/plugin, or have any suggestions (would really be appreciated), feel free to contact us at foxhat.solutions@…

Attachments (3)

autogcp.patch (219.4 KB ) - added by jamesm6162 14 years ago.
Patch file to add AutoGCP library to QGIS. Execute from root sources (qgis/) directory
autogcp.12.10.10.patch.tar.gz (74.2 KB ) - added by jamesm6162 14 years ago.
New patch for the autogcp class library. The next patch will integrate into analysis module.
autogcp_patch_0.5.tar.gz (91.1 KB ) - added by jamesm6162 13 years ago.
Latest AutoGCP patch

Download all attachments as: .zip

Change History (21)

by jamesm6162, 14 years ago

Attachment: autogcp.patch added

Patch file to add AutoGCP library to QGIS. Execute from root sources (qgis/) directory

comment:1 by lutra, 14 years ago

Type: enhancementpatch

comment:2 by jamesm6162, 14 years ago

The E-Mail is foxhat.solutions (at) gmail.com

comment:3 by timlinux, 14 years ago

Status: newassigned

Thanks for the patch guys - compiling it now!

Regards

Tim

comment:4 by timlinux, 14 years ago

Hi James

I have some initial feedback for you bulleted out below. My comments relate more to the code and ui style at the moment and not on the quality of algorithm implementation etc.

First impressions: UI: You have done a great job with the user interface, nice and cleanly done (more comments on if follow below.

First impressions: Patch: The patch applied cleanly and I was able to compile your code with no issues.

Patch: I see your patch removes lines 38 - 40 of python/CMakeLists.txt - was this intentional?

Patch: I think your (c++) code would be better placed under src/analysis and become part of the QGIS analysis library. Our intention is to build out this library with analytical routines and keep the core and gui libs limited to dealing with basic file io, geometry handling, symbolisation etc.

UI: The Auto GCP menu entry is spelled incorrectly (exctration)

UI: When I first started the agcp plugin, I was prompted for a CRS - however there is no way to return to that dialog (that I can see) after closing it.

UI: The icons (while nice) are inconsistent with QGIS icons. QGIS has a theming infrastructure which you can make use of or to hedge your bets, use icons from or in keeping with the 'GIS' theme since that will most likely become the official icon theme at some point in the near future.

UI: For the map toolbars, a 'zoom to all' icon would be nice.

UI: The first 3 items under the settings menu probably belong better under the 'View' menu.

Code: Please take a look at the QGIS coding convention docs (supplied as text document 'CODING' at the root of the QGIS source tree. Take care of indentation (2 spaces) and other such mundane stuff since the code wont be accepted into trunk without it. There are tools to automatically format your code in a compliant way under the scripts dir (scripts/astyle.sh). Check with the mailing list if you need help on using it.

Documentation: Also take care to add doxygen comments describing each public method as can be seen in the other parts of core.

Documentation: Each C++ source should also get an \ingroup directive (see CODING once again). Assuming your code lands up in analysis lib it would be something like this:

/** \ingroup analysis
 * The QGis class provides vector geometry analysis functions
 */

UI: Import existing GCP's currently does nothing.

UI: It would be nice to apply the GCPs to the image to carry out a basic georeferencing (easily achieved with a shell call to gdal even) until such time as you have written your orthorectification stuff (if that is in scope of your project).

UI: Make use of a qprogressbar to show progress. If the progress is non-deterministic, qprogressbar has an option to simply bounce the cursor up & down while you are waiting.

UI: Similar to above, set the cursor to an hour glass.

These are all mainly housekeeping comments. I was able to generate a few simple autgcp runs with the tool using e.g. pan and ms bands from a spot image. I still need to do further testing.

Can you supply me with all your names so that I can credit you - I want to write a blog article highlighting your work which will hopefully generate more comments and interest (I think many people dont even realise that such a thing as Automated GCP collection exists!).

Keep up the good work!

Regards

Tim

in reply to:  4 comment:5 by jamesm6162, 14 years ago

Replying to timlinux:

Hi Tim

Thanks a lot for the feedback. We are looking into your suggestions and comments.

Regarding the python/CMakeLists.txt, no I think the removal is an error caused by ours still being made from a previous version of the CMakeLists.txt. I am assuming those lines were added during the past 5 months?

Then as for the Coding Guidelines, we are aware of it and its on our to-do list.

We are working on the orthorectification at the moment, so we will probably be able to add that to the next patch, along with all the fixes you mentioned.

I will keep you updated.

comment:6 by timlinux, 14 years ago

A couple more comments:

  • please remember the last used directory so opening rasters doesnt require so much navigation through the file system
  • for the selection of CRS, please follow the 'principle of least surprise' and use the existing one in QGIS - its available via the python api too.
  • the processing seems to write temporary files into the image directory - it would probably be neater to use the system /tmp directory - Qt will give you in a cross platform manner - see QString QDir::tempPath ()
  • On further testing I am getting a crash - see stack trace below:

Crash:

[Thread 0x7fffbffff710 (LWP 9076) exited]
Debug: QgsProjectionManager::setProjectionInformation - Could not find specified projections.
Debug: qgsautogcpmanager.cpp: (QgsAutoGCPManager::extractControlPoints()) Starting Control Point Extraction
Debug: Analyzer Starting GCP extraction
Debug: Levels: 5
Features detected: 103132
Debug: Dividing image into 7 X 7 grids
Debug: Extracting GCP Chips
Debug: Analyzer Starting GCP extraction
Debug: Levels: 5
Features detected: 55788
Debug: Dividing image into 1001 X 1001 grids
Debug: Extracting GCP Chips

Program received signal SIGSEGV, Segmentation fault.
0x00007fffd3731d96 in QList<QgsGCP*>::detach (this=0x19ebc580) at /usr/include/qt4/QtCore/qlist.h:122
122	    inline void detach() { if (d->ref != 1) detach_helper(); }
(gdb) bt
#0  0x00007fffd3731d96 in QList<QgsGCP*>::detach (this=0x19ebc580) at /usr/include/qt4/QtCore/qlist.h:122
#1  0x00007fffd3731947 in QList<QgsGCP*>::append (this=0x19ebc580, t=@0x12859818) at /usr/include/qt4/QtCore/qlist.h:468
#2  0x00007fffd350fbc1 in QList<QgsGCP*>::push_back (this=0x19ebc580, t=@0x12859818) at /usr/include/qt4/QtCore/qlist.h:277
#3  0x00007fffd350f048 in QgsImageAnalyzer::QgsGrid::fillGrid (this=0x102ba660, gcpSet=0x4294010) at /home/timlinux/dev/cpp/qgis/src/autogcp/qgsimageanalyzer.cpp:505
#4  0x00007fffd350d4fd in QgsImageAnalyzer::matchGcps (this=0x10c8fb0, gcpSet=0x490f990) at /home/timlinux/dev/cpp/qgis/src/autogcp/qgsimageanalyzer.cpp:121
#5  0x00007fffd3507502 in QgsAutoGCPManager::matchControlPoints (this=0x4c0d710) at /home/timlinux/dev/cpp/qgis/src/autogcp/qgsautogcpmanager.cpp:119
#6  0x00007fffd373b022 in meth_QgsAutoGCPManager_matchControlPoints (sipSelf=<QgsAutoGCPManager at remote 0x4302c88>, sipArgs=()) at sipautogcppart3.cpp:1281
#7  0x00007fffd67fc030 in call_function (f=
    Frame 0x7b1afd0, for file /home/timlinux/.qgis/python/plugins/autogcp/autogcpguibase.py, line 1010, in matchGcps (self=<Ui_MainWindow(dockWidgetContents_2=<QWidget at remote 0x42fca68>, dockWidgetContents_3=<QWidget at remote 0x4301160>, rawMapCanvas=<QgsMapCanvas at remote 0x4301380>, gcpRawHighlight=[], actionTest1=<QAction at remote 0x4302738>, menuSettings=<QMenu at remote 0x421ae20>, actionTest2=<QAction at remote 0x4302848>, actionAbout=<QAction at remote 0x4301d98>, menubar=<QMenuBar at remote 0x421ab78>, gcpListSrcY=[<QTableWidgetItem at remote 0x430c5a0>, <QTableWidgetItem at remote 0x430ca68>, <QTableWidgetItem at remote 0x430cf30>, <QTableWidgetItem at remote 0x430d490>, <QTableWidgetItem at remote 0x430d958>, <QTableWidgetItem at remote 0x430de20>, <QTableWidgetItem at remote 0x430e380>, <QTableWidgetItem at remote 0x430e848>, <QTableWidgetItem at remote 0x430ed10>, <QTableWidgetItem at remote 0x430f270>, <QTableWidgetItem at remote 0x430f738>, <QTableWidgetItem at remote 0x430fc00>, <QTableWidget...(truncated), throwflag=<value optimized out>) at ../Python/ceval.c:3750
#8  PyEval_EvalFrameEx (f=
    Frame 0x7b1afd0, for file /home/timlinux/.qgis/python/plugins/autogcp/autogcpguibase.py, line 1010, in matchGcps (self=<Ui_MainWindow(dockWidgetContents_2=<QWidget at remote 0x42fca68>, dockWidgetContents_3=<QWidget at remote 0x4301160>, rawMapCanvas=<QgsMapCanvas at remote 0x4301380>, gcpRawHighlight=[], actionTest1=<QAction at remote 0x4302738>, menuSettings=<QMenu at remote 0x421ae20>, actionTest2=<QAction at remote 0x4302848>, actionAbout=<QAction at remote 0x4301d98>, menubar=<QMenuBar at remote 0x421ab78>, gcpListSrcY=[<QTableWidgetItem at remote 0x430c5a0>, <QTableWidgetItem at remote 0x430ca68>, <QTableWidgetItem at remote 0x430cf30>, <QTableWidgetItem at remote 0x430d490>, <QTableWidgetItem at remote 0x430d958>, <QTableWidgetItem at remote 0x430de20>, <QTableWidgetItem at remote 0x430e380>, <QTableWidgetItem at remote 0x430e848>, <QTableWidgetItem at remote 0x430ed10>, <QTableWidgetItem at remote 0x430f270>, <QTableWidgetItem at remote 0x430f738>, <QTableWidgetItem at remote 0x430fc00>, <QTableWidget...(truncated), throwflag=<value optimized out>) at ../Python/ceval.c:2412
#9  0x00007fffd67fdd60 in PyEval_EvalCodeEx (co=0x24727b0, globals=<value optimized out>, locals=<value optimized out>, args=0x1, argcount=<value optimized out>, 
    kws=<value optimized out>, kwcount=0, defs=0x0, defcount=0, closure=0x0) at ../Python/ceval.c:3000
#10 0x00007fffd6783d60 in function_call (func=<function at remote 0x248b488>, arg=
    (<Ui_MainWindow(dockWidgetContents_2=<QWidget at remote 0x42fca68>, dockWidgetContents_3=<QWidget at remote 0x4301160>, rawMapCanvas=<QgsMapCanvas at remote 0x4301380>, gcpRawHighlight=[], actionTest1=<QAction at remote 0x4302738>, menuSettings=<QMenu at remote 0x421ae20>, actionTest2=<QAction at remote 0x4302848>, actionAbout=<QAction at remote 0x4301d98>, menubar=<QMenuBar at remote 0x421ab78>, gcpListSrcY=[<QTableWidgetItem at remote 0x430c5a0>, <QTableWidgetItem at remote 0x430ca68>, <QTableWidgetItem at remote 0x430cf30>, <QTableWidgetItem at remote 0x430d490>, <QTableWidgetItem at remote 0x430d958>, <QTableWidgetItem at remote 0x430de20>, <QTableWidgetItem at remote 0x430e380>, <QTableWidgetItem at remote 0x430e848>, <QTableWidgetItem at remote 0x430ed10>, <QTableWidgetItem at remote 0x430f270>, <QTableWidgetItem at remote 0x430f738>, <QTableWidgetItem at remote 0x430fc00>, <QTableWidgetItem at remote 0x4310160>, <QTableWidgetItem at remote 0x4310628>, <QTableWidgetItem at remote 0x4310af0>, <QTableWidg...(truncated), kw=0x0) at ../Objects/funcobject.c:524
#11 0x00007fffd67562e3 in PyObject_Call (func=<function at remote 0x248b488>, arg=Traceback (most recent call last):
  File "/usr/lib/debug/usr/lib/libpython2.6.so.1.0-gdb.py", line 1054, in to_string
    pyop = PyObjectPtr.from_pyobject_ptr(self.gdbval)
  File "/usr/lib/debug/usr/lib/libpython2.6.so.1.0-gdb.py", line 343, in from_pyobject_ptr
    cls = cls.subclass_from_type(p.type())
  File "/usr/lib/debug/usr/lib/libpython2.6.so.1.0-gdb.py", line 288, in subclass_from_type
    tp_name = t.field('tp_name').string()
  File "/usr/lib/python2.6/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)

by jamesm6162, 14 years ago

New patch for the autogcp class library. The next patch will integrate into analysis module.

comment:7 by jamesm6162, 14 years ago

Please also make sure to download the updated AutoGCP plugin from the repository http://pyqgis.org/repo/contributed.

Any feedback would be appreciated.

comment:8 by timlinux, 14 years ago

Can you verify that the current python plugin version is 0.3? The plugin manager shows only 0.2 available, but the version it installs shows version 0.3 August 2010 in the help -> about dialog. Please confirm what the version number should be to use with your latest patch.

Thanks!

Tim

comment:9 by goocreations, 14 years ago

Sorry about this. We never uploaded version 0.2 to the online repository. The new version (0.3) is now up to date on http://pyqgis.org/repo/contributed and must be used with the current patch uploaded to this site (12-10-10).

comment:10 by timlinux, 14 years ago

Hi

I grabbed the new version thanks. The plugin help->about version shows as 0.4, while the listing on http://pyqgis.org/repo/contributed shows 0.3. It would be good to get those in sync to minimize confusion.

Regards

Tim

comment:11 by timlinux, 14 years ago

Hi

I upgraded both the lib parts and the plugin parts. A couple of new comments:

  • it would be nice to persist the last used dir for reference and raw images separately since these will often be in separate directories.
  • It would be nice to have an option to simply georeference the image (as opposed to orthorectify it) for those that dont have a dem handy.
  • I still get a crash when trying to gather GCP's between two images. The data is not publically shareable, so I will mail you a copy offlist.
  • It would still be nice to have a 'zoom to image' tool on the toolbars.
  • Thanks for updating to use the built in CRS selector from QGIS - much better usability.
Debug: qgsautogcpmanager.cpp: (QgsAutoGCPManager::extractControlPoints()) Starting Control Point Extraction
Debug: Analyzer Starting GCP extraction
Debug: Levels: 5
Debug: Chip Cache Size = 5 of 256 elements 

Debug: Wavelet Iterations: 296 x 352

Debug: Dividing image into 7 X 7 grids
Debug: Extracting GCP Chips
Debug: GCP Extraction Complete
Debug: ++++++++++++++++++++++++11
Debug: Analyzer Starting GCP extraction
Debug: Levels: 5
Debug: Chip Cache Size = 5 of 256 elements 

Debug: Wavelet Iterations: 221 x 260

Debug: Dividing image into 56 X 56 grids
Debug: Extracting GCP Chips
Debug: GCP Extraction Complete

Program received signal SIGSEGV, Segmentation fault.
0x00007fffd34c9254 in QList<QgsGcp*>::detach (this=0x86333e0) at /usr/include/qt4/QtCore/qlist.h:122
122	    inline void detach() { if (d->ref != 1) detach_helper(); }

backtrace:

#0  0x00007fffd34c9254 in QList<QgsGcp*>::detach (this=0x86333e0) at /usr/include/qt4/QtCore/qlist.h:122
#1  0x00007fffd34c8d99 in QList<QgsGcp*>::append (this=0x86333e0, t=@0x69109b8) at /usr/include/qt4/QtCore/qlist.h:468
#2  0x00007fffd327a9cf in QList<QgsGcp*>::push_back (this=0x86333e0, t=@0x69109b8) at /usr/include/qt4/QtCore/qlist.h:277
#3  0x00007fffd3279e2e in QgsImageAnalyzer::QgsGrid::fillGrid (this=0x49121c0, gcpSet=0x61f9f30)
    at /home/timlinux/dev/cpp/qgis/src/autogcp/qgsimageanalyzer.cpp:521
#4  0x00007fffd327821d in QgsImageAnalyzer::matchGcps (this=0x4091630, gcpSet=0x5f58180)
    at /home/timlinux/dev/cpp/qgis/src/autogcp/qgsimageanalyzer.cpp:127
#5  0x00007fffd3270b9e in QgsAutoGCPManager::matchControlPoints (this=0x44fa290) at /home/timlinux/dev/cpp/qgis/src/autogcp/qgsautogcpmanager.cpp:138
#6  0x00007fffd34ddd3f in meth_QgsAutoGCPManager_matchControlPoints (sipSelf=<QgsAutoGCPManager at remote 0x43ff7c0>, sipArgs=())
    at sipautogcppart3.cpp:1361
#7  0x00007fffd67e1030 in call_function (f=
    Frame 0x408b230, for file /home/timlinux/.qgis/python/plugins/autogcp/guibase.py, line 1235, in matchGcps (self=<Ui_MainWindow(dockWidgetContents_2=<QWidget at remote 0x43fb490>, dockWidgetContents_3=<QWidget at remote 0x43fbaf0>, rawMapCanvas=<QgsMapCanvas at remote 0x43fbd10>, actionTest1=<QAction at remote 0x43fe160>, menuSettings=<QMenu at remote 0x43f67c0>, actionTest2=<QAction at remote 0x43fe270>, actionAbout=<QAction at remote 0x43fd7c0>, menubar=<QMenuBar at remote 0x43f65a0>, menuHelp=<QMenu at remote 0x43f6628>, actionZoomInAll=<QAction at remote 0x43fec88>, actionDetectGCP=<QAction at remote 0x43fd380>, actionZoomOutAll=<QAction at remote 0x43fed10>, bandCount=<QString at remote 0x43e68d8>, refLayer=<QgsRasterLayer at remote 0x43feaf0>, actionZoomOut2=<QAction at remote 0x43fe518>, rawScaleText=<QLineEdit at remote 0x43fd050>, actionShowRefImage=<QAction at remote 0x43fe958>, gcpItems=[], sqlitePath=<QString at remote 0x43e6460>, settings=<AutoGcpSettings(sqliteChoice=0, markerIconType=0, selected...(truncated), 
    throwflag=<value optimized out>) at ../Python/ceval.c:3750
#8  PyEval_EvalFrameEx (f=
    Frame 0x408b230, for file /home/timlinux/.qgis/python/plugins/autogcp/guibase.py, line 1235, in matchGcps (self=<Ui_MainWindow(dockWidgetContents_2=<QWidget at remote 0x43fb490>, dockWidgetContents_3=<QWidget at remote 0x43fbaf0>, rawMapCanvas=<QgsMapCanvas at remote 0x43fbd10>, actionTest1=<QAction at remote 0x43fe160>, menuSettings=<QMenu at remote 0x43f67c0>, actionTest2=<QAction at remote 0x43fe270>, actionAbout=<QAction at remote 0x43fd7c0>, menubar=<QMenuBar at remote 0x43f65a0>, menuHelp=<QMenu at remote 0x43f6628>, actionZoomInAll=<QAction at remote 0x43fec88>, actionDetectGCP=<QAction at remote 0x43fd380>, actionZoomOutAll=<QAction at remote 0x43fed10>, bandCount=<QString at remote 0x43e68d8>, refLayer=<QgsRasterLayer at remote 0x43feaf0>, actionZoomOut2=<QAction at remote 0x43fe518>, rawScaleText=<QLineEdit at remote 0x43fd050>, actionShowRefImage=<QAction at remote 0x43fe958>, gcpItems=[], sqlitePath=<QString at remote 0x43e6460>, settings=<AutoGcpSettings(sqliteChoice=0, markerIconType=0, selected...(truncated), 
    throwflag=<value optimized out>) at ../Python/ceval.c:2412
#9  0x00007fffd67e2d60 in PyEval_EvalCodeEx (co=0x247a558, globals=<value optimized out>, locals=<value optimized out>, args=0x1, 
    argcount=<value optimized out>, kws=<value optimized out>, kwcount=0, defs=0x0, defcount=0, closure=0x0) at ../Python/ceval.c:3000
#10 0x00007fffd6768d60 in function_call (func=<function at remote 0x252ccf8>, arg=
    (<Ui_MainWindow(dockWidgetContents_2=<QWidget at remote 0x43fb490>, dockWidgetContents_3=<QWidget at remote 0x43fbaf0>, rawMapCanvas=<QgsMapCanvas at remote 0x43fbd10>, actionTest1=<QAction at remote 0x43fe160>, menuSettings=<QMenu at remote 0x43f67c0>, actionTest2=<QAction at remote 0x43fe270>, actionAbout=<QAction at remote 0x43fd7c0>, menubar=<QMenuBar at remote 0x43f65a0>, menuHelp=<QMenu at remote 0x43f6628>, actionZoomInAll=<QAction at remote 0x43fec88>, actionDetectGCP=<QAction at remote 0x43fd380>, actionZoomOutAll=<QAction at remote 0x43fed10>, bandCount=<QString at remote 0x43e68d8>, refLayer=<QgsRasterLayer at remote 0x43feaf0>, actionZoomOut2=<QAction at remote 0x43fe518>, rawScaleText=<QLineEdit at remote 0x43fd050>, actionShowRefImage=<QAction at remote 0x43fe958>, gcpItems=[], sqlitePath=<QString at remote 0x43e6460>, settings=<AutoGcpSettings(sqliteChoice=0, markerIconType=0, selectedIconColor=0, postgresHost=<QString at remote 0x44021f0>, chipHeight=32, databaseSelection=1, postgresName=<QStr...(truncated), kw=0x0) at ../Objects/funcobject.c:524
#11 0x00007fffd673b2e3 in PyObject_Call (func=<function at remote 0x252ccf8>, arg=Traceback (most recent call last):
  File "/usr/lib/debug/usr/lib/libpython2.6.so.1.0-gdb.py", line 1054, in to_string
    pyop = PyObjectPtr.from_pyobject_ptr(self.gdbval)
  File "/usr/lib/debug/usr/lib/libpython2.6.so.1.0-gdb.py", line 343, in from_pyobject_ptr
    cls = cls.subclass_from_type(p.type())
  File "/usr/lib/debug/usr/lib/libpython2.6.so.1.0-gdb.py", line 288, in subclass_from_type
    tp_name = t.field('tp_name').string()
  File "/usr/lib/python2.6/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 0-2: invalid data
, kw=Traceback (most recent call last):
  File "/usr/lib/debug/usr/lib/libpython2.6.so.1.0-gdb.py", line 1054, in to_string
    pyop = PyObjectPtr.from_pyobject_ptr(self.gdbval)
  File "/usr/lib/debug/usr/lib/libpython2.6.so.1.0-gdb.py", line 343, in from_pyobject_ptr
    cls = cls.subclass_from_type(p.type())
  File "/usr/lib/debug/usr/lib/libpython2.6.so.1.0-gdb.py", line 288, in subclass_from_type
    tp_name = t.field('tp_name').string()
  File "/usr/lib/python2.6/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 0-2: invalid data
) at ../Objects/abstract.c:2492
#12 0x00007fffd674ccef in instancemethod_call (func=<function at remote 0x252ccf8>, arg=
    (<Ui_MainWindow(dockWidgetContents_2=<QWidget at remote 0x43fb490>, dockWidgetContents_3=<QWidget at remote 0x43fbaf0>, rawMapCanvas=<QgsMapCanvas at remote 0x43fbd10>, actionTest1=<QAction at remote 0x43fe160>, menuSettings=<QMenu at remote 0x43f67c0>, actionTest2=<QAction at remote 0x43fe270>, actionAbout=<QAction at remote 0x43fd7c0>, menubar=<QMenuBar at remote 0x43f65a0>, menuHelp=<QMenu at remote 0x43f6628>, actionZoomInAll=<QAction at remote 0x43fec88>, actionDetectGCP=<QAction at remote 0x43fd380>, actionZoomOutAll=<QAction at remote 0x43fed10>, bandCount=<QString at remote 0x43e68d8>, refLayer=<QgsRasterLayer at remote 0x43feaf0>, actionZoomOut2=<QAction at remote 0x43fe518>, rawScaleText=<QLineEdit at remote 0x43fd050>, actionShowRefImage=<QAction at remote 0x43fe958>, gcpItems=[], sqlitePath=<QString at remote 0x43e6460>, settings=<AutoGcpSettings(sqliteChoice=0, markerIconType=0, selectedIconColor=0, postgresHost=<QString at remote 0x44021f0>, chipHeight=32, databaseSelection=1, postgresName=<QStr...(truncated), kw=
    0x0) at ../Objects/classobject.c:2579
#13 0x00007fffd673b2e3 in PyObject_Call (func=<instancemethod at remote 0x1d8cf50>, arg=Traceback (most recent call last):
  File "/usr/lib/debug/usr/lib/libpython2.6.so.1.0-gdb.py", line 1054, in to_string
    pyop = PyObjectPtr.from_pyobject_ptr(self.gdbval)
  File "/usr/lib/debug/usr/lib/libpython2.6.so.1.0-gdb.py", line 343, in from_pyobject_ptr
    cls = cls.subclass_from_type(p.type())
  File "/usr/lib/debug/usr/lib/libpython2.6.so.1.0-gdb.py", line 288, in subclass_from_type
    tp_name = t.field('tp_name').string()
  File "/usr/lib/python2.6/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 0-2: invalid data
) at ../Python/ceval.c:3619
#15 0x00007fffd64e2a38 in sip_api_invoke_slot () from /usr/lib/pymodules/python2.6/sip.so
#16 0x00007fffd621f016 in ?? () from /usr/lib/pymodules/python2.6/PyQt4/QtCore.so
#17 0x00007fffd621f138 in ?? () from /usr/lib/pymodules/python2.6/PyQt4/QtCore.so
#18 0x00007fffd621f1f2 in ?? () from /usr/lib/pymodules/python2.6/PyQt4/QtCore.so
#19 0x00007ffff6554e3f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#20 0x00007ffff58f5032 in QAction::triggered(bool) () from /usr/lib/libQtGui.so.4
#21 0x00007ffff58f70ab in QAction::activate(QAction::ActionEvent) () from /usr/lib/libQtGui.so.4
#22 0x00007ffff5cb16ca in ?? () from /usr/lib/libQtGui.so.4
#23 0x00007ffff5cb197c in QAbstractButton::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/libQtGui.so.4
#24 0x00007ffff5d7d8ca in QToolButton::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/libQtGui.so.4
#25 0x00007ffff5951582 in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#26 0x00007ffff58fb22c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#27 0x00007ffff5901ecb in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#28 0x00007ffff759d8e5 in QgsApplication::notify (this=0x7fffffffded0, receiver=0x44b1f80, event=0x7fffffffd0a0)
    at /home/timlinux/dev/cpp/qgis/src/core/qgsapplication.cpp:88
#29 0x00007ffff654206c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#30 0x00007ffff59010ae in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) ()
   from /usr/lib/libQtGui.so.4
#31 0x00007ffff5980f65 in ?? () from /usr/lib/libQtGui.so.4
#32 0x00007ffff597f8ac in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/libQtGui.so.4
#33 0x00007ffff59ab882 in ?? () from /usr/lib/libQtGui.so.4
#34 0x00007ffff19af8c2 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#35 0x00007ffff19b3748 in ?? () from /lib/libglib-2.0.so.0
#36 0x00007ffff19b38fc in g_main_context_iteration () from /lib/libglib-2.0.so.0
#37 0x00007ffff656b513 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#38 0x00007ffff59ab46e in ?? () from /usr/lib/libQtGui.so.4
#39 0x00007ffff6540992 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#40 0x00007ffff6540d6c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#41 0x00007ffff6544aab in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#42 0x0000000000523ff5 in main (argc=1, argv=0x7fffffffe5d8) at /home/timlinux/dev/cpp/qgis/src/app/main.cpp:802

Regards

Tim

in reply to:  11 ; comment:12 by jamesm6162, 14 years ago

Hi Tim

Thanks for the feedback. We are working on getting all the crashes fixed adn we'll get to all your recommended features as soon as possible.

One question from my side though. What would be the best resource to start looking at if we want to implement the Georeferencing with GDAL?

Thanks

James

Replying to timlinux:

Hi

I upgraded both the lib parts and the plugin parts. A couple of new comments:

  • it would be nice to persist the last used dir for reference and raw images separately since these will often be in separate directories.
  • It would be nice to have an option to simply georeference the image (as opposed to orthorectify it) for those that dont have a dem handy.
  • I still get a crash when trying to gather GCP's between two images. The data is not publically shareable, so I will mail you a copy offlist.
  • It would still be nice to have a 'zoom to image' tool on the toolbars.
  • Thanks for updating to use the built in CRS selector from QGIS - much better usability.
Debug: qgsautogcpmanager.cpp: (QgsAutoGCPManager::extractControlPoints()) Starting Control Point Extraction
Debug: Analyzer Starting GCP extraction
Debug: Levels: 5
Debug: Chip Cache Size = 5 of 256 elements 

Debug: Wavelet Iterations: 296 x 352

Debug: Dividing image into 7 X 7 grids
Debug: Extracting GCP Chips
Debug: GCP Extraction Complete
Debug: ++++++++++++++++++++++++11
Debug: Analyzer Starting GCP extraction
Debug: Levels: 5
Debug: Chip Cache Size = 5 of 256 elements 

Debug: Wavelet Iterations: 221 x 260

Debug: Dividing image into 56 X 56 grids
Debug: Extracting GCP Chips
Debug: GCP Extraction Complete

Program received signal SIGSEGV, Segmentation fault.
0x00007fffd34c9254 in QList<QgsGcp*>::detach (this=0x86333e0) at /usr/include/qt4/QtCore/qlist.h:122
122	    inline void detach() { if (d->ref != 1) detach_helper(); }

backtrace:

#0  0x00007fffd34c9254 in QList<QgsGcp*>::detach (this=0x86333e0) at /usr/include/qt4/QtCore/qlist.h:122
#1  0x00007fffd34c8d99 in QList<QgsGcp*>::append (this=0x86333e0, t=@0x69109b8) at /usr/include/qt4/QtCore/qlist.h:468
#2  0x00007fffd327a9cf in QList<QgsGcp*>::push_back (this=0x86333e0, t=@0x69109b8) at /usr/include/qt4/QtCore/qlist.h:277
#3  0x00007fffd3279e2e in QgsImageAnalyzer::QgsGrid::fillGrid (this=0x49121c0, gcpSet=0x61f9f30)
    at /home/timlinux/dev/cpp/qgis/src/autogcp/qgsimageanalyzer.cpp:521
#4  0x00007fffd327821d in QgsImageAnalyzer::matchGcps (this=0x4091630, gcpSet=0x5f58180)
    at /home/timlinux/dev/cpp/qgis/src/autogcp/qgsimageanalyzer.cpp:127
#5  0x00007fffd3270b9e in QgsAutoGCPManager::matchControlPoints (this=0x44fa290) at /home/timlinux/dev/cpp/qgis/src/autogcp/qgsautogcpmanager.cpp:138
#6  0x00007fffd34ddd3f in meth_QgsAutoGCPManager_matchControlPoints (sipSelf=<QgsAutoGCPManager at remote 0x43ff7c0>, sipArgs=())
    at sipautogcppart3.cpp:1361
#7  0x00007fffd67e1030 in call_function (f=
    Frame 0x408b230, for file /home/timlinux/.qgis/python/plugins/autogcp/guibase.py, line 1235, in matchGcps (self=<Ui_MainWindow(dockWidgetContents_2=<QWidget at remote 0x43fb490>, dockWidgetContents_3=<QWidget at remote 0x43fbaf0>, rawMapCanvas=<QgsMapCanvas at remote 0x43fbd10>, actionTest1=<QAction at remote 0x43fe160>, menuSettings=<QMenu at remote 0x43f67c0>, actionTest2=<QAction at remote 0x43fe270>, actionAbout=<QAction at remote 0x43fd7c0>, menubar=<QMenuBar at remote 0x43f65a0>, menuHelp=<QMenu at remote 0x43f6628>, actionZoomInAll=<QAction at remote 0x43fec88>, actionDetectGCP=<QAction at remote 0x43fd380>, actionZoomOutAll=<QAction at remote 0x43fed10>, bandCount=<QString at remote 0x43e68d8>, refLayer=<QgsRasterLayer at remote 0x43feaf0>, actionZoomOut2=<QAction at remote 0x43fe518>, rawScaleText=<QLineEdit at remote 0x43fd050>, actionShowRefImage=<QAction at remote 0x43fe958>, gcpItems=[], sqlitePath=<QString at remote 0x43e6460>, settings=<AutoGcpSettings(sqliteChoice=0, markerIconType=0, selected...(truncated), 
    throwflag=<value optimized out>) at ../Python/ceval.c:3750
#8  PyEval_EvalFrameEx (f=
    Frame 0x408b230, for file /home/timlinux/.qgis/python/plugins/autogcp/guibase.py, line 1235, in matchGcps (self=<Ui_MainWindow(dockWidgetContents_2=<QWidget at remote 0x43fb490>, dockWidgetContents_3=<QWidget at remote 0x43fbaf0>, rawMapCanvas=<QgsMapCanvas at remote 0x43fbd10>, actionTest1=<QAction at remote 0x43fe160>, menuSettings=<QMenu at remote 0x43f67c0>, actionTest2=<QAction at remote 0x43fe270>, actionAbout=<QAction at remote 0x43fd7c0>, menubar=<QMenuBar at remote 0x43f65a0>, menuHelp=<QMenu at remote 0x43f6628>, actionZoomInAll=<QAction at remote 0x43fec88>, actionDetectGCP=<QAction at remote 0x43fd380>, actionZoomOutAll=<QAction at remote 0x43fed10>, bandCount=<QString at remote 0x43e68d8>, refLayer=<QgsRasterLayer at remote 0x43feaf0>, actionZoomOut2=<QAction at remote 0x43fe518>, rawScaleText=<QLineEdit at remote 0x43fd050>, actionShowRefImage=<QAction at remote 0x43fe958>, gcpItems=[], sqlitePath=<QString at remote 0x43e6460>, settings=<AutoGcpSettings(sqliteChoice=0, markerIconType=0, selected...(truncated), 
    throwflag=<value optimized out>) at ../Python/ceval.c:2412
#9  0x00007fffd67e2d60 in PyEval_EvalCodeEx (co=0x247a558, globals=<value optimized out>, locals=<value optimized out>, args=0x1, 
    argcount=<value optimized out>, kws=<value optimized out>, kwcount=0, defs=0x0, defcount=0, closure=0x0) at ../Python/ceval.c:3000
#10 0x00007fffd6768d60 in function_call (func=<function at remote 0x252ccf8>, arg=
    (<Ui_MainWindow(dockWidgetContents_2=<QWidget at remote 0x43fb490>, dockWidgetContents_3=<QWidget at remote 0x43fbaf0>, rawMapCanvas=<QgsMapCanvas at remote 0x43fbd10>, actionTest1=<QAction at remote 0x43fe160>, menuSettings=<QMenu at remote 0x43f67c0>, actionTest2=<QAction at remote 0x43fe270>, actionAbout=<QAction at remote 0x43fd7c0>, menubar=<QMenuBar at remote 0x43f65a0>, menuHelp=<QMenu at remote 0x43f6628>, actionZoomInAll=<QAction at remote 0x43fec88>, actionDetectGCP=<QAction at remote 0x43fd380>, actionZoomOutAll=<QAction at remote 0x43fed10>, bandCount=<QString at remote 0x43e68d8>, refLayer=<QgsRasterLayer at remote 0x43feaf0>, actionZoomOut2=<QAction at remote 0x43fe518>, rawScaleText=<QLineEdit at remote 0x43fd050>, actionShowRefImage=<QAction at remote 0x43fe958>, gcpItems=[], sqlitePath=<QString at remote 0x43e6460>, settings=<AutoGcpSettings(sqliteChoice=0, markerIconType=0, selectedIconColor=0, postgresHost=<QString at remote 0x44021f0>, chipHeight=32, databaseSelection=1, postgresName=<QStr...(truncated), kw=0x0) at ../Objects/funcobject.c:524
#11 0x00007fffd673b2e3 in PyObject_Call (func=<function at remote 0x252ccf8>, arg=Traceback (most recent call last):
  File "/usr/lib/debug/usr/lib/libpython2.6.so.1.0-gdb.py", line 1054, in to_string
    pyop = PyObjectPtr.from_pyobject_ptr(self.gdbval)
  File "/usr/lib/debug/usr/lib/libpython2.6.so.1.0-gdb.py", line 343, in from_pyobject_ptr
    cls = cls.subclass_from_type(p.type())
  File "/usr/lib/debug/usr/lib/libpython2.6.so.1.0-gdb.py", line 288, in subclass_from_type
    tp_name = t.field('tp_name').string()
  File "/usr/lib/python2.6/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 0-2: invalid data
, kw=Traceback (most recent call last):
  File "/usr/lib/debug/usr/lib/libpython2.6.so.1.0-gdb.py", line 1054, in to_string
    pyop = PyObjectPtr.from_pyobject_ptr(self.gdbval)
  File "/usr/lib/debug/usr/lib/libpython2.6.so.1.0-gdb.py", line 343, in from_pyobject_ptr
    cls = cls.subclass_from_type(p.type())
  File "/usr/lib/debug/usr/lib/libpython2.6.so.1.0-gdb.py", line 288, in subclass_from_type
    tp_name = t.field('tp_name').string()
  File "/usr/lib/python2.6/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 0-2: invalid data
) at ../Objects/abstract.c:2492
#12 0x00007fffd674ccef in instancemethod_call (func=<function at remote 0x252ccf8>, arg=
    (<Ui_MainWindow(dockWidgetContents_2=<QWidget at remote 0x43fb490>, dockWidgetContents_3=<QWidget at remote 0x43fbaf0>, rawMapCanvas=<QgsMapCanvas at remote 0x43fbd10>, actionTest1=<QAction at remote 0x43fe160>, menuSettings=<QMenu at remote 0x43f67c0>, actionTest2=<QAction at remote 0x43fe270>, actionAbout=<QAction at remote 0x43fd7c0>, menubar=<QMenuBar at remote 0x43f65a0>, menuHelp=<QMenu at remote 0x43f6628>, actionZoomInAll=<QAction at remote 0x43fec88>, actionDetectGCP=<QAction at remote 0x43fd380>, actionZoomOutAll=<QAction at remote 0x43fed10>, bandCount=<QString at remote 0x43e68d8>, refLayer=<QgsRasterLayer at remote 0x43feaf0>, actionZoomOut2=<QAction at remote 0x43fe518>, rawScaleText=<QLineEdit at remote 0x43fd050>, actionShowRefImage=<QAction at remote 0x43fe958>, gcpItems=[], sqlitePath=<QString at remote 0x43e6460>, settings=<AutoGcpSettings(sqliteChoice=0, markerIconType=0, selectedIconColor=0, postgresHost=<QString at remote 0x44021f0>, chipHeight=32, databaseSelection=1, postgresName=<QStr...(truncated), kw=
    0x0) at ../Objects/classobject.c:2579
#13 0x00007fffd673b2e3 in PyObject_Call (func=<instancemethod at remote 0x1d8cf50>, arg=Traceback (most recent call last):
  File "/usr/lib/debug/usr/lib/libpython2.6.so.1.0-gdb.py", line 1054, in to_string
    pyop = PyObjectPtr.from_pyobject_ptr(self.gdbval)
  File "/usr/lib/debug/usr/lib/libpython2.6.so.1.0-gdb.py", line 343, in from_pyobject_ptr
    cls = cls.subclass_from_type(p.type())
  File "/usr/lib/debug/usr/lib/libpython2.6.so.1.0-gdb.py", line 288, in subclass_from_type
    tp_name = t.field('tp_name').string()
  File "/usr/lib/python2.6/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 0-2: invalid data
) at ../Python/ceval.c:3619
#15 0x00007fffd64e2a38 in sip_api_invoke_slot () from /usr/lib/pymodules/python2.6/sip.so
#16 0x00007fffd621f016 in ?? () from /usr/lib/pymodules/python2.6/PyQt4/QtCore.so
#17 0x00007fffd621f138 in ?? () from /usr/lib/pymodules/python2.6/PyQt4/QtCore.so
#18 0x00007fffd621f1f2 in ?? () from /usr/lib/pymodules/python2.6/PyQt4/QtCore.so
#19 0x00007ffff6554e3f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#20 0x00007ffff58f5032 in QAction::triggered(bool) () from /usr/lib/libQtGui.so.4
#21 0x00007ffff58f70ab in QAction::activate(QAction::ActionEvent) () from /usr/lib/libQtGui.so.4
#22 0x00007ffff5cb16ca in ?? () from /usr/lib/libQtGui.so.4
#23 0x00007ffff5cb197c in QAbstractButton::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/libQtGui.so.4
#24 0x00007ffff5d7d8ca in QToolButton::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/libQtGui.so.4
#25 0x00007ffff5951582 in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#26 0x00007ffff58fb22c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#27 0x00007ffff5901ecb in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#28 0x00007ffff759d8e5 in QgsApplication::notify (this=0x7fffffffded0, receiver=0x44b1f80, event=0x7fffffffd0a0)
    at /home/timlinux/dev/cpp/qgis/src/core/qgsapplication.cpp:88
#29 0x00007ffff654206c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#30 0x00007ffff59010ae in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) ()
   from /usr/lib/libQtGui.so.4
#31 0x00007ffff5980f65 in ?? () from /usr/lib/libQtGui.so.4
#32 0x00007ffff597f8ac in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/libQtGui.so.4
#33 0x00007ffff59ab882 in ?? () from /usr/lib/libQtGui.so.4
#34 0x00007ffff19af8c2 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#35 0x00007ffff19b3748 in ?? () from /lib/libglib-2.0.so.0
#36 0x00007ffff19b38fc in g_main_context_iteration () from /lib/libglib-2.0.so.0
#37 0x00007ffff656b513 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#38 0x00007ffff59ab46e in ?? () from /usr/lib/libQtGui.so.4
#39 0x00007ffff6540992 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#40 0x00007ffff6540d6c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#41 0x00007ffff6544aab in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#42 0x0000000000523ff5 in main (argc=1, argv=0x7fffffffe5d8) at /home/timlinux/dev/cpp/qgis/src/app/main.cpp:802

Regards

Tim

comment:13 by goocreations, 14 years ago

The version from the repository and the about dialog are now in sync. Sorry about that.

comment:14 by goocreations, 14 years ago

Regarding the error received from georeferencing the images, I will have a look into this. As far as I can see now, the error may be caused because no GCPs were detected.

Currently our workflow is as follows: Open ref/raw image -> detect GCPs -> georeferencing images -> orthorectify image (optional)

When the detection step is skipped, QGis crashes. I will fix this asap.

in reply to:  12 comment:15 by timlinux, 14 years ago

Replying to jamesm6162:

Hi Tim

Thanks for the feedback. We are working on getting all the crashes fixed adn we'll get to all your recommended features as soon as possible.

One question from my side though. What would be the best resource to start looking at if we want to implement the Georeferencing with GDAL?

Thanks

James

Using gdal_translate either via the python api (I've never tried so you will need to check their docs) or by doing a shell call from python. Below is an example from some code of mine:

myString = "gdal_translate -a_srs 'EPSG:4326' -gcp 0 0 %s %s -gcp %s 0 %s %s -gcp %s %s %s %s -gcp 0 %s %s %s -of GTIFF -co COMPRESS=DEFLATE -co    TILED=YES %s %s" % ( \
         myTL[0], myTL[1], \
         myImageXDim, myTR[0],myTR[1], \
         myImageXDim, myImageYDim, myBR[0],myBR[1], \
         myImageYDim, myBL[0],myBL[1], \
         myPath, \
         myOutputPath )
   print myString
   os.system( myString )

You can add as many -gcp parameters as you like. My example above simply georeferences the corners hence the hard coded 0's. You can verify your GCPs in the output file by calling gdaoinfo on it.

Hope that helps!

Regards

Tim

comment:16 by goocreations, 14 years ago

Just to clarify, I meant cross-referencing and not georeferencing in my previous reply. Sorry

comment:17 by riaanvddool, 13 years ago

James, please contact Riaan as SAC. Sorry, I dont have your email address...

by jamesm6162, 13 years ago

Attachment: autogcp_patch_0.5.tar.gz added

Latest AutoGCP patch

comment:18 by jamesm6162, 13 years ago

Hi

I have uploaded the latest patch for the AutoGCP (v0.5) library. The latest plugin can also be downloaded from http://pyqgis.org/repo/contributed.

This patch as well as the complete source code is also available from http://www.foxhat.org/code.html

Regards

James

Note: See TracTickets for help on using tickets.