Needs["CV`"]
CVOpen[]
img=CVLoadImage["pic5.png",CVLoadImageGrayScale];
s=CVGetSize[img];
Image[CVGetImageArray[img,1,-1]]
img2=CVCreateImage[s,IplDepth8U,1];
CVCanny[img,img2,50.0,100.0,3];
                
Image[CVGetImageArray[img2,1,-1]]
mem=CVCreateMemStorage[0];
method=CVHoughStandard;
seq=CVHoughLines2[img2,mem,method,1.0,N[2*Pi/100],100,0.0,0.0];
                
n=CVGetSeqSize[seq]
lines=CVGetHoughLines[seq,method]
img3=CVLoadImage["pic5.png",CVLoadImageUnchanged];
CVDrawHoughLines[img3,seq,method,{255,0,0},1000,1];
                
Image[CVGetImageArray[img3,1,-1]]
method=CVHoughProbabilistic;
seq=CVHoughLines2[img2,mem,method,1.0,N[2*Pi/100],80,10.0,1.0];
n=CVGetSeqSize[seq]
segments=CVGetHoughLines[seq,method]
img3=CVLoadImage["pic5.png",CVLoadImageUnchanged];
CVDrawHoughLines[img3,seq,method,{255,0,0},1000,1];
                
Image[CVGetImageArray[img3,1,-1]]
CVClose[]
