AGB  ·  Datenschutz  ·  Impressum  







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

Hough transformation for Kreise

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

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

Hough transformation for Kreise

  Alt 24. Dez 2010, 15:02
sieht jemand einen Bug in dieser Version der Hough Transformation für Kreise ?
Das thema Hough und Lines gabe es bereits hier : http://www.delphipraxis.net/156893-h...formation.html



Delphi-Quellcode:
///
/// Hough transformation for line detection
///
///
/// AnalysisBitmap : TBitMap; -> the image for hough tranmsformation
/// aHoughResult : THoughResult -> the result of the Hough transformation
/// r : Integer; -> the search radius
///
///


procedure Hough_CircleDetection ( AnalysisBitmap : TBitMap; var aHoughResult : THoughResult ; r : Integer );
var x,y, a,b : integer;
    ImageWidth : integer;
    ImageHeight : Integer;
    max_d : Integer;
    help : Real;

begin


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



                            // a // b
   SetLength(aHoughResult,ImageWidth, ImageHeight );

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

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

      // Is there a point ?
      if IsPixel(x,y, AnalysisBitmap, 128 ) then
      begin
           // circle
           // r *r = ( x-a) *(x-a) + (y-b) *( y-b)
           for a:=0 to ImageWidth do
           begin
                // r * r := (x-a) * (x-a) + (y-b) * (y-b);
                // solve equation and get y ...
                help := r * r - (x-a) * (x-a);

                if ( help >= 0 ) then
                    begin

                    b := Round( sqrt (help) + y ) ;

                    Inc(aHoughResult [a, b]);

                    end;



           end;
      end;
   end;
  end;


end;

Geändert von mkinzler (26. Dez 2010 um 09:48 Uhr) Grund: Delphi-Tag eingefügt
  Mit Zitat antworten Zitat
 


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 00:13 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