darsia.extract_quadrilateral_ROI#

extract_quadrilateral_ROI(img_src, pts_src=None, indexing='reverse matrix', interpolation='inter_linear', **kwargs)[source]#

Extract a quadrilateral ROI via a perspective transform.

The corner points of a (by default square) object are assumed known.

Parameters:
img_srcnp.ndarray

Source image.

pts_srcarray, optional

N points in pixels; several indexing formats are accepted.

indexing{“matrix”, “reverse matrix”}

Indexing of the pixels (only relevant when pts_src is a list or np.ndarray).

interpolationInterpolationOption

Interpolation method, adopted from OpenCV.

**kwargs

Physical geometry of the target object:

width (int | float)      width of the physical object
height (int | float)     height of the physical object
pts_src (array)          N >= 4 points in (col, row) pixel format
pts_dst (array)          N >= 4 points in (col, row) pixel format