Because of the holidays, TI E2E™ design support forum responses will be delayed from Dec. 25 through Jan. 2. Thank you for your patience.

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.

VLIB Canny Edge Detection Parameters

Dear Friends,

 

I am trying to work with the VLIB Canny Edge Detection algorithm. The VLIB_Canny_Edge_Detection wrapper function included in vlib_c674x_3_2_1_0 works, but seems to create an excess number of edges.

I need to tweak this function and control its various parameters.

Numerous documentations, such as sprab78, explain how to break down the wrapper function into its building block functions, and apply the relevant parameters to each function in order to achieve the desired results.

My questions are:

1. What is the meaning of the "numItems" parameter of the VLIB_Canny_Edge_Detection wrapper function? It seems to have no effect.

2. Where can I get the source code of VLIB functions (Optimized Assembly and/or Natural C)? IMGLIB and DSPLIB for example include source code.

3. Is there any way to modify the various parameters of the VLIB Kernel Functions without applying them separately? Similar to Matlab "edge" function for example.

4. Is there a code sample that shows how to optimally apply VLIB Canny Edge Detection by applying the 5 VLIB_Canny_Edge_Detection Base Kernels Separately?

 

Thanks,

Avi Tal.

  • Update:

    1. The numItems parameter is output so question 1 is irrelevant.
    2. After breaking up the VLIB_Canny_Edge_Detection to its building block, it seems like the last stage: VLIB_edgeRelaxation has no effect. Why?

    Thanks,
    Avi
  • Hi,

    We will work on this and will update you shortly.

    Thanks & regards,
    Sivaraj K
  • Avi

    I understand that if you have the source code you can answer all your questions

    I downloaded vlib from software-dl.ti.com/.../index_FDS.html and in the release I looked at directory

    \vlib\packages\ti\vlib\src\VLIB_Canny_Edge_Detection (vlib is where I installed the library) there are several files. In general XXX,c is the optimized code, XXX_cn.c is natural C (or ANSII C code) and XXX_d.c is a test code

    Look at the release. You may download multiple releases (for multiple devices) to find the source code

    Best Regards

    Ran
  • Hi Ran,

    Thanks allot for your answer.

    I downloaded both vlib_c674x_obj_3_2_1_0_Win32.exe and vlib_c64Px_obj_3_2_1_0_Win32.exe.
    There is no XXX_cn.c anywhere , only XXX_cn.h.
    Can you please send me these files or a link to the exact file to download?

    My email is: avi_tal@012.net.il

    Thanks,
    Avi Tal.
  • This is what I mean by looking for other devices

    I just downloaded (again) the vlib version for C66 (vlib_c66x_obj_3_2_1_0_Win32.exe ) and build it and in the directory that I specified I see the source code.  Here is a screen shot:

  • Hi,
    I am unable to see XXX_cn.c in your screenshot, or the c66x installed directory.
    Thanks,
    Avi.
  • You are right, I just noticed. I will find the source for you


    Ran
  • sent email to the person who is responsible for the source code.  Stay tuned

  • Avi Tal,

    The source code for VLIB is not publicly available. However, I will try to answer your other questions here:

    1. What is the meaning of the "numItems" parameter of the VLIB_Canny_Edge_Detection wrapper function? It seems to have no effect.
    A. As you said in a follow-up post, it is an output.

    2. Where can I get the source code of VLIB functions (Optimized Assembly and/or Natural C)? IMGLIB and DSPLIB for example include source code.
    A. VLIB is not publicly available with source code.

    3. Is there any way to modify the various parameters of the VLIB Kernel Functions without applying them separately? Similar to Matlab "edge" function for example.
    A. No

    4. Is there a code sample that shows how to optimally apply VLIB Canny Edge Detection by applying the 5 VLIB_Canny_Edge_Detection Base Kernels Separately?
    A. You can reference the following test file: src/VLIB_hysteresisThresholding/VLIB_hysteresisThresholding_d.c. This file does the same first few function calls as the Canny Wrapper function. The difference is that instead of calling hysteresisThresholding function, the canny function calls VLIB_doublethresholding() and VLIB_edgeRelaxation().

    5. After breaking up the VLIB_Canny_Edge_Detection to its building block, it seems like the last stage: VLIB_edgeRelaxation has no effect. Why?
    A. This is data dependent. This essentially promotes POSSIBLE_EDGES (127) which are in the 8 pixel neighborhood of strong edges (255). If your image does not have any such cases, then this will not have any effect. If you try a real image, you may be able to see some POSSIBLE_EDGES converting to strong edges in the edgeMap.

    Note that you can replace the doublethresholding and edgeRelaxation functions with a single hysteresisThresholding function if you want. I think this single function was broken into 2 parts (doublethresholding and edgeRelazation) in case you want to perform block based operations (using DMA), the doublethresholding function allows you do do that.

    Jesse
  • Hi Jesse,

    Thanks allot for your answer.

    1.

    I tried the VLIB_hysteresisThresholding, and it seems that the exact same results are achieved as with applying the VLIB_doublethresholding (the VLIB_edgeRelaxation seem to have no effect).

    When applying Matlab Canny edge detection on the same image, I get nice continuous edges. Any suggestions?

    2.

    Regarding VLIB source code, can TI supply the Natural C code?

    Thanks,

    Avi Tal.

     

  • Is it possible for you to send the input to this function, and the expected and actual output so we can review?

  • Sure.
    I can send you everything.
    Can you give me an email?
    My email is avi_tal@012.net.il
    Thanks,
    Avi Tal.