React Native OCR - v0.11.0
    Preparing search index...

    Function warpByGridTensor

    • Resamples a uint8 [height, width, channels] image tensor through a grid_sample-style backward field, as produced by the UVDoc dewarping model, into a new tensor of the same size.

      grid is a float32 tensor of shape [2, gridHeight, gridWidth] (a leading batch dimension of 1 is accepted): channel 0 holds x and channel 1 holds y, both normalized to [-1, 1] with align_corners = true. The grid is bilinearly upsampled to the image size natively, so it may be much coarser than the image. Sampling is cv::remap. Images of 1 to 4 channels are supported. The caller owns every tensor involved.

      Parameters

      • image: Tensor

        The image to warp.

      • grid: Tensor

        The sampling grid.

      • Optionaloptions: WarpByGridOptions

        Interpolation and border handling.

      Returns Tensor

      A newly allocated tensor of the same shape as image.

      With code INVALID_ARGUMENT when the tensors are not of the expected dtype and rank.