![]() ![]() Although Euclidian Distance imitates Expand, it is not possible to introduce negative value to encroach/shrink. This is basically a variant to answer and uses Euclidian Distance to expand and shrink the raster boundaries to smooth the sharp corners of the raster which is exaggrated by expand-shrink process which utilises the number of cells to grow/encroach. Then wait about a minute each to execute the operations. If you really want to use R, load the "raster" library and exploit focalFilter to create functions to do the expanding and shrinking. The workflow in ArcGIS is the same but the syntax will be lengthier. L = Dilation, 3], 1] (* This does all the work *)ĭelta = ColorCombine (* Compares images *) Incidentally, I chose to make the eight images in this illustration with Mathematica commands because they are so simple, easy, and fast to execute: i = Import This was an option at the outset, but a little initial cleaning with Expand and Shrink reduces the work and provides the desired smoothing. ![]() If the larger remaining pieces need to be removed, that might best be done with RegionGroup to identify them, after which they can be obliterated through reclassification. The "difference" column uses color to highlight differences between the start and end image at each step: blue for black that turned to white, and orange for white that turned to black. "Expand" and "shrink" are both with reference to the white cells, so that expanding causes them to grow outwards and shrinking causes the black cells to encroach into white regions. Here is a sequence that works well to eliminate much of the apparent "noise" while maintaining most of the detail in the "entities". Often it helps to experiment a little with the parameters: you have to decide how much expanding and shrinking is needed to clean an image and usually you want to do as little as possible, because each operation tends to smooth out some of the sharp details. Use ArcGIS (or GRASS or Mathematica) because R's "raster" library is too slow. The morphological operations Expand and Shrink were created for this kind of processing. ![]()
0 Comments
Leave a Reply. |