![]() |
SLProject
4.3.020
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
|
#include <SENSCvCamera.h>
Public Types | |
| enum | ConfigReturnCode { SUCCESS = 0 , WARN_TARGET_SIZE_NOT_FOUND , ERROR_CAMERA_INVALID , ERROR_CAMERA_IS_RUNNING , ERROR_FACING_NOT_AVAILABLE , ERROR_UNKNOWN } |
| error code definition, will be returned by configure in case of failure. See method advice() for explanation. More... | |
Public Member Functions | |
| SENSCvCamera (SENSCamera *camera) | |
| ConfigReturnCode | configure (SENSCameraFacing facing, int targetWidth, int targetHeight, int manipWidth, int manipHeight, bool mirrorH, bool mirrorV, bool convertManipToGray) |
| bool | started () |
| bool | start () |
| void | stop () |
| SENSFramePtr | latestFrame () |
| bool | supportsFacing (SENSCameraFacing facing) |
| SENSCamera *& | cameraRef () |
| bool | isConfigured () |
| const SENSCvCameraConfig * | config () |
| const SENSCalibration *const | calibration () const |
| returns SENSCalibration if it was started (maybe a guessed one from a fovV guess). Else returns nullptr. The calibration is used for computer vision applications. So, if a manipulated image is requested (see imgManipSize in SENSCamera::start(...), SENSFrame::imgManip and SENSCameraConfig) this calibration is adjusted to fit to this image, else to the original sized image (see SENSFrame::imgBGR) More... | |
| const SENSCalibration *const | calibrationManip () const |
| void | guessAndSetCalibration (float fovDegFallbackGuess) |
| cv::Mat | scaledCameraMat () |
| void | setCalibration (const SENSCalibration &calibration, bool buildUndistortionMaps) |
| Set calibration and adapt it to current image size. Camera has to be configured, before this function is called. More... | |
| void | clearCalibration () |
| clear calibration set from outsilde with setCalibration. Only then an automatic guess will be possible. More... | |
Static Public Member Functions | |
| static std::string | advice (const ConfigReturnCode returnCode) |
| returns advice to an error code More... | |
Private Member Functions | |
| SENSFramePtr | processNewFrame (const SENSTimePt &timePt, cv::Mat bgrImg, cv::Mat intrinsics, bool intrinsicsChanged) |
Private Attributes | |
| SENSCamera * | _camera |
| std::unique_ptr< SENSCvCameraConfig > | _config |
| std::unique_ptr< SENSCalibration > | _calibration |
| The calibration is used for computer vision applications. This calibration is adjusted to fit to the original sized image (see SENSFrame::imgBGR and SENSCameraConfig::targetWidth, targetHeight) More... | |
| std::unique_ptr< SENSCalibration > | _calibrationManip |
| std::unique_ptr< SENSCalibration > | _calibrationOverwrite |
Camera wrapper for computer vision applications that adds convenience functions and that makes post processing steps.
Definition at line 64 of file SENSCvCamera.h.
error code definition, will be returned by configure in case of failure. See method advice() for explanation.
| Enumerator | |
|---|---|
| SUCCESS | |
| WARN_TARGET_SIZE_NOT_FOUND | |
| ERROR_CAMERA_INVALID | |
| ERROR_CAMERA_IS_RUNNING | |
| ERROR_FACING_NOT_AVAILABLE | |
| ERROR_UNKNOWN | |
Definition at line 68 of file SENSCvCamera.h.
| SENSCvCamera::SENSCvCamera | ( | SENSCamera * | camera | ) |
Definition at line 81 of file SENSCvCamera.cpp.
|
inlinestatic |
returns advice to an error code
Definition at line 79 of file SENSCvCamera.h.
|
inline |
returns SENSCalibration if it was started (maybe a guessed one from a fovV guess). Else returns nullptr. The calibration is used for computer vision applications. So, if a manipulated image is requested (see imgManipSize in SENSCamera::start(...), SENSFrame::imgManip and SENSCameraConfig) this calibration is adjusted to fit to this image, else to the original sized image (see SENSFrame::imgBGR)
Definition at line 120 of file SENSCvCamera.h.
|
inline |
Definition at line 121 of file SENSCvCamera.h.
|
inline |
Definition at line 115 of file SENSCvCamera.h.
|
inline |
clear calibration set from outsilde with setCalibration. Only then an automatic guess will be possible.
Definition at line 132 of file SENSCvCamera.h.
|
inline |
Definition at line 117 of file SENSCvCamera.h.
| SENSCvCamera::ConfigReturnCode SENSCvCamera::configure | ( | SENSCameraFacing | facing, |
| int | targetWidth, | ||
| int | targetHeight, | ||
| int | manipWidth, | ||
| int | manipHeight, | ||
| bool | mirrorH, | ||
| bool | mirrorV, | ||
| bool | convertManipToGray | ||
| ) |
configure camera: the function checks with the wrapped camera if it could successfully configure the camera.
configure camera: the function checks with the wrapped camera if it could successfully configure the camera. If not, it will return false. This may have dirrerent reasons:
Definition at line 106 of file SENSCvCamera.cpp.
| void SENSCvCamera::guessAndSetCalibration | ( | float | fovDegFallbackGuess | ) |
Definition at line 54 of file SENSCvCamera.cpp.
|
inline |
Definition at line 116 of file SENSCvCamera.h.
| SENSFramePtr SENSCvCamera::latestFrame | ( | ) |
Definition at line 210 of file SENSCvCamera.cpp.
|
private |
Definition at line 7 of file SENSCvCamera.cpp.
| cv::Mat SENSCvCamera::scaledCameraMat | ( | ) |
Definition at line 251 of file SENSCvCamera.cpp.
| void SENSCvCamera::setCalibration | ( | const SENSCalibration & | calibration, |
| bool | buildUndistortionMaps | ||
| ) |
Set calibration and adapt it to current image size. Camera has to be configured, before this function is called.
Definition at line 260 of file SENSCvCamera.cpp.
| bool SENSCvCamera::start | ( | ) |
| bool SENSCvCamera::started | ( | ) |
Definition at line 196 of file SENSCvCamera.cpp.
| void SENSCvCamera::stop | ( | ) |
Definition at line 204 of file SENSCvCamera.cpp.
| bool SENSCvCamera::supportsFacing | ( | SENSCameraFacing | facing | ) |
Definition at line 90 of file SENSCvCamera.cpp.
|
private |
The calibration is used for computer vision applications. This calibration is adjusted to fit to the original sized image (see SENSFrame::imgBGR and SENSCameraConfig::targetWidth, targetHeight)
Definition at line 141 of file SENSCvCamera.h.
|
private |
Definition at line 143 of file SENSCvCamera.h.
|
private |
Definition at line 146 of file SENSCvCamera.h.
|
private |
Definition at line 137 of file SENSCvCamera.h.
|
private |
Definition at line 138 of file SENSCvCamera.h.