Camera/Object tracking - object behind wall

I’m using Blender tracking to track a moving object about a metre in front of a wall. The object moves slowly with some slight rotation. Thanks to previous help here, the camera is now moving slowly. The camera is about 4 m away. I track the camera based on points on the wall (it has an L shape with depth). Both object and camera track well. The camera is a Canon IXUS220 HS. I’ve set up a camera parameters py based on camera spec data.

camera.sensor_width = 7.6
camera.units = ‘MILLIMETERS’
camera.focal_length = 4.3
camera.pixel_aspect = 1

However, when I view the tracks, the object appears behind the wall. I’ve tried various “refine” options without benefit.

Can anyone help please ?

I believe if you go into the reconstruction settings for the object you’ve tracked, you can set the distance between two points on that object and it will move the whole thing closer or further away depending on what distance you put in. (I’m suggesting this from memory since I’ve only watched tutorials on object tracking and haven’t had the chance for practical experience yet.)

How much solve error did you get when you solved your camera motion ? If it’s higher than 3 you’ll need to consider other tracking points or refining the tracks.

it looks like your camera data is not quite correct… a 1/2.3 type sensor is typically ~6.17mm wide not 7.6mm (7.6mm would be a diagonal measurement)

so try 6.17 & 4.3 as your camera stats… better yet, use the 35mm equivalents ( 36mm sensor width & 24mm focal length)

Little-me, The object error was 1.2 but the camera error was 5.8. I re-did some of the tracking and got the error to 2.5 but it hasn’t fixed the problem.

steve, I can’t see where to make your suggested change.

gpa, I’ll give that a try.

I might just try starting again from scratch. I’ve found the prepass and normalize may be slow but they make a huge difference to tracking.

I indeed found the same problem with your sensor width.
Also make sure that your shot was made without any zoom. If it was at minimum zoom your focal length seems correct.

Concerning the solve error, a value over 3 means that the tracking isn’t good and will be jittery/incorrect. Values between 1 and 3 aren’t very good but you should be able to work with the camera solution without too many issues. Below 1 means that you have a good track. I’ve heard people say that for tracking scenes in film productions, they consider that a track is close to perfect when the solve error is below 0.5.

I’ve tried doing it all again. The tracking is in front of a brick wall and I’m using marks on the bricks to track the camera. I get a camera solve error of 3.0. The tracking error is 1.2. There was no zoom on filming.
The object still appears behind the wall. The object is a pyramid with 8 points on the base with the apex towards the camera.
It also appears as though the object is stretched along the axis to the camera. Perhaps there’s a way to scale this ?

I used an HV30 camera this time. FL=4.04 W= 5.37
I did get better looking solutions, that is object in front of wall, by changing the camera settings, such as W=11, FL=24. However W=36mm, FL=24mm still puts the object in the wall.

Further checking the 3D view shows that something quite strange is happening. Parts of the wall that are closest to the camera appear further away in the 3D view. However Num0, camera view, with the video as background, seems fine. Somehow everything is getting inverted on the camera axis.

You can try fiddling with the A&B keyframes and solving again. I could be wrong, but my guess that your problems appear because of your high solve error. Or there’s a problem with the footage…

yea, I think I’m with Little-me on this one. However, just for object scale and distance from the camera after the solve, let me go in a bit more detail.
In the movie clip editor where you did your tracking, click on the tab at the bottom of the screen that says ‘tracking’ and change it to ‘reconstruction’. This changes your tool panel options slightly. On the left side of the screen you should now be able to scroll down and see a section called ‘object scale’ with some options for scale and distance. Select two points that you’ve tracked and type in their distance from each other (in meters) in the area below the ‘set scale’ (or ‘set distance’…can’t really remember now) button and then click that button. Above that button is another value slider that you can use to manually tweak the object’s distance from the camera if you need to.

but yeah, it sounds like you need a better solve too…at least for the camera. 5 is too much.

Thanks for that Steve. I can see set scale but not the object distance. I also played around with the “wall” button (above the set scale) but I couldn’t get it to set the plane as the wall.

I do now suspect the camera. I’ve tested several different scenes with the IXUS but always get a camera solve error around 3. Changing A and B does not have much effect. Various refines don’t help either.

I’ve done some testing with my HV30. The best I can get is about 2.2 with the best individual track 1.4. I rendered to remove interlacing.

Is it possible that interlacing or the rolling shutter in CMOS cameras is causing the high tracking errors ?

Do the tracking markers jump around the regular brick shapes? I sometimes find that very repetitive shapes cause errors in the search function.

No, 3pointEdit. I can get the tracks actually looking quite good … at least to the eye.

I’ve found I can set my HV30 to progessive instead of interlaced. I’ll give that a try. It may be just doing a conversion in the camera which may not help much.

Has anyone tested non CMOS, rolling shutter vs non rolling shutter cameras ? I’ve tried to keep movement slow but perhaps small sudden movements upsets it ?

With the same camera (HV30), same scene, moving at about the same rate, I can get the solve error down to 1.1 using progressive instead of interlaced ! Perhaps the rolling shutter accounts for the rest of the increase over the ideal 0.5 ?

What value should be set for the “correlation” value to get an ideal track ? The default 0.75 seems high.

After further close inspection, I’m convinced that poor solve errors are not related to just the video quality. I can see the track wandering, even when successive frames ae good quality, and there is good contrast at the point being tracked. I’ve tried everything I can think of but there must be ways to improve the tracking ?

For the rolling shutter and progressive/interlaced, I have no idea at all whether they influence the tracking or not, sorry.

Correlation of .75 seems fine to me, I’ve done all my tracks with this and achieved solves errors below 1 each time.

If you see the track moving and jumping around then this is certainly the problem. Try to retrack it or move it manually when it goes crazy. You can also guess which tracks cause most problems by activating “Names and Status” under the Display tab in the properties panel. You’ll then see the average error linked to each track and identify those that have the highest error. Try to work on these.

Another option is the number of tracks that you have. You need at least 8 I think, but if you have too many tracks the errors add up and can cause bad solves. Try deleting some tracks if you have too many, those with the highest error preferably.

Thanks Little-me.

I’m gradually getting better tracks. Progressive scan certainly helps. I’ve also found that the markers need to be full patterns, such as a circle or a blob or some sort, with good contrast. Using corners such as the mortar in brickwork, doesn’t work as well. Sudden camera jerks don’t help. I’ve been able to get a track or two below 0.5.

That’s great ! You don’t need absolutely every tracker below .5, although the lower they are, the more quality you’ll get.
Also, you can track corners or places with non-full patterns, as long as they’re fairly isolated and create enough contrast, which isn’t the case on brick work indeed ^^