[89] | 1 | /***************************************************************************
|
---|
| 2 | *
|
---|
| 3 | * Copyright 2000 by David Demirdjian. All rights reserved.
|
---|
| 4 | *
|
---|
| 5 | * Developed by David Demirdjian
|
---|
| 6 | *
|
---|
| 7 | * Permission to use, copy, or modify this software and its documentation
|
---|
| 8 | * for educational and research purposes only and without fee is hereby
|
---|
| 9 | * granted, provided that this copyright notice and the original authors's
|
---|
| 10 | * names appear on all copies and supporting documentation. If individual
|
---|
| 11 | * files are separated from this distribution directory structure, this
|
---|
| 12 | * copyright notice must be included. For any other uses of this software,
|
---|
| 13 | * in original or modified form, including but not limited to distribution
|
---|
| 14 | * in whole or in part, specific prior permission must be obtained from
|
---|
| 15 | * MIT. These programs shall not be used, rewritten, or adapted as the
|
---|
| 16 | * basis of a commercial software or hardware product without first
|
---|
| 17 | * obtaining appropriate licenses from David Demirdjian. The author makes
|
---|
| 18 | * no representations about the suitability of this software for any purpose.
|
---|
| 19 | * It is provided "as is" without express or implied warranty.
|
---|
| 20 | *
|
---|
| 21 | **************************************************************************/
|
---|
| 22 | #ifndef _RECONST3D_H
|
---|
| 23 | #define _RECONST3D_H
|
---|
| 24 |
|
---|
| 25 | class StereoImage;
|
---|
| 26 | class ReconstPoints3D;
|
---|
| 27 | #ifdef _USEGDI
|
---|
| 28 | #include <gdiplus.h>
|
---|
| 29 | #else
|
---|
| 30 | class Bitmap;
|
---|
| 31 | #endif
|
---|
| 32 |
|
---|
| 33 | // ********************************************************************
|
---|
| 34 | // ********************************************************************
|
---|
| 35 | // Reconst3D: class used for 3D Euclidean reconstruction stereo images
|
---|
| 36 | class Reconst3D
|
---|
| 37 | {
|
---|
| 38 | public:
|
---|
| 39 | Reconst3D();
|
---|
| 40 | ~Reconst3D();
|
---|
| 41 |
|
---|
| 42 | enum Error { CAMERA_PARAM_NOT_SET, IMAGE_BUFFER_NULL, WRONG_IMAGE_SIZE, RECONST_OK };
|
---|
| 43 |
|
---|
| 44 | // -------- set/get stereo parameters --------
|
---|
| 45 | void setCameraParameters(float focal, float baseline, float u0, float v0);
|
---|
| 46 | void getCameraParameters(float& focal, float& baseline, float& u0, float& v0) const;
|
---|
| 47 |
|
---|
| 48 | // -----------------------------------------------------------------------
|
---|
| 49 | // -------- doReconstruction: 3D reconstruction of the full scene --------
|
---|
| 50 | // input:
|
---|
| 51 | // - pStereoData: Pointer on a StereoImage structure containing the stereo data
|
---|
| 52 | // output:
|
---|
| 53 | // - reconstPts3d: Pointer on a the calculated 3D reconstruction
|
---|
| 54 | int doReconstruction(ReconstPoints3D* reconstPts3d, const StereoImage* pStereoData);
|
---|
| 55 |
|
---|
| 56 | //#ifdef _USEGDI
|
---|
| 57 | // ------------------------------------------------------------------------------
|
---|
| 58 | // -------- doReconstruction: 3D reconstruction of the full scene with color info
|
---|
| 59 | // input:
|
---|
| 60 | // - pStereoData: Pointer on a StereoImage structure containing the stereo data
|
---|
| 61 | // output:
|
---|
| 62 | // - reconstPts3d: Pointer on a the calculated 3D reconstruction
|
---|
| 63 | int doReconstruction(ReconstPoints3D* reconstPts3d, const StereoImage* pStereoData,
|
---|
| 64 | Bitmap *bitmap);
|
---|
| 65 | //#endif
|
---|
| 66 | // camera parameters
|
---|
| 67 | float m_fFocalLength;
|
---|
| 68 | float m_fBaseLine;
|
---|
| 69 | float m_u0;
|
---|
| 70 | float m_v0;
|
---|
| 71 | };
|
---|
| 72 |
|
---|
| 73 | #endif |
---|