M-File Help: SphericalCamera | View code for SphericalCamera |
Spherical camera class
A concrete class a spherical-projection camera.
project | project world points |
plot | plot/return world point on image plane |
hold | control hold for image plane |
ishold | test figure hold for image plane |
clf | clear image plane |
figure | figure holding the image plane |
mesh | draw shape represented as a mesh |
point | draw homogeneous points on image plane |
line | draw homogeneous lines on image plane |
plot_camera | draw camera |
rpy | set camera attitude |
move | copy of Camera after motion |
centre | get world coordinate of camera centre |
delete | object destructor |
char | convert camera parameters to string |
display | display camera parameters |
npix | image dimensions in pixels (2x1) |
pp | intrinsic: principal point (2x1) |
rho | intrinsic: pixel dimensions (2x1) in metres |
T | extrinsic: camera pose as homogeneous transformation |
nu | number of pixels in u-direction |
nv | number of pixels in v-direction |
Create spherical projection camera object
C = SphericalCamera() creates a spherical projection camera with canonic parameters: f=1 and name='canonic'.
C = CentralCamera(options) as above but with specified parameters.
'name', N | Name of camera |
'pixel', S | Pixel size: SxS or S(1)xS(2) |
'pose', T | Pose of the camera as a homogeneous transformation |
Camera, CentralCamera, fisheyecamera, CatadioptricCamera
Project world points to image plane
pt = C.project(p, options) are the image plane coordinates for the world points p. The columns of p (3xN) are the world points and the columns of pt (2xN) are the corresponding spherical projection points, each column is phi (longitude) and theta (colatitude).
'Tobj', T | Transform all points by the homogeneous transformation T before projecting them to the camera image plane. |
'Tcam', T | Set the camera pose to the homogeneous transformation T before projecting points to the camera image plane. Overrides the current camera pose C.T. |
Implement spherical IBVS for point features
results = sph(T) results = sph(T, params)
Simulate IBVS with for a square target comprising 4 points is placed in the world XY plane. The camera/robot is initially at pose T and is driven to the orgin.
Two windows are shown and animated:
1. The camera view, showing the desired view (*) and the
current view (o)
2. The external view, showing the target points and the camera
The results structure contains time-history information about the image plane, camera pose, error, Jacobian condition number, error norm, image plane size and desired feature locations.
The params structure can be used to override simulation defaults by providing elements, defaults in parentheses:
target_size | - the side length of the target in world units (0.5) |
target_center - center of the target in world coords (0,0,2)
niter | - the number of iterations to run the simulation (500) |
eterm | - a stopping criteria on feature error norm (0) |
lambda | - gain, can be scalar or diagonal 6x6 matrix (0.01) |
ci | - camera intrinsic structure (camparam) |
depth | - depth of points to use for Jacobian, scalar for |
all points, of 4-vector. If null take actual value from simulation ([])
SEE ALSO: ibvsplot
Implement spherical IBVS for point features
results = sph(T) results = sph(T, params)
Simulate IBVS with for a square target comprising 4 points is placed in the world XY plane. The camera/robot is initially at pose T and is driven to the orgin.
Two windows are shown and animated:
1. The camera view, showing the desired view (*) and the
current view (o)
2. The external view, showing the target points and the camera
The results structure contains time-history information about the image plane, camera pose, error, Jacobian condition number, error norm, image plane size and desired feature locations.
The params structure can be used to override simulation defaults by providing elements, defaults in parentheses:
target_size | - the side length of the target in world units (0.5) |
target_center - center of the target in world coords (0,0,3)
niter | - the number of iterations to run the simulation (500) |
eterm | - a stopping criteria on feature error norm (0) |
lambda | - gain, can be scalar or diagonal 6x6 matrix (0.01) |
ci | - camera intrinsic structure (camparam) |
depth | - depth of points to use for Jacobian, scalar for |
all points, of 4-vector. If null take actual value from simulation ([])
SEE ALSO: ibvsplot
Visual motion Jacobian for point feature
J = C.visjac_p(pt, z) is the image Jacobian (2Nx6) for the image plane points pt (2xN) described by phi (longitude) and theta (colatitude). The depth of the points from the camera is given by z which is a scalar, for all points, or a vector (Nx1) for each point.
The Jacobian gives the image-plane velocity in terms of camera spatial velocity.
"Spherical image-based visual servo and structure estimation", P. I. Corke, in Proc. IEEE Int. Conf. Robotics and Automation, (Anchorage), pp. 5550-5555, May 3-7 2010.
CentralCamera.visjac_p_polar, CentralCamera.visjac_l, CentralCamera.visjac_e
© 1990-2012 Peter Corke.