2D Affine Transform

Apply a 2D affine transformation to an input image (2D array). The transformation is defined by a 2x3 matrix which combines rotation, scaling, shearing, and translation. 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.
  - "matrix": A list of 2 lists (each with 3 floats) representing the affine transformation matrix.

Example input:
{
    "image": [
        [100.0, 150.0, 200.0],
        [50.0, 100.0, 150.0],
        [0.0, 50.0, 100.0]
    ],
    "matrix": [
        [0.9, -0.1, 1.5],
        [0.1, 1.1, -2.0]
    ]
}

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

Example output:
{
    "transformed_image": [
        [88.5, 141.2, 188.0],
        [45.1, 99.8, 147.3],
        [5.6, 55.2, 103.1]
    ]
}

Category: signal_processing