![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Camera (projective) sensor. More...
#include <ecvCameraSensor.h>


Classes | |
| struct | BrownDistortionParameters |
| Brown's distortion model + Linear Disparity. More... | |
| struct | ExtendedRadialDistortionParameters |
| Extended radial distortion model. More... | |
| struct | FrustumInformation |
| Frustum information structure. More... | |
| struct | IntrinsicParameters |
| Intrinsic parameters of the camera sensor. More... | |
| struct | KeyPoint |
| struct | LensDistortionParameters |
| Lens distortion parameters (interface) More... | |
| struct | RadialDistortionParameters |
| Simple radial distortion model. More... | |
Public Types | |
| enum | DistortionModel { NO_DISTORTION_MODEL = 0 , SIMPLE_RADIAL_DISTORTION , BROWN_DISTORTION , EXTENDED_RADIAL_DISTORTION } |
| Supported distortion models. More... | |
Public Types inherited from ccHObject | |
| enum | DEPENDENCY_FLAGS { DP_NONE = 0 , DP_NOTIFY_OTHER_ON_DELETE = 1 , DP_NOTIFY_OTHER_ON_UPDATE , DP_DELETE_OTHER = 8 , DP_PARENT_OF_OTHER = 24 } |
| Dependency flags. More... | |
| enum | SelectionBehavior { SELECTION_AA_BBOX , SELECTION_FIT_BBOX , SELECTION_IGNORED } |
| Behavior when selected. More... | |
| using | Container = std::vector< ccHObject * > |
| Standard instances container (for children, etc.) More... | |
| using | Shared = QSharedPointer< ccHObject > |
| Shared pointer. More... | |
| using | SharedContainer = std::vector< Shared > |
| Shared instances container (for children, etc.) More... | |
| using | GlobalBoundingBox = cloudViewer::BoundingBoxTpl< double > |
| Global (non-shifted) bounding-box. More... | |
Public Types inherited from ccSerializableObject | |
| enum | DeserializationFlags { DF_POINT_COORDS_64_BITS , DF_SCALAR_VAL_32_BITS = 2 } |
| Deserialization flags (bit-field) More... | |
| typedef QMultiMap< unsigned, unsigned > | LoadedIDMap |
| Map of loaded unique IDs (old ID --> new ID) More... | |
Public Member Functions | |
| ccCameraSensor () | |
| Default constructor. More... | |
| ccCameraSensor (const ccCameraSensor &sensor) | |
| Copy constructor. More... | |
| ccCameraSensor (const IntrinsicParameters &iParams) | |
| virtual | ~ccCameraSensor () override |
| Destructor. More... | |
| virtual CV_CLASS_ENUM | getClassID () const override |
| Returns class ID. More... | |
| virtual bool | isSerializable () const override |
| Returns whether object is serializable of not. More... | |
| virtual ccBBox | getOwnBB (bool withGLFeatures=false) override |
| Returns the entity's own bounding-box. More... | |
| virtual ccBBox | getOwnFitBB (ccGLMatrix &trans) override |
| Returns best-fit bounding-box (if available) More... | |
| virtual bool | applyViewport () override |
| Apply sensor 'viewport' to a 3D view. More... | |
| void | setVertFocal_pix (float vertFocal_pix) |
| Sets focal (in pixels) More... | |
| float | getVertFocal_pix () const |
| Returns vertical focal (in pixels) More... | |
| float | getHorizFocal_pix () const |
| Returns horizontal focal (in pixels) More... | |
| void | setVerticalFov_rad (float fov_rad) |
| Sets the (vertical) field of view in radians. More... | |
| float | getVerticalFov_rad () const |
| Returns the (vertical) field of view in radians. More... | |
| const IntrinsicParameters & | getIntrinsicParameters () const |
| Returns intrinsic parameters. More... | |
| void | setIntrinsicParameters (const IntrinsicParameters ¶ms) |
| Sets intrinsic parameters. More... | |
| const LensDistortionParameters::Shared & | getDistortionParameters () const |
| Returns uncertainty parameters. More... | |
| void | setDistortionParameters (LensDistortionParameters::Shared params) |
| Sets uncertainty parameters. More... | |
| bool | getProjectionMatrix (ccGLMatrix &matrix) |
| Returns the camera projection matrix. More... | |
| bool | frustumIsDrawn () const |
| Returns whether the frustum should be displayed or not. More... | |
| void | drawFrustum (bool state) |
| Sets whether the frustum should be displayed or not. More... | |
| bool | frustumPlanesAreDrawn () const |
| Returns whether the frustum planes should be displayed or not. More... | |
| void | drawFrustumPlanes (bool state) |
| Sets whether the frustum planes should be displayed or not. More... | |
| bool | fromLocalCoordToGlobalCoord (const CCVector3 &localCoord, CCVector3 &globalCoord) const |
| bool | fromGlobalCoordToLocalCoord (const CCVector3 &globalCoord, CCVector3 &localCoord) const |
| bool | fromLocalCoordToImageCoord (const CCVector3 &localCoord, CCVector2 &imageCoord, bool withLensError=true) const |
| bool | fromImageCoordToLocalCoord (const CCVector2 &imageCoord, CCVector3 &localCoord, PointCoordinateType depth, bool withLensCorrection=true) const |
| bool | fromGlobalCoordToImageCoord (const CCVector3 &globalCoord, CCVector2 &imageCoord, bool withLensError=true) const |
| bool | fromImageCoordToGlobalCoord (const CCVector2 &imageCoord, CCVector3 &globalCoord, PointCoordinateType z0, bool withLensCorrection=true) const |
| bool | fromRealImCoordToIdealImCoord (const CCVector2 &real, CCVector2 &ideal) const |
| ccPointCloud * | orthoRectifyAsCloud (const ccImage *image, cloudViewer::GenericIndexedCloud *keypoints3D, std::vector< KeyPoint > &keypointsImage) const |
| Projective ortho-rectification of an image (as cloud) More... | |
| ccImage * | orthoRectifyAsImage (const ccImage *image, cloudViewer::GenericIndexedCloud *keypoints3D, std::vector< KeyPoint > &keypointsImage, double &pixelSize, double *minCorner=nullptr, double *maxCorner=nullptr, double *realCorners=nullptr) const |
| Projective ortho-rectification of an image (as image) More... | |
| ccImage * | orthoRectifyAsImageDirect (const ccImage *image, PointCoordinateType altitude, double &pixelSize, bool undistortImages=true, double *minCorner=nullptr, double *maxCorner=nullptr, double *realCorners=nullptr) const |
| Direct ortho-rectification of an image (as image) More... | |
| bool | computeOrthoRectificationParams (const ccImage *image, cloudViewer::GenericIndexedCloud *keypoints3D, std::vector< KeyPoint > &keypointsImage, double a[3], double b[3], double c[3]) const |
| Computes ortho-rectification parameters for a given image. More... | |
| bool | computeUncertainty (const CCVector2 &pixel, const float depth, Vector3Tpl< ScalarType > &sigma) const |
| bool | computeUncertainty (cloudViewer::ReferenceCloud *points, std::vector< Vector3Tpl< ScalarType >> &accuracy) |
| QImage | undistort (const QImage &image) const |
| Undistorts an image based on the sensor distortion parameters. More... | |
| ccImage * | undistort (ccImage *image, bool inplace=true) const |
| Undistorts an image based on the sensor distortion parameters. More... | |
| bool | isGlobalCoordInFrustum (const CCVector3 &globalCoord) const |
| Tests if a 3D point is in the field of view of the camera. More... | |
| bool | computeGlobalPlaneCoefficients (float planeCoefficients[6][4], CCVector3 ptsFrustum[8], CCVector3 edges[6], CCVector3 ¢er) |
| const cloudViewer::geometry::LineSet & | getNearPlane () const |
| const cloudViewer::geometry::LineSet & | getSideLines () const |
| const cloudViewer::geometry::LineSet & | getArrow () const |
| const cloudViewer::geometry::LineSet & | getAxis () const |
| void | setPlaneColor (ecvColor::Rgb color) |
| const ecvColor::Rgb & | getPlaneColor () const |
| double | getFocalLength () const |
| virtual void | clearDrawings () override |
| virtual void | hideShowDrawings (CC_DRAW_CONTEXT &context) override |
| void | updateData () |
Public Member Functions inherited from ccSensor | |
| ccSensor (QString name) | |
| Default constructor. More... | |
| ccSensor (const ccSensor &sensor) | |
| Copy constructor. More... | |
| virtual CC_SENSOR_TYPE | getType () const |
| Returns the sensor type. More... | |
| virtual unsigned char | checkVisibility (const CCVector3 &P) const |
| Returns the "visibility type" of a point. More... | |
| ccIndexedTransformationBuffer * | getPositions () |
| Returns associated positions. More... | |
| void | setPositions (ccIndexedTransformationBuffer *positions) |
| Sets associated positions. More... | |
| bool | addPosition (ccGLMatrix &trans, double index) |
| Adds a new position (shortcut) More... | |
| bool | getAbsoluteTransformation (ccIndexedTransformation &trans, double index) const |
| bool | getActiveAbsoluteTransformation (ccIndexedTransformation &trans) const |
| Gets currently active absolute transformation. More... | |
| bool | getActiveAbsoluteCenter (CCVector3 &vec) const |
| Gets currently active absolute position. More... | |
| bool | getActiveAbsoluteRotation (ccGLMatrix &rotation) const |
| Gets currently active rotation matrix (without translation) More... | |
| virtual void | setRigidTransformation (const ccGLMatrix &mat) |
| virtual ccGLMatrix & | getRigidTransformation () |
| virtual const ccGLMatrix & | getRigidTransformation () const |
| void | getIndexBounds (double &minIndex, double &maxIndex) const |
| Gets index boundaries (shortcut) More... | |
| double | getActiveIndex () const |
| Sets currently active index (displayed position, etc.) More... | |
| void | setActiveIndex (double index) |
| Sets currently active index (displayed position, etc.) More... | |
| void | setGraphicScale (PointCoordinateType scale) |
| Sets the sensor graphic representation scale. More... | |
| PointCoordinateType | getGraphicScale () const |
| Returns the sensor graphic representation scale. More... | |
| void | setFrameColor (ecvColor::Rgb color) |
| const ecvColor::Rgb & | getFrameColor () const |
| virtual void | applyGLTransformation (const ccGLMatrix &trans) override |
| Applies a GL transformation to the entity. More... | |
Public Member Functions inherited from ccHObject | |
| ccHObject (QString name=QString()) | |
| Default constructor. More... | |
| ccHObject (const ccHObject &object) | |
| Copy constructor. More... | |
| virtual | ~ccHObject () override |
| Default destructor. More... | |
| virtual bool | IsEmpty () const |
| virtual Eigen::Vector3d | GetMinBound () const |
| Returns min bounds for geometry coordinates. More... | |
| virtual Eigen::Vector2d | GetMin2DBound () const |
| virtual Eigen::Vector3d | GetMaxBound () const |
| Returns max bounds for geometry coordinates. More... | |
| virtual Eigen::Vector2d | GetMax2DBound () const |
| virtual Eigen::Vector3d | GetCenter () const |
| Returns the center of the geometry coordinates. More... | |
| virtual ccBBox | GetAxisAlignedBoundingBox () const |
| Returns an axis-aligned bounding box of the geometry. More... | |
| virtual ecvOrientedBBox | GetOrientedBoundingBox () const |
| virtual ccHObject & | Transform (const Eigen::Matrix4d &transformation) |
| Apply transformation (4x4 matrix) to the geometry coordinates. More... | |
| virtual ccHObject & | Translate (const Eigen::Vector3d &translation, bool relative=true) |
| Apply translation to the geometry coordinates. More... | |
| virtual ccHObject & | Scale (const double s, const Eigen::Vector3d ¢er) |
Apply scaling to the geometry coordinates. Given a scaling factor , and center , a given point is transformed according to . More... | |
| virtual ccHObject & | Scale (const double s) |
| virtual ccHObject & | Rotate (const Eigen::Matrix3d &R, const Eigen::Vector3d ¢er) |
Apply rotation to the geometry coordinates and normals. Given a rotation matrix , and center , a given point is transformed according to . More... | |
| virtual ccHObject & | Rotate (const Eigen::Matrix3d &R) |
| QString | getViewId () const |
| bool | isGroup () const |
| Returns whether the instance is a group. More... | |
| ccHObject * | getParent () const |
| Returns parent object. More... | |
| virtual QIcon | getIcon () const |
| Returns the icon associated to this entity. More... | |
| void | addDependency (ccHObject *otherObject, int flags, bool additive=true) |
| Adds a new dependence (additive or not) More... | |
| int | getDependencyFlagsWith (const ccHObject *otherObject) |
| Returns the dependency flags with a given object. More... | |
| void | removeDependencyWith (ccHObject *otherObject) |
| Removes any dependency flags with a given object. More... | |
| void | removeDependencyFlag (ccHObject *otherObject, DEPENDENCY_FLAGS flag) |
| Removes a given dependency flag. More... | |
| virtual bool | addChild (ccHObject *child, int dependencyFlags=DP_PARENT_OF_OTHER, int insertIndex=-1) |
| Adds a child. More... | |
| unsigned | getChildrenNumber () const |
| Returns the number of children. More... | |
| unsigned int | getChildCountRecursive () const |
| Returns the total number of children under this object recursively. More... | |
| ccHObject * | getChild (unsigned childPos) const |
| Returns the ith child. More... | |
| ccHObject * | find (unsigned uniqueID) |
| Finds an entity in this object hierarchy. More... | |
| unsigned | filterChildren (Container &filteredChildren, bool recursive=false, CV_CLASS_ENUM filter=CV_TYPES::OBJECT, bool strict=false) const |
| Collects the children corresponding to a certain pattern. More... | |
| void | detachChild (ccHObject *child) |
| Detaches a specific child. More... | |
| void | detachAllChildren () |
| Removes a specific child. More... | |
| void | getTypeID_recursive (std::vector< removeInfo > &rmInfos, bool relative) |
| void | getTypeID_recursive (std::vector< hideInfo > &hdInfos, bool relative) |
| void | removeChild (ccHObject *child) |
| void | removeChild (int pos) |
| Removes a specific child given its index. More... | |
| void | removeAllChildren () |
| Removes all children. More... | |
| int | getChildIndex (const ccHObject *aChild) const |
| Returns child index. More... | |
| void | swapChildren (unsigned firstChildIndex, unsigned secondChildIndex) |
| Swaps two children. More... | |
| int | getIndex () const |
| Returns index relatively to its parent or -1 if no parent. More... | |
| void | transferChild (ccHObject *child, ccHObject &newParent) |
| Transfer a given child to another parent. More... | |
| void | transferChildren (ccHObject &newParent, bool forceFatherDependent=false) |
| Transfer all children to another parent. More... | |
| ccHObject * | getFirstChild () const |
| Shortcut: returns first child. More... | |
| ccHObject * | getLastChild () const |
| Shortcut: returns last child. More... | |
| bool | isAncestorOf (const ccHObject *anObject) const |
| Returns true if the current object is an ancestor of the specified one. More... | |
| void | removeFromRenderScreen (bool recursive=true) |
| void | hideObject_recursive (bool recursive) |
| void | hideBB (CC_DRAW_CONTEXT context) |
| void | showBB (CC_DRAW_CONTEXT context) |
| void | setRedrawFlagRecursive (bool redraw=false) |
| void | setForceRedrawRecursive (bool redraw=false) |
| void | setPointSizeRecursive (int pSize) |
| void | setLineWidthRecursive (PointCoordinateType width) |
| virtual ccBBox | getBB_recursive (bool withGLFeatures=false, bool onlyEnabledChildren=true) |
| Returns the bounding-box of this entity and it's children. More... | |
| virtual GlobalBoundingBox | getOwnGlobalBB (bool withGLFeatures=false) |
| virtual bool | getOwnGlobalBB (CCVector3d &minCorner, CCVector3d &maxCorner) |
| virtual GlobalBoundingBox | getGlobalBB_recursive (bool withGLFeatures=false, bool onlyEnabledChildren=true) |
| Returns the global bounding-box of this entity and it's children. More... | |
| virtual ccBBox | getDisplayBB_recursive (bool relative) |
| Returns the bounding-box of this entity and it's children WHEN DISPLAYED. More... | |
| virtual void | drawBB (CC_DRAW_CONTEXT &context, const ecvColor::Rgb &col) |
| Draws the entity (and its children) bounding-box. More... | |
| void | draw (CC_DRAW_CONTEXT &context) override |
| Draws entity and its children. More... | |
| void | updateNameIn3DRecursive () |
| void | setHideShowType (CC_DRAW_CONTEXT &context) |
| void | setRemoveType (CC_DRAW_CONTEXT &context) |
| ENTITY_TYPE | getEntityType () const |
| virtual void | redrawDisplay (bool forceRedraw=true, bool only2D=false) |
| Redraws associated display. More... | |
| bool | getAbsoluteGLTransformation (ccGLMatrix &trans) const |
| virtual bool | isDisplayed () const |
| Returns whether the object is actually displayed (visible) or not. More... | |
| virtual bool | isBranchEnabled () const |
| Returns whether the object and all its ancestors are enabled. More... | |
| virtual void | redrawDisplay_recursive (bool p) |
| virtual void | refreshDisplay_recursive (bool p) |
| virtual void | setSelected_recursive (bool p) |
| virtual void | toggleActivation_recursive () |
| virtual void | toggleVisibility_recursive () |
| virtual void | toggleColors_recursive () |
| virtual void | resetGLTransformationHistory_recursive () |
| virtual void | toggleNormals_recursive () |
| virtual void | toggleSF_recursive () |
| virtual void | toggleShowName_recursive () |
| unsigned | findMaxUniqueID_recursive () const |
| Returns the max 'unique ID' of this entity and its siblings. More... | |
| void | applyGLTransformation_recursive (const ccGLMatrix *trans=nullptr) |
| Applies the active OpenGL transformation to the entity (recursive) More... | |
| virtual void | notifyGeometryUpdate () |
| bool | toFile (QFile &out, short dataVersion) const override |
| Saves data to binary stream. More... | |
| bool | fromFile (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override |
| Loads data from binary stream. More... | |
| short | minimumFileVersion () const override |
| Returns the minimum file version required to save this instance. More... | |
| bool | fromFileNoChildren (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) |
| Custom version of ccSerializableObject::fromFile. More... | |
| virtual bool | isShareable () const |
| Returns whether object is shareable or not. More... | |
| virtual void | setSelectionBehavior (SelectionBehavior mode) |
| Sets selection behavior (when displayed) More... | |
| virtual SelectionBehavior | getSelectionBehavior () const |
| Returns selection behavior. More... | |
| virtual unsigned | getUniqueIDForDisplay () const |
| Returns object unqiue ID used for display. More... | |
| virtual const ccGLMatrix & | getGLTransformationHistory () const |
| Returns the transformation 'history' matrix. More... | |
| virtual void | setGLTransformationHistory (const ccGLMatrix &mat) |
| Sets the transformation 'history' matrix (handle with care!) More... | |
| virtual void | resetGLTransformationHistory () |
| Resets the transformation 'history' matrix. More... | |
| bool | pushDisplayState () override |
| Pushes the current display state (overridden) More... | |
| void | popDisplayState (bool apply=true) override |
| Pops the last pushed display state (overridden) More... | |
Public Member Functions inherited from ccObject | |
| ccObject (QString name=QString()) | |
| Default constructor. More... | |
| ccObject (const ccObject &object) | |
| Copy constructor. More... | |
| virtual QString | getName () const |
| Returns object name. More... | |
| virtual void | setName (const QString &name) |
| Sets object name. More... | |
| virtual void | setRemoveFlag (bool removeFlag) |
| Sets removeFlag. More... | |
| virtual bool | getRemoveFlag () |
| Returns removeFlag. More... | |
| virtual unsigned | getUniqueID () const |
| Returns object unique ID. More... | |
| virtual void | setUniqueID (unsigned ID) |
| Changes unique ID. More... | |
| virtual bool | isEnabled () const |
| Returns whether the object is enabled or not. More... | |
| virtual void | setEnabled (bool state) |
| Sets the "enabled" property. More... | |
| virtual void | toggleActivation () |
| Toggles the "enabled" property. More... | |
| virtual bool | isLocked () const |
| Returns whether the object is locked or not. More... | |
| virtual void | setLocked (bool state) |
| Sets the "enabled" property. More... | |
| bool | isLeaf () const |
| bool | isCustom () const |
| bool | isHierarchy () const |
| bool | isKindOf (CV_CLASS_ENUM type) const |
| bool | isA (CV_CLASS_ENUM type) const |
| QVariant | getMetaData (const QString &key) const |
| Returns a given associated meta data. More... | |
| bool | removeMetaData (const QString &key) |
| Removes a given associated meta-data. More... | |
| void | setMetaData (const QString &key, const QVariant &data) |
| Sets a meta-data element. More... | |
| void | setMetaData (const QVariantMap &dataset, bool overwrite=false) |
| Sets several meta-data elements at a time. More... | |
| bool | hasMetaData (const QString &key) const |
| Returns whether a meta-data element with the given key exists or not. More... | |
| const QVariantMap & | metaData () const |
| Returns meta-data map (const only) More... | |
| void | setBaseName (const QString &baseName) |
| QString | getBaseName () const |
| void | setFullPath (const QString &fullPaht) |
| QString | getFullPath () const |
Public Member Functions inherited from ccSerializableObject | |
| virtual | ~ccSerializableObject ()=default |
| Destructor. More... | |
Public Member Functions inherited from ccDrawableObject | |
| ccDrawableObject () | |
| Default constructor. More... | |
| ccDrawableObject (const ccDrawableObject &object) | |
| Copy constructor. More... | |
| virtual | ~ccDrawableObject ()=default |
| virtual bool | isVisible () const |
| Returns whether entity is visible or not. More... | |
| virtual void | setVisible (bool state) |
| Sets entity visibility. More... | |
| virtual void | toggleVisibility () |
| Toggles visibility. More... | |
| virtual bool | isRedraw () const |
| Returns whether entity is to be redraw. More... | |
| virtual void | setRedraw (bool state) |
| Sets entity redraw mode. More... | |
| virtual void | setForceRedraw (bool state) |
| Sets force redraw. More... | |
| virtual void | setFixedId (bool state) |
| virtual bool | isFixedId () |
| virtual bool | isVisibilityLocked () const |
| Returns whether visibility is locked or not. More... | |
| virtual void | lockVisibility (bool state) |
| Locks/unlocks visibility. More... | |
| virtual bool | isSelected () const |
| Returns whether entity is selected or not. More... | |
| virtual void | setSelected (bool state) |
| Selects/Unselects entity. More... | |
| virtual void | getDrawingParameters (glDrawParams ¶ms) const |
| Returns main OpenGL parameters for this entity. More... | |
| virtual bool | hasColors () const |
| Returns whether colors are enabled or not. More... | |
| virtual bool | colorsShown () const |
| Returns whether colors are shown or not. More... | |
| virtual void | showColors (bool state) |
| Sets colors visibility. More... | |
| virtual void | toggleColors () |
| Toggles colors display state. More... | |
| virtual bool | hasNormals () const |
| Returns whether normals are enabled or not. More... | |
| virtual bool | normalsShown () const |
| Returns whether normals are shown or not. More... | |
| virtual void | showNormals (bool state) |
| Sets normals visibility. More... | |
| virtual void | toggleNormals () |
| Toggles normals display state. More... | |
| virtual bool | hasDisplayedScalarField () const |
| Returns whether an active scalar field is available or not. More... | |
| virtual bool | hasScalarFields () const |
| Returns whether one or more scalar fields are instantiated. More... | |
| virtual void | showSF (bool state) |
| Sets active scalarfield visibility. More... | |
| virtual void | toggleSF () |
| Toggles SF display state. More... | |
| virtual bool | sfShown () const |
| Returns whether active scalar field is visible. More... | |
| virtual void | toggleMaterials () |
| Toggles material display state. More... | |
| virtual void | showNameIn3D (bool state) |
| Sets whether name should be displayed in 3D. More... | |
| virtual bool | nameShownIn3D () const |
| Returns whether name is displayed in 3D or not. More... | |
| virtual void | toggleShowName () |
| Toggles name in 3D display state. More... | |
| virtual bool | isColorOverridden () const |
| virtual const ecvColor::Rgb & | getTempColor () const |
| Returns current temporary (unique) color. More... | |
| virtual void | setTempColor (const ecvColor::Rgb &col, bool autoActivate=true) |
| Sets current temporary (unique) More... | |
| virtual void | enableTempColor (bool state) |
| Set temporary color activation state. More... | |
| virtual float | getOpacity () const |
| virtual void | setOpacity (float opacity) |
| Set opacity activation state. More... | |
| virtual void | setGLTransformation (const ccGLMatrix &trans) |
| Associates entity with a GL transformation (rotation + translation) More... | |
| virtual void | enableGLTransformation (bool state) |
| Enables/disables associated GL transformation. More... | |
| virtual bool | isGLTransEnabled () const |
| Returns whether a GL transformation is enabled or not. More... | |
| virtual const ccGLMatrix & | getGLTransformation () const |
| Returns associated GL transformation. More... | |
| virtual void | resetGLTransformation () |
| Resets associated GL transformation. More... | |
| virtual void | rotateGL (const ccGLMatrix &rotMat) |
| Multiplies (left) current GL transformation by a rotation matrix. More... | |
| virtual void | translateGL (const CCVector3 &trans) |
| Translates current GL transformation by a rotation matrix. More... | |
| virtual void | removeAllClipPlanes () |
| Removes all clipping planes (if any) More... | |
| virtual bool | addClipPlanes (const ccClipPlane &plane) |
| Registers a new clipping plane. More... | |
| virtual void | toggleClipPlanes (CC_DRAW_CONTEXT &context, bool enable) |
| Enables or disables clipping planes (OpenGL) More... | |
| virtual void | applyDisplayState (const DisplayState &state) |
| Applies a display state. More... | |
Static Public Member Functions | |
| static bool | OrthoRectifyAsImages (std::vector< ccImage * > images, double a[], double b[], double c[], unsigned maxSize, QDir *outputDir=nullptr, std::vector< ccImage * > *orthoRectifiedImages=nullptr, std::vector< std::pair< double, double >> *relativePos=nullptr) |
| Projective ortho-rectification of multiple images (as image files) More... | |
| static float | ConvertFocalPixToMM (float focal_pix, float ccdPixelSize_mm) |
| Helper: converts camera focal from pixels to mm. More... | |
| static float | ConvertFocalMMToPix (float focal_mm, float ccdPixelSize_mm) |
| Helper: converts camera focal from mm to pixels. More... | |
| static float | ComputeFovRadFromFocalPix (float focal_pix, int imageSize_pix) |
| Helper: deduces camera f.o.v. (in radians) from focal (in pixels) More... | |
| static float | ComputeFovRadFromFocalMm (float focal_mm, float ccdSize_mm) |
| Helper: deduces camera f.o.v. (in radians) from focal (in mm) More... | |
Static Public Member Functions inherited from ccHObject | |
| static ccHObject * | New (CV_CLASS_ENUM objectType, const char *name=nullptr) |
| Static factory. More... | |
| static ccHObject * | New (const QString &pluginId, const QString &classId, const char *name=nullptr) |
| Static factory (version to be used by external plugin factories) More... | |
| static Eigen::Vector3d | ComputeMinBound (const std::vector< Eigen::Vector3d > &points) |
| Compute min bound of a list points. More... | |
| static Eigen::Vector3d | ComputeMaxBound (const std::vector< Eigen::Vector3d > &points) |
| Compute max bound of a list points. More... | |
| static Eigen::Vector3d | ComputeCenter (const std::vector< Eigen::Vector3d > &points) |
| Computer center of a list of points. More... | |
| static void | ResizeAndPaintUniformColor (std::vector< Eigen::Vector3d > &colors, std::size_t size, const Eigen::Vector3d &color) |
| Resizes the colors vector and paints a uniform color. More... | |
| static void | TransformPoints (const Eigen::Matrix4d &transformation, std::vector< Eigen::Vector3d > &points) |
| Transforms all points with the transformation matrix. More... | |
| static void | TransformNormals (const Eigen::Matrix4d &transformation, std::vector< Eigen::Vector3d > &normals) |
| Transforms the normals with the transformation matrix. More... | |
| static void | TransformCovariances (const Eigen::Matrix4d &transformation, std::vector< Eigen::Matrix3d > &covariances) |
| Transforms all covariance matrices with the transformation. More... | |
| static void | TranslatePoints (const Eigen::Vector3d &translation, std::vector< Eigen::Vector3d > &points, bool relative) |
| Apply translation to the geometry coordinates. More... | |
| static void | ScalePoints (const double scale, std::vector< Eigen::Vector3d > &points, const Eigen::Vector3d ¢er) |
Scale the coordinates of all points by the scaling factor scale. More... | |
| static void | RotatePoints (const Eigen::Matrix3d &R, std::vector< Eigen::Vector3d > &points, const Eigen::Vector3d ¢er) |
Rotate all points with the rotation matrix R. More... | |
| static void | RotateNormals (const Eigen::Matrix3d &R, std::vector< Eigen::Vector3d > &normals) |
Rotate all normals with the rotation matrix R. More... | |
| static void | RotateCovariances (const Eigen::Matrix3d &R, std::vector< Eigen::Matrix3d > &covariances) |
Rotate all covariance matrices with the rotation matrix R. More... | |
| static Eigen::Matrix3d | GetRotationMatrixFromXYZ (const Eigen::Vector3d &rotation) |
| Get Rotation Matrix from XYZ RotationType. More... | |
| static Eigen::Matrix3d | GetRotationMatrixFromYZX (const Eigen::Vector3d &rotation) |
| Get Rotation Matrix from YZX RotationType. More... | |
| static Eigen::Matrix3d | GetRotationMatrixFromZXY (const Eigen::Vector3d &rotation) |
| Get Rotation Matrix from ZXY RotationType. More... | |
| static Eigen::Matrix3d | GetRotationMatrixFromXZY (const Eigen::Vector3d &rotation) |
| Get Rotation Matrix from XZY RotationType. More... | |
| static Eigen::Matrix3d | GetRotationMatrixFromZYX (const Eigen::Vector3d &rotation) |
| Get Rotation Matrix from ZYX RotationType. More... | |
| static Eigen::Matrix3d | GetRotationMatrixFromYXZ (const Eigen::Vector3d &rotation) |
| Get Rotation Matrix from YXZ RotationType. More... | |
| static Eigen::Matrix3d | GetRotationMatrixFromAxisAngle (const Eigen::Vector3d &rotation) |
| Get Rotation Matrix from AxisAngle RotationType. More... | |
| static Eigen::Matrix3d | GetRotationMatrixFromQuaternion (const Eigen::Vector4d &rotation) |
| Get Rotation Matrix from Quaternion. More... | |
| static Eigen::Matrix3d | GetRotationMatrixFromEulerAngle (const Eigen::Vector3d &rotation) |
| Get Rotation Matrix from Euler angle. More... | |
Static Public Member Functions inherited from ccObject | |
| static unsigned | GetCurrentDBVersion () |
| Returns current database version. More... | |
| static void | SetUniqueIDGenerator (ccUniqueIDGenerator::Shared generator) |
| Sets the unique ID generator. More... | |
| static ccUniqueIDGenerator::Shared | GetUniqueIDGenerator () |
| Returns the unique ID generator. More... | |
| static unsigned | GetNextUniqueID () |
| Returns a new unassigned unique ID. More... | |
| static unsigned | GetLastUniqueID () |
| Returns last assigned unique ID. More... | |
| static CV_CLASS_ENUM | ReadClassIDFromFile (QFile &in, short dataVersion) |
| Helper: reads out class ID from a binary stream. More... | |
Static Public Member Functions inherited from ccSerializableObject | |
| static bool | WriteError () |
| Sends a custom error message (write error) and returns 'false'. More... | |
| static bool | ReadError () |
| Sends a custom error message (read error) and returns 'false'. More... | |
| static bool | MemoryError () |
| Sends a custom error message (not enough memory) and returns 'false'. More... | |
| static bool | CorruptError () |
| Sends a custom error message (corrupted file) and returns 'false'. More... | |
Protected Member Functions | |
| CCVector3 | computeUpperLeftPoint () const |
| Used internally for display. More... | |
| void | computeProjectionMatrix () |
| Compute the projection matrix (from intrinsic parameters) More... | |
| bool | computeFrustumCorners () |
| Computes the eight corners of the frustum. More... | |
| bool | toFile_MeOnly (QFile &out, short dataVersion) const override |
| Save own object data. More... | |
| short | minimumFileVersion_MeOnly () const override |
| bool | fromFile_MeOnly (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override |
| Loads own object data. More... | |
| virtual void | drawMeOnly (CC_DRAW_CONTEXT &context) override |
| Draws the entity only (not its children) More... | |
Protected Member Functions inherited from ccSensor | |
| bool | toFile_MeOnly (QFile &out, short dataVersion) const override |
| Save own object data. More... | |
| short | minimumFileVersion_MeOnly () const override |
| bool | fromFile_MeOnly (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override |
| Loads own object data. More... | |
Protected Member Functions inherited from ccHObject | |
| virtual void | setParent (ccHObject *anObject) |
| Sets parent object. More... | |
| virtual void | drawNameIn3D () |
| Draws the entity name in 3D. More... | |
| virtual void | onDeletionOf (const ccHObject *obj) |
| This method is called when another object is deleted. More... | |
| virtual void | onUpdateOf (ccHObject *obj) |
| This method is called when another object (geometry) is updated. More... | |
Protected Member Functions inherited from ccObject | |
| virtual bool | getFlagState (CV_OBJECT_FLAG flag) const |
| Returns flag state. More... | |
| virtual void | setFlagState (CV_OBJECT_FLAG flag, bool state) |
| Sets flag state. More... | |
| bool | toFile (QFile &out, short dataVersion) const override |
| Saves data to binary stream. More... | |
| short | minimumFileVersion () const override |
| Returns the minimum file version required to save this instance. More... | |
| bool | fromFile (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override |
| Reimplemented from ccSerializableObject::fromFile. More... | |
Protected Attributes | |
| ecvColor::Rgb | m_plane_color |
| IntrinsicParameters | m_intrinsicParams |
| Camera intrinsic parameters. More... | |
| LensDistortionParameters::Shared | m_distortionParams |
| Lens distortion parameters. More... | |
| FrustumInformation | m_frustumInfos |
| Frustum information structure. More... | |
| ccGLMatrix | m_projectionMatrix |
| Intrinsic parameters matrix. More... | |
| bool | m_projectionMatrixIsValid |
| Whether the intrinsic matrix is valid or not. More... | |
| cloudViewer::geometry::LineSet | m_nearPlane |
| cloudViewer::geometry::LineSet | m_sideLines |
| cloudViewer::geometry::LineSet | m_arrow |
| cloudViewer::geometry::LineSet | m_axis |
| double | m_focalLength |
Protected Attributes inherited from ccSensor | |
| ccIndexedTransformationBuffer * | m_posBuffer |
| Positions buffer (optional) More... | |
| ccGLMatrix | m_rigidTransformation |
| Rigid transformation between this sensor and its associated positions. More... | |
| double | m_activeIndex |
| Active index (for displayed position, etc.) More... | |
| ecvColor::Rgb | m_color |
| Color of the sensor. More... | |
| PointCoordinateType | m_scale |
| Sensor graphic representation scale. More... | |
Protected Attributes inherited from ccHObject | |
| ccHObject * | m_parent |
| Parent. More... | |
| Container | m_children |
| Children. More... | |
| SelectionBehavior | m_selectionBehavior |
| Selection behavior. More... | |
| std::map< ccHObject *, int > | m_dependencies |
| Dependencies map. More... | |
| ccGLMatrix | m_glTransHistory |
| Cumulative GL transformation. More... | |
| bool | m_isDeleting |
| Flag to safely handle dependencies when the object is being deleted. More... | |
Protected Attributes inherited from ccObject | |
| QString | m_name |
| Object name. More... | |
| QString | m_baseName |
| QString | m_filePath |
| bool | m_removeFlag |
| unsigned | m_flags |
| Object flags. More... | |
| QVariantMap | m_metaData |
| Associated meta-data. More... | |
Protected Attributes inherited from ccDrawableObject | |
| bool | m_fixedId |
| bool | m_modelRedraw |
| bool | m_forceRedraw |
| float | m_opacity |
| bool | m_visible |
| Specifies whether the object is visible or not. More... | |
| bool | m_selected |
| Specifies whether the object is selected or not. More... | |
| bool | m_lockedVisibility |
| Specifies whether the visibility can be changed by user or not. More... | |
| bool | m_colorsDisplayed |
| Specifies whether colors should be displayed. More... | |
| bool | m_normalsDisplayed |
| Specifies whether normals should be displayed. More... | |
| bool | m_sfDisplayed |
| Specifies whether scalar field should be displayed. More... | |
| ecvColor::Rgb | m_tempColor |
| Temporary (unique) color. More... | |
| bool | m_colorIsOverridden |
| Temporary (unique) color activation state. More... | |
| ccGLMatrix | m_glTrans |
| Current GL transformation. More... | |
| bool | m_glTransEnabled |
| Current GL transformation activation state. More... | |
| bool | m_showNameIn3D |
| Whether name is displayed in 3D or not. More... | |
| CCVector3d | m_nameIn3DPos |
| Last 2D position of the '3D' name. More... | |
| ccClipPlaneSet | m_clipPlanes |
| Active clipping planes (used for display only) More... | |
| std::vector< DisplayState::Shared > | m_displayStateStack |
| The stack of pushed display states. More... | |
Camera (projective) sensor.
Definition at line 24 of file ecvCameraSensor.h.
Supported distortion models.
Definition at line 57 of file ecvCameraSensor.h.
| ccCameraSensor::ccCameraSensor | ( | ) |
Default constructor.
Definition at line 174 of file ecvCameraSensor.cpp.
References ccDrawableObject::lockVisibility(), ccHObject::SELECTION_FIT_BBOX, and ccHObject::setSelectionBehavior().
| ccCameraSensor::ccCameraSensor | ( | const ccCameraSensor & | sensor | ) |
Copy constructor.
Definition at line 195 of file ecvCameraSensor.cpp.
References BROWN_DISTORTION, EXTENDED_RADIAL_DISTORTION, m_distortionParams, m_intrinsicParams, setDistortionParameters(), setIntrinsicParameters(), and SIMPLE_RADIAL_DISTORTION.
| ccCameraSensor::ccCameraSensor | ( | const IntrinsicParameters & | iParams | ) |
Constructor with given intrinsic parameters (and optional uncertainty parameters)
Definition at line 183 of file ecvCameraSensor.cpp.
References ccDrawableObject::lockVisibility(), ccHObject::SELECTION_FIT_BBOX, setIntrinsicParameters(), and ccHObject::setSelectionBehavior().
|
overridevirtual |
Destructor.
Definition at line 243 of file ecvCameraSensor.cpp.
|
overridevirtual |
Apply sensor 'viewport' to a 3D view.
| win | 3D view to which to apply the sensor viewport (or the associated 'display' if 0) |
Reimplemented from ccSensor.
Definition at line 331 of file ecvCameraSensor.cpp.
References ccCameraSensor::IntrinsicParameters::arrayHeight, computeUpperLeftPoint(), ecvViewportParameters::focal, ecvViewportParameters::fov_deg, Vector3Tpl< double >::fromArray(), ccSensor::getActiveAbsoluteTransformation(), ccGLMatrixTpl< T >::getColumnAsVec3D(), ecvDisplayTools::GetCurrentScreen(), ccGLMatrixTpl< T >::getTranslationAsVec3D(), ecvDisplayTools::GetViewportParameters(), cloudViewer::LessThanEpsilon(), m_intrinsicParams, Vector3Tpl< Type >::norm(), Vector3Tpl< Type >::normalize(), cloudViewer::RadiansToDegrees(), ecvViewportParameters::setCameraCenter(), ecvViewportParameters::setPivotPoint(), ecvDisplayTools::SetViewportParameters(), ecvViewportParameters::up, ecvDisplayTools::UpdateScreen(), ccCameraSensor::IntrinsicParameters::vFOV_rad, CVLog::Warning(), Tuple3Tpl< Type >::z, ecvViewportParameters::zFar, ccCameraSensor::IntrinsicParameters::zFar_mm, ecvViewportParameters::zNear, and ccCameraSensor::IntrinsicParameters::zNear_mm.
|
overridevirtual |
Reimplemented from ccSensor.
Definition at line 1625 of file ecvCameraSensor.cpp.
References context, ECV_MESH, ccCameraSensor::FrustumInformation::frustumHull, ccHObject::getViewId(), m_frustumInfos, and ecvDisplayTools::RemoveEntities().
Helper: deduces camera f.o.v. (in radians) from focal (in mm)
Definition at line 1680 of file ecvCameraSensor.cpp.
Referenced by LoadImage().
Helper: deduces camera f.o.v. (in radians) from focal (in pixels)
Definition at line 1670 of file ecvCameraSensor.cpp.
Referenced by DecodeSensor().
|
protected |
Computes the eight corners of the frustum.
Definition at line 1188 of file ecvCameraSensor.cpp.
References cloudViewer::PointCloudTpl< T >::addPoint(), ccCameraSensor::IntrinsicParameters::arrayHeight, ccCameraSensor::IntrinsicParameters::arrayWidth, ccCameraSensor::FrustumInformation::center, ccCameraSensor::FrustumInformation::frustumCorners, cloudViewer::PointCloudTpl< T >::getPoint(), ccCameraSensor::FrustumInformation::initFrustumCorners(), ccCameraSensor::FrustumInformation::isComputed, m_frustumInfos, m_intrinsicParams, ccSensor::m_scale, Vector3Tpl< Type >::norm2(), PC_ONE, ccCameraSensor::IntrinsicParameters::vFOV_rad, CVLog::Warning(), Tuple3Tpl< Type >::z, z, ccCameraSensor::IntrinsicParameters::zFar_mm, and ccCameraSensor::IntrinsicParameters::zNear_mm.
Referenced by computeGlobalPlaneCoefficients(), and drawMeOnly().
| bool ccCameraSensor::computeGlobalPlaneCoefficients | ( | float | planeCoefficients[6][4], |
| CCVector3 | ptsFrustum[8], | ||
| CCVector3 | edges[6], | ||
| CCVector3 & | center | ||
| ) |
Compute the coefficients of the 6 planes frustum in the global coordinates system (normal vector are headed the frustum inside), the edges direction vectors and the frustum center
| planeCoefficients | coefficients of the six planes |
| edges | direction vectors of the frustum edges (there are 12 edges but some of them are colinear) |
| ptsFrustum | the 8 frustum corners in the global coordinates system |
| center | center of the the frustum circumscribed sphere |
Definition at line 1250 of file ecvCameraSensor.cpp.
References ccCameraSensor::FrustumInformation::center, computeFrustumCorners(), Vector3Tpl< Type >::cross(), fromLocalCoordToGlobalCoord(), ccCameraSensor::FrustumInformation::frustumCorners, cloudViewer::PointCloudTpl< T >::getPoint(), ccCameraSensor::FrustumInformation::isComputed, m_frustumInfos, Vector3Tpl< Type >::normalize(), cloudViewer::PointCloudTpl< T >::size(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
Referenced by ccOctree::intersectWithFrustum().
| bool ccCameraSensor::computeOrthoRectificationParams | ( | const ccImage * | image, |
| cloudViewer::GenericIndexedCloud * | keypoints3D, | ||
| std::vector< KeyPoint > & | keypointsImage, | ||
| double | a[3], | ||
| double | b[3], | ||
| double | c[3] | ||
| ) | const |
Computes ortho-rectification parameters for a given image.
Requires at least 4 key points! Collinearity equation: x'i = (a0+a1.xi+a2.yi)/(1+c1.xi+c2.yi) y'i = (b0+b1.xi+b2.yi)/(1+c1.xi+c2.yi)
| image | input image |
| keypoints3D | keypoints in 3D |
| keypointsImage | corresponding keypoints in image |
| a | a0, a1 & a2 parameters |
| b | b0, b1 & b2 parameters |
| c | c0(=1), c1 & c2 parameters |
Definition at line 1690 of file ecvCameraSensor.cpp.
References cloudViewer::ConjugateGradient< N, Scalar >::A(), cloudViewer::ConjugateGradient< N, Scalar >::b(), count, cloudViewer::GenericIndexedCloud::getPoint(), image, ccCameraSensor::KeyPoint::index, cloudViewer::ConjugateGradient< N, Scalar >::initConjugateGradient(), cloudViewer::ConjugateGradient< N, Scalar >::iterConjugateGradient(), cloudViewer::SquareMatrixTpl< Scalar >::m_values, CVLog::PrintDebug(), Tuple3Tpl< Type >::x, ccCameraSensor::KeyPoint::x, Tuple3Tpl< Type >::y, and ccCameraSensor::KeyPoint::y.
Referenced by orthoRectifyAsCloud(), and orthoRectifyAsImage().
|
protected |
Compute the projection matrix (from intrinsic parameters)
Definition at line 401 of file ecvCameraSensor.cpp.
References ccGLMatrixTpl< T >::data(), getHorizFocal_pix(), getVertFocal_pix(), m_intrinsicParams, m_projectionMatrix, m_projectionMatrixIsValid, ccCameraSensor::IntrinsicParameters::principal_point, ccCameraSensor::IntrinsicParameters::skew, and ccGLMatrixTpl< T >::toZero().
Referenced by getProjectionMatrix().
| bool ccCameraSensor::computeUncertainty | ( | cloudViewer::ReferenceCloud * | points, |
| std::vector< Vector3Tpl< ScalarType >> & | accuracy | ||
| ) |
Computes the coordinates of a 3D point in the sensor coordinate system knowing its coordinates in the global coordinate system.
| points | the points we want to compute the uncertainty |
| accuracy | to get back the uncertainty TODO lensDistortion if we want to take the lens distortion into consideration |
Definition at line 958 of file ecvCameraSensor.cpp.
References BROWN_DISTORTION, computeUncertainty(), count, fromGlobalCoordToLocalCoord(), fromLocalCoordToImageCoord(), m_distortionParams, NAN_VALUE, points, CVLog::Warning(), and Tuple3Tpl< Type >::z.
| bool ccCameraSensor::computeUncertainty | ( | const CCVector2 & | pixel, |
| const float | depth, | ||
| Vector3Tpl< ScalarType > & | sigma | ||
| ) | const |
Computes the uncertainty of a point knowing its depth (from the sensor view point) and pixel projection coordinates
| pixel | coordinates of the pixel where the 3D points is projected --> !! Note that the first index is (0,0) and the last (width-1,height-1) !! |
| depth | depth from sensor center to 3D point (must be positive) |
| sigma | uncertainty vector (along X, Y and Z) |
Definition at line 898 of file ecvCameraSensor.cpp.
References ccCameraSensor::IntrinsicParameters::arrayHeight, ccCameraSensor::IntrinsicParameters::arrayWidth, BROWN_DISTORTION, EXTENDED_RADIAL_DISTORTION, getHorizFocal_pix(), getVertFocal_pix(), height, ccCameraSensor::BrownDistortionParameters::linearDisparityParams, m_distortionParams, m_intrinsicParams, ccCameraSensor::IntrinsicParameters::pixelSize_mm, ccCameraSensor::IntrinsicParameters::principal_point, SIMPLE_RADIAL_DISTORTION, width, Vector2Tpl< Type >::x, Tuple3Tpl< Type >::x, Vector2Tpl< Type >::y, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
Referenced by computeUncertainty().
|
protected |
Used internally for display.
Definition at line 1169 of file ecvCameraSensor.cpp.
References ccCameraSensor::IntrinsicParameters::arrayHeight, ccCameraSensor::IntrinsicParameters::arrayWidth, ConvertFocalPixToMM(), m_intrinsicParams, ccSensor::m_scale, ccCameraSensor::IntrinsicParameters::pixelSize_mm, ccCameraSensor::IntrinsicParameters::vertFocal_pix, ccCameraSensor::IntrinsicParameters::vFOV_rad, and Tuple3Tpl< Type >::z.
Referenced by applyViewport(), getOwnBB(), getOwnFitBB(), and updateData().
Helper: converts camera focal from mm to pixels.
Definition at line 1658 of file ecvCameraSensor.cpp.
References CVLog::Warning().
Referenced by ccCameraSensor::IntrinsicParameters::GetKinectDefaults(), and LoadImage().
Helper: converts camera focal from pixels to mm.
Definition at line 1646 of file ecvCameraSensor.cpp.
References CVLog::Warning().
Referenced by computeUpperLeftPoint().
|
inline |
Sets whether the frustum should be displayed or not.
Definition at line 249 of file ecvCameraSensor.h.
|
inline |
Sets whether the frustum planes should be displayed or not.
Definition at line 257 of file ecvCameraSensor.h.
|
overrideprotectedvirtual |
Draws the entity only (not its children)
Reimplemented from ccHObject.
Definition at line 1474 of file ecvCameraSensor.cpp.
References ccPointCloud::applyRigidTransformation(), CC_ENTITY_PICKING, computeFrustumCorners(), context, ccGLDrawContext::currentLineWidth, ccGLDrawContext::defaultMeshColor, ccGLDrawContext::defaultPolylineColor, ecvDisplayTools::Draw(), ccCameraSensor::FrustumInformation::drawFrustum, ccGLDrawContext::drawingFlags, ccCameraSensor::FrustumInformation::drawSidePlanes, ECV_SURFACE_MODE, ccGenericMesh::enableStippling(), Vector3Tpl< double >::fromArray(), ccCameraSensor::FrustumInformation::frustumCorners, ccCameraSensor::FrustumInformation::frustumHull, ccSensor::getAbsoluteTransformation(), ccSensor::getActiveIndex(), ecvDisplayTools::GetCurrentScreen(), ccSensor::getFrameColor(), getPlaneColor(), cloudViewer::PointCloudTpl< T >::getPoint(), ccHObject::getViewId(), ecvDisplayTools::HideShowEntities(), ccCameraSensor::FrustumInformation::initFrustumHull(), ccCameraSensor::FrustumInformation::isComputed, cloudViewer::geometry::LineSet::lines_, m_arrow, m_axis, ccSensor::m_color, m_frustumInfos, m_nearPlane, m_sideLines, MACRO_Draw3D, ccGLDrawContext::meshRenderingMode, ccGLDrawContext::opacity, cloudViewer::geometry::LineSet::points_, ccDrawableObject::setOpacity(), ccDrawableObject::setTempColor(), ccGenericMesh::showWired(), cloudViewer::PointCloudTpl< T >::size(), ccGLMatrixTpl< double >::ToEigenMatrix4(), cloudViewer::geometry::LineSet::Transform(), updateData(), ccGLDrawContext::viewID, and ccGLDrawContext::visible.
|
overrideprotectedvirtual |
Loads own object data.
Called by 'fromFile' (recursive scheme) To be overloaded (but still called ;) by subclass.
| in | input file |
| dataVersion | file version |
| flags | deserialization flags (see ccSerializableObject::DeserializationFlags) |
| oldToNewIDMap | map to link old IDs with new IDs |
various parameters (dataVersion>=35)
Reimplemented from ccHObject.
Definition at line 511 of file ecvCameraSensor.cpp.
| bool ccCameraSensor::fromGlobalCoordToImageCoord | ( | const CCVector3 & | globalCoord, |
| CCVector2 & | imageCoord, | ||
| bool | withLensError = true |
||
| ) | const |
Computes the coordinates of a 3D point in the image knowing its coordinates in the global coordinate system.
| globalCoord | global coordinates of the 3D point |
| imageCoord | to get back the image coordinates of the projected 3D point --> !! Note that the first index is (0,0) and the last (width-1,height-1) !! |
| withLensError | to take lens distortion into account |
Definition at line 780 of file ecvCameraSensor.cpp.
References fromGlobalCoordToLocalCoord(), and fromLocalCoordToImageCoord().
Referenced by orthoRectifyAsImageDirect().
| bool ccCameraSensor::fromGlobalCoordToLocalCoord | ( | const CCVector3 & | globalCoord, |
| CCVector3 & | localCoord | ||
| ) | const |
Computes the coordinates of a 3D point in the sensor coordinate system knowing its coordinates in the global coordinate system.
| globalCoord | global coordinates of the 3D point (input) |
| localCoord | corresponding local coordinates of the 3D point (output) |
Definition at line 647 of file ecvCameraSensor.cpp.
References ccGLMatrixTpl< T >::apply(), ccSensor::getActiveAbsoluteTransformation(), and ccIndexedTransformation::inverse().
Referenced by computeUncertainty(), fromGlobalCoordToImageCoord(), and isGlobalCoordInFrustum().
| bool ccCameraSensor::fromImageCoordToGlobalCoord | ( | const CCVector2 & | imageCoord, |
| CCVector3 & | globalCoord, | ||
| PointCoordinateType | z0, | ||
| bool | withLensCorrection = true |
||
| ) | const |
Computes the global coordinates of a 3D points from its 3D coordinates (pixel position in the image)
| imageCoord | image coordinates of the pixel (input) --> !! Note that the first index is (0,0) and the last (width-1,height-1) !! |
| globalCoord | global coordinates of the corresponding 3D point (output) |
| z0 | altitude of the output pixel |
| withLensCorrection | if we want to correct the initial pixel coordinates with the lens correction formula |
Definition at line 790 of file ecvCameraSensor.cpp.
References ccGLMatrixTpl< T >::applyRotation(), fromImageCoordToLocalCoord(), ccSensor::getActiveAbsoluteTransformation(), ccGLMatrixTpl< T >::getTranslationAsVec3D(), cloudViewer::LessThanEpsilon(), Vector3Tpl< Type >::normalize(), PC_ONE, and Tuple3Tpl< Type >::z.
Referenced by orthoRectifyAsImageDirect().
| bool ccCameraSensor::fromImageCoordToLocalCoord | ( | const CCVector2 & | imageCoord, |
| CCVector3 & | localCoord, | ||
| PointCoordinateType | depth, | ||
| bool | withLensCorrection = true |
||
| ) | const |
Computes the coordinates of a 3D point in the sensor coordinate system knowing its coordinates in the global coordinate system.
| imageCoord | image coordinates of the pixel (input) --> !! Note that the first index is (0,0) and the last (width-1,height-1) !! |
| localCoord | local coordinates of the corresponding 3D point (output) |
| depth | depth of the output pixel relatively to the camera center |
| withLensCorrection | if we want to correct the initial pixel coordinates with the lens correction formula |
Definition at line 756 of file ecvCameraSensor.cpp.
References m_intrinsicParams, ccCameraSensor::IntrinsicParameters::principal_point, ccCameraSensor::IntrinsicParameters::vertFocal_pix, Vector2Tpl< Type >::x, Tuple3Tpl< Type >::x, Vector2Tpl< Type >::y, and Tuple3Tpl< Type >::y.
Referenced by fromImageCoordToGlobalCoord().
| bool ccCameraSensor::fromLocalCoordToGlobalCoord | ( | const CCVector3 & | localCoord, |
| CCVector3 & | globalCoord | ||
| ) | const |
Computes the coordinates of a 3D point in the global coordinate system knowing its coordinates in the sensor coordinate system.
| localCoord | local coordinates of the 3D point (input) |
| globalCoord | corresponding global coordinates of the 3D point (output) |
Definition at line 635 of file ecvCameraSensor.cpp.
References ccGLMatrixTpl< T >::apply(), and ccSensor::getActiveAbsoluteTransformation().
Referenced by computeGlobalPlaneCoefficients().
| bool ccCameraSensor::fromLocalCoordToImageCoord | ( | const CCVector3 & | localCoord, |
| CCVector2 & | imageCoord, | ||
| bool | withLensError = true |
||
| ) | const |
Computes the coordinates of a 3D point in the global coordinate system knowing its coordinates in the sensor coordinate system.
| localCoord | local coordinates of the 3D point (input) |
| imageCoord | image coordinates of the projected point on the image (output) --> !! Note that the first index is (0,0) and the last (width-1,height-1) !! |
| withLensError | to take lens distortion into account |
Definition at line 659 of file ecvCameraSensor.cpp.
References ccCameraSensor::IntrinsicParameters::arrayHeight, ccCameraSensor::IntrinsicParameters::arrayWidth, EXTENDED_RADIAL_DISTORTION, getProjectionMatrix(), ccCameraSensor::RadialDistortionParameters::k1, ccCameraSensor::RadialDistortionParameters::k2, ccCameraSensor::ExtendedRadialDistortionParameters::k3, m_distortionParams, m_intrinsicParams, Vector2Tpl< Type >::norm2(), ccCameraSensor::IntrinsicParameters::principal_point, SIMPLE_RADIAL_DISTORTION, ccCameraSensor::IntrinsicParameters::vertFocal_pix, Vector2Tpl< Type >::x, Tuple3Tpl< Type >::x, Vector2Tpl< Type >::y, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
Referenced by computeUncertainty(), and fromGlobalCoordToImageCoord().
| bool ccCameraSensor::fromRealImCoordToIdealImCoord | ( | const CCVector2 & | real, |
| CCVector2 & | ideal | ||
| ) | const |
Apply the Brown's lens correction to the real projection (through a lens) of a 3D point in the image
| real | real 2D coordinates of a pixel (asumming that this pixel coordinate is obtained after projection through a lens) (input) !! Note that the first index is (0,0) and the last (width-1,height-1) !! |
| ideal | after applying lens correction (output) --> !! Note that the first index is (0,0) and the last (width-1,height-1) !! |
Definition at line 828 of file ecvCameraSensor.cpp.
References BROWN_DISTORTION, EXTENDED_RADIAL_DISTORTION, ccCameraSensor::BrownDistortionParameters::K_BrownParams, m_distortionParams, m_intrinsicParams, ccCameraSensor::BrownDistortionParameters::P_BrownParams, ccCameraSensor::IntrinsicParameters::pixelSize_mm, ccCameraSensor::IntrinsicParameters::principal_point, ccCameraSensor::BrownDistortionParameters::principalPointOffset, SIMPLE_RADIAL_DISTORTION, Vector2Tpl< Type >::x, and Vector2Tpl< Type >::y.
|
inline |
Returns whether the frustum should be displayed or not.
Definition at line 246 of file ecvCameraSensor.h.
Referenced by ccPropertiesTreeDelegate::fillWithCameraSensor().
|
inline |
Returns whether the frustum planes should be displayed or not.
Definition at line 252 of file ecvCameraSensor.h.
Referenced by ccPropertiesTreeDelegate::fillWithCameraSensor().
|
inline |
Definition at line 546 of file ecvCameraSensor.h.
Referenced by PclTools::CreateCameraSensor().
|
inline |
Definition at line 547 of file ecvCameraSensor.h.
Referenced by PclTools::CreateCameraSensor().
|
inlineoverridevirtual |
Returns class ID.
Reimplemented from ccSensor.
Definition at line 190 of file ecvCameraSensor.h.
References CV_TYPES::CAMERA_SENSOR.
|
inline |
Returns uncertainty parameters.
Definition at line 229 of file ecvCameraSensor.h.
Referenced by ccCamSensorProjectionDlg::initWithCamSensor().
|
inline |
Definition at line 552 of file ecvCameraSensor.h.
|
inline |
Returns horizontal focal (in pixels)
Definition at line 210 of file ecvCameraSensor.h.
Referenced by computeProjectionMatrix(), computeUncertainty(), define_ccCameraSensor(), and undistort().
|
inline |
Returns intrinsic parameters.
Definition at line 222 of file ecvCameraSensor.h.
Referenced by define_ccCameraSensor(), ccPropertiesTreeDelegate::fillWithCameraSensor(), and ccCamSensorProjectionDlg::initWithCamSensor().
|
inline |
Definition at line 540 of file ecvCameraSensor.h.
Referenced by PclTools::CreateCameraSensor(), and ecvDisplayTools::StartCPUBasedPointPicking().
|
overridevirtual |
Returns the entity's own bounding-box.
Children bboxes are ignored.
| withGLFeatures | whether to take into account display-only elements (if any) |
Reimplemented from ccHObject.
Definition at line 245 of file ecvCameraSensor.cpp.
References cloudViewer::PointCloudTpl< T >::addPoint(), ccPointCloud::applyRigidTransformation(), computeUpperLeftPoint(), ccCameraSensor::FrustumInformation::drawFrustum, ccCameraSensor::FrustumInformation::drawSidePlanes, ccCameraSensor::FrustumInformation::frustumCorners, ccSensor::getAbsoluteTransformation(), ccGenericPointCloud::getOwnBB(), cloudViewer::PointCloudTpl< T >::getPoint(), ccCameraSensor::FrustumInformation::isComputed, ccSensor::m_activeIndex, m_frustumInfos, ccPointCloud::reserve(), cloudViewer::PointCloudTpl< T >::size(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
|
overridevirtual |
Returns best-fit bounding-box (if available)
| [out] | trans | associated transformation (so that the bounding-box can be displayed in the right position!) |
Reimplemented from ccHObject.
Definition at line 289 of file ecvCameraSensor.cpp.
References computeUpperLeftPoint(), ccSensor::getAbsoluteTransformation(), ccSensor::m_activeIndex, Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
|
inline |
Definition at line 550 of file ecvCameraSensor.h.
Referenced by drawMeOnly(), and cloudViewer::ModelViewerWidget::SelectObject().
| bool ccCameraSensor::getProjectionMatrix | ( | ccGLMatrix & | matrix | ) |
Returns the camera projection matrix.
| [out] | matrix | projection matrix (if the method returns true) |
Definition at line 391 of file ecvCameraSensor.cpp.
References computeProjectionMatrix(), m_projectionMatrix, and m_projectionMatrixIsValid.
Referenced by fromLocalCoordToImageCoord().
|
inline |
Definition at line 543 of file ecvCameraSensor.h.
Referenced by PclTools::CreateCameraSensor().
|
inline |
Returns vertical focal (in pixels)
Definition at line 206 of file ecvCameraSensor.h.
Referenced by computeProjectionMatrix(), computeUncertainty(), and undistort().
|
inline |
Returns the (vertical) field of view in radians.
Definition at line 217 of file ecvCameraSensor.h.
Referenced by define_ccCameraSensor().
|
overridevirtual |
Reimplemented from ccSensor.
Definition at line 1635 of file ecvCameraSensor.cpp.
References context, ccCameraSensor::FrustumInformation::drawSidePlanes, ccCameraSensor::FrustumInformation::frustumHull, ccHObject::getViewId(), ecvDisplayTools::HideShowEntities(), and m_frustumInfos.
| bool ccCameraSensor::isGlobalCoordInFrustum | ( | const CCVector3 & | globalCoord | ) | const |
Tests if a 3D point is in the field of view of the camera.
| globalCoord | global coordinates of the 3D point TODO withLensCorrection if we want to take the lens distortion into consideration |
Definition at line 1151 of file ecvCameraSensor.cpp.
References fromGlobalCoordToLocalCoord(), m_intrinsicParams, Tuple3Tpl< Type >::z, z, ccCameraSensor::IntrinsicParameters::zFar_mm, and ccCameraSensor::IntrinsicParameters::zNear_mm.
Referenced by ccOctree::intersectWithFrustum().
|
inlineoverridevirtual |
Returns whether object is serializable of not.
Reimplemented from ccSensor.
Definition at line 193 of file ecvCameraSensor.h.
|
overrideprotectedvirtual |
Returns the minimum file version required to save this instance's own data To be overloaded (but still called ;) by subclass. Used internally by minimumFileVersion() to compute the overall minimum.
Reimplemented from ccHObject.
Definition at line 505 of file ecvCameraSensor.cpp.
References ccSensor::minimumFileVersion_MeOnly().
| ccPointCloud * ccCameraSensor::orthoRectifyAsCloud | ( | const ccImage * | image, |
| cloudViewer::GenericIndexedCloud * | keypoints3D, | ||
| std::vector< KeyPoint > & | keypointsImage | ||
| ) | const |
Projective ortho-rectification of an image (as cloud)
Requires at least 4 key points!
| image | input image |
| keypoints3D | keypoints in 3D |
| keypointsImage | corresponding keypoints in image |
Definition at line 2384 of file ecvCameraSensor.cpp.
References a, cloudViewer::PointCloudTpl< T >::addPoint(), ccPointCloud::addRGBColor(), computeOrthoRectificationParams(), ccObject::getName(), height, image, ccPointCloud::reserve(), ccPointCloud::reserveTheRGBTable(), ccPointCloud::resize(), rgb, ccDrawableObject::showColors(), CVLog::Warning(), and width.
| ccImage * ccCameraSensor::orthoRectifyAsImage | ( | const ccImage * | image, |
| cloudViewer::GenericIndexedCloud * | keypoints3D, | ||
| std::vector< KeyPoint > & | keypointsImage, | ||
| double & | pixelSize, | ||
| double * | minCorner = nullptr, |
||
| double * | maxCorner = nullptr, |
||
| double * | realCorners = nullptr |
||
| ) | const |
Projective ortho-rectification of an image (as image)
Requires at least 4 key points!
| image | input image |
| keypoints3D | keypoints in 3D |
| keypointsImage | corresponding keypoints in image |
| pixelSize | pixel size (auto if -1) |
| minCorner | (optional) outputs 3D min corner (2 values) |
| maxCorner | (optional) outputs 3D max corner (2 values) |
| realCorners | (optional) image real 3D corners (4*2 values) |
Definition at line 1985 of file ecvCameraSensor.cpp.
References a, computeOrthoRectificationParams(), ccObject::getName(), height, image, rgb, width, x, and y.
| ccImage * ccCameraSensor::orthoRectifyAsImageDirect | ( | const ccImage * | image, |
| PointCoordinateType | altitude, | ||
| double & | pixelSize, | ||
| bool | undistortImages = true, |
||
| double * | minCorner = nullptr, |
||
| double * | maxCorner = nullptr, |
||
| double * | realCorners = nullptr |
||
| ) | const |
Direct ortho-rectification of an image (as image)
No keypoint is required. The user must specify however the orthorectification 'altitude'.
| image | input image |
| altitude | orthorectification altitude |
| pixelSize | pixel size (auto if -1) |
| undistortImages | whether images should be undistorted or not |
| minCorner | (optional) outputs 3D min corner (2 values) |
| maxCorner | (optional) outputs 3D max corner (2 values) |
| realCorners | (optional) image real 3D corners (4*2 values) |
Definition at line 1827 of file ecvCameraSensor.cpp.
References fromGlobalCoordToImageCoord(), fromImageCoordToGlobalCoord(), ccObject::getName(), height, image, rgb, width, Vector2Tpl< Type >::x, Tuple3Tpl< Type >::x, x, Vector2Tpl< Type >::y, Tuple3Tpl< Type >::y, and y.
|
static |
Projective ortho-rectification of multiple images (as image files)
| images | set of N calibrated images (i.e. images with their associated sensor) | |
| a | {a0, a1, a2} triplets for all images (size: 3*N) | |
| b | {b0, b1, b2} triplets for all images (size: 3*N) | |
| c | {c0(=1), c1, c2} triplets for all images (size: 3*N) | |
| maxSize | output image(s) max dimension | |
| outputDir | output directory for resulting images (is successful) | |
| [out] | orthoRectifiedImages | resulting images (is successful) |
| [out] | relativePos | relative positions (relatively to first image) |
Definition at line 2136 of file ecvCameraSensor.cpp.
References a, cloudViewer::core::Append(), cloudViewer::utility::ceil(), count, QtCompat::endl(), height, image, result, rgb, CVLog::Warning(), width, x, and y.
|
inline |
Sets uncertainty parameters.
Definition at line 233 of file ecvCameraSensor.h.
Referenced by ccCameraSensor(), and DecodeSensor().
| void ccCameraSensor::setIntrinsicParameters | ( | const IntrinsicParameters & | params | ) |
Sets intrinsic parameters.
Definition at line 323 of file ecvCameraSensor.cpp.
References ccCameraSensor::FrustumInformation::isComputed, m_frustumInfos, m_intrinsicParams, and m_projectionMatrixIsValid.
Referenced by ccCameraSensor(), define_ccCameraSensor(), and ccCamSensorProjectionDlg::updateCamSensor().
|
inline |
Definition at line 549 of file ecvCameraSensor.h.
References color.
| void ccCameraSensor::setVertFocal_pix | ( | float | vertFocal_pix | ) |
Sets focal (in pixels)
Definition at line 308 of file ecvCameraSensor.cpp.
References ccCameraSensor::FrustumInformation::isComputed, m_frustumInfos, m_intrinsicParams, m_projectionMatrixIsValid, and ccCameraSensor::IntrinsicParameters::vertFocal_pix.
Referenced by define_ccCameraSensor().
| void ccCameraSensor::setVerticalFov_rad | ( | float | fov_rad | ) |
Sets the (vertical) field of view in radians.
Definition at line 318 of file ecvCameraSensor.cpp.
References m_intrinsicParams, and ccCameraSensor::IntrinsicParameters::vFOV_rad.
Referenced by define_ccCameraSensor().
|
overrideprotectedvirtual |
Save own object data.
Called by 'toFile' (recursive scheme) To be overloaded (but still called ;) by subclass.
| out | output file |
| dataVersion | target file version for compatibility control |
various parameters (dataVersion>=35)
Reimplemented from ccHObject.
Definition at line 421 of file ecvCameraSensor.cpp.
Undistorts an image based on the sensor distortion parameters.
| image | input image |
| inplace | whether the undistortion should be applied in place or not |
Definition at line 1128 of file ecvCameraSensor.cpp.
References image, undistort(), and CVLog::Warning().
| QImage ccCameraSensor::undistort | ( | const QImage & | image | ) | const |
Undistorts an image based on the sensor distortion parameters.
| image | input image |
Definition at line 1005 of file ecvCameraSensor.cpp.
References ccCameraSensor::IntrinsicParameters::arrayHeight, ccCameraSensor::IntrinsicParameters::arrayWidth, BROWN_DISTORTION, EXTENDED_RADIAL_DISTORTION, getHorizFocal_pix(), getVertFocal_pix(), height, image, ccCameraSensor::RadialDistortionParameters::k1, ccCameraSensor::RadialDistortionParameters::k2, m_distortionParams, m_intrinsicParams, ccCameraSensor::IntrinsicParameters::principal_point, SIMPLE_RADIAL_DISTORTION, CVLog::Warning(), width, x, and y.
Referenced by PhotoScanFilter::loadFile(), and undistort().
| void ccCameraSensor::updateData | ( | ) |
Definition at line 1386 of file ecvCameraSensor.cpp.
References cloudViewer::geometry::LineSet::clear(), cloudViewer::geometry::LineSet::colors_, computeUpperLeftPoint(), data, Vector3Tpl< double >::fromArray(), ecvColor::green(), cloudViewer::geometry::LineSet::lines_, m_arrow, m_axis, m_nearPlane, m_sideLines, cloudViewer::geometry::LineSet::points_, ecvColor::red(), ecvColor::RgbTpl< Type >::ToEigen(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, ecvColor::yellow(), and Tuple3Tpl< Type >::z.
Referenced by drawMeOnly().
|
protected |
Definition at line 613 of file ecvCameraSensor.h.
Referenced by drawMeOnly(), and updateData().
|
protected |
Definition at line 614 of file ecvCameraSensor.h.
Referenced by drawMeOnly(), and updateData().
|
protected |
Lens distortion parameters.
Definition at line 599 of file ecvCameraSensor.h.
Referenced by ccCameraSensor(), computeUncertainty(), fromLocalCoordToImageCoord(), fromRealImCoordToIdealImCoord(), and undistort().
|
protected |
Definition at line 615 of file ecvCameraSensor.h.
|
protected |
Frustum information structure.
Used to draw it properly.
Definition at line 604 of file ecvCameraSensor.h.
Referenced by clearDrawings(), computeFrustumCorners(), computeGlobalPlaneCoefficients(), drawMeOnly(), getOwnBB(), hideShowDrawings(), setIntrinsicParameters(), and setVertFocal_pix().
|
protected |
Camera intrinsic parameters.
Definition at line 596 of file ecvCameraSensor.h.
Referenced by applyViewport(), ccCameraSensor(), computeFrustumCorners(), computeProjectionMatrix(), computeUncertainty(), computeUpperLeftPoint(), fromImageCoordToLocalCoord(), fromLocalCoordToImageCoord(), fromRealImCoordToIdealImCoord(), isGlobalCoordInFrustum(), setIntrinsicParameters(), setVertFocal_pix(), setVerticalFov_rad(), and undistort().
|
protected |
Definition at line 611 of file ecvCameraSensor.h.
Referenced by drawMeOnly(), and updateData().
|
protected |
Definition at line 593 of file ecvCameraSensor.h.
|
protected |
Intrinsic parameters matrix.
Definition at line 607 of file ecvCameraSensor.h.
Referenced by computeProjectionMatrix(), and getProjectionMatrix().
|
protected |
Whether the intrinsic matrix is valid or not.
Definition at line 609 of file ecvCameraSensor.h.
Referenced by computeProjectionMatrix(), getProjectionMatrix(), setIntrinsicParameters(), and setVertFocal_pix().
|
protected |
Definition at line 612 of file ecvCameraSensor.h.
Referenced by drawMeOnly(), and updateData().