1 #ifndef SENS_CV_CAMERA_H
2 #define SENS_CV_CAMERA_H
4 #include <opencv2/core.hpp>
83 case SUCCESS:
return "Camera was configured successfully";
89 default:
return "Unknown return code";
105 bool convertManipToGray);
std::chrono::high_resolution_clock::time_point SENSTimePt
SENSCameraFacing
Definition of camera facing.
std::shared_ptr< SENSFrame > SENSFramePtr
Pure abstract camera class.
cv::Mat scaledCameraMat()
void clearCalibration()
clear calibration set from outsilde with setCalibration. Only then an automatic guess will be possibl...
bool supportsFacing(SENSCameraFacing facing)
const SENSCvCameraConfig * config()
ConfigReturnCode
error code definition, will be returned by configure in case of failure. See method advice() for expl...
@ ERROR_FACING_NOT_AVAILABLE
@ ERROR_CAMERA_IS_RUNNING
@ WARN_TARGET_SIZE_NOT_FOUND
void guessAndSetCalibration(float fovDegFallbackGuess)
std::unique_ptr< SENSCalibration > _calibrationManip
std::unique_ptr< SENSCvCameraConfig > _config
void setCalibration(const SENSCalibration &calibration, bool buildUndistortionMaps)
Set calibration and adapt it to current image size. Camera has to be configured, before this function...
SENSCvCamera(SENSCamera *camera)
ConfigReturnCode configure(SENSCameraFacing facing, int targetWidth, int targetHeight, int manipWidth, int manipHeight, bool mirrorH, bool mirrorV, bool convertManipToGray)
const SENSCalibration *const calibration() const
returns SENSCalibration if it was started (maybe a guessed one from a fovV guess)....
SENSFramePtr latestFrame()
SENSCamera *& cameraRef()
static std::string advice(const ConfigReturnCode returnCode)
returns advice to an error code
std::unique_ptr< SENSCalibration > _calibration
The calibration is used for computer vision applications. This calibration is adjusted to fit to the ...
const SENSCalibration *const calibrationManip() const
SENSFramePtr processNewFrame(const SENSTimePt &timePt, cv::Mat bgrImg, cv::Mat intrinsics, bool intrinsicsChanged)
std::unique_ptr< SENSCalibration > _calibrationOverwrite
const SENSCameraStreamConfig * streamConfig
const int manipWidth
width of smaller image version (e.g. for tracking)
const int manipHeight
height of smaller image version (e.g. for tracking)
const int targetWidth
largest target image width (only BGR)
const int targetHeight
largest target image width (only BGR)
const bool convertManipToGray
provide gray version of small image
SENSCvCameraConfig(const SENSCameraDeviceProps *deviceProps, const SENSCameraStreamConfig *streamConfig, int targetWidth, int targetHeight, int manipWidth, int manipHeight, bool mirrorH, bool mirrorV, bool convertManipToGray)
const bool mirrorV
mirror image vertically after capturing
const SENSCameraDeviceProps * deviceProps
const bool mirrorH
mirror image horizontally after capturing