The composition of distortion



Hello))) I have problems renderer pictures. I can not correct for the distortion of the composite image. How do I solve this problem?

I add more pictures with my problem. I know how to do it in other programs, but I want to learn how to do in a blender. Help me.

source file GoPro fisheye

Attachments


Hi, welcome to the forums!

I’m guessing your object is really big and has exceeded the camera clipping boundary. Select your camera and check the camera context of the properties editor. In the lens panel increase the end clipping.

If that is not the issue, try uploading the blend. It’s a bit too hard to read the nodes from your image to determine if it is there somehow.

Hope you figure it out!



I add more pictures with my problem. I know how to do it in other programs, but I want to learn how to do in a blender. Help me.

I add more pictures with my problem. I know how to do it in other programs, but I want to learn how to do in a blender. Help me.





I add more pictures with my problem. I know how to do it in other programs, but I want to learn how to do in a blender. Help me.


I add more pictures with my problem. I know how to do it in other programs, but I want to learn how to do in a blender. Help me.




This is one of the challenges of match moving and fx shots. CG ‘lenses’ just don’t distort in the same ways as RL lenses. When doing the motion tracking, if you can get the focal length and sensor size settings as accurately as you can, Blender can often work out a good approximation of the real lens distortion as part of the solve. Refine K1,K2 as a starting point in the solve tab, and you’ll see those values in the Movie editor, lens settings.

Then in compositing I use the Movie Distortion node to ‘Undistort’ the footage, then composite the cg elements, then distort the whole image back again with the MD node at the end of the chain.

Hope that helps.




You must render your 3d elements in the resolution of undistorted footage, NOT original footage. This way you get all the data necessary to fill the whole image after applying distortion.

At the moment the image border cuts the building object from place that is not on frame border after distortion and it results in visible gap.

The red box on your drawing correctly indicates the size of image that must be rendered and as you mark, the resolution depends on distortion parameters.



oh)))) I’m here for the first time and do not know how to use the post))) I’m sorry for the mess))))

I see your problem. Anyone know how best to deal with this? Simply increasing the render resolution just gives me the same render at higher resolution.

Seems like this would be a common issue with matchmoving—rendering non-distorting cg then distorting to match background. Maybe we need a new rendering option to somehow render this extra area to allow for distortion in compositing…

Could you explain the workflow for this? I tried it as an experiment and had no luck.

Sorry, I have not done any tracking in Blender, so I can’t explain exact workflow in Blender. I am a SynthEyes user myself.

The main steps that must be done are:

  1. Undistort the camera footage
    The result of this stage is an image that is larger than original and positioned in a way that optical center of image is in the center of the frame.

  2. Track the undistorted footage
    This gives you the camera data. The solved FOV most probably will not match the FOV that you would get when tracking the original image, at least in Blender! The reason for this mismatch is that the FOV is calculated based on the whole image and the undistorted image is bigger both in resolution and also the angular span, thus the FOV can not be the same. Blender does not pad the undistorted image, instead it crops it to original resolution. It results in part of image being lost behind the frame, and, in reverse, parts of CG elements missing after distorting it (the problem this topic started from).

  3. Render your 3D elements and distort & crop them to match the distortion in original camera footage.
    This distortion must invert the undistortion operation in step 1 but for CG elements.

  4. Composite the distorted CG elemets with original camera footage
    You want CG to match camera, not the other way around. For this reason you will not change the camera footage! Ofcourse sometimes you need to remove the distortion in original footage for aesthetical or whatever reasons, but this is another topic.

How it is achieved in Blender, I don’t know. After fussing around a bit I did not find a way to undistort footage without losing parts of it because they move beyond frame borders. Maybe there is the padding option somewhere, but I did not find it. As I said, padded image MUST have bigger resolution than original, if it does not, something is messed up.

Example padded undistorted image. Original resolution 1920x1080, undistorted and padded resolution 2026x1140. Note the curved edges and black areas where original image data is missing:


Yes that is exactly what I was trying to do, as is the OP I think. Does anyone else know of a way to do this in Blender? I.e. render the cg elements with a wider FOV to match undistorted background footage?

If not I think this would be a useful thread to bring to the attention of some devs + Seb König, and hopefully find a solution for.

Hammers, is a good idea to inform the developer)))))

I’m just not 100% sure if there is a workaround in Blender, and would love to hear if anyone has a solution. In summary what we want to do is:

  • track footage [check √]
  • solve camera and setup scene [check √]
  • add 3d elements to tracked scene (undistorted typically) [check √]
  • render 3d elements with wider FOV somehow (padded?) to match full area of footage [can this be done somehow?]
  • redistort 3d render in composite, to match original distorted footage, retaining extra area so edges of 3d are not cropped. [guessing this should be easy-ish with current undistort node if previous step is achieved]

If anyone’s got any ideas for this workflow please chime in, otherwise I’ll try to pass this on to Sebastian and/or the dev team.

i run in the same problem recording a tutorial a few months ago but didnt find a proper solution for it, on the bright side sergey fix a bug with the antialiasing of the distort node after being reported but this “cropping” of the image is still a problem

an option that it was mention was to render more image an use that info in that case this scrip from Oscurart can be useful
https://github.com/oscurart/BlenderAddons/blob/master/oscurart_resize_resolution.py


It basically change the field of view, but a t the same changes the render size to match the cropping of the original camera so insted of rendering a 1920x1080 you wil be rendering something about 2k as it was mention, but this would do the set up a bit easier

Wow this sounds like it should be a big help. I’m gonna try that out real soon.

It would be great to extend this tool to integrate with the lens distortion to automatically calculate the required FOV increase. But a useful helped by the looks.