Video and Image Processing Suite User Guide

ID 683416
Date 4/04/2022
Public
Document Table of Contents

8.6.1. Edge Detection

You can determine what constitutes a blurred edge by setting upper and lower blur thresholds (either at compile time or as run-time controlled values). The edge detection is applied independently in the horizontal and vertical directions according to the following steps:

  1. The target pixel is compared to the pixels immediately to the left and right.
  2. If both differences to the neighboring pixel are less than the upper blur threshold, the edge detection continues. Otherwise, the pixel is considered to be part of an edge that is already sharp enough that does not require further sharpening.
  3. If the differences to the pixels to the left and right are below the upper blur threshold, the differences between the target pixel and its neighbors 1, 2, and 3 pixels to the left and right are calculated.
  4. You may configure the range of pixels over which a blurred edge is detected.
    • Setting the Blur search range register to 1 means that only the differences to the neighbors 1 pixel to the left and right are considered.
    • Setting the register to 2 increases the search across the 2 neighboring pixels.
    • Setting the register to 3 increases it to the full range across all 3 neighbors in each direction.
    The value of the blur search range can be updated at run time if you turn on run-time control feature for the 2D FIR II IP core.
  5. If the difference to any of the enabled neighboring pixels is greater than the lower blur threshold, the target pixel is tagged as a horizontal edge. Otherwise, target pixel is considered to be part of an area of flat color and left unaltered.
Note: The algorithm is described for horizontal edge detection, but the same algorithm is used for vertical detection, just replace left and right with above and below.