Adjust points to gradient🔗

Adjusts the given points in the input image towards maximum gradients and filters out the points which are surrounded by too similar points. Similarity is measured by calculating gray-level difference of each input point to the points distance pixels away in 8 directions. If the largest difference is more than similarityThreshold, the point is nudged towards the maximal direction. This is repeated up to maxSteps times. Typically, the coordinates of the input points come from :doc:grid generation tool <GenerateGridTool>.


  • image: Input image.

  • points: Pixel coordinates of input points. A N-by-2 matrix.

  • distance: Distance between pixels in gray-level difference computation.

  • similarityThreshold: Points with gray-level difference smaller than similarityThreshold are rejected. The bigger the threshold, the fewer output points there will be.

  • maxSteps: Maximum number of steps the maximal gradient search algorthm can take.


  • points: Pixel coordinates of output points. A N-by-2 matrix. There will be no duplicates (even if the set of input points contained duplicates.)