Making a 2D pyramid in MATLAB

To make a square-base 2D data pyramid in Matlab, where:

N: number of pixels per side (e.g. 512)

MinVal: minimum data value (e.g. 0)

MaxVal: maximum data value (e.g. 65535)

use the code

Here, the values at the “base” of the pyramid are zero, and increase linearly on each side to 65,535. This sort of figure might be useful when testing an optical flow algorithm.

Categories:

Updated:

Leave a Comment