EatTheFuture/camera_projector

FEATURE REQUEST: "undistort"

marklio opened this issue · 3 comments

This tool rocks! I'm wondering how feasible it is for this to handle "undistorting" footage when reprojecting it.

As you are no doubt aware, when using "traditional" camera tracking/compositing, the blender compositor has a node to "undistort" the movie clip so that compositing the output from blender's non-distorted camera can work. It would be amazing if camera_projector could do the same thing. Otherwise, objects that span a large part of the screen, or are near the edge of distorted footage aren't stable through panning.

I've found this is particularly true of drone footage I work with, and it renders the "viewport as compositor" approach useless without undistorting the footage first.

That sounds feasible to me, yeah. I admit that I'm not thrilled at the idea of digging through Blender's source code to reverse-engineer a matching undistort formula. But at least in principle it shouldn't be too hard, as long as the formulas are analytic.

I assume this isn't strictly a blocker for you, since you can presumably pre-undistort the footage as mentioned?

(This also reminds me that, ultimately, I'd like to make this a built-in node in Blender. It really ought to be one. And then it might(?) be easier to just reuse the existing undistort code. Of course, there's a lot more up-front work to take that route, and it would take time to get into a Blender release in any case.)

This is definitely not "blocking". Undistort also prevents the use of the built-in UV projection mechanism. A "viewport as compositor" workflow with distorted footage would be to motion track footage, then use blender's compositor with an undistort node to generate an "undistorted" image sequence. Then, that undistorted sequence would be the texture source you'd project onto geometry.

Just some other thoughts/observations... Undistort appears to be driven from the K* factors that are generated when motion tracking (or otherwise specified). This seems to be a separate "kind" of movie clip than the one you use in the shader editor (it doesn't show up in the dropdown in the shader editor, and you have to load it again), so those may not be connected in a useful way.