numpy - Interpolation over regular grid in Python -


I am struggling to penetrate the data of "empty" pixels in my 2D matrix. In fact, I understand (but deeply) interpolation techniques such as inverse distance weight, cringing, bikebik etc. I do not know the starting point at all (either in the problem or statement of the python case).

Problem definition: I have an MxN matrix (regular grid) in which each pixel represents some measurement value ( figure below < / Strong> and the data used in this data ). I wanted to add data to the "question mark location" (white space consists of the same size but empty pixels) using the data present in the form of "blue pixels"

evaporation in space

My question: < / Strong>

1) How can I add this data? Can someone give me a general example (for example 3x3 matrix) to understand clearly?

2) Can someone guide me how to take action in the solution of Python environment?

3) How can I compare interpolation techniques in the sense of accuracy using Python?

4) Do you think it is a good idea to use different interpolation based on the density of the data?

Appreciate your answers and suggestions.

What is a sensible solution, it primarily depends on which question you are trying Answers with Interpolated Pixels - Warning Epitars: Extrapolating on missing data can be very confusing answer!

Radial Basis Function Interpolation / Kernel Smashing

In terms of practical solutions available in Python, one way to fill those pixels, Residential Basis Function Interposition ( See) the implementation of the Esipps which will be used to launch the smoothing / inter-scattered data.

Your metrics are given to M and the built-in 1D coordination arrays r and c (e.g. M.shape == (r.size, c.size) ), where M's entries are set to nan , it works quite well with a linear RBF kernel as follows Import the salt in the form of import as scipy.interpolate as interpolate ('measurement.txt') as fh: m = np.vstack (map (float, R.split ('')) RFID for RF. SplitLine S ()) R = N.P.Linespace (0, 1, M. size [0]) C = N.P.Linespace (0, 1, M. shape [1]) RR, cc = np.meshgrid (r, c) Vals = ~ np.isnan (m) f = interpolate.rbf (rr [vals], cc [vals], m [vals], function = 'linear') interpolated = f (rr, cc)

This generates the following projection of the data linked by you above, although, as appropriate, it shows how much the actual data of salt samples are unfavorable:

"Https://i.stack.imgur.com/MkiEs.png" alt = "RBF Interpolito Gassection Process Not available / Cringing

The Killing Projection implementation is available through the implementation of the Dancy Cringing Toolbox (which is itself based on Daisy Cribing Toolbox), it can be implemented as follows: sklearn.gaussian_process Gauci Process GP = Gaussian Process (theta0 = 0.1, thetaL = .001, thetaU = 1., Naget = 0.01) from gp.fit (X = Np.column_stack ([rr [vals], cc [vals]], y = m [Vals]) rr_cc_as_cols = np.column_stack ([rr.flatten (), cc.flatten ()]) interpolated = gp.predict (Rr_cc_as_cols). Reperfect (M. shape)

This generates a very similar interpolation in the example of the above radial bases function. There are several criteria for exploring both cases - they are liked if they are guessed about these data. (An advantage of the linear kernel used in the example RBF given above is that there is no free parameter in it)

Inpinning

In the final form, using a complete solution OpenCV functionality It will, although it recognizes 8bit arrays (0 - 255), and does not have a simple mathematical explanation.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

How to access user directory in lazarus? -

java - Gradle dependencies: compile project by relative path -