There are several improvements which result from using the Voronoi image as a guide in the mosaic process. As previously stated this allows mapping each output pixel exactly once, eliminating redundant calculcations. A second benefit is that the pixels mapped tend to be from the central parts of input images which improves the accuracy of the mapping. Finally it is fairly easy to divide the output image into tiles which can be processed in parallel taking advantage of the availability of multi-core CPUs. Parallel ProcessesThe mosaic program uses 5 different types of processes to perform its work: a single master process, a DEM reader process, multiple RGB image reader processes, multiple mapper processes and a single writer process. In the initial version of the parallel mosaic program these processes are initiated by performing fork calls and executing specific functions. Due to Windows not directly supporting the fork system call, the software is being redesigned to use processes and threads, but the overall strategy is still much the same. Master ProcessThe master process reads a parameter file which contains specific parameters such as camera boresight and lens values, names of other files, and a variety of processing parameters. The master reads a file containing the names and aircraft attitude of the RGB input images to be mosaicked. Then it computes the Voronoi image and determines the sequence for reading the input images and how many must be in memory to avoid deadlock. Then it starts the other processes and enters a loop where it services requests arriving over pipes. DEM ReaderThe DEM reader process reads a single digital elevation model image (32 bit floating point values) into a shared memory array. After it completes reading the file, it sends a message to the master announcing completion so that the master can allow the mapper processes to verify that the elevation data is available for processing. RGB ReadersThe RGB readers request from the master the image number of the next image to read. The master delays sending the reply until the shared memory region for the file is available for use. There are typically under 100 shared memory regions for RGB images though there can be many more images to read. The master knows when images are no longer needed and, thus, when their memory can be reused. When a reader completes reading an image, it sends a completion message to the master so that the mapper processes can access that image after it is ready. Eventully the master sends -1 image numbers to the readers to tell them to exit. MappersThere are multiple mapper processes - typically as many as the number of CPU cores in the system. Each mapper works on 1 tile at a time. A reasonable tile size is perhaps 512x512. The mappers request tile numbers from the master allowing the master to control the use of the memory for the tiles. After a mapper completes a tile, it sends a completion message to the master which ultimately allows the writer to write that tile to the output file. Eventually the master sends -1 tile number to the mappers to signal the end of processing. WriterThere is a single writer process which writes the output file one tile at a time. The writer requests tile numbers from the master, writes the tiles and signals completion. Signaling completion of tile writing allows mappers to reuse tiles for different parts of the output image.
ModelingThe basic model used is a 3 dimensional affine transformation from pixel coordinates to UTM coordinates. The resampling uses the inverse of this transformation so that each output pixel can be mapped to an input pixel position. The output pixels have northing and easting values based on their location in the output file and elevation values from the DEM image. Typically the resolution of the DEM image is coarser than the output image, so bilinear interpolation is applied to elevation values. The northing, easting and elevation values are transformed into pixel coordinates and interpolation is applied to the input pixel values. The mosaic program implements a radial lends distortion correction as part of the mapping. This correction is applied by precomputing a 2 dimensional array of scale factors which are multiplied times the pixel coordinates before adding the principal point values. The distortion is supplied as a set of coefficients for a 4th degree polynomial. As part of the precomputation the polynomial inverse is approximated by a 7th degree polynomial over the practical range of the polynomial (limited from 0 to 1000 pixels). The scale factor array is computed using this 7th degree inverse polynomial. The user can select geographic (latitude/longitude) output coordinates if desired. In that case the actual mapping is still performed using UTM coordinates. The output geographic coordinates are converted to UTM prior to mapping. Since this conversion is non-trivial, every 10th row and column are converted using the PROJ4 library and interpolation is used to get accurate approximations during the mapping. ResultsThe test area for this report is over Pickering, Ontario. The input consists of 608 RGB images. Most of the flight lines are approximately north-south or south-north, though some are east-west or west-east. A sample of the output image is shown below.
PerformancePerformance testing was performed on an 8 core AMD Opteron computer. This system has 4 dual-core CPUs operating at 2.4 GHz. The system has 32 GB of RAM and runs a 64 bit version of Fedora Linux. The disk system uses SATA disks without RAID. Linux allowed enabling and disabling CPUs as desired during testing. In addition Linux allowed flushing the disk cache so that each test properly reflected the time spent reading input images. Below you can see elapsed time and speedup graphs based on using 1 to 8 cores. In this test the speedup is nearly ideal through 4 cores. After 4 cores the system is probably limited by the single writer process which produced a compressed GeoTiff file. Eliminating compression would improve efficiency beyond 4 cores. Overall the time required is less than 1 minute for a task which had previously required 2 to 3 hours to complete.
Last Updated on Thursday, 26 June 2008 15:11 |
|
|||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
More Articles...
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
« StartPrev123NextEnd » |
||||||||||||||||||||||||||||||||||||||||||||||||||
| Page 1 of 3 | ||||||||||||||||||||||||||||||||||||||||||||||||||







I built a trellis during Spring Break which covers the patio in my backyard and extends to shade a double window in the den. The diagram on the right shows the structure of the trellis frame. There are 9 4x4 treated pine posts (dark blue). Seven of the posts are planted about 3 feet deep in the ground. Two of the posts are simply standing on the concrete of the patio. The tops of the posts are about 7 feet above the level of the patio.