|11 November 2011|
I have updated my old XPresso tool "CameraMatchCam2" to R12. It adjusts camera where "3D scene" matchs to "background picture", with 8 markers.
2004.4.23/11th moon/Toshio Fuji<firstname.lastname@example.org>
2004.4.23: ver. 1.01 release.
2004.5.7: ver.1.10 add "Auto..." buttons, "Reset" buttonb and improve
CameraMatchCam2, R12 compatible, changed Focal_Length to manual
The CameraMatchCam2 adjusts camera position and rotation where "3D scene"
matchs to "background picture". However, you need to change "Focal_Length"
and "Film_Offset_X, Y" manually.
The CameraMatchCam2 indicates "Total_error" between "background picture"
and "3D scene".
a. Before you use the CameraMatchCam2, you have to place 8 set of 2D
markers and 3D markers. 2D markers are placed on anchor point in the
"background picture", also 3D markers are snapped to anchor point in polygon
or spline object of the "3D scene".
b. Next, CameraMatchCam2 moves and rotates the camera a bit (by position
delta and rotation delta), in every 1 frame.
c. Next, CameraMatchCam2 evaluate angle errors between 2D marker and 3D
marker. Then, if the error decrease than itself of previous frame, it increases
position or rotation delta. Else if the error increase, it decrease the position or
rotation delta, and reverses the sign.
3. How to use
a. Copy "CameraMatchCam2" object to your current scene. You can controll it
through userdata of XPresso tag applied to "CM_cam" object.
Unckeck "Use" while you are arranging markers, to prevent unwanted camera
b. Next, import "backgrund picture" into "BK" material. Then change values in
"Render settings -> Output -> Resolution" to same ratio as the "background
Distorted picture does not work properly. If you use Zoom lens to take the
picture, please remove the distortion enough before using CameraMatchCam2.
c. Next. make "3D scene" which respond to the "background picture". The scene
is used to set 3D markers only, so you need not to make details, but need to
make enough acculate.
For example, "edges of buildings" or "edges of ground" are good for the anchor
point. If there is no good anchor point, add markers by your hand, and measure
position of them accurately. Of course the marker should be seen in the
Generraly speaking, 8 points of cube which fills the background picture are
ideal anchor points.
d. Next, adjust position and rotation of "CM_cam" roughly. Then start 3D
snapping and enable "point" target. Then snap 8 null objects under "3D_targets"
to anchor points modeled in previous step c.
e. Next, turn off snapping. Then place 8 null objects under "2D_targets" to
anchor points in "background picture" described in previous step b.
At this time, take care about colors of targets.
f. That is all. Check "Use" and start animation preview. Then CameraMatchCam2
starts to adjust camera where the "3D scene" and "background picture" should
4. Evaluate error and manual adjustments
a. CameraMatchCam2 indicates error to "Total_error" field while working. Of
course the value can not reach 0, but actually it is enough if the error becomes
less than 1.
b. If the error stays greater than 1, change "Focal_Length" manually.
c. If still the error stays greater than 1 after adjusting the "Focal_Length", the
"background picture" may be shifted (or trimmed). So change "Film_Offset_X, Y"
d. If still the error stays greater than 1 after adjusting the "Film_Offset_X, Y", the
"3D scene" may be wrong. If you modeled it from drawings, go there and
measure anchor points by your hand. Every time you have to doubt drawings.
e. If still the error stays greater than 1 with correct 3D scene, the "background
picture" may be wrong. Trash it and re-take "background picture" with fix focal
length lens and SLR digital camera.