|
iCub-main
|
Camera image calibration module.
Collaboration diagram for camCalib:Camera image calibration module.
YARP OpenCV (version >= 2.0) spmap (icub library)
We have enabled changes of the image saturation directly from the rpc port (see port description). This has been done (temporary) in order to change the saturation for the bayer images. The command are sent via rpc can be:
Command-line Parameters
The following key-value pairs can be specified as command-line parameters by prefixing -- to the key (e.g. --from file.ini. The value part can be changed to suit your needs; the default values are shown below.
--from camcalib.ini --context cameraCalibration $ICUB_ROOT/icub/app to the configuration file--name camcalib --group CAMERA_CALIBRATION_LEFT CAMERA_CALIBRATION_LEFT or CAMERA_CALIBRATION_RIGHT)Set projection pinhole in the selected camera calibration group to undistort a standard pinhole camera image. The following parameters are required in that group:
drawCenterCross: 0 to disable or 1 to draw a cross at the principal pointw, h: image size used when deriving the calibrationfx, fy: focal lengthscx, cy: principal pointk1, k2: radial distortion coefficientsp1, p2: tangential distortion coefficientsThe intrinsic matrix is automatically rescaled when the runtime image size differs from w and h. The distortion coefficients remain unchanged.
Example pinhole configuration:
projection pinhole drawCenterCross 1 w 320 h 240 fx 221.607 fy 221.689 cx 174.29 cy 130.528 k1 -0.397161 k2 0.180303 p1 4.08465e-005 p2 0.000456613
The module also supports projection fisheye for stereo fisheye lenses. In this mode, camCalib rectifies one camera stream at a time using the calibration of both cameras plus the stereo extrinsic transform stored in the same configuration file.
Fisheye requirements:
projection fisheye in the selected camera group--group set to either CAMERA_CALIBRATION_LEFT or CAMERA_CALIBRATION_RIGHT [CAMERA_CALIBRATION_LEFT] and [CAMERA_CALIBRATION_RIGHT] groups available[STEREO_DISPARITY] group containing HN as a 4x4 homogeneous transformEach fisheye camera group must contain:
w, h fx, fy, cx, cy k1, k2, k3, k4 Fisheye rectification settings:
balance: value in [0,1] controlling the crop level after rectification. It can be specified globally or in the selected camera group; the global value takes precedence.fovScale: value greater than 0 that scales the output field of view. It can be specified globally or in the selected camera group; the global value takes precedence.rectifyAlpha: global fallback value for balance when balance is not set.drawEpipolars: global boolean that overlays horizontal epipolar lines on the rectified image.epipolarLineStep: global pixel spacing between epipolar lines; values less than one are treated as one.Fisheye rectification automatically rescales the intrinsic matrices if the runtime image size differs from the calibration size.
Example fisheye configuration:
[CAMERA_CALIBRATION_LEFT] projection fisheye w 640 h 480 fx 320.0 fy 320.0 cx 320.0 cy 240.0 k1 -0.01 k2 0.001 k3 0.0 k4 0.0 balance 0.0 fovScale 1.0 [CAMERA_CALIBRATION_RIGHT] projection fisheye w 640 h 480 fx 320.0 fy 320.0 cx 320.0 cy 240.0 k1 -0.01 k2 0.001 k3 0.0 k4 0.0 [STEREO_DISPARITY] HN (-1 0 0 0 0 -1 0 0 0 0 1 0 0.05 0 0 1)
Example invocation:
camCalib –name /icub/camcalib/left –context cameraCalibration –from icubEyes.ini –group CAMERA_CALIBRATION_LEFT
Input port
/camCalib/in Output port
/camCalib/out Rpc port
/camCalib/conf camcalib.ini in $ICUB_ROOT/app/cameraCalibration
Linux: Ubuntu 9.10, Debian Stable, squeeze and windows
camCalib –name /icub/camcalib/left –context cameraCalibration –from icubEyes.ini –group CAMERA_CALIBRATION_LEFT
More information on camera calibration:
OpenCV: http://opencvlibrary.sourceforge.net/CvReference#cv_3d
Matlab Toolbox: http://www.vision.caltech.edu/bouguetj/calib_doc/
YARP OpenCV (version >= 2.0) spmap (icub library)
We have enabled changes of the image saturation directly from the rpc port (see port description). This has been done (temporary) in order to change the saturation for the bayer images. The command are sent via rpc can be:
Command-line Parameters
The following key-value pairs can be specified as command-line parameters by prefixing -- to the key (e.g. --from file.ini. The value part can be changed to suit your needs; the default values are shown below.
--from camcalib.ini --context cameraCalibration $ICUB_ROOT/icub/app to the configuration file--name camcalib Configuration File Parameters
The following key-value pairs can be specified as parameters in the configuration file The value part can be changed to suit your needs; the default values are shown below.
projection pinhole drawCenterCross 1 w 320 h 240 fx 221.607 fy 221.689 cx 174.29 cy 130.528 k1 -0.397161 k2 0.180303 p1 4.08465e-005 p2 0.000456613
Input port
/camCalib/in Output port
/camCalib/out Rpc port
/camCalib/conf camcalib.ini in $ICUB_ROOT/app/cameraCalibration
Linux: Ubuntu 9.10, Debian Stable, squeeze and windows
camCalib –name /icub/camcalib/left –context cameraCalibration –from icubEyes.ini –group CAMERA_CALIBRATION_LEFT
More information on camera calibration:
OpenCV: http://opencvlibrary.sourceforge.net/CvReference#cv_3d
Matlab Toolbox: http://www.vision.caltech.edu/bouguetj/calib_doc/