neon29
neon29

Reputation: 299

Image warping by means of a vector field using Python

I have two images of the same size and I have computed a vector field to warp the second image onto the first one.

However, as my vector field is computed over a grid with a 10 pixels spacing along both directions, I would like to define such a vector field but for all points of my image.

Thus, I am wondering how I could achieve this.

Upvotes: 1

Views: 1702

Answers (1)

jake77
jake77

Reputation: 2034

Possibilities:

  • interpolate between the points - 2D interpolation over regular grid, should be fast, using scipy
  • compute your vector field for a 1-pixel resolution
  • reduce the size (using PIL) of your original image and use the 10-pixel vector field

Either case it is a tradeoff between image size/quality and speed.

Upvotes: 1

Related Questions