Learning Photogrammetry with Interactive Software Tool PhoX

Photogrammetry is a complex topic in high-level university teaching, especially in the fields of geodesy, geoinformatics and metrology where high quality results are demanded. In addition, more and more black-box solutions for 3D image processing and point cloud generation are available that generate nice results easily, e.g. by structure-from-motion approaches. Within this context, the classical approach of teaching photogrammetry (e.g. focusing on aerial stereophotogrammetry) has to be reformed in order to educate students and professionals with new topics and provide them with more information behind the scene. Since around 20 years photogrammetry courses at the Jade University of Applied Sciences in Oldenburg, Germany, include the use of digital photogrammetry software that provide individual exercises, deep analysis of calculation results and a wide range of visualization tools for almost all standard tasks in photogrammetry. During the last years the software package PhoX has been developed that is part of a new didactic concept in photogrammetry and related subjects. It also serves as analysis tool in recent research projects. PhoX consists of a project-oriented data structure for images, image data, measured points and features and 3D objects. It allows for almost all basic photogrammetric measurement tools, image processing, calculation methods, graphical analysis functions, simulations and much more. Students use the program in order to conduct predefined exercises where they have the opportunity to analyse results in a high level of detail. This includes the analysis of statistical quality parameters but also the meaning of transformation parameters, rotation matrices, calibration and orientation data. As one specific advantage, PhoX allows for the interactive modification of single parameters and the direct view of the resulting effect in image or object space.


INTRODUCTION
The author is teaching photogrammetry, digital image processing, remote sensing and computer graphics for more than 20 years.During this time the technological development in photogrammetry has moved forward drastically.In particular, the availability of digital image data, the degree of automation in digital image measurement, calibration, orientation and matching has reached a very high level.Consequently, nowadays students are faced with more or less automated blackbox systems where the internal processing steps are hidden against the user.On the other hand, modern young people are overwhelmed with digital data, and they expect fully automated modes in many respects.Worldwide end-user mentality can be observed amongst students (Vyas & Koenig, 2014).The author's experiences in teaching photogrammetry includes bachelor and master courses, and specific knowledge transfer seminars for professionals.A wide range of subjects are collected in international textbooks, e.g.Luhmann et al. (2014).
The education of future engineers should consider contrary skills.On the one hand, engineers should be able to handle new systems, know about tools to manage big data projects, and are able to apply new technologies adequately in terms of economic and technical efficiency.On the other hand, engineers should have a deep understanding of algorithms and relationships between different stages of software processing, and they should be able to identify errors, weaknesses in projects or potentials for improvement.In this conflict, which not only is challenging for teachers, the students normally tent to concentrate on automatic solutions by pushing buttons rather than go the hard way into deep understanding and analysis.E-learning tools in the geo-information sciences mostly cover remote sensing and GIS technologies.For photogrammetry, only a few software systems for educational purposes exist.Examples are software systems like ARPENTEUR (Gussenmeyer et al. 2002) or GRAPHOS (Gonzalez-Aguilera et al, 2015).Within this context, the software package PhoX has been developed to provide a tool for self-learning, tests and exercises with real photogrammetric data.PhoX is able to process almost any kind of imagery, from scanned or digital aerial images to close-range images.The main purpose of the software is data analysis, interactive image measurements, simulation and visualisation of results.Real production is not addressed, although partly possible.
PhoX is currently available with German, English and Ukrainian user-interfaces (see Figure 1).Short quick help instructions can be displayed on every interactive stage of the program.A 250 pages German instruction manual is available.Individual teaching material (in PDF format) can be associated and presented with every menu function.In addition, a number of pre-defined assistance guides are available that lead the user through different steps of processing.They can be modified or extended by the user.The same idea is used to provide exercise modules for certain educational tasks of photogrammetry.

Multi-image approach
PhoX is based on a project-oriented multi-image and multiobject approach for data management (Figure 2).Images are organized as logical objects that contain calibration and orientation data, image points and contours, image sequences and meta data.Image bitmaps are optionally, hence processing of images is possible even if no bitmaps are stored.Image windows are used to display bitmaps.They can be removed or reloaded at any time in order to save memory for large sets of images.
Figure 2: Project tree with images and objects Besides images, 3D objects can be organised within PhoX.Similar to image objects, an unlimited number of 3D objects can be handled.Each 3D object is regarded as a spatial body which consists of 3D coordinates, transformation parameters in space, polygons (topological connections of object points), point clouds and triangulation meshes.

Import/export functions
Image bitmaps can be loaded and saved in all common formats.Image data such as interior and exterior orientation data can be imported or exported in various formats including Leica LPS, INPHO, AICON, iWitness and arbitrary free text formats.

Image processing and analysis
PhoX provides a wide variety of image analysis and processing tools.Image analysis includes the interactive measurement of colour profiles, histograms or pixel, image and object coordinates of cursor positions.
Image processing methods include all usual contrast and gamma corrections, smoothing, sharpness or edge filters, colour processing and more.These functions do not change image geometry, hence can be applied to calibrated images of a photogrammetric process.Image processing chains can be defined where several single processes are conducted sequentially.Batch processing is possible for a free selectable number of images (Figure 3).

Interactive measurement
Interactive measurement of image points is a key feature in PhoX.It allows for manual measurements by cursor setting including sub-pixel zoom (Figure 4).Non-destructive gain, offset and gamma corrections are possible for all images in order to enable better point recognition.

Automatic target measurement
Automatic target measurement is provided by the following operators:  centroid  ellipse operator (Figure 5)  template matching  cross-correlation The operators are suitable to measure target centres with highest quality down to 1/20 of a pixel or less.Since they require approximate values of the target positions, these can be provided by blob detection, interest operators or back-projection from object coordinates.However, there is no image matching included, hence point numbers must be generated manually.

Distortion-free images
Images with calibration parameters of interior orientation can be rectified to distortion-free images.They are generated with the same exterior orientation as the original image but ideal errorfree interior orientation (Figure 7).Based on relative or absolute orientation of a stereo pair, normalized images can be calculated (Figure 8).These images are again free of distortion with the same exterior orientation as the input images.Based on normalized images, also anaglyph images can be generated for external stereo viewing.The user can interactively adjust x-and y-parallaxes to observe the impact and result of such modifications.
Figure 8: Original and normalized stereo images

Optics processing
In order to provide a deeper understanding of physical optics, students can observe the result of simple geometric optic calculations.Parameters such as depth of field, image scale, image resolution and others can be calculated and modified interactively.The result is immediately visible in a simplified lens graph (Figure 9).

Camera parameters
PhoX supports the full set of interior orientation (IO) models based on Brown's parameters.In addition, special models such as angle-dependent parameters, spherical models or lens map functions are included.Each camera is organized in a camera file while every single image may have its own IO parameters.

Calibration procedures
Up to now there is no self-calibrating bundle adjustment implemented.Approximate calculation of IO parameters is provided by an extended space resection or by the DLT method.However, import functions for various bundle adjustment output formats are provided.

Orientation procedures
PhoX provides relative orientation, absolute orientation, space resection, DLT and 3D similarity transformation.Each function is based on least-squares adjustment.Detailed information about the results is listed in a log file which is available to users (Figure 10).If a surface model is given (e.g.triangulated meshes) also mono-plotting for 3D object measurement is possible.
For demonstration purposes a 3D floating mark can be used.It works like the principle of analytical plotters where a given 3D position is back-projected into the images.The user observes parallaxes or deviations between images and corrects for the 3D position until a good match between all images is achieved.
Measured 3D points can be processed to 2½ surface meshing or polygons.Simple 3D models (e.g.building models) with textures can be generated.

Interactive data manipulation
All data in PhoX are accessible to the user.Consequently, single data values or parameters can be modified interactively in order to analyse the final effect.
One interesting tool is the modification of IO and EO parameters in order to observe the spatial position in space and the projection of object points into the image directly through a graphical 3D viewer.The tool enables non-experienced students to get used to rotations and data in 3D space, and to understand the effect of the collinearity equations (see Figure 11).
Figure 11: Interactive modification of orientation data with visualized effect in image and object space

Monte-Carlo simulations
Different tools for statistical error propagation based on Monte-Carlo methods are integrated.They allow for the precision analysis of space resection, multi-image forward intersection, 3D similarity transformation and 6DOF calculations.Especially for these complex 3D calculations error propagation is difficult, hence the implemented tool provide an easy way of getting a 'feeling' about the obtainable accuracy (example in Figure 12).In addition, statistical noise can be applied to image coordinates and image colour values in order to study the effect for image measurement accuracy.

Artificial images
Artificial images can be generated if IO and EO parameters, a 3D surface model and a texture image are given.By resampling through object space, the image is filled with colour values.Artificial images can be used to create reference or error-free images of which all parameters are known.
In addition, PhoX provides are large range of synthetic image patterns.They include Siemens star, chess board, grids, colour wedges etc.

VISUALISATION OF RESULTS
PhoX allows for the display of an unlimited number of image windows.Besides imagery, a several graphical displays are provided.For viewing of 3D scenes with camera positions, object points, surfaces etc. an integrated viewer is available (Figure 13).In addition, the same data can be exported to VRML for external manipulation.Image footprints, distribution of image and object points, histogram and distribution of image and object residuals, length measurement errors and more can be visualized in diagrams (example in Figure 15) and exported to Excel.

Module description
During Bachelor studies photogrammetry is one of the mandatory subjects.It is organized as a two-semester course with each 4 hours of lessons per week.In addition to oral lectures, students have to participate in two major exercises (Figure 16).PhoX modules with increasing complexity have to be completed within particular time limits during the semesters.
Among others, additional courses are offered in "Digital image processing", "Close-range photogrammetry", "Engineering geodesy", "Remote sensing" and "Computer graphics".For Master studies students can select "Photogrammetric information processing" in order to get deeper knowledge about 3D image processing.

Work flow
During a long period of teaching experiences, the author observed a decreasing interest of students to analyse results, to conduct deep analysis of data and work with photogrammetric tasks in general.On the other hand, the increasing number of automated black-box systems makes it easy to achieve first results by pushing buttons without the need for a deeper understanding of the background.
Since about two years we have changed the educational concept in photogrammetry.Now, in each of the two semesters for the bachelor course in photogrammetry, each student must successfully pass about eight different exercises with PhoX (Figure 16).It starts with simple analyses of the content and properties of digital images, includes classical interior orientation of analog images, relative and absolute orientation, collinearity equations, epipolar geometry, space and forward intersection.
In each exercise a standard task has to be performed (Figure 17).After that, specific experiments like manipulation of input data or repeated measurements have to done.Each student must deliver a report about the exercise which will be corrected and sent back to him/her.Without that kind of direct feedback, the didactical effect would be small.As a result of this new concept, the number of students that pass the exams successfully at their first attempt has been increased significantly.As a positive side effect, students get a better relationship to photogrammetry.

Example exercise modules
Up to now the students have access to the following exercises:

Teaching materials
At every stage of the program PhoX offers context-sensitive help information.Quick help instructions are displayed mainly for interactive image operations while the instruction manual provides a complete description of all functions.
Exercise scripts can be edited by the user (or teacher) that consist of a sequence of pre-defined program functions that can (but not must) be followed by the student.The same script language is used for so-called assistants that guide the user through standard tasks in photogrammetry, e.g.rectification of a planar surface.
If teachers want to display their own PDF learning material, this can be included by list of PDF file names that is associated with specific menu items.Students may simply open these files from PhoX in order to add other sources of information about a particular photogrammetric operation.

CONCLUSIONS
Photogrammetry is a complex subject that requires specific effort in teaching.Since students (and other users) have to deal with mathematics, physics, least squares, sensor technology, image processing, geodetic networks, accuracy definition etc., learning concepts have to integrate a variety of different areas into one resulting technology.Since standard software packages do not allow for a deep analysis of effects and results, the program PhoX tries to close this gap.The global idea of PhoX is addressed to interactive processes and analyses of the most important photogrammetric procedures.It is not meant to be a tool for professional production, nor for fully automated 3D object reconstruction.
However, a software tool is not useful if the teaching concept does not match to its capabilities.In addition, students usually have to be forced to pass certain exercises, hence voluntary offers are usually not successful.
PhoX is used at the University of Applied Sciences in Oldenburg, Germany, since many years.It is not only offered to students of Bachelor and Master courses but also serves as a powerful analysis tool within research projects.It also serves as learning tool at the Kiev National University for Construction and Architecture within a cooperation in research and teaching (Kravchenko et al., 2016).

Figure 5 :
Figure 5: Result of ellipse operator (left) and template matching (right)

Figure 7 :
Figure 7: Distorted and undistorted image 4.3 Normalized stereo images

Figure 9 :
Figure 9: Calculation and display of optical parameters

Figure 10 :
Figure 10: Log file for space resection5.5 3D measurementUsually 3D points in PhoX are generated by forward intersection.The implemented function works with an unlimited number of images in any 3D coordinate system.Again, all statistical adjustment parameters are provided in a log file.

Figure 12 :
Figure 12: Stereo error propagation in object space by Monte-Carlo simulation

Figure 14 :
Figure 14: Distortion curves and pattern

Figure 16 :
Figure 16: Exercises in bachelor course of photogrammetry

Figure 17 :
Figure 17: Work flow for exercises in PhoX