#include <iostream>
#include <vector>
#include <cv.h>
#include <highgui.h>
#include <calib/camera.h>
#include "multigrab.h"
#include <GL/glut.h>
Include dependency graph for multigl.cpp:

Go to the source code of this file.
Functions | |
| void | photo_start () |
| Starts photometric calibration. | |
| void | geom_calib_start (bool cache) |
| Start geometric calibration. If the calibration can be loaded from disk, continue directly with photometric calibration. | |
| void | reshape (int width, int height) |
| GLUT callback on window size change. | |
| void | usage (const char *s) |
| Print a command line help and exit. | |
| bool | init (int argc, char **argv) |
| Initialize everything. | |
| void | keyboard (unsigned char c, int x, int y) |
| void | emptyWindow () |
| int | main (int argc, char *argv[]) |
| bool | drawBackground (IplTexture *tex) |
| Draw a frame contained in an IplTexture object on an OpenGL viewport. | |
| void | geom_calib_draw (void) |
| A draw callback during camera calibration. | |
| void | geom_calib_end () |
| Called when geometric calibration ends. It makes sure that the CamAugmentation object is ready to work. | |
| void | geom_calib_idle (void) |
| void | photo_draw (void) |
| void | photo_idle () |
Variables | |
| MultiGrab * | multi = 0 |
| int | geom_calib_nb_homography |
| CamCalibration * | calib = 0 |
| int | current_cam = 0 |
| IplTexture * | frameTexture = 0 |
| bool | frameOK = false |
| int | nbLightMeasures = 0 |
| bool | cacheLight = false |
| bool | dynamicLight = false |
| bool | sphereObject = false |
This example first calibrates connected camera(s) and then uses OpenGL to augment the calibration target with a teapot, shaded by the calibrated light map.
Definition in file multigl.cpp.
|
|
Draw a frame contained in an IplTexture object on an OpenGL viewport.
Definition at line 159 of file multigl.cpp. References IplTexture::disableTexture(), IplTexture::getIm(), IplTexture::loadTexture(), IplTexture::u(), and IplTexture::v(). Referenced by geom_calib_draw(), and photo_draw(). |
|
|
Definition at line 136 of file multigl.cpp. Referenced by main(). |
|
|
A draw callback during camera calibration. GLUT calls that function during camera calibration when repainting the window is required. During geometric calibration, no 3D is known: we just plot 2d points where some feature points have been recognized. Definition at line 205 of file multigl.cpp. References MultiGrab::cams, PyrImage::convCoordf(), current_cam, drawBackground(), frameTexture, and multi. Referenced by geom_calib_start(). |
|
|
Called when geometric calibration ends. It makes sure that the CamAugmentation object is ready to work.
Definition at line 253 of file multigl.cpp. References CalibModel::augm, calib, CamAugmentation::LoadOptimalStructureFromFile(), MultiGrab::model, and multi. Referenced by geom_calib_idle(). |
|
|
Called by GLUT during geometric calibration when there's nothing else to do. This function grab frames from camera(s), run the 2D detection on every image, and keep the result in memory for calibration. When enough homographies have been detected, it tries to actually calibrate the cameras. Definition at line 272 of file multigl.cpp. References add_detected_homography(), CamCalibration::AddHomography(), calib, CamCalibration::Calibrate(), MultiGrab::cams, current_cam, frameTexture, geom_calib_end(), geom_calib_nb_homography, MultiGrab::grabFrames(), multi, photo_start(), CamCalibration::PrintOptimizedResultsToFile1(), and IplTexture::setImage(). Referenced by geom_calib_start(). |
|
|
Start geometric calibration. If the calibration can be loaded from disk, continue directly with photometric calibration.
Definition at line 327 of file multigl.cpp. References CamCalibration::AddCamera(), CalibModel::augm, calib, MultiGrab::cams, geom_calib_draw(), geom_calib_idle(), geom_calib_nb_homography, CamAugmentation::LoadOptimalStructureFromFile(), MultiGrab::model, multi, and photo_start(). Referenced by init(). |
|
||||||||||||
|
Initialize everything.
Definition at line 71 of file multigl.cpp. References cacheLight, geom_calib_start(), MultiGrab::init(), modelFile, multi, and usage(). Referenced by main(). |
|
||||||||||||||||
|
The keyboard callback: reacts to '+' and '-' to change the viewed cam, 'q' exits. 'o' switches between a teapot and a sphere 'd' turns on/off the dynamic lightmap update. 'f' goes fullscreen. Definition at line 117 of file multigl.cpp. References MultiGrab::cams, current_cam, dynamicLight, multi, and sphereObject. Referenced by main(). |
|
||||||||||||
|
Definition at line 140 of file multigl.cpp. References emptyWindow(), init(), and keyboard(). |
|
|
|
GLUT calls this during photometric calibration or augmentation phase when there's nothing else to do. This function does the 2D detection and bundle adjusts the 3D pose of the calibration pattern. Then, it extracts the surface normal, and pass all the lighting measurements to the LightMap object. When enough is collected, the lightmap is computed. Definition at line 548 of file multigl.cpp. References CamAugmentation::Accomodate(), add_detected_homography(), CamAugmentation::AddHomography(), LightMap::addNormal(), CalibModel::augm, MultiGrab::cams, CamAugmentation::Clear(), LightMap::computeLightParams(), current_cam, frameOK, frameTexture, CamAugmentation::GetObjectToWorld(), MultiGrab::grabFrames(), LightMap::isReady(), CalibModel::map, MultiGrab::model, multi, nbLightMeasures, LightMap::nbNormals(), LightMap::save(), and IplTexture::setImage(). Referenced by photo_start(). |
|
|
Starts photometric calibration.
Definition at line 606 of file multigl.cpp. References MultiGrab::allocLightCollector(), LightMap::load(), CalibModel::map, MultiGrab::model, multi, nbLightMeasures, photo_draw(), and photo_idle(). Referenced by geom_calib_idle(), and geom_calib_start(). |
|
||||||||||||
|
GLUT callback on window size change.
Definition at line 43 of file multigl.cpp. |
|
|
Print a command line help and exit.
Definition at line 52 of file multigl.cpp. |
|
|
Definition at line 34 of file multigl.cpp. Referenced by init(). |
|
|
Definition at line 29 of file multigl.cpp. Referenced by add_detected_homography(), geom_calib_end(), geom_calib_idle(), geom_calib_start(), geometric_calibration(), and main(). |
|
|
Definition at line 30 of file multigl.cpp. Referenced by geom_calib_draw(), geom_calib_idle(), keyboard(), photo_draw(), and photo_idle(). |
|
|
Definition at line 35 of file multigl.cpp. Referenced by keyboard(). |
|
|
Definition at line 32 of file multigl.cpp. Referenced by photo_idle(), and photometric_calibration(). |
|
|
Definition at line 31 of file multigl.cpp. Referenced by geom_calib_draw(), geom_calib_idle(), photo_draw(), and photo_idle(). |
|
|
Definition at line 28 of file multigl.cpp. Referenced by geom_calib_idle(), and geom_calib_start(). |
|
|
Definition at line 26 of file multigl.cpp. Referenced by geom_calib_draw(), geom_calib_end(), geom_calib_idle(), geom_calib_start(), geometric_calibration(), init(), keyboard(), main(), photo_draw(), photo_idle(), photo_start(), and photometric_calibration(). |
|
|
Definition at line 33 of file multigl.cpp. Referenced by photo_idle(), photo_start(), and photometric_calibration(). |
|
|
Definition at line 36 of file multigl.cpp. Referenced by keyboard(). |
1.3.9.1