68     static bool       processedCalibResult = 
false;
 
   85             processedCalibResult = 
false;
 
   97             ss << 
"Click on the screen to create a calibration photo. Created " 
  109             s->
info(
"Busy extracting corners, please wait with grabbing ...");
 
  116             s->
info(
"Calculating calibration, please wait ...");
 
  120             if (!processedCalibResult)
 
  124                     processedCalibResult = 
true;
 
  128                     string      mainCalibFilename = 
"camCalib_" + computerInfo + 
"_main.xml";
 
  129                     string      scndCalibFilename = 
"camCalib_" + computerInfo + 
"_scnd.xml";
 
  134 #ifndef SL_EMSCRIPTEN 
  149                         errorMsg += 
" Saving calibration failed!";
 
  156                     s->
info((
"Calibration failed!"));
 
  162             s->
info((
"Capturing done!"));
 
  167         log(
"SLProject", e.what());
 
  168         s->
info(
"Exception during calibration! Please restart!");
 
  191         if (!strF.empty() && !strW.empty() && !strH.empty())
 
  193             float devF = strF.empty() ? 0.0f : stof(strF);
 
  194             float devW = strW.empty() ? 0.0f : stof(strW);
 
  195             float devH = strH.empty() ? 0.0f : stof(strH);
 
  268                     SLMat4f glOVM(cvOVM.val[0], cvOVM.val[1], cvOVM.val[2], cvOVM.val[3],
 
  269                                   cvOVM.val[4], cvOVM.val[5], cvOVM.val[6], cvOVM.val[7],
 
  270                                   cvOVM.val[8], cvOVM.val[9], cvOVM.val[10],cvOVM.val[11],
 
  271                                   cvOVM.val[12],cvOVM.val[13],cvOVM.val[14],cvOVM.val[15]);
 
  303                     ss << 
"FOVH: " << fovH << 
", error: " << err;
 
  305                     ss << 
"Not calibrated. FOVH guessed: " << fovH << 
" degrees.";
 
  324                                               undistorted.isContinuous(),
 
  340 #ifndef SL_EMSCRIPTEN 
The AppCommon class holds the top-level instances of the app-demo.
 
Definition of scene IDs in the demo app.
 
@ SID_VideoTrackChessScnd
 
@ SID_VideoTrackChessMain
 
bool onUpdateVideo()
Implements the update per frame for video update and feature tracking.
 
SLNode * gVideoTrackedNode
 
SLGLTexture * gVideoTexture
 
void ensureValidCalibration(CVCamera *ac, SLSceneView *sv)
logic that ensures that we have a valid calibration state
 
void updateTrackingSceneCamera(CVCamera *ac)
 
CVTracked * gVideoTracker
 
void runCalibrationEstimator(CVCamera *ac, SLScene *s, SLSceneView *sv)
 
@ CS_calibrated
The camera is calibrated.
 
@ CS_uncalibrated
The camera is not calibrated (no calibration found)
 
@ VT_NONE
No camera needed.
 
@ VT_MAIN
Main camera on all on all all devices.
 
#define PROFILE_FUNCTION()
 
#define SL_WARN_MSG(message)
 
#define SL_DB_HIDDEN
Flags an object as hidden.
 
static const string CALIB_FTP_HOST
ftp host for calibration up and download
 
static CVCalibrationEstimator * calibrationEstimator
 
static const string CALIB_FTP_USER
ftp login user for calibration up and download
 
static const string CALIB_FTP_DIR
ftp directory for calibration up and download
 
static SLstring calibIniPath
That's where data/calibrations folder is located.
 
static SLstring exePath
executable root path
 
static const string CALIB_FTP_PWD
ftp login pwd for calibration up and download
 
static SLVSceneView sceneViews
Vector of sceneview pointers.
 
static CVCalibrationEstimatorParams calibrationEstimatorParams
 
static SLstring externalPath
Default path for external file storage.
 
static SLSceneID sceneID
ID of currently loaded scene.
 
static SLScene * scene
Pointer to the one and only SLScene instance.
 
static map< string, string > deviceParameter
Generic device parameter.
 
static SLstring calibFilePath
That's where calibrations are stored and loaded from.
 
special exception that informs about errors during calibration process
 
CVCalibration getCalibration()
Get resulting calibration.
 
bool updateAndDecorate(CVMat imageColor, const CVMat &imageGray, bool grabFrame, bool drawCorners=true)
< Finds the inner chessboard corners in the given image
 
Live video camera calibration class with OpenCV an OpenCV calibration.
 
void remap(CVMat &inDistorted, CVMat &outUndistorted)
Undistorts the inDistorted image into the outUndistorted.
 
float reprojectionError() const
 
float cameraFovHDeg() const
 
float cameraFovVDeg() const
 
bool save(const string &calibDir, const string &calibFileName)
Saves the camera calibration parameters to the config file.
 
CVCalibState state() const
 
CVCalibration calibration
 
void showUndistorted(bool su)
 
CVCamera * activeCamera
Pointer to the active camera.
 
CVPixelFormatGL format
GL pixel format.
 
void videoType(CVVideoType vt)
Setter for video type also sets the active calibration.
 
CVMat lastFrame
last frame grabbed in BGR
 
static CVCapture * instance()
Public static instance getter for singleton pattern.
 
CVTracked is the pure virtual base class for tracking features in video.
 
static AvgFloat trackingTimesMS
Averaged time for video tracking in ms.
 
virtual bool track(CVMat imageGray, CVMat imageBgr, CVCalibration *calib)=0
 
CVMatx44f objectViewMat()
 
Active or visible camera node class.
 
void fov(const SLfloat fov)
vertical field of view
 
Texture object for OpenGL texturing.
 
SLbool copyVideoImage(SLint camWidth, SLint camHeight, CVPixelFormatGL glFormat, SLuchar *data, SLbool isContinuous, SLbool isTopLeft)
Copies the image data from a video camera into the current video image.
 
SLMat4< T > inverted() const
Computes the inverse of a 4x4 non-singular matrix.
 
SLNode represents a node in a hierarchical scene graph.
 
void om(const SLMat4f &mat)
 
void setDrawBitsRec(SLuint bit, SLbool state)
 
The SLScene class represents the top level instance holding the scene structure.
 
SceneView class represents a dynamic real time 3D view onto the scene.
 
void camera(SLCamera *camera)
 
void set(T value)
Sets the current value in the value array and builds the average.
 
bool uploadFile(const string &fileDir, const string &fileName, const string &ftpHost, const string &ftpUser, const string &ftpPwd, const string &ftpDir, string &errorMsg)
Uploads file to the ftp server.
 
void errorMsg(const char *tag, const char *msg, const int line, const char *file)
Platform independent error message output.
 
void log(const char *tag, const char *format,...)
logs a formatted string platform independently