cars.applications.resampling.resampling_algo

Resampling module: contains functions used for epipolar resampling

Functions

epipolar_rectify_images(left_imgs, right_imgs, grid1, ...)

Resample left and right images

resample_image(imgs, grid, largest_size[, step, ...])

Resample image according to grid and largest size.

oversampling_func(grid_reader, img_reader, ...)

Do the resampling calculus

to_band_format(edges_dict)

Helper function, that takes the edges input dict and transforms it into a

Module Contents

cars.applications.resampling.resampling_algo.epipolar_rectify_images(left_imgs, right_imgs, grid1, grid2, region, margins, epipolar_size_x, epipolar_size_y, interpolator_image='bicubic', interpolator_classif='nearest', interpolator_mask='nearest', interpolators_edges=None, step=None, mask1=None, mask2=None, edges1=None, edges2=None, left_classifs=None, right_classifs=None, nodata1=0, nodata2=0, add_classif=True, add_edges=True)[source]

Resample left and right images

cars.applications.resampling.resampling_algo.resample_image(imgs, grid, largest_size, step=None, region=None, nodata=None, mask=None, band_coords=False, interpolator_img='bicubic', interpolator_mask='nearest', img_transform=None)[source]

Resample image according to grid and largest size.

Parameters:
  • img (string) – Path to the image to resample

  • grid (dict) – rectification grid dict

  • largest_size (list of two int) – Size of full output image

  • step (int) – horizontal step of resampling (useful for strip resampling)

  • region (None (full output is produced) or array of four floats [xmin,ymin,xmax,ymax]) – A subset of the output image to produce

  • nodata (None or float) – Nodata value to use (both for input and output)

  • mask (None or path to mask image) – Mask to resample as well

  • band_coords (boolean) – Force bands coordinate in output dataset

  • interpolator (str ("nearest" "linear" "bco")) – interpolator type (bicubic (default) or nearest)

Return type:

xarray.Dataset with resampled image and mask

cars.applications.resampling.resampling_algo.oversampling_func(grid_reader, img_reader, img_transform, block_region, interpolator_img, band_coords, nb_bands, bands, resamp, nodata, msk, mask, nodata_msk, interpolator_mask, ysize, xsize, ystart, xstart)[source]

Do the resampling calculus

cars.applications.resampling.resampling_algo.to_band_format(edges_dict)[source]

Helper function, that takes the edges input dict and transforms it into a band format image, so resampling can understand it