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.153 Beiträge
 
Delphi 11 Alexandria
 
#7

AW: Hough transformation for Kreise

  Alt 30. Dez 2010, 07:33
Danke für die schnelle Hilfe, der Port in eine 2D Array analog zur Linienerkennung ist fertig.

Ich kann zwar den Akku vom TestBild reproduzieren bei vielen anderen Testbeispielen bekomme ich aber kein sinnvolles Ergebnis



///
/// Hough transformation for circle detection
///
///
/// AnalysisBitmap : TBitMap; -> the image for hough tranmsformation
/// aHoughResult : THoughResult -> the result of the Hough transformation array of array of integer
/// r : Integer; -> the search radius
///
///


procedure Hough_CircleDetection ( AnalysisBitmap : TBitMap; var aHoughResult : THoughResult ; r : Integer );
var x,y, x0,y0 : integer;
ImageWidth : integer;
ImageHeight : Integer;
max_d : Integer;
help : Real;
theta : Integer;
max_theta : Integer;
Box_LL : FPoint;
Box_UR : FPoint;
TestPoint : TPoint;
begin


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

///
Box_LL.X := 0;
Box_UR.y := 0;

Box_UR.X := ImageWidth;
Box_UR.Y := ImageHeight;

max_theta := 360;
// 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

for theta:=0 to max_theta do
begin

TestPoint.x := round ( x - r * cos(theta*PI/max_theta) );
TestPoint.y := round ( y - r * sin(theta*PI/max_theta));

// if IsPointInBox( Box_LL , Box_UR, testPoint ) then Inc(aHoughResult[x,y]);

if ((testPoint.x < ImageWidth) and (testPoint.x > 0 ) and
(testPoint.y < ImageHeight ) and (testPoint.y > 0 ) ) then Inc(aHoughResult[TestPoint.x,TestPoint.y]);

end;
end;
end;
end;


end
  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 11:29 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz