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/APPS: Edge_Detector output not generated

Hello,

 

I am trying to build the existing edge_detector apps present in " PROCESSOR_SDK_VISION_03_01_00_00/ti_components/algorithms/eve_sw_01_18_01_00/apps/edge_detector " , included the input_image of size mentioned in config file i.e 640x480, but the output image for sobel is not generated.

so want to know:

--> what should i do to make it work.

-->what is maximum image size we can check with this. can we use HD image with existing code?

--> what could be the maximum block_width, block_height, img_width & img_height  i can use for this existing code.

Regards

Surbhi

  • Surbhi,
    When you say output image for sobel is not generated what do you mean? By default image dumps are disabled and if you want to enable dump of the output image you should set ENABLE_OUTPUT_DUMP =1 in edge_detector_tb.c file.

    Regards,
    Anshu
  • Anshu,
    I am able to get the output image. For sobel any other specific flag is their to enable so to get the edges clear in the output.

    Regards
    Surbhi
  • Kindly refer the interface file.

    /**
    @brief The format in which edge detection output is expected to come

    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;

    Regards,
    Anshu
  • Hi Anshu,

    Can you explain :

    --> how block edges is been managed in this edge_detector (sobel ). As we tried kernel_c code implementation of sobel but block edges are their.

    --> what is the value taken for roundShift?

    Regards

    Surbhi

  • Hi Surbhi,

      What do you mean by block edges? Sobel edge detector first applies sobel operator in X and Y direction which is followed by thresholding.  The threshold used for thresholding is configurable via EDGE_DETECTOR_TI_InArgs->threshold1. Please refer natural C code (function edgeDetector_cn in side edge_detector_tb.c) to understand the processing done in this applet.

    Regards,

    Anshu

  • Hi Anshu

    I got your point. As per my understanding :

    --> before fetching we were not taking the boarders ,so after writing back to external memory the lines of the block were visible.

    --> i want to know the value been used in sobel for roundShift in .k file

    {  outDataX[Addr1].interleave() = (VinterimX1, VinterimX2).round(roundShift).saturate( SAT_LO, SAT_HI );}

    Regards

    Surbhi

  • Surbhi,
    Please find my answers inlined :
    --> before fetching we were not taking the boarders ,so after writing back to external memory the lines of the block were visible.
    Anshu >>> I am still not clear which borders you are talking about. With sobel operator if input width is W then output generated is W-2. We take care of this while DMA. We always DMA the extra data required to compute a block. So there should not be any lines visible across blocks.
    --> i want to know the value been used in sobel for roundShift in .k file
    As mentioned earlier please refer the natural C code it has round shift value used (3).

    Regards,
    Anshu
  • thank you anshu i am able to get that and by saying this:
    --> before fetching we were not taking the boarders ,so after writing back to external memory the lines of the block were visible.
    i meant that we were not managing the DMA properly that's why i was getting that problem.

    Thanks & Regards
    Surbhi
  • Hi Anshu,

    I am unable to understand this:-

    1.--> for which these could be enabled for: (means for sobel / canny) & what is the purpose?

    #define ENABLE_EDGE_RELAXATION 0
    #define ENABLE_TRACES 0
    #define FIXED_PATTERN 0

    #define ENABLE_PROFILE 0

    2.--> why the image_height is increased by 64. as actual image height is taken 480.

     
        idx = EDGE_DETECTOR_TI_BUFDESC_IN_IMAGE;
        inBufs.bufDesc[idx]->numPlanes                                        = 1;
        inBufs.bufDesc[idx]->bufPlanes[0].frameROI.topLeft.x    = 0;
        inBufs.bufDesc[idx]->bufPlanes[0].frameROI.topLeft.y    = 0;
        inBufs.bufDesc[idx]->bufPlanes[0].width                           = testcaseParams[testcase].imagePitch;
        inBufs.bufDesc[idx]->bufPlanes[0].height                     = testcaseParams[testcase].imageHeight + 64;
        inBufs.bufDesc[idx]->bufPlanes[0].frameROI.width         = testcaseParams[testcase].imageWidth;
        inBufs.bufDesc[idx]->bufPlanes[0].frameROI.height       = testcaseParams[testcase].imageHeight;
        inBufs.bufDesc[idx]->bufPlanes[0].planeType                  = 0;
        inBufs.bufDesc[idx]->bufPlanes[0].buf                               = NULL;

    3.--> What is the purpose for writing in the binpack output format.

    4.--> i have attached the actual_input, reference output & the edge Detector(apps ) output for sobel, why this much of difference is their? Is i am missing something?

    image_file.tar.gz

    Regards

    Surbhi

  • Surbhi,
    Please find my answers inline :

    1.--> for which these could be enabled for: (means for sobel / canny) & what is the purpose?

    #define ENABLE_EDGE_RELAXATION 0
    #define ENABLE_TRACES 0
    #define FIXED_PATTERN 0
    #define ENABLE_PROFILE 0

    Anshu >>> All these macros are there in testbench ( and most of it are self explanatory) and if you just search them you will know what they are doing.

    ENABLE_EDGE_RELAXATION : Only for Canny and does edge relaxation as we are not doing edge relaxation in EVE
    ENABLE_TRACES : Just enable traces in the testbench
    FIXED_PATTERN : Instead of random input a fixed input is used
    ENABLE_PROFILE : Just enabled some profiling

    2.--> why the image_height is increased by 64. as actual image height is taken 480.

    idx = EDGE_DETECTOR_TI_BUFDESC_IN_IMAGE;
    inBufs.bufDesc[idx]->numPlanes = 1;
    inBufs.bufDesc[idx]->bufPlanes[0].frameROI.topLeft.x = 0;
    inBufs.bufDesc[idx]->bufPlanes[0].frameROI.topLeft.y = 0;
    inBufs.bufDesc[idx]->bufPlanes[0].width = testcaseParams[testcase].imagePitch;
    inBufs.bufDesc[idx]->bufPlanes[0].height = testcaseParams[testcase].imageHeight + 64;
    inBufs.bufDesc[idx]->bufPlanes[0].frameROI.width = testcaseParams[testcase].imageWidth;
    inBufs.bufDesc[idx]->bufPlanes[0].frameROI.height = testcaseParams[testcase].imageHeight;
    inBufs.bufDesc[idx]->bufPlanes[0].planeType = 0;
    inBufs.bufDesc[idx]->bufPlanes[0].buf = NULL;

    Anshu >>> I don't remember the exact reason now but mostly to handle the extra memory which we would be accessing because the block dimensions used are not always multiple of the image width and height

    3.--> What is the purpose for writing in the binpack output format.
    Anshu >>> The bin pack format helps in DDR bandwidth when there is another applet which wants to use the output of edge detector

    4.--> i have attached the actual_input, reference output & the edge Detector(apps ) output for sobel, why this much of difference is their? Is i am missing something?
    image_file.tar.gz
    Anshu >>> Reference data which you shared is all random data. What exactly is your reference data here?

    Regards,
    Anshu
  • Surbhi,
    Is there any open question in this thread? Can you close this if you are able to make progress.

    Regards,
    Anshu