This software extracts building locations from USGS DRG (Digital Raster Graph) files. It may also work with similar files produced by other organizations, such as scanned international topo quads. The input file is expected to be a TIF, and the output is a VTST (Structures File).
The Image Processing Library (IPL) must be installed for you to compile or run this program. This can be obtained from the VTP CD. Unfortunately it is no longer available directly from its creator.
You may also need to copy the IPL DLLs from the directory in which they were installed (usually C:/Program Files/Intel/plsuite/bin) to a directory on your path (for example, C:/winnt)
If you are going to process a full-size DRG, be aware that you should have at least 128 MB of RAM on your machine - more is better.
Once an image is loaded, user can do the following:
- Zoom in/out (using menu or +/- keys)
- SuperZoom: Can zoom in by factor of 3X by hitting the spacebar. Hitting the spacebar a second time causes you to return to your original position. This is very useful for precisely labeling the centers of buildings after you've done the automatic processing.
- Scroll around the image using the scrollbars or the up/down/left/right arrow keys on the keyboard
- View the image at it's original resolution (from the View menu, select "View Full Resolution Image")
- In Building Select mode:
- Left mouse button click will place or remove a building mark
- Left mouse button drag will form a rectangle until released; when released, all building marks inside the rectangle will be removed.
- Middle mouse button drag enables scrolling around the image
- In Hand mode:
- Left mouse button drag enables scrolling around the image
- This mode is not needed unless you do not have a middle mouse button
Extract Buildings -- This function is the meat of the application, and is composed of the following parts:
- PreFloodFillThis is highly recommended, especially for large files.
- The purpose of the pre-floodfill is to remove objects larger than buildings (such as letters) from the image before the convolve occurs.
- It reduces the amount of false positives in the final output (therefore reducing the amount of user processing required after the convolve).
- Tweaks: in the file B_ExtractorDoc.cpp, in the PreFloodFillDIB method, the critical line is:
"if (result > #)".
- # represents the number of black pixels the floodfill must encounter (starting from a specific point) in order to remove that object from the image. Buildings in the Hawaii DRG's are approximately 40 pixels in volume, but ones close together can be connected, or buildings can be connected to thin black lines of pixels, which artificially increase the pixel count for the building (which is why it is set at 120 in the code).
- The user can make this number lower:
- + this reduces the number of false positives in the final output
- - this means taking the risk of removing buildings from the image before they can be recognized in the convolve (potentially increases false negatives)
- or higher:
- + higher value means more sure that all buildings will survive to the convolve step
- - increases the number of false positives (since more words will make it to the convolve and be recognized)
- Kernel Size(PreConvolve)
- Can choose 9x9, 7x7, or 5x5
- 7 x 7 appears to give the best results in tests done to date
- 5 x 5 is not recommended, it was only used in an aborted attempt to incorporate erosion of the image into the processing. The Erode is no longer done, so the 5 x 5 kernel does not return any good results.
- Perhaps the most important decision, the threshold determines where the cut-off is for a building (placing or not placing a building mark at a point in the image).
- If you are getting too many false positives, try a higher threshold. This will reduce them, but will also reduce the number of buildings identified correctly (will increase false negatives)
- If you are getting too many false negatives, try a lower threshold. This will increase the number of buildings labelled correctly, but will cause a corresponding increase in the number of words/marks/etc incorrectly marked as being a building.
- The threshold can be manually set by changing the number passed in to the iplThreshold function. This function is called in B_ExtractorView.cpp, in the OnFunctionsConvolve method
Clear Selected Buildings -- This function clears all building marks from the image. Useful if the user wants to try a different kernel size or threshold setting on an image.
TestIPL -- This function is of no use for building recognition. It was used to test certain aspects of the Intel Image Processing Library during development.
In order to use the VTST files you have generated, copy them to the VTP Enviro data directory Enviro/Data/BuildingData. The next time you run Enviro, they will appear on the "Structures Filename" drop-down control of the Terrain Parameters dialog.