AnsweredAssumed Answered

How many cycles does BF707 consume for Blackfin Image Processing Toolbox's Contours?

Question asked by thirdUncle on Aug 11, 2015
Latest reply on Aug 26, 2015 by rsingh

Hi,

I would like to estimate the amount of time consumed in Blackfin Image Processing Toolbox's Contours, which is equivalent to OpenCV's function,

cv::findContours(mono_img, contours, cv::RETR_EXTERNAL, cv::CHAIN_APPROX_NONE).

 

Your Image_Tool_Box_ProductReferenceGuide_Rel2.4.0.pdf says that:

  8.42 Contours

  Contours Sequence of API calls to trace contour of input binary image

  adi_DynamicMemInit                /* Dynamic Memory Init */

  adi_contour_RLE                   /* Run-Len Encode inputimage */

  adi_contour_segment_image         /* Segment image */

  for each segment

    adi_contour_BoundingRectangle   /* Find bounding rectangle of segment */

    adi_contour_SplitSegmentRowWise /* Split list of RLE nodes of a segment row-wise */

    adi_contour_TraceContour        /* Trace Contour of Segment */

so I estimated as follows where BF707@400MHz, image size = 320x240, 10 ellipses(no overlapped) about 30x40 and each function's Average Cycles/pel from Image_Tool_Box_ProductSpecs_Rel2.4.0.pdf,

     'adi_DynamicMemInit'               4.4,

     'adi_contour_RLE'                 13.41,

     'adi_contour_segment_image'       19.99,

     'adi_contour_BoundingRectangle'    3.25,

     'adi_contour_SplitSegmentRowWise' 13.41,(note)

     'adi_contour_TraceContour(1pass)' 17.23.

  note) adi_contour_SplitSegmentRowWise's Average Cycles/pel is assumed to be the same as adi_contour_RLE because no data about adi_contour_SplitSegmentRowWise.

 

  adi_DynamicMemInit              consumes    337,920.0 cycles =  4.40 *  76,800(pixel*call).

  adi_contour_RLE                 consumes  1,029,888.0 cycles = 13.41 *  76,800(pixel*call).

  adi_contour_segment_image       consumes  1,535,232.0 cycles = 19.99 *  76,800(pixel*call).

  adi_contour_BoundingRectangle   consumes  2,496,000.0 cycles =  3.25 * 768,000(pixel*call).

  adi_contour_SplitSegmentRowWise consumes 10,298,880.0 cycles = 13.41 * 768,000(pixel*call).

  adi_contour_TraceContour(1pass) consumes 13,232,640.0 cycles = 17.23 * 768,000(pixel*call).

  Total cycles for 1 frame: 28930560

  Total time for 1 frame: 72.32640ms

 

Is above likely or not?

And I'd like to know adi_contour_SplitSegmentRowWise's average Cycles/pel.

 

Thanks,

Outcomes