Skip to content

Commit 42f5ae5

Browse files
[Update] Updates RDP post
1 parent 86b0faf commit 42f5ae5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

_posts/Remote Sensing and Satellite Image Processing/2022-04-27-RDP_algorithm.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ header:
1111
caption: "Photo credit: [**Mehmet Turgut Kirkgoz **]"
1212
---
1313

14-
# The Problem
14+
## The Problem
1515

1616
When we were working on a satellite image of one of the local area of Nepal, we had to simplify the obtained mask to feed into the GIS system. In order to simplify, we ended up using a very interesting yet simple algorithm, **Ramer-Douglas-Peucker algorithm** (also called **Douglas-Peucker algorithm**).
1717

@@ -29,7 +29,7 @@ Here is a sample image and it's corresponding masks:
2929
<figcaption>Fig 2. Masks of houses (left) and result after simplifying using RDP algorithm (right).</figcaption>
3030
</figure>
3131

32-
# The Algorithm
32+
## The Algorithm
3333
In 1973, David H. Douglas and Thomas K. Peucker introduced an algorithm that produced a simplified polyline than the original in their paper: *“Algorithms for the reduction of the number of points required to represent a digitized line or its caricature”.* The algorithm generates a new curve similar to the original curve, but with fewer points.
3434

3535
The original paper defines the first point as ***anchor*** and last point as ***floater***. All the remaining points are examined to find the one with the greatest perpendicular distance between the point and the line joining anchor and floater. If the distance is less than the tolerance defined, then all points are terminated and the straight line segment represents the whole line. Otherwise, the point with greatest distance is set as a new floater. The algorithm recursively calls itself with anchor and floaters and finally merges it to give the simplified polyline.
@@ -40,7 +40,7 @@ There is this simple gif from [Mysid](https://en.wikipedia.org/wiki/User:Mysid)
4040

4141
In the worst case, this algorithm has a running time of $O(n^2)$ and in the best case, it has running time of $O(nlog ⁡n)$. [2](https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm)
4242

43-
# Code
43+
## Code
4444

4545
```
4646
def perpendicular_distance(line, point):
@@ -126,7 +126,7 @@ Co-Authors: [Shital Adhikari](https://shitaladhikari.github.io/) and [Anil Kumar
126126

127127

128128

129-
# Resources
129+
## Resources
130130
1. Douglas, D. H., & Peucker, T. K. (1973). Algorithms for the reduction of the number of points required to represent a digitized line or its caricature.
131131
2. [Wikipedia](https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm)
132132
3. Wu et al. A non-self-intersection Douglas-Peucker algorithm. https://www.dca.fee.unicamp.br/~ting/Publications/P2001-2005/wu-roci-2003-rfm.pdf

0 commit comments

Comments
 (0)