2D interpolation

I've developed a little program that let me load an image then make some angle measurements onto it. Here is a screenshot (there is no image loaded in this screenshot).

When all the measurements are done I have a list of x, y and angle values. What I'd like to do is interpolate them to generate some kind of graph. I would prefer to directly implement this functionality and not rely on any other library (as long as it's possible and not to complicated).

So basically I see two steps, first interpolating the data, second, generating a graph from it.

At first I was going to implement some bicubic interpolation but this kind of interpolation needs a regular grid, which I can't ensure.

For the moment I think I have to main options:

  1. Convert my data to a regular grid and then do a bicubic interpolation.
  2. Find an other kind of interpolation that doesn't require a regular grid.

What way do you think I should go and do you have any idea of which grid-redefining/interpolation I should use? I don't have any opinion on both methods but I think this is going to take me a lot of time and I wouldn't like to realize in the end that I am in a dead-end.

If this is of any relevance I'm working with Qt and on windows.

Edit: Basically I want something like that in the end:


What you are looking for is a 2D Least squares fitting function, and generating a heat map or a 3D surface.

QWT is nice library that can help with graphing it, but it is doable without it.

Google Least Squares 2D Calculation

Need Your Help

lua and lsqlite3: speeding up select statement

database performance sqlite3 lua

I'm using the lsqlite3 lua wrapper and I'm making queries into a database. My DB has ~5million rows and the code I'm using to retrieve rows is akin to:

Doctrine: Update Join?

join symfony1 doctrine

Anyone know how to do an update with a join (i.e. update on two tables in one query) in Doctrine 1.2?