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.

EVE: Canny Edge Detector output doesn't match with Expected (opencv's) output

Hello,

I executed canny edge detection applet provided by TI.

But not getting expected output as opencv's edge detection output.

Please find attached snap for your reference.

Original Image:- input image

Edge Image :- opencv's canny output

apple640x480_canny_50_150.y :- TI's canny output

Just want to know whether TI's output is correct (then why not matching  with opencv's output )  or am I executing in wrong way??

I thought maybe issue is with threshold values which we provide from config file, so I changed them and tried but  it's not expected as opencv.

Other thing is,

output has last 5 columns and last 2 rows garbage data >> why??

Regards,

kajal

  • Hi Kajal,
    At what stage you dumped the output from EVE edge Detector applet? It is important to note that when method used is Canny the output is not the edges detectd. Instead output is an image with each pixel classified into three states:
    Pixel value 0 : For non edge pixels
    Pixel value 1 : For Pixels which are above low threshold and beloe the high threshold
    Pixel value 255 : For Pixels which are edge pixels

    So can you confirm that the dump which you are mentioning here is after EVE or after doing the hysteresis

    Regards,
    Anshu
  • Hello Anshu,

    The output has dumped after whole process is done, meaning,  after the kernel " vcop_canny_non_maximum_suppression"  ( includes NMS and hysteresis stages of canny) execution .

    You:-It is important to note that when method used is Canny the output is not the edges detectd.

    >> I think you are talking about outputFormat = 1 i.e. for binPack edgeMap

    In configuration file, I have selected outputFormat =0 (i..e for byte edge map ) .

    Following snippet in "iedge_detector_ti.h" file also tells that, "output should contain 255 ( if an edge is there) and 0 ( not an edge) "

      EDGE_DETECTOR_TI_OUTPUT_FORMAT_BYTE_EDGEMAP: Output edge map image whose
          each pixel  value is 255  if its an edge and 0 if its  not an edge

      EDGE_DETECTOR_TI_OUTPUT_FORMAT_BINARY_PACK : Output edge map as a binary image
         with following mapping
         Byte0 -> Bit0 (LSB of the byte in binary image)
         Byte7 -> Bit7 (MSB of the byte in binary image)

         pixels :0 1 2 3 4 5 6 7 8 9 10 will be present as
         Binary : 7 6 5 4 3 2 1 0 15 14 23 12 11 10 9 8 .... and so on


    */
    typedef enum
    {
      EDGE_DETECTOR_TI_OUTPUT_FORMAT_BYTE_EDGEMAP = 0,
      EDGE_DETECTOR_TI_OUTPUT_FORMAT_BINARY_PACK
    } EDGE_DETECTOR_TI_OutputFormat;


    So, there nowhere mentioned about pixel value as "1" and inside code also values ( 0 and 255 ) are setting as per threshold value.

    The output image also contain 0 and 255 values.

    Guide us for the same!!

    Regards,

    Kajal.

  • Any update??

    Regards,

    Kajal

  • Kajal,

        We don't run all the steps of Canny Edge detection on EVE as the last step of edge relaxation is not suitable to be implemented on EVE. We do have a reference C code for the same (edge relaxation) in edge detection test bench ( vcop_edgeRelaxation_cn). Can you confirm that you are doing this step before dumping the output?


    Regards,

    Anshu

  • Kajal,
    Were you able to make progress on this?

    Regards,
    Anshu
  • Hello Anshu,

    I checked/dumped output with edge relaxation part also. but output is same except the border side of image.

    As per canny Edge detection algorithm, edge relaxation is not a part of that. What is purpose of doing edge relaxation??

    Regards,
    Kajal

  • Kajal,

       The output of EVE canny edge detection clasifies edges into 3 parts : Strong edges, weak edges, no edges. Edge relaxation ( also called as Hysteresis) is the step which parse the full image and convert weak edges into strong or no edges. This part of the processing is not done in EVE. I am suspecting that what you are  is only strong edge and no edges ( thats why their seems to be holes in the output edges).

    Regards,

    Anshu

  • Kajal,
    Can you update us on this thread? If you are able to proceed then please close this thread.

    Regards,
    Anshu