Ramer–Douglas–Peucker algorithm

The Ramer–Douglas–Peucker algorithm, also known as the Douglas–Peucker algorithm and iterative end-point fit algorithm, is an algorithm that decimates a curve composed of line segments to a similar curve with fewer points. It was one of the earliest successful algorithms developed for cartographic generalization. It produces the most accurate generalization, but it is also more time-consuming.[1]

Algorithm

Simplifying a piecewise linear curve with the Douglas–Peucker algorithm.

The starting curve is an ordered set of points or lines and the distance dimension ε > 0.

The algorithm recursively divides the line. Initially it is given all the points between the first and last point. It automatically marks the first and last point to be kept. It then finds the point that is farthest from the line segment with the first and last points as end points; this point is always farthest on the curve from the approximating line segment between the end points. If the point is closer than ε to the line segment, then any points not currently marked to be kept can be discarded without the simplified curve being worse than ε.

If the point farthest from the line segment is greater than ε from the approximation then that point must be kept. The algorithm recursively calls itself with the first point and the farthest point and then with the farthest point and the last point, which includes the farthest point being marked as kept.

When the recursion is completed a new output curve can be generated consisting of all and only those points that have been marked as kept.

The effect of varying epsilon in a parametric implementation of RDP

Non-parametric Ramer–Douglas–Peucker

The choice of ε is usually user-defined. Like most line fitting, polygonal approximation or dominant point detection methods, it can be made non-parametric by using the error bound due to digitization and quantization as a termination condition.[2]

Pseudocode

Assuming the input is a one-based array:

 # source: https://karthaus.nl/rdp/
function DouglasPeucker(PointList[], epsilon)
    # Find the point with the maximum distance
    dmax = 0
    index = 0
    end = length(PointList)
    for i = 2 to (end - 1) {
        d = perpendicularDistance(PointList[i], Line(PointList[1], PointList[end])) 
        if (d > dmax) {
            index = i
            dmax = d
        }
    }

    ResultList[] = empty;

    # If max distance is greater than epsilon, recursively simplify
    if (dmax > epsilon) {
        # Recursive call
        recResults1[] = DouglasPeucker(PointList[1...index], epsilon)
        recResults2[] = DouglasPeucker(PointList[index...end], epsilon)

        # Build the result list
        ResultList[] = {recResults1[1...length(recResults1) - 1], recResults2[1...length(recResults2)]}
    } else {
        ResultList[] = {PointList[1], PointList[end]}
    }
    # Return the result
    return ResultList[]

Application

The algorithm is used for the processing of vector graphics and cartographic generalization. It is recognized as the one that delivers the best perceptual representations of the original lines. But a self-intersection could occur if the accepted approximation is not sufficiently fine which led to the development of variant algorithms.[3]

The algorithm is widely used in robotics[4] to perform simplification and denoising of range data acquired by a rotating range scanner; in this field it is known as the split-and-merge algorithm and is attributed to Duda and Hart.[5]

Complexity

The running time of this algorithm when run on a polyline consisting of n – 1 segments and n vertices is given by the recurrence T(n) = T(i + 1) + T(ni) + O(n) where i = 1, 2,..., n − 2 is the value of index in the pseudocode. In the worst case, i = 1 or i = n − 2 at each recursive invocation yields a running time of O(n2). In the best case, i = n/2 or i = n ± 1/2 at each recursive invocation yields a running time of O(n log n).

Using (fully or semi-) dynamic convex hull data structures, the simplification performed by the algorithm can be accomplished in O(n log n) time.[6]

Given specific conditions related to the bounding metric, it is possible to decrease the computational complexity to a range between O(n) and O(2n) through the application of an iterative method.[7]

The running time for digital elevation model generalization using the three-dimensional variant of the algorithm is O(n3), but techniques have been developed to reduce the running time for larger data in practice.[8]

Similar algorithms

Comparison with Visvalingam–Whyatt algorithm

Alternative algorithms for line simplification include:

See also

Further reading

  • Ramer, Urs (1972). "An iterative procedure for the polygonal approximation of plane curves". Computer Graphics and Image Processing. 1 (3): 244–256. doi:10.1016/S0146-664X(72)80017-0.
  • Douglas, David; Peucker, Thomas (1973). "Algorithms for the reduction of the number of points required to represent a digitized line or its caricature". Cartographica: The International Journal for Geographic Information and Geovisualization. 10 (2): 112–122. doi:10.3138/FM57-6770-U75U-7727.
  • Hershberger, John; Snoeyink, Jack (1992). Speeding Up the Douglas–Peucker Line-Simplification Algorithm. Proceedings of the 5th Symposium on Data Handling. pp. 134–143. UBC Tech Report TR-92-07 available at Speeding Up the Douglas-Peucker Line-Simplification Algorithm | Computer Science at UBC
  • Duda, R.O.; Hart, P.E. (1973). Pattern Classification and Scene Analysis. New York: Wiley. Bibcode:1973pcsa.book.....D. Archived from the original on 2011-07-15.
  • Visvalingam, M.; Whyatt, J.D. (1992). Line Generalisation by Repeated Elimination of the Smallest Area (Technical report). Discussion Paper. Cartographic Information Systems Research Group (CISRG), The University of Hull. 10.

References

  1. ^ Shi, Wenzhong; Cheung, ChuiKwan (2006). "Performance Evaluation of Line Simplification Algorithms for Vector Generalization". The Cartographic Journal. 43 (1): 27–44. doi:10.1179/000870406x93490.
  2. ^ Prasad, Dilip K.; Leung, Maylor K.H.; Quek, Chai; Cho, Siu-Yeung (2012). "A novel framework for making dominant point detection methods non-parametric". Image and Vision Computing. 30 (11): 843–859. doi:10.1016/j.imavis.2012.06.010.
  3. ^ Wu, Shin-Ting; Marquez, Mercedes (2003). "A non-self-intersection Douglas-Peucker algorithm". 16th Brazilian Symposium on Computer Graphics and Image Processing (SIBGRAPI 2003). Sao Carlos, Brazil: IEEE. pp. 60–66. CiteSeerX 10.1.1.73.5773. doi:10.1109/SIBGRA.2003.1240992. ISBN 978-0-7695-2032-2. S2CID 10163908.
  4. ^ Nguyen, Viet; Gächter, Stefan; Martinelli, Agostino; Tomatis, Nicola; Siegwart, Roland (2007). "A comparison of line extraction algorithms using 2D range data for indoor mobile robotics" (PDF). Autonomous Robots. 23 (2): 97–111. doi:10.1007/s10514-007-9034-y. hdl:20.500.11850/9089. S2CID 35663952.
  5. ^ Duda, Richard O.; Hart, Peter E. (1973). Pattern classification and scene analysis. New York: Wiley. ISBN 0-471-22361-1.
  6. ^ Hershberger, John; Snoeyink, Jack (1992). Speeding Up the Douglas-Peucker Line-Simplification Algorithm (PDF) (Technical report).
  7. ^ "ramer_douglas_peucker_funneling.py". Gist.
  8. ^ Fei, Lifan; He, Jin (2009). "A three-dimensional Douglas–Peucker algorithm and its application to automated generalization of DEMs". International Journal of Geographical Information Science. 23 (6): 703–718. doi:10.1080/13658810701703001.

Read other articles:

Frederik Willem de Klerk(1990) Nama dalam bahasa asli(af) Frederik Willem de Klerk BiografiKelahiran18 Maret 1936 Johannesburg Kematian11 November 2021 (85 tahun)Kota Tanjung Penyebab kematianMesotelioma  1r Daftar Wakil Presiden Afrika Selatan 10 Mei 1994 – 30 Juni 1996 ← Alwyn Schlebusch (en) – Thabo Mbeki →  7è State President of South Africa (en) 15 Agustus 1989 – 10 Mei 1994 ← Pieter Willem Botha – Nelson M...

 

 

US Alessandria Calcio 1912Calcio I Grigi, L'Orso grigio, Mandrogni Segni distintivi Uniformi di gara Casa Trasferta Colori sociali Grigio Simboli Orso Grigio Inno Forza Alessandria Dati societari Città Alessandria Nazione  Italia Confederazione UEFA Federazione FIGC Campionato Serie C Fondazione 1912 Rifondazione2003 Proprietario Alessandria 2023 S.r.l. Presidente Andrea Molinaro Allenatore Jonatan Binotto Stadio Giuseppe Moccagatta(5 827 posti) Sito web www.alessandriacalcio1912....

 

 

Guerre seminoleVillaggio SeminoleData1817 - 1858 LuogoFlorida, Stati Uniti EsitoEsaurimento, con la maggior parte della tribù deportata in Oklahoma, e una parte minore rimasta libera nelle paludi fino ai giorni nostri[1] Schieramenti Stati UnitiSeminole Yuchi Choctaw Liberti Comandanti Andrew Jackson Martin Van Buren William Henry Harrison John Tyler Duncan Lamont Clinch Edmund P. Gaines Winfield Scott Thomas Jesup Richard Gentry † David Moniac † Francis Langhorne Dade † Zachar...

Halaman ini berisi artikel tentang negara bagian di Malaysia. Untuk kegunaan lain, lihat Selangor (disambiguasi). Selangor سلاڠور دار الإحسانNegara bagianKerajaan Negeri Selangor Darul Ehsan[b]Dari atas, kiri ke kanan: Masjid Sultan Salahuddin Abdul Aziz, gemerlap i-City di malam hari, Alun-alun kota Shah Alam, kawasan Batu Caves dengan patung terkenalnya Dewa Murugan, tribun penonton di Sirkuit Internasional Sepang, pematang sawah di Sekinchan BenderaLambang kebesaran...

 

 

Voce principale: Savona 1907 Foot-Ball Club. Savona 1907 Foot-Ball ClubStagione 2011-2012Sport calcio Squadra Savona Allenatore Ninni Corda Presidente Aldo Dellepiane Lega Pro Seconda Divisione13º posto 2010-2011 2012-2013 Si invita a seguire il modello di voce Questa voce raccoglie le informazioni riguardanti il Savona 1907 Foot-Ball Club nelle competizioni ufficiali della stagione 2011-2012. Indice 1 Stagione 2 Rosa 3 Risultati 3.1 Campionato 3.1.1 Girone di andata 3.1.2 Girone di ri...

 

 

Uomo meditante - Autoritratto del 1467 Nikolaus Gerhaert, detto Nikolaus von Leyden (Leida, 1420 – Vienna, 11 giugno 1473), è stato uno scultore olandese. Indice 1 Biografia 2 Note 3 Bibliografia 4 Altri progetti 5 Collegamenti esterni Biografia Crocifisso nella Collegiata di Baden-Baden, 1467. Lavorò soprattutto in Germania - si hanno informazioni certe dei suoi soggiorni a Treviri, Strasburgo, Costanza e Vienna, tra il 1462 e il 1473. Viene considerato dai critici d'arte come uno degli ...

Leopoldo di Anhalt-KöthenDipinto raffigurante il principe Leopoldo di Anhalt-Köthen col suo kammermohrPrincipe di Anhalt-KöthenStemma In carica30 maggio 1704 –19 novembre 1728 PredecessoreEmmanuele Lebrecht di Anhalt-Köthen SuccessoreAugusto Luigi di Anhalt-Köthen NascitaKöthen, 28 novembre 1694 MorteKöthen, 19 novembre 1728 (33 anni) DinastiaAnhalt-Köthen PadreEmanuele Lebrecht di Anhalt-Köthen MadreGisella Agnese von Rath ConsortiFederica Enrichetta di Anhalt-Bern...

 

 

Utility company based in Virginia, United States Old Dominion Electric CooperativeCompany typeCooperative FederationFounded1948 (1948)HeadquartersGlen Allen, Virginia, United StatesArea servedVirginia, Maryland, & DelawareKey peopleMarcus Harris, President & CEORevenue300 MillionMembers11Number of employees104Websiteodec.com Old Dominion Electric Cooperative (ODEC) is an electric generation and transmission cooperative headquartered in Glen Allen, Virginia. ODEC provides wholesal...

 

 

جميلة إسماعيل   معلومات شخصية اسم الولادة جميلة محمد إسماعيل محمد  الميلاد 12 أبريل 1966 (58 سنة)  القاهرة  مواطنة مصر  الحياة العملية المدرسة الأم جامعة القاهرة  المهنة صحافية،  وسياسية،  وناشطة حقوق الإنسان،  وكاتِبة  الحزب حزب الدستور اللغة الأم الع...

Private educational institution in Kanagawa, Japan This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Senzoku Gakuen – news · newspapers · books · scholar · JSTOR (November 2013) (Learn how and when to remove this message) Senzoku Gakuen College of Musicand Senzoku Gakuen Junior College洗足学園音楽大学 ...

 

 

Tour de Catalogne 1939GénéralitésCourse 19e Tour de CatalogneÉtapes 7 étapesDate 17 au 24 septembre 1939Distance 891 kmPays traversé(s) EspagneLieu de départ BarceloneLieu d'arrivée BarceloneRésultatsVainqueur Mariano Cañardo (ESP)Deuxième Diego CháferTroisième Fermín TruebaMeilleur grimpeur Federico Ezquerra (ESP)Tour de Catalogne 1936Tour de Catalogne 1940modifier - modifier le code - modifier Wikidata Le Tour de Catalogne 1939 est la 19e édition du Tour de Catalogne, un...

 

 

هذه المقالة بحاجة لصندوق معلومات. فضلًا ساعد في تحسين هذه المقالة بإضافة صندوق معلومات مخصص إليها.Learn how and when to remove this message يعتمد التقويم الكوري على القمر أي أنه تقويم قمري، وتم استبدال التقويم الكوري بالتقويم الميلادي عام 1895، لكن لايزال استخدام التقويم الكوري في الاحتفالا�...

هذه المقالة بحاجة لصندوق معلومات. فضلًا ساعد في تحسين هذه المقالة بإضافة صندوق معلومات مخصص إليها. ملصق دستور كوبا كانت كوبا تمتلك عدة دساتير حتى قبل حصولها على استقلالها عن إسبانيا، سواء كانت دساتير اعتمدها الثوار أو اقترحوها كوثائق حاكمة للأراضي التي سيطروا عليها خلال ح...

 

 

Part of a series on theOlympic water polorecords and statistics Topics Overall statistics men women Champions men women Team appearances men women Player appearances men women Medalists men women Top goalscorers men women Goalkeepers men women Flag bearers and oath takers Venues Teams Men's teams Australia Belgium Brazil Canada Croatia Egypt France Germany Great Britain Greece Hungary Italy Japan Kazakhstan Montenegro Netherlands Romania Russia Serbia Serbia and Montenegro Soviet Union Spain...

 

 

Piers MorganMorgan di acara PaleyFest 2013LahirPiers Stefan O'Meara30 Maret 1965 (umur 59)Newick, Sussex, Inggris[1]KebangsaanBritaniaPendidikanSekolah ChaileyAlmamaterHarlow CollegePekerjaanPresenter televisi, penulis, jurnalisTahun aktif1985–sekarangTempat kerjaSouth London News (1985–88)The Sun (1989–94)News of the World (1994–95)Daily Mirror (1995–2004)Dikenal atasPenyunting koranTuan rumah acara televisiTelevisiBritain's Got TalentAmerica's Got TalentThe Cele...

This article is about the automobile engine. For the steam locomotive, see GWR Iron Duke Class. This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Iron Duke engine – news · newspapers · books · scholar · JSTOR (January 2014) (Learn how and when to remove this message) Reciprocating internal combustion engine Ir...

 

 

Radio station in Grand Rapids, MinnesotaKAXEGrand Rapids, MinnesotaFrequency91.7 MHzBrandingNorthern Community RadioProgrammingFormatCommunity/PublicAffiliationsNPR, AMPERSOwnershipOwnerNorthern Community RadioHistoryFirst air dateApril 23, 1976[1]Call sign meaningKAXE The Cutting EdgeTechnical informationClassC1ERP100,000 wattsHAAT140 meters (460 ft)Translator(s)see belowRepeater(s)90.5 KBXE (Bagley)LinksWebcastListen LiveWebsitekaxe.org KAXE (91.7 FM) is a community licensed pu...

 

 

Hoạt hình của quả bóng nảy lên xuống (dưới đây) bao gồm 6 hình. Hoạt hình này được nhắc lại 10 hình trong một giây. Hoạt hình này chuyển động với tốc độ 2 hình trong một giây. Với tốc độ này, chúng ta hầu như có thể phân biệt được từng hình mộtTốc độ 12 hình trong một giây là tốc độ mà các phim hoạt họa dùng hoạt hình (animated cartoon) thực hiện. Phim hoạt hình hay phim hoạt...

Портал:Политика Россия Статья из серии Политическая системаРоссии Конституция Российской Федерации Всенародное голосование о принятии Конституции (1993) Внесение поправок: • 2008 • февраль 2014 • июль 2014 • 2020 (общероссийское голосование) Основы конституционного строя Нар�...

 

 

NeXTstation(コンピュータ) NeXTstation(ネクストステーション)は、1990年から1993年にかけてNeXTが開発・製造・販売した、ワークステーションである。NeXTstationではNEXTSTEPオペレーティングシステムが動作した。NeXTstationは、より手ごろなNeXTcubeとしてリリースされ、価格はおよそ半額のUS $4,995であった。複数のモデル、つまり NeXTstation (25 MHz), NeXTstation Turbo (33 MHz), NeXTstation Color...