FUNCTION LinearHoughLink,xpts,ypts,THRESHOLD=thresh,NLINES=nlines,$ RHOBINS=N,THETABINS=M,HOUGH_MATRIX=A1,FINAL_MATRIX=A,H_MATRIX=H,$ NHD_RAD=nrem,VERBOSE=verbose,MIN_LENGTH=minLen,MAX_LENGTH=maxLen,$ MAXSTEP=maxStep,RHOMAX=rhomax,RHOMIN=rhomin ;+ ;RESULT=LinearHoughLink(xpts,ypts) finds the endpoints of linse in ;sets of points whose coordinates are given by xpts,ypts. The funcion ;uses the Hough transform and is controlled by a number of keyword ;parameters. ; ;RESULT is an array of anonymous structures with the following tags ;and initial values: ; ;Index:-1L Each line has a unique index [1,2,...,nlines] ;Xends:[0.0,0.0] X coordinates of beginning and ending points ;Yends:[0.0,0.0] Y coordinates of beginning and ending points ;THETA:0.0 The THETA of the normal representation ;RHO:0.0 The RHO of the normal representation ;Length:0.0 The length of the line ;Location:0L} The location in the Hough Parameter matrix ; ;EXAMPLE ;Suppose that IMG is a binary image. An image B of boundary ;points that describe object boundaries can be found by erosion ;with a structuring element S. The line descriptions of the ;boundaries can be found and plotted as an overlay on the ;image.with the following code. ; ;S=REPLICATE(1,3,3) ;B=image AND NOT ERODE(IMG,S) ;imSiz=SIZE(B) ;WINDOW,/FREE,XSIZE=imSiz[1],YSIZE=imSiz[2],TITLE='Edges' ;lines=LinearHoughLink(x,y) ;nlines=MAX(lines.Index) ;Find the number of lines found. ;FOR k=0,nlines-1 DO PLOTS,lines[k].Xends,lines[k].Yends ; ;DESCRIPTION AND KEYWORDS ;The algorithm utilizes the normal form of a straight line ;given by rho=x*Cos(theta)+y*Sin(theta). (theta,rho) space ;is divided into a grid of size NxM over the interval -90