Kalman Filter for vtkTransform

Hi Developers

I am currently implementing a pose Kalman Filter using MEKF as a spare-time project. This means that I could add this as a contribution to the VTK repository if you think it is a good idea.

So far, I have created a source, which own a reference to a vtkTransform object. On the output port, 4x4 matrices is output and is exposed downstream using wall clock. I have used the keys for handling temporal information.

I am considering writing the Kalman Filter with two output ports, one for the filtered and one for a predicted output, where the last measurement is ignored. The filter own a reference to a vtkTransform, which is updated whenever the filter is updated.

Is this a terrible approach? Would it make sense to also inherit vtkLinearTransformation and do everything internally. Such a module could then either just use wall time or receive timestamps on an input port.

Any thoughts are welcome.

Thanks in advance

Hello,

From what I could understand, that sounds a little like application-specific or a better fit to a higher level library based on VTK (see this example). I mean, I didn’t understand that as recurrent problem unit in many computer graphics applications (e.g. interpolation, geometry operator, etc.) typical of an API of the abstraction level of VTK. Perhaps you could improve the clarity of you proposal with more details, for example: a) state the problem; b) state the objetive; c) lay out the overall algorithm or method; or simply add some figures.

regards,

Paulo

Hi Paulo

You are right. It is not a recurring problem in general 3D graphics applications. I will look into the example and see how they build their functionality on top of VTK. Perhaps, I can find some inspiration.

The only general use that I can think of are situations where actors are moved using input from sensors or using input and the movement needs to be more smooth…

Hi, Jens,

Please, don’t quit it yet. Let’s hear what others have to say.

take care,

Paulo

1 Like

Hi Jens,

You could try posting in the AR/VR category if you don’t get many replies here in the Development category.

A class that has outputs for two matrices is probably the best architecture.

I advise against deriving it from vtkLinearTransform, because even though this will make some use cases more convenient, it makes the class less general. If you write the class like a filter (your first proposal), then later someone can add a vtkLinearTransform-derived class that uses the filter class internally, if they find that they need one.

David

1 Like

Thanks David

I also leaned more towards a filter which could take as input 4x4 matrices and/or use input from a vtkTransform.

I think that I will move the post to the AR/VR group. So far I have only worked on the core of the algorithm and introduced a number of test cases.

Thanks for reaching out

I don’t really understand what are the form of your data in your Kalman filter. Is the input state a set of points that you’re trying to move? Or is it more general and abstract kind of state?

Do you expect users of your filter to cascade them by hand in a for loop, or do you plan on creating a more global filter that runs each step automatically and outputs the final result that you’re looking for?

Hi Yohann

The pose Kalman filter receives poses over time. It has memory. It will output filtered poses and if the input is not updated a pure predicted pose can be output. For this reason, I will prefer two output ports.

My idea was that the filter will use either temporal input or the wall clock for adding the time dimension to the equations.

For the filter, it’s better to have a temporal input, any wall-clock checks should be done outside. This will allow people to filter the wall clock measurements if they want to do so. Also, some devices might provide their own clock signals.

Hi David

Yes and no. I was thinking to introduce a mode property. Time can be taken from input together with data or time is wall clock and data is taken from a vtkTransform given to the module. In this way everything is possible and you can use it in a simple way for filtering a vtkTransform, also. If an input is set supplying temporal data, this can be used instead.

I could imagine most people will use it for simply smoothing out vtkTransform using wall clock. This will be my primary use and where I will start…

I believe the lack of integer time stamps in the pipeline will be the primary issue for people using sensors… Not that the module has a SetTransform function they can ignore if they want to provide temporal input.