Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Representations/Perception/CameraInfo.cpp

Go to the documentation of this file.
00001 /**
00002 * @file CameraInfo.cpp
00003 *
00004 * Implementation of class CameraInfo.
00005 *
00006 * @author <a href="mailto:juengel@informatik.hu-berlin.de">Matthias Juengel</a>
00007 * @author <a href="mailto:walter.nistico@uni-dortmund.de">Walter Nistico</a>
00008 */
00009 
00010 #include "CameraInfo.h"
00011 
00012 CameraInfo::CameraInfo() : 
00013 resolutionWidth(cameraResolutionWidth_ERS7),
00014 resolutionHeight(cameraResolutionHeight_ERS7),
00015 openingAngleWidth(openingAngleWidth_ERS7),
00016 openingAngleHeight(openingAngleHeight_ERS7),
00017 focalLength(focalLength_ERS7),
00018 focalLengthMM(focalLengthMM_ERS7),
00019 pixelPerMM(pixelPerMM_ERS7),
00020 opticalCenter(opticalCenterX_ERS7, opticalCenterY_ERS7),
00021 secondOrderRadialDistortion(secondOrderRadialDistortion_ERS7),
00022 fourthOrderRadialDistortion(fourthOrderRadialDistortion_ERS7),
00023 focalLenPow2(focalLength*focalLength),
00024 focalLenPow4(focalLength*focalLength*focalLength*focalLength),
00025 focalLengthInv(1.0/focalLength),
00026 simulated(false)
00027 {
00028 } 
00029 
00030 CameraInfo::CameraInfo(RobotDesign::Design robotDesign) : 
00031 resolutionWidth(robotDesign == RobotDesign::ERS210 ? cameraResolutionWidth_ERS210 : cameraResolutionWidth_ERS7),
00032 resolutionHeight(robotDesign == RobotDesign::ERS210 ? cameraResolutionHeight_ERS210 : cameraResolutionHeight_ERS7),
00033 openingAngleWidth(robotDesign == RobotDesign::ERS210 ? openingAngleWidth_ERS210 : openingAngleWidth_ERS7),
00034 openingAngleHeight(robotDesign == RobotDesign::ERS210 ? openingAngleHeight_ERS210 : openingAngleHeight_ERS7),
00035 focalLength(robotDesign == RobotDesign::ERS210 ? focalLength_ERS210 : focalLength_ERS7),
00036 focalLengthMM(robotDesign == RobotDesign::ERS210 ? focalLengthMM_ERS210 : focalLengthMM_ERS7),
00037 pixelPerMM(robotDesign == RobotDesign::ERS210 ? pixelPerMM_ERS210 : pixelPerMM_ERS7),
00038 opticalCenter(robotDesign == RobotDesign::ERS210 ? opticalCenterX_ERS210 : opticalCenterX_ERS7, 
00039                   robotDesign == RobotDesign::ERS210 ? opticalCenterY_ERS210 : opticalCenterY_ERS7),
00040 secondOrderRadialDistortion(robotDesign == RobotDesign::ERS210 ? secondOrderRadialDistortion_ERS210 : secondOrderRadialDistortion_ERS7),
00041 fourthOrderRadialDistortion(robotDesign == RobotDesign::ERS210 ? fourthOrderRadialDistortion_ERS210 : fourthOrderRadialDistortion_ERS7),
00042 focalLenPow2(focalLength*focalLength),
00043 focalLenPow4(focalLength*focalLength*focalLength*focalLength),
00044 focalLengthInv(1.0/focalLength),
00045 simulated(false)
00046 {
00047 } 
00048 /*
00049 In& operator>>(In& stream,CameraInfo& cameraInfo)
00050 {
00051   char c;
00052   stream >> cameraInfo.resolutionWidth;
00053   stream >> cameraInfo.resolutionHeight;
00054   stream >> cameraInfo.openingAngleWidth;
00055   stream >> cameraInfo.openingAngleHeight;
00056   stream >> cameraInfo.focalLength;
00057   stream >> cameraInfo.focalLengthMM;
00058   stream >> cameraInfo.pixelPerMM;
00059   stream >> cameraInfo.opticalCenter;
00060   stream >> cameraInfo.secondOrderRadialDistortion;
00061   stream >> cameraInfo.fourthOrderRadialDistortion;
00062   stream >> cameraInfo.focalLenPow2;
00063   stream >> cameraInfo.focalLenPow4;
00064   stream >> c;
00065   cameraInfo.simulated = c != 0;
00066   cameraInfo.focalLengthInv = 1.0/cameraInfo.focalLength;
00067   return stream;
00068 }
00069 
00070 Out& operator<<(Out& stream, const CameraInfo& cameraInfo)
00071 {
00072   stream << cameraInfo.resolutionWidth;
00073   stream << cameraInfo.resolutionHeight;
00074   stream << cameraInfo.openingAngleWidth;
00075   stream << cameraInfo.openingAngleHeight;
00076   stream << cameraInfo.focalLength;
00077   stream << cameraInfo.focalLengthMM;
00078   stream << cameraInfo.pixelPerMM;
00079   stream << cameraInfo.opticalCenter;
00080   stream << cameraInfo.secondOrderRadialDistortion;
00081   stream << cameraInfo.fourthOrderRadialDistortion;
00082   stream << cameraInfo.focalLenPow2;
00083   stream << cameraInfo.focalLenPow4;
00084   stream << (char) cameraInfo.simulated;
00085   return stream;
00086 }
00087 */

Generated on Mon Mar 20 22:00:02 2006 for GT2005 by doxygen 1.3.6