AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

hough transformation

Ein Thema von bernhard_LA · begonnen am 19. Dez 2010 · letzter Beitrag vom 28. Dez 2011
Antwort Antwort
bernhard_LA

Registriert seit: 8. Jun 2009
Ort: Bayern
1.121 Beiträge
 
Delphi 11 Alexandria
 
#1

hough transformation

  Alt 19. Dez 2010, 15:49
bin auf der Suche nach einer korrekten Implementierung der Hough Transformation für Linien in Pascal,
der Code unten liefert nicht den korrekten Accumulator Inhalt zurück




Delphi-Quellcode:
THoughResult = array of array of Integer


///
/// Hough transformation for line detection
/// r = sin(theta) * a + cos(theta) * b
///
///
procedure Hough_LineDetection ( AnalysisBitmap : TBitMap; var aHoughResult : THoughResult );
var x,y, theta : integer;
    r : Extended;
    ImageWidth : integer;
    ImageHeight : Integer;
    max_d : Integer;

begin


   /// size of hough array
   ImageWidth := AnalysisBitmap.Width;
   ImageHeight:= AnalysisBitmap.Height;

   max_d := round( sqrt( ImageHeight* ImageHeight + ImageWidth * ImageWidth ) ) ;

   SetLength(aHoughResult,360, max_d );

   // For all rows in image do :
   for y:=0 to AnalysisBitmap.Height-1 do
   begin

   // For all pixel in one row do :
   for x:=0 to AnalysisBitmap.Width-1 do
   begin

      // Is there a point there or not ? If not, just skip the pixel ( threshold based methode ...)
      if IsPixel(x, y, AnalysisBitmap, 128 ) then
      begin
           // iterate the unknown variables : ( r, theta )
           // loop theta -> to be able to determine the other unknown -> r
           for theta:=0 to 359 do
           begin
                r:=x*cos(theta*PI/360) + y*sin(theta*PI/360);

                // Plot the finding (theta,r) into an array.
                // Ignore negative values...
                //
                if r>=0 then Inc(aHoughResult[theta,round(r)]);
           end;
      end;
   end;
  end;


end;

Geändert von mkinzler (19. Dez 2010 um 15:54 Uhr) Grund: Delphi-Tag eingefügt
  Mit Zitat antworten Zitat
Benutzerbild von Corpsman
Corpsman

Registriert seit: 8. Nov 2005
Ort: nähe Stuttgart
981 Beiträge
 
Delphi XE2 Professional
 
#2

AW: hough transformation

  Alt 19. Dez 2010, 21:15
Schau dir mal Das Hier an, evtl. hilft das weiter ..
Uwe
My Sitewww.Corpsman.de

My marble madness clone Balanced ( ca. 70,0 mb ) aktuell ver 2.01
  Mit Zitat antworten Zitat
bernhard_LA

Registriert seit: 8. Jun 2009
Ort: Bayern
1.121 Beiträge
 
Delphi 11 Alexandria
 
#3

AW: hough transformation

  Alt 21. Dez 2010, 09:10
Danke,
anhand der Testimage festgestellt, mein Akku ging auch schon korrekt
  Mit Zitat antworten Zitat
bernhard_LA

Registriert seit: 8. Jun 2009
Ort: Bayern
1.121 Beiträge
 
Delphi 11 Alexandria
 
#4

AW: hough transformation

  Alt 28. Dez 2011, 10:28
fyi :

unter http://sourceforge.net/projects/houghtransforma/ gibt den ganzen code zum Download !

Für Anregungen & Verbesserungen immer Dankbar !
  Mit Zitat antworten Zitat
Benutzerbild von Corpsman
Corpsman

Registriert seit: 8. Nov 2005
Ort: nähe Stuttgart
981 Beiträge
 
Delphi XE2 Professional
 
#5

AW: hough transformation

  Alt 28. Dez 2011, 11:08
Also ich finde da nur eine "readme.txt", evtl kann ich aber auch nicht mit SourceForge umgehen ...
Uwe
My Sitewww.Corpsman.de

My marble madness clone Balanced ( ca. 70,0 mb ) aktuell ver 2.01
  Mit Zitat antworten Zitat
bernhard_LA

Registriert seit: 8. Jun 2009
Ort: Bayern
1.121 Beiträge
 
Delphi 11 Alexandria
 
#6

AW: hough transformation

  Alt 28. Dez 2011, 11:17
bitte den Code mit Tortoise SVN runterladen

svn co https://houghtransforma.svn.sourcefo...oughtransforma houghtransforma

Eine Anleitung zu TORTOISE habe ich bei meinem INDY 10 DELPHI -- bitte hier wegen den Details nachlesen



PS: DELPHI XE2 kann sogar Libs Projekte via SVN einbinden - coole feature - nur kann ich es leider im Firmennetzwerk wegen FIREWALL nicht nutzen
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 08:23 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz