2D Image Shift

Shift a 2D image (2D array) by a given subpixel amount specified by a shift vector `[shift_row, shift_col]`. Positive shifts move the image content down and right. This task uses cubic spline interpolation (order=3) and handles boundary conditions using the 'constant' mode (padding with 0).

Input:
A dictionary with keys:
  - "image": A list of n lists of floats (in the range [0.0, 255.0]) representing the n x n input image.
  - "shift": A list of two floats `[shift_row, shift_col]` representing the shift amounts.

Example input:
{
    "image": [
        [0.0, 0.0, 0.0],
        [0.0, 255.0, 0.0],
        [0.0, 0.0, 0.0]
    ],
    "shift": [0.5, -0.5]
}

Output:
A dictionary with key:
  - "shifted_image": A list of n lists of floats representing the n x n shifted image.

Example output:
{
    "shifted_image": [
        [0.0, 0.0, 0.0],
        [0.0, 47.8, 47.8],
        [0.0, 47.8, 47.8]
    ]
}

Category: signal_processing