Lamp
Lamp

Reputation: 342

How to perform Bilinear Interpolation to a masked image?

Suppose I have an image with mask, valid pixels are masked as 1 and others 0, how to perform bilinear interpolation to fill all the invalid pixels?

for example, image: 1, 0, 0, 4

mask: 1, 0, 0, 1

interpolation result should be: 1, 2, 3, 4

The valid pixels are not regularly arranged, a more complicated sample, image:

4, 0, 6, 0,

0, 8, 5, 0

5, 3, 0, 0

mask:

1, 0, 1, 0,

0, 1, 1, 0

1, 1, 0, 0


interpolate with scipy.interpolate.interp2d and the result has many holes and noise uv of vertex uv after interpolation

Upvotes: 1

Views: 1196

Answers (0)

Related Questions