Skip to content

XYZGrid

Eric Swanson edited this page Nov 16, 2023 · 4 revisions

The XYZGrid() Python object holds the real world target grid on which rectification or pixel subsampling will take place. For rectification tasks, the user first initializes an XYZGrid() object. The user specifies x and y limits and resolution of the real- world grid in x and y directions. The value given for z should be the estimated water level at the time of data collection relative to the local vertical datum used in specifying extrinsic information.

class definition

XYZGrid(xlims, ylims, dx=1, dy=1, z=0) Source

 Real world XYZ Grid onto which images will be rectified.
 Limits should be given in local coordinates and have the
 same coordinates as camera intrinsic and extrinsic values.

 For multiple rectification tasks with the same desired grid,
 you only have to initialize this class once.
 Then, call mergeRectify for each set of cameras and images.

 If local coordinates are desired and inputs are not yet converted to local,
 user can flag coords = 'geo' and input local origin.

 If intrinsics are in a format other than CIRN (currently the only other
 supported format is DLT), user can flag mType = 'DLT'.

 Args:
      xlims (ndarray): min and max (inclusive) in the x-direction
          (e.g. [-250, 500])
      ylims (ndarray): min and max (inclusive) in the y-direction
          (e.g. [0, 1800])
      dx (float): resolution of grid in x direction
          (same units as camera calibration)
      dy (float): resolution of grid in y direction
          (same units as camera calibration)
      z (float): estimated elevation at every point in the x, y grid

example

#Grid boundaries
xMin = 0
xMax = 500
yMin = -500
yMax = 1200
dy = 1
dx = 1
z = 0

grid = XYZGrid([xMin,xMax], [yMin,yMax], dx, dy, z)
Clone this wiki locally