qCC_db version 2.13.alpha (Qt) - 31 May 2022
CloudCompare 3D entities
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ccCameraSensor Class Reference

Camera (projective) sensor. More...

#include <ccCameraSensor.h>

Inheritance diagram for ccCameraSensor:
Inheritance graph
[legend]
Collaboration diagram for ccCameraSensor:
Collaboration graph
[legend]

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
 Knowing the ideal projection of a 3D point, computes what would be the real projection (through a lens) More...
 
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 = 1 , BROWN_DISTORTION = 2 , EXTENDED_RADIAL_DISTORTION = 3 }
 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 = 2 , 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.
 
using Container = std::vector< ccHObject * >
 Standard instances container (for children, etc.)
 
using Shared = QSharedPointer< ccHObject >
 Shared pointer.
 
using SharedContainer = std::vector< Shared >
 Shared instances container (for children, etc.)
 
using GlobalBoundingBox = CCCoreLib::BoundingBoxTpl< double >
 Global (non-shifted) bounding-box.
 
- Public Types inherited from ccSerializableObject
enum  DeserializationFlags { DF_POINT_COORDS_64_BITS = 1 , 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)
 

Public Member Functions

 ccCameraSensor ()
 Default constructor.
 
 ccCameraSensor (const ccCameraSensor &sensor)
 Copy constructor.
 
 ccCameraSensor (const IntrinsicParameters &iParams)
 Constructor with given intrinsic parameters (and optional uncertainty parameters)
 
 ~ccCameraSensor () override=default
 Destructor.
 
CC_CLASS_ENUM getClassID () const override
 Returns class ID. More...
 
bool isSerializable () const override
 Returns whether object is serializable of not. More...
 
ccBBox getOwnBB (bool withGLFeatures=false) override
 Returns the entity's own bounding-box (with local/shifted coordinates) More...
 
ccBBox getOwnFitBB (ccGLMatrix &trans) override
 Returns best-fit bounding-box (if available) More...
 
bool applyViewport (ccGenericGLDisplay *win=nullptr) 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)
 
float getHorizFocal_pix () const
 Returns horizontal focal (in pixels)
 
void setVerticalFov_rad (float fov_rad)
 Sets the (vertical) field of view in radians.
 
float getVerticalFov_rad () const
 Returns the (vertical) field of view in radians.
 
const IntrinsicParametersgetIntrinsicParameters () const
 Returns intrinsic parameters.
 
void setIntrinsicParameters (const IntrinsicParameters &params)
 Sets intrinsic parameters.
 
const LensDistortionParameters::SharedgetDistortionParameters () const
 Returns uncertainty parameters.
 
void setDistortionParameters (LensDistortionParameters::Shared params)
 Sets uncertainty parameters.
 
bool getProjectionMatrix (ccGLMatrix &matrix)
 Returns the camera projection matrix. More...
 
bool frustumIsDrawn () const
 Returns whether the frustum should be displayed or not.
 
void drawFrustum (bool state)
 Sets whether the frustum should be displayed or not.
 
bool frustumPlanesAreDrawn () const
 Returns whether the frustum planes should be displayed or not.
 
void drawFrustumPlanes (bool state)
 Sets whether the frustum planes should be displayed or not.
 
bool 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. More...
 
bool 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. More...
 
bool 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. More...
 
bool 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. More...
 
bool 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. More...
 
bool 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) More...
 
bool 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. More...
 
ccPointCloudorthoRectifyAsCloud (const ccImage *image, CCCoreLib::GenericIndexedCloud *keypoints3D, std::vector< KeyPoint > &keypointsImage) const
 Projective ortho-rectification of an image (as cloud) More...
 
ccImageorthoRectifyAsImage (const ccImage *image, CCCoreLib::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...
 
ccImageorthoRectifyAsImageDirect (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, CCCoreLib::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
 Computes the uncertainty of a point knowing its depth (from the sensor view point) and pixel projection coordinates. More...
 
bool computeUncertainty (CCCoreLib::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. More...
 
QImage undistort (const QImage &image) const
 Undistorts an image based on the sensor distortion parameters. More...
 
ccImageundistort (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 &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. More...
 
- Public Member Functions inherited from ccSensor
 ccSensor (const QString &name)
 Default constructor.
 
 ccSensor (const ccSensor &sensor)
 Copy constructor.
 
CC_CLASS_ENUM getClassID () const override
 Returns class ID. More...
 
bool isSerializable () const override
 Returns whether object is serializable of not. 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...
 
ccIndexedTransformationBuffergetPositions ()
 Returns associated positions.
 
const ccIndexedTransformationBuffergetPositions () const
 Returns associated positions.
 
void setPositions (ccIndexedTransformationBuffer *positions)
 Sets associated positions.
 
bool addPosition (ccGLMatrix &trans, double index)
 Adds a new position (shortcut) More...
 
bool getAbsoluteTransformation (ccIndexedTransformation &trans, double index) const
 Returns the absolute transformation between the world and the "optical" center (shortcut) More...
 
bool getActiveAbsoluteTransformation (ccIndexedTransformation &trans) const
 Gets currently active absolute transformation.
 
bool getActiveAbsoluteCenter (CCVector3 &vec) const
 Gets currently active absolute position.
 
bool getActiveAbsoluteRotation (ccGLMatrix &rotation) const
 Gets currently active rotation matrix (without translation)
 
virtual void setRigidTransformation (const ccGLMatrix &mat)
 Sets the rigid transformation between this sensor and its associated positions. More...
 
virtual ccGLMatrixgetRigidTransformation ()
 Returns the rigid transformation between this sensor and its associated positions.
 
virtual const ccGLMatrixgetRigidTransformation () const
 Returns the rigid transformation between this sensor and its associated positions (const version)
 
void getIndexBounds (double &minIndex, double &maxIndex) const
 Gets index boundaries (shortcut)
 
double getActiveIndex () const
 Sets currently active index (displayed position, etc.)
 
void setActiveIndex (double index)
 Sets currently active index (displayed position, etc.)
 
void setGraphicScale (PointCoordinateType scale)
 Sets the sensor graphic representation scale.
 
PointCoordinateType getGraphicScale () const
 Returns the sensor graphic representation scale.
 
virtual bool applyViewport (ccGenericGLDisplay *win=nullptr)
 Apply sensor 'viewport' to a 3D view. More...
 
void applyGLTransformation (const ccGLMatrix &trans) override
 Applies a GL transformation to the entity. More...
 
- Public Member Functions inherited from ccHObject
 ccHObject (const QString &name=QString(), unsigned uniqueID=ccUniqueIDGenerator::InvalidUniqueID)
 Default constructor. More...
 
 ccHObject (const ccHObject &object)
 Copy constructor.
 
 ~ccHObject () override
 Default destructor.
 
CC_CLASS_ENUM getClassID () const override
 Returns class ID. More...
 
bool isGroup () const
 Returns whether the instance is a group.
 
ccHObjectgetParent () 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) const
 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...
 
ccHObjectgetChild (unsigned childPos) const
 Returns the ith child. More...
 
ccHObjectfind (unsigned uniqueID) const
 Finds an entity in this object hierarchy. More...
 
unsigned filterChildren (Container &filteredChildren, bool recursive=false, CC_CLASS_ENUM filter=CC_TYPES::OBJECT, bool strict=false, ccGenericGLDisplay *inDisplay=nullptr) 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 removeChild (ccHObject *child)
 
void removeChild (int pos)
 Removes a specific child given its index. More...
 
void removeAllChildren ()
 Removes all children.
 
int getChildIndex (const ccHObject *aChild) const
 Returns child index.
 
void swapChildren (unsigned firstChildIndex, unsigned secondChildIndex)
 Swaps two children.
 
int getIndex () const
 Returns index relatively to its parent or -1 if no parent.
 
void transferChild (ccHObject *child, ccHObject &newParent)
 Transfer a given child to another parent.
 
void transferChildren (ccHObject &newParent, bool forceFatherDependent=false)
 Transfer all children to another parent.
 
ccHObjectgetFirstChild () const
 Shortcut: returns first child.
 
ccHObjectgetLastChild () const
 Shortcut: returns last child.
 
bool isAncestorOf (const ccHObject *anObject) const
 Returns true if the current object is an ancestor of the specified one.
 
virtual ccBBox getOwnBB (bool withGLFeatures=false)
 Returns the entity's own bounding-box (with local/shifted coordinates) More...
 
virtual ccBBox getBB_recursive (bool withGLFeatures=false, bool onlyEnabledChildren=true)
 Returns the local bounding-box of this entity and it's children. More...
 
virtual GlobalBoundingBox getOwnGlobalBB (bool withGLFeatures=false)
 Returns the entity's own global bounding-box (with global/non-shifted coordinates - if relevant) More...
 
virtual bool getOwnGlobalBB (CCVector3d &minCorner, CCVector3d &maxCorner)
 Returns the entity's own global bounding-box (with global/non-shifted coordinates - if relevant) More...
 
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, const ccGenericGLDisplay *display=nullptr)
 Returns the bounding-box of this entity and it's children WHEN DISPLAYED. More...
 
virtual ccBBox getOwnFitBB (ccGLMatrix &trans)
 Returns best-fit bounding-box (if available) More...
 
virtual void drawBB (CC_DRAW_CONTEXT &context, const ccColor::Rgb &col)
 Draws the entity (and its children) bounding-box. More...
 
void draw (CC_DRAW_CONTEXT &context) override
 Draws entity and its children. More...
 
bool getAbsoluteGLTransformation (ccGLMatrix &trans) const
 Returns the absolute transformation (i.e. the actual displayed GL transformation) of an entity. More...
 
virtual bool isDisplayed () const
 Returns whether the object is actually displayed (visible) or not.
 
virtual bool isDisplayedIn (const ccGenericGLDisplay *display) const
 Returns whether the object is actually displayed (visible) in a given display or not.
 
virtual bool isBranchEnabled () const
 Returns whether the object and all its ancestors are enabled.
 
 ccHObject_recursive_call1 (setSelected, bool, setSelected_recursive) ccHObject_recursive_call1(setDisplay
 
ccGenericGLDisplay setDisplay_recursive ccHObject_recursive_call1 (removeFromDisplay, ccGenericGLDisplay *, removeFromDisplay_recursive) ccHObject_recursive_call0(prepareDisplayForRefresh
 
ccGenericGLDisplay setDisplay_recursive prepareDisplayForRefresh_recursive ccHObject_recursive_call1 (refreshDisplay, bool, refreshDisplay_recursive) ccHObject_recursive_call0(resetGLTransformationHistory
 
ccGenericGLDisplay setDisplay_recursive prepareDisplayForRefresh_recursive resetGLTransformationHistory_recursive ccHObject_recursive_call0 (toggleActivation, toggleActivation_recursive) ccHObject_recursive_call0(toggleVisibility
 
ccGenericGLDisplay setDisplay_recursive prepareDisplayForRefresh_recursive resetGLTransformationHistory_recursive toggleVisibility_recursive ccHObject_recursive_call0 (toggleColors, toggleColors_recursive) ccHObject_recursive_call0(toggleNormals
 
ccGenericGLDisplay setDisplay_recursive prepareDisplayForRefresh_recursive resetGLTransformationHistory_recursive toggleVisibility_recursive toggleNormals_recursive ccHObject_recursive_call0 (toggleSF, toggleSF_recursive) ccHObject_recursive_call0(toggleShowName
 
ccGenericGLDisplay setDisplay_recursive prepareDisplayForRefresh_recursive resetGLTransformationHistory_recursive toggleVisibility_recursive toggleNormals_recursive toggleShowName_recursive ccHObject_recursive_call0 (toggleMaterials, toggleMaterials_recursive) inline virtual void transferDisplay(ccGenericGLDisplay *oldDisplay
 Transfers the entity from one display to the other.
 
void applyGLTransformation_recursive (const ccGLMatrix *trans=nullptr)
 Applies the active OpenGL transformation to the entity (recursive) More...
 
virtual void notifyGeometryUpdate ()
 Notifies all dependent entities that the geometry of this entity has changed.
 
bool isSerializable () const override
 Returns whether object is serializable of not. More...
 
bool toFile (QFile &out) 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...
 
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.
 
virtual unsigned getUniqueIDForDisplay () const
 Returns object unique ID used for display. More...
 
virtual const ccGLMatrixgetGLTransformationHistory () const
 Returns the transformation 'history' matrix. More...
 
virtual void setGLTransformationHistory (const ccGLMatrix &mat)
 Sets the transformation 'history' matrix (handle with care!)
 
virtual void resetGLTransformationHistory ()
 Resets the transformation 'history' matrix.
 
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 (const QString &name=QString(), unsigned uniqueID=ccUniqueIDGenerator::InvalidUniqueID)
 Default constructor. More...
 
 ccObject (const ccObject &object)
 Copy constructor.
 
virtual CC_CLASS_ENUM getClassID () const =0
 Returns class ID. More...
 
virtual QString getName () const
 Returns object name. More...
 
virtual void setName (const QString &name)
 Sets object name.
 
virtual unsigned getUniqueID () const
 Returns object unique ID.
 
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.
 
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 (CC_CLASS_ENUM type) const
 
bool isA (CC_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)
 
- Public Member Functions inherited from ccSerializableObject
virtual ~ccSerializableObject ()=default
 Destructor.
 
virtual bool isSerializable () const
 Returns whether object is serializable of not. More...
 
virtual bool toFile (QFile &out) const
 Saves data to binary stream. More...
 
virtual bool fromFile (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap)
 Loads data from binary stream. More...
 
- Public Member Functions inherited from ccDrawableObject
 ccDrawableObject ()
 Default constructor.
 
 ccDrawableObject (const ccDrawableObject &object)
 Copy constructor.
 
virtual void draw (CC_DRAW_CONTEXT &context)=0
 Draws entity and its children. More...
 
virtual bool isVisible () const
 Returns whether entity is visible or not.
 
virtual void setVisible (bool state)
 Sets entity visibility.
 
virtual void toggleVisibility ()
 Toggles visibility.
 
virtual bool isVisibilityLocked () const
 Returns whether visibility is locked or not.
 
virtual void lockVisibility (bool state)
 Locks/unlocks visibility. More...
 
virtual bool isSelected () const
 Returns whether entity is selected or not.
 
virtual void setSelected (bool state)
 Selects/unselects entity.
 
virtual void getDrawingParameters (glDrawParams &params) 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.
 
virtual void showColors (bool state)
 Sets colors visibility.
 
virtual void toggleColors ()
 Toggles colors display state.
 
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.
 
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.
 
virtual void toggleSF ()
 Toggles SF display state.
 
virtual bool sfShown () const
 Returns whether active scalar field is visible.
 
virtual void toggleMaterials ()
 Toggles material display state. More...
 
virtual void showNameIn3D (bool state)
 Sets whether name should be displayed in 3D or not.
 
virtual bool nameShownIn3D () const
 Returns whether name is displayed in 3D or not.
 
virtual void toggleShowName ()
 Toggles name in 3D display state.
 
virtual bool isColorOverridden () const
 Returns whether colors are currently overridden by a temporary (unique) color. More...
 
virtual const ccColor::RgbagetTempColor () const
 Returns current temporary (unique) color.
 
virtual void setTempColor (const ccColor::Rgba &col, bool autoActivate=true)
 Sets current temporary (unique) More...
 
virtual void setTempColor (const ccColor::Rgb &col, bool autoActivate=true)
 Sets current temporary (unique) More...
 
virtual void enableTempColor (bool state)
 Set temporary color activation state.
 
virtual void removeFromDisplay (const ccGenericGLDisplay *win)
 Unlinks entity from a GL display (only if it belongs to it of course)
 
virtual void setDisplay (ccGenericGLDisplay *win)
 Sets associated GL display.
 
virtual ccGenericGLDisplaygetDisplay () const
 Returns associated GL display.
 
virtual void redrawDisplay ()
 Redraws associated GL display.
 
virtual void prepareDisplayForRefresh ()
 Sets associated GL display 'refreshable' before global refresh. More...
 
virtual void refreshDisplay (bool only2D=false)
 Refreshes associated GL display. 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.
 
virtual const ccGLMatrixgetGLTransformation () 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)
 
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 bool pushDisplayState ()
 Pushes the current display state. More...
 
virtual void popDisplayState (bool apply=true)
 Pops the last pushed display state. More...
 
virtual void applyDisplayState (const DisplayState &state)
 Applies a display state.
 

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.
 
static float ConvertFocalMMToPix (float focal_mm, float ccdPixelSize_mm)
 Helper: converts camera focal from mm to pixels.
 
static float ComputeFovRadFromFocalPix (float focal_pix, int imageSize_pix)
 Helper: deduces camera f.o.v. (in radians) from focal (in pixels)
 
static float ComputeFovRadFromFocalMm (float focal_mm, float ccdSize_mm)
 Helper: deduces camera f.o.v. (in radians) from focal (in mm)
 
- Static Public Member Functions inherited from ccHObject
static ccHObjectNew (CC_CLASS_ENUM objectType, const char *name=nullptr)
 Static factory. More...
 
static ccHObjectNew (const QString &pluginId, const QString &classId, const char *name=nullptr)
 Static factory (version to be used by external plugin factories) More...
 
- Static Public Member Functions inherited from ccObject
static unsigned GetCurrentDBVersion ()
 Returns current database version.
 
static void SetUniqueIDGenerator (ccUniqueIDGenerator::Shared generator)
 Sets the unique ID generator.
 
static ccUniqueIDGenerator::Shared GetUniqueIDGenerator ()
 Returns the unique ID generator.
 
static unsigned GetNextUniqueID ()
 Returns a new unassigned unique ID. More...
 
static unsigned GetLastUniqueID ()
 Returns last assigned unique ID. More...
 
static CC_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.
 
void computeProjectionMatrix ()
 Compute the projection matrix (from intrinsic parameters)
 
bool computeFrustumCorners ()
 Computes the eight corners of the frustum. More...
 
bool toFile_MeOnly (QFile &out) const override
 Save own object data. More...
 
bool fromFile_MeOnly (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override
 Loads own object data. More...
 
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) const override
 Save own object data. More...
 
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.
 
virtual void drawMeOnly (CC_DRAW_CONTEXT &context)
 Draws the entity only (not its children) More...
 
virtual void applyGLTransformation (const ccGLMatrix &trans)
 Applies a GL transformation to the entity. More...
 
virtual bool toFile_MeOnly (QFile &out) const
 Save own object data. More...
 
virtual bool fromFile_MeOnly (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap)
 Loads own object data. More...
 
virtual void drawNameIn3D (CC_DRAW_CONTEXT &context)
 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 (CC_OBJECT_FLAG flag) const
 Returns flag state.
 
virtual void setFlagState (CC_OBJECT_FLAG flag, bool state)
 Sets flag state. More...
 
bool toFile (QFile &out) const override
 Saves data to binary stream. More...
 
bool fromFile (QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override
 Reimplemented from ccSerializableObject::fromFile. More...
 

Protected Attributes

IntrinsicParameters m_intrinsicParams
 Camera intrinsic parameters.
 
LensDistortionParameters::Shared m_distortionParams
 Lens distortion parameters.
 
FrustumInformation m_frustumInfos
 Frustum information structure. More...
 
ccGLMatrix m_projectionMatrix
 Intrinsic parameters matrix.
 
bool m_projectionMatrixIsValid
 Whether the intrinsic matrix is valid or not.
 
- Protected Attributes inherited from ccSensor
ccIndexedTransformationBufferm_posBuffer
 Positions buffer (optional)
 
ccGLMatrix m_rigidTransformation
 Rigid transformation between this sensor and its associated positions. More...
 
double m_activeIndex
 Active index (for displayed position, etc.)
 
ccColor::Rgb m_color
 Color of the sensor. More...
 
PointCoordinateType m_scale
 Sensor graphic representation scale.
 
- Protected Attributes inherited from ccHObject
ccHObjectm_parent
 Parent.
 
Container m_children
 Children.
 
SelectionBehavior m_selectionBehavior
 Selection behavior.
 
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.
 
- Protected Attributes inherited from ccObject
QString m_name
 Object name.
 
unsigned m_flags
 Object flags.
 
QVariantMap m_metaData
 Associated meta-data.
 
- Protected Attributes inherited from ccDrawableObject
bool m_visible
 Specifies whether the object is visible or not. More...
 
bool m_selected
 Specifies whether the object is selected or not.
 
bool m_lockedVisibility
 Specifies whether the visibility can be changed by user or not.
 
bool m_colorsDisplayed
 Specifies whether colors should be displayed.
 
bool m_normalsDisplayed
 Specifies whether normals should be displayed.
 
bool m_sfDisplayed
 Specifies whether scalar field should be displayed.
 
ccColor::Rgba m_tempColor
 Temporary (unique) color.
 
bool m_colorIsOverridden
 Temporary (unique) color activation state.
 
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.
 
CCVector3d m_nameIn3DPos
 Last 2D position of the '3D' name.
 
bool m_nameIn3DPosIsValid
 Whether the last 2D position of the '3D' name is valid or not.
 
ccGenericGLDisplaym_currentDisplay
 Currently associated GL display.
 
ccClipPlaneSet m_clipPlanes
 Active clipping planes (used for display only)
 
std::vector< DisplayState::Shared > m_displayStateStack
 The stack of pushed display states.
 

Additional Inherited Members

- Public Attributes inherited from ccHObject
ccGenericGLDisplay setDisplay_recursive prepareDisplayForRefresh_recursive resetGLTransformationHistory_recursive toggleVisibility_recursive toggleNormals_recursive toggleShowName_recursive ccGenericGLDisplaynewDisplay
 

Detailed Description

Camera (projective) sensor.

Member Enumeration Documentation

◆ DistortionModel

Supported distortion models.

Enumerator
NO_DISTORTION_MODEL 

no distortion model

SIMPLE_RADIAL_DISTORTION 

simple radial distortion model (k1, k2)

BROWN_DISTORTION 

Brown's distortion model (k1, k2, k3, etc.)

EXTENDED_RADIAL_DISTORTION 

extended radial distortion model (k1, k2, k3)

Member Function Documentation

◆ applyViewport()

bool ccCameraSensor::applyViewport ( ccGenericGLDisplay win = nullptr)
overridevirtual

Apply sensor 'viewport' to a 3D view.

Parameters
win3D view to which to apply the sensor viewport (or the associated 'display' if 0)
Returns
success

Reimplemented from ccSensor.

◆ computeFrustumCorners()

bool ccCameraSensor::computeFrustumCorners ( )
protected

Computes the eight corners of the frustum.

Returns
success

◆ computeGlobalPlaneCoefficients()

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.

Parameters
planeCoefficientscoefficients of the six planes
edgesdirection vectors of the frustum edges (there are 12 edges but some of them are collinear)
ptsFrustumthe 8 frustum corners in the global coordinates system
centercenter of the the frustum circumscribed sphere
Returns
success

◆ computeOrthoRectificationParams()

bool ccCameraSensor::computeOrthoRectificationParams ( const ccImage image,
CCCoreLib::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)

Parameters
imageinput image
keypoints3Dkeypoints in 3D
keypointsImagecorresponding keypoints in image
aa0, a1 & a2 parameters
bb0, b1 & b2 parameters
cc0(=1), c1 & c2 parameters
Returns
success

◆ computeUncertainty() [1/2]

bool ccCameraSensor::computeUncertainty ( CCCoreLib::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.

Warning
Only works with Brown's distortion model for now (see BrownDistortionParameters).
Parameters
pointsthe points we want to compute the uncertainty
accuracyto get back the uncertainty TODO lensDistortion if we want to take the lens distortion into consideration
Returns
success

◆ computeUncertainty() [2/2]

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.

Warning
Only works with Brown's distortion model for now (see BrownDistortionParameters).
Parameters
pixelcoordinates of the pixel where the 3D points is projected --> !! Note that the first index is (0,0) and the last (width-1,height-1) !!
depthdepth from sensor center to 3D point (must be positive)
sigmauncertainty vector (along X, Y and Z)
Returns
operation has succeeded (typically, errors occur when the initial pixel coordinates are not into the image boundaries, or when the depth of the 3D point is negative)

◆ drawMeOnly()

void ccCameraSensor::drawMeOnly ( CC_DRAW_CONTEXT context)
overrideprotectedvirtual

Draws the entity only (not its children)

Reimplemented from ccHObject.

◆ fromFile_MeOnly()

bool ccCameraSensor::fromFile_MeOnly ( QFile &  in,
short  dataVersion,
int  flags,
LoadedIDMap oldToNewIDMap 
)
overrideprotectedvirtual

Loads own object data.

Called by 'fromFile' (recursive scheme) To be overloaded (but still called;) by subclass.

Parameters
ininput file
dataVersionfile version
flagsdeserialization flags (see ccSerializableObject::DeserializationFlags)
oldToNewIDMapmap to link old IDs with new IDs

various parameters (dataVersion>=35)

Reimplemented from ccHObject.

◆ fromGlobalCoordToImageCoord()

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.

Parameters
globalCoordglobal coordinates of the 3D point
imageCoordto 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) !!
withLensErrorto take lens distortion into account
Returns
if operation has succeeded (typically, errors occur when the projection of the initial 3D points is not into the image boundaries, or when the 3D point is behind the camera)

◆ fromGlobalCoordToLocalCoord()

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.

Parameters
globalCoordglobal coordinates of the 3D point (input)
localCoordcorresponding local coordinates of the 3D point (output)

◆ fromImageCoordToGlobalCoord()

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)

Parameters
imageCoordimage coordinates of the pixel (input) --> !! Note that the first index is (0,0) and the last (width-1,height-1) !!
globalCoordglobal coordinates of the corresponding 3D point (output)
z0altitude of the output pixel
withLensCorrectionif we want to correct the initial pixel coordinates with the lens correction formula
Returns
if operation has succeeded (typically, errors occur when the initial pixel coordinates are not into the image boundaries)

◆ fromImageCoordToLocalCoord()

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.

Parameters
imageCoordimage coordinates of the pixel (input) --> !! Note that the first index is (0,0) and the last (width-1,height-1) !!
localCoordlocal coordinates of the corresponding 3D point (output)
depthdepth of the output pixel relatively to the camera center
withLensCorrectionif we want to correct the initial pixel coordinates with the lens correction formula
Returns
if operation has succeeded (typically, errors occur when the initial pixel coordinates are not into the image boundaries)

◆ fromLocalCoordToGlobalCoord()

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.

Parameters
localCoordlocal coordinates of the 3D point (input)
globalCoordcorresponding global coordinates of the 3D point (output)

◆ fromLocalCoordToImageCoord()

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.

Parameters
localCoordlocal coordinates of the 3D point (input)
imageCoordimage coordinates of the projected point on the image (output) --> !! Note that the first index is (0,0) and the last (width-1,height-1) !!
withLensErrorto take lens distortion into account
Returns
if operation has succeeded (typically, errors occur when the projection of the initial 3D points is not into the image boundaries, or when the 3D point is behind the camera)

◆ fromRealImCoordToIdealImCoord()

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.

Warning
Only works with Brown's distortion model for now (see BrownDistortionParameters).
Parameters
realreal 2D coordinates of a pixel (assuming 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) !!
idealafter applying lens correction (output) --> !! Note that the first index is (0,0) and the last (width-1,height-1) !!

◆ getClassID()

CC_CLASS_ENUM ccCameraSensor::getClassID ( ) const
inlineoverridevirtual

Returns class ID.

Implements ccObject.

◆ getOwnBB()

ccBBox ccCameraSensor::getOwnBB ( bool  withGLFeatures = false)
overridevirtual

Returns the entity's own bounding-box (with local/shifted coordinates)

Children bounding-boxes are ignored.

Parameters
withGLFeatureswhether to take into account display-only elements (if any)
Returns
bounding-box

Reimplemented from ccHObject.

◆ getOwnFitBB()

ccBBox ccCameraSensor::getOwnFitBB ( ccGLMatrix trans)
overridevirtual

Returns best-fit bounding-box (if available)

Warning
Only suitable for leaf objects (i.e. without children) Therefore children bboxes are always ignored.
This method is not supported by all entities! (returns the axis-aligned bounding-box by default).
Parameters
[out]transassociated transformation (so that the bounding-box can be displayed in the right position!)
Returns
fit bounding-box

Reimplemented from ccHObject.

◆ getProjectionMatrix()

bool ccCameraSensor::getProjectionMatrix ( ccGLMatrix matrix)

Returns the camera projection matrix.

Parameters
[out]matrixprojection matrix (if the method returns true)
Returns
whether the matrix could be computed or not (probably due to wrong parameters)

◆ isGlobalCoordInFrustum()

bool ccCameraSensor::isGlobalCoordInFrustum ( const CCVector3 &  globalCoord) const

Tests if a 3D point is in the field of view of the camera.

Parameters
globalCoordglobal coordinates of the 3D point TODO withLensCorrection if we want to take the lens distortion into consideration
Returns
if operation has succeeded

◆ isSerializable()

bool ccCameraSensor::isSerializable ( ) const
inlineoverridevirtual

Returns whether object is serializable of not.

Reimplemented from ccSerializableObject.

◆ orthoRectifyAsCloud()

ccPointCloud * ccCameraSensor::orthoRectifyAsCloud ( const ccImage image,
CCCoreLib::GenericIndexedCloud *  keypoints3D,
std::vector< KeyPoint > &  keypointsImage 
) const

Projective ortho-rectification of an image (as cloud)

Requires at least 4 key points!

Parameters
imageinput image
keypoints3Dkeypoints in 3D
keypointsImagecorresponding keypoints in image
Returns
ortho-rectified image as a point cloud

◆ orthoRectifyAsImage()

ccImage * ccCameraSensor::orthoRectifyAsImage ( const ccImage image,
CCCoreLib::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!

Parameters
imageinput image
keypoints3Dkeypoints in 3D
keypointsImagecorresponding keypoints in image
pixelSizepixel 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)
Returns
ortho-rectified image

◆ orthoRectifyAsImageDirect()

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'.

Parameters
imageinput image
altitudeorthorectification altitude
pixelSizepixel size (auto if -1)
undistortImageswhether 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)
Returns
ortho-rectified image

◆ OrthoRectifyAsImages()

bool ccCameraSensor::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 
)
static

Projective ortho-rectification of multiple images (as image files)

Parameters
imagesset 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)
maxSizeoutput image(s) max dimension
outputDiroutput directory for resulting images (is successful)
[out]orthoRectifiedImagesresulting images (is successful)
[out]relativePosrelative positions (relatively to first image)
Returns
true if successful

◆ setVertFocal_pix()

void ccCameraSensor::setVertFocal_pix ( float  vertFocal_pix)

Sets focal (in pixels)

Warning
Vertical dimension by default

◆ toFile_MeOnly()

bool ccCameraSensor::toFile_MeOnly ( QFile &  out) const
overrideprotectedvirtual

Save own object data.

Called by 'toFile' (recursive scheme) To be overloaded (but still called;) by subclass.

various parameters (dataVersion>=35)

Reimplemented from ccHObject.

◆ undistort() [1/2]

ccImage * ccCameraSensor::undistort ( ccImage image,
bool  inplace = true 
) const

Undistorts an image based on the sensor distortion parameters.

Warning
Only works with the simple radial distortion model for now (see RadialDistortionParameters).
Parameters
imageinput image
inplacewhether the undistortion should be applied in place or not
Returns
undistorted image (maybe the same as the input image if inplace is true, or even a null pointer if an error occurred)

◆ undistort() [2/2]

QImage ccCameraSensor::undistort ( const QImage &  image) const

Undistorts an image based on the sensor distortion parameters.

Warning
Only works with the simple radial distortion model for now (see RadialDistortionParameters).
Parameters
imageinput image
Returns
undistorted image (or a null one if an error occurred)

Member Data Documentation

◆ m_frustumInfos

FrustumInformation ccCameraSensor::m_frustumInfos
protected

Frustum information structure.

Used to draw it properly.


The documentation for this class was generated from the following files: