Because of the Thanksgiving holiday in the U.S., TI E2E™ design support forum responses may be delayed the week of November 23.

This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Hough Transofrm for Lines

Hi ,

   When I use the function VLIB_houghLineFromList() in vlib for Hough Transform, I have a question: 

   I do not konwn how to set  the parameters "pEdgeMapList, rhoMaxLength" ? I have read the test code-VLIB_testHough.c, but I still don't understand fully.

   If the image is 720*480, how the set the "rhoMaxLenth" value, and how can put the parameters "pEdgeMagList"? 

  Is  there another simple project using VLIB Hough transform for line detection in an image?

  My email is : xiangfei.dong@desay-svautomotive.com

Thanks a lot.

I am looking forward to your reply as soon as possible.

  • Xiangfei,

    I emailed you the Line Detection Demo using VLIB's Hough transform.

    You can understand pEdgeMagList from the example attached.

     

    rhoMaxLenth is the number of samples you allocate for the rho parameter in Hough transform.

    For example, if W and H are the width and height of your image, the maximum value of rho is rhomax = sqrt(W*W+H*H) and the rho values from 0 to rhomax is uniformly quantized using rhoMaxLength number of samples.

    Please let me know if this is useful.


    Regards,

    Senthil

  • Hello Senthil,

    You sais in your previous email :

    W and H are the width and height of your image, the maximum value of rho is rhomax = sqrt(W*W+H*H)

     

    But in your sample, you have :

    #include <stdio.h>

    #include <math.h>
    #define W 360
    #define H 120
    #define NUMTHETA (267)
    #define RHOMAX   (600)

    sqrt(W*W+H*H) = 380 and you define RHOMAX to 600

    Could you explain?


    Also from the equation "rho=xcos(theta) + ysin(theta)" I would have to have the parameters of the line in the image space : y=mx+p
    No problem to have a good m by using the equation m=(-1)*cos(theta)/sin(theta) but I can not have a good p.
    It is not the same as the one using a linear fit of the points done by your
    draw_line function to draw the line.



    Thanks a lot

    Jérôme
  • Senthil:

    Could you send an email to me? I also have some ploblems...

    My email addr is zoreneo@gmail.com

    Thanks very much.

  • Senthil:

    Could you send an email to me? I have some ploblems...

    My email addr is myleeinwh@gmail.com

    Thanks very much.