26 #ifndef __EPIPOLARLINE_HH__
27 #define __EPIPOLARLINE_HH__
28 #include "bias_config.h"
30 #include <Base/Geometry/HomgPoint2D.hh>
31 #include <Base/Geometry/HomgLine2D.hh>
32 #include <Base/ImageUtils/EightWaySymmetry.hh>
33 #include <Base/Debug/Debug.hh>
34 #include <Base/Image/Image.hh>
35 #include <Geometry/Projection.hh>
37 #include "EightWaySymmetryHomg.hh"
43 #define TWICEPI 6.2831853071795864769252867665590058
45 #define D_EL_SLOPE 1<<0
46 #define D_EL_TRANSF 1<<1
47 #define D_EL_STARTEND 1<<2
48 #define D_EL_NEWSTARTEND 1<<3
49 #define D_EL_ROUND 1<<4
50 #define D_EL_NEXTLINE 1<<5
51 #define D_EL_OFFSET 1<<6
52 #define D_EL_BRES 1<<7
53 #define D_EL_BRESROUND 1<<8
57 enum TEdge { TopEdge, BottomEdge, LeftEdge, RightEdge, InvalidEdge };
59 BIASGeometry_EXPORT std::ostream&
operator<<(std::ostream& os,
const enum TEdge edge);
105 {
return ROffset_; };
114 {
return TransformedStart_; };
117 {
return TransformedEnd_; };
120 {
return TransformedStart_; };
123 {
return TransformedEnd_; };
131 {
return RMinLine_; }
135 {
return RMaxLine_; }
139 {
return FarIntersection_; };
143 {
return CloseIntersection_; };
147 {
return FarIntersection_; };
151 {
return CloseIntersection_; };
153 virtual inline enum TEdge GetFarEdge()
const
154 {
return FarEdge_; };
156 virtual inline enum TEdge GetCloseEdge()
const
157 {
return CloseEdge_; };
160 {
return (
unsigned int)(rint(maxx_-minx_)+1); };
163 {
return (
unsigned int)(rint(maxy_-miny_)+1); };
166 double& maxx,
double& maxy)
const {
175 {
return EpipolePosition_; };
178 virtual void GetNextLine(
bool clockwise,
EpipolarLine& next,
184 int Recalc(
unsigned int width,
unsigned int height,
190 int Recalc(
const double& minx,
const double& miny,
191 const double& maxx,
const double& maxy,
200 virtual void Init(
const double& minx,
const double& miny,
201 const double& maxx,
const double& maxy,
206 virtual void Init(
unsigned int width,
unsigned int height,
211 virtual void Init(
unsigned int width,
unsigned int height,
227 bool forward,
unsigned int& length,
228 unsigned char* Destination);
231 template <
class PixelType>
235 template <
class PixelType>
248 template <
class PixelType>
249 static void DrawDistortedLine(
const Vector3<double>& epipoleRayOrigImage,
253 PixelType* Color = NULL,
267 template <
class PixelType>
268 static void ProjectEpipolarPlane(
const Projection& thisP,
272 PixelType* Color = NULL,
292 enum TEdge FarEdge_, CloseEdge_;
311 unsigned int ROffset,
312 unsigned int& length,
unsigned char *Destination,
314 virtual void CalcTransformed_();
316 bool DetermineIntersectionsAndEpipoleDistances_(
HomgPoint2D& point);
318 virtual void Interpolate_(
enum TLineType& type,
unsigned char **ida,
319 int& x,
int& y,
double& g,
320 unsigned char& result);
335 #endif // __EPIPOLARLINE_HH__
double minx_
int Width_; // width of image int Height_; // height of image image borders in xdir, typically 0, width-1
virtual HomgPoint2D & GetFarIntersectionWithImageBorder()
HomgPoint2D FarIntersection_
class HomgPoint2D describes a point with 2 degrees of freedom in projective coordinates.
Used in function DetermineStartEnd_.
virtual unsigned int GetImageWidth() const
HomgPoint2D GetTransformedEnd() const
std::ostream & operator<<(std::ostream &os, const AppData &ad)
HomgPoint2D CloseIntersection_
void GetImageBoundaries(double &minx, double &miny, double &maxx, double &maxy) const
double GetAngle() const
angle to abszissa (-pi, pi]
void SetEpipole(HomgPoint2D &ep)
virtual double GetRMax() const
distance epipole - far intersection with image border
double miny_
image borders in xdir, typically 0, height-1
virtual double GetDeltaR() const
This class hides the underlying projection model, like projection matrix, spherical camera...
EightWaySymmetryHomg Sym_
a line l = (a b c)^T is a form of the implicit straight line equation 0 = a*x + b*y + c if homogenize...
double GetROffset() const
HomgPoint2D & GetTransformedEnd()
HomgPoint2D TransformedStart_
HomgPoint2D & GetTransformedStart()
virtual HomgPoint2D & GetEpipole()
virtual double GetRMin() const
distance epipole - close intersection with image border
virtual HomgPoint2D GetCopyOfEpipole() const
virtual unsigned int GetImageHeight() const
direction of line if start is in coordinate origin as given by compass
virtual HomgPoint2D GetCopyOfFarIntersectionWithImageBorder() const
Camera parameters which define the mapping between rays in the camera coordinate system and pixels in...
HomgPoint2D GetTransformedStart() const
virtual HomgPoint2D & GetCloseIntersectionWithImageBorder()
HomgPoint2D TransformedCurrent_
TLineType
direction of line if start is in coordinate origin as given by compass
virtual HomgPoint2D GetCopyOfCloseIntersectionWithImageBorder() const
A class for representing epipolar lines with useful functions like ScanLine().