comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Extracting the resultant angles from the Hough transform
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Extracting the resultant angles from the Hough transform [message #46069 is a reply to message #46017] Thu, 03 November 2005 03:53 Go to previous messageGo to previous message
txominhermos is currently offline  txominhermos
Messages: 25
Registered: October 2005
Junior Member
THE ANSWER TO THIS QUESTION HAS BEEN GIVEN BY THE RSI TECH SUPPORT


------------------------------------------------------------ --------------------

The THETA output variable can be used to find the angle for a line.
Here is a short example demonstrating how this is done:

;*********************************************************** ****************
pro test

; Choose two points in the range
; 1 < x < 199
; 1 < y < 199
p0 = [40.,20]
p1 = [120,180]

nx = 200d
ny = 200d

array = fltarr(nx,ny)
array[[p0[0],p1[0]],[p0[1],p1[1]]] = 1b

; Display the data:
window, 0, xs = nx, ys = ny, $
xpos = 0, ypos = 0, $
title = 'original data'
tvscl, array

; HOUGH input parameters:
dx = 1.2
dy = 1.0
xmin = 0.0
ymin = 0.0

r = hough(array, rho = rho, theta = theta, $
dx = dx, dy = dy, xmin = xmin, ymin = ymin)

sz = size(r, /dim)

; Locate the line
maxcount = where(r eq max(r))

; Use the output variable THETA to get the line's angle:
radangles = theta[maxcount mod sz[0]] - !pi/2
print, 'Angle(s) : '
print, radangles
print

end
;*********************************************************** ****************
Reply to this post
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: reading wav files
Next Topic: GDL installation for Ubuntu Linux

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 13:42:19 PDT 2025

Total time taken to generate the page: 1.59786 seconds