HuginLines Namespace Reference


Classes

struct  VerticalLine
struct  SingleLine
 a single line extracted from image More...

Typedefs

typedef std::vector< VerticalLineVerticalLineVector
typedef std::vector< SingleLineLines
 vector of extracted lines from image

Enumerations

enum  LineStatus {
  valid_line = 0, valid_line_disabled, bad_length, bad_orientation,
  bad_curvature
}
 enumeration for different line status More...

Functions

template<class SrcImageIterator, class SrcAccessor, class DestImage>
double resize_image (const triple< SrcImageIterator, SrcImageIterator, SrcAccessor > src, DestImage &dest, int resize_dimension)
vigra::BImage * detectEdges (const UInt8RGBImage &input, const double scale, const double threshold, const unsigned int resize_dimension, double &size_factor)
vigra::BImage * detectEdges (const BImage &input, const double scale, const double threshold, const unsigned int resize_dimension, double &size_factor)
double calculate_focal_length_pixels (double focal_length, double cropFactor, double width, double height)
Lines findLines (vigra::BImage &edge, double length_threshold, double focal_length, double crop_factor)
 find straightish non-crossing lines find straightish non-crossing lines in an edge map using 8-neighborhood operations.
void ScaleLines (HuginLines::Lines &lines, const double scale)
 scales the given lines with given factor use in conjugation with HuginLines::detectEdges to scale the lines to image space because edge image to scaled to smaller size for faster computation
HuginBase::CPVector GetControlPoints (const SingleLine &line, const unsigned int imgNr, const unsigned int lineNr, const unsigned int numberOfCtrlPoints)
 returns a HuginBase::CPVector with cps_per_lines
vigra::Point2D GetFootpoint (vigra::Point2D p, vigra::Point2D p1, vigra::Point2D p2)
VerticalLine FitLine (SingleLine line)
VerticalLineVector FilterLines (Lines lines, double roll)
bool SortByError (const HuginBase::ControlPoint &cp1, const HuginBase::ControlPoint &cp2)
template<class ImageType>
HuginBase::CPVector _getVerticalLines (const HuginBase::Panorama &pano, const unsigned int imgNr, ImageType &image, const unsigned int nrLines)
HuginBase::CPVector GetVerticalLines (const HuginBase::Panorama &pano, const unsigned int imgNr, vigra::UInt8RGBImage &image, const unsigned int nrLines)
 searches for vertical control points in given image
HuginBase::CPVector GetVerticalLines (const HuginBase::Panorama &pano, const unsigned int imgNr, vigra::BImage &image, const unsigned int nrLines)
LINESIMPEX vigra::BImage * detectEdges (const vigra::UInt8RGBImage &input, const double scale, const double threshold, const unsigned int resize_dimension, double &size_factor)
 detect and mark edges in an edge image using Canny's algorithm
LINESIMPEX vigra::BImage * detectEdges (const vigra::BImage &input, const double scale, const double threshold, const unsigned int resize_dimension, double &size_factor)
BImage edgeMap2linePts (BImage &input)
float ccdist (int dx, int dy)
float eudist (int dx, int dy)
static double CtoAcc (vector< Point2D > &pts, int start, int count, double &C, double &A)
static double CtoAeu (vector< Point2D > &pts, int start, int count, double &C, double &A)
float scurv (Point2D &l, Point2D &m, Point2D &r)
void vcurv (Point2D &l, Point2D &m, Point2D &r, float &vx, float &vy)
static int lineFilter (vector< Point2D > &pts, int lmin, double flpix, double xcen, double ycen)
int linePts2lineList (BImage &img, int minsize, double flpix, Lines &lines)
vigra::BImage edgeMap2linePts (vigra::BImage &input)
 marks line point
int linePts2lineList (vigra::BImage &img, int minsize, double flPix, Lines &lines)
 converts a linePts image to a list of lines


Typedef Documentation

typedef std::vector<VerticalLine> HuginLines::VerticalLineVector

Definition at line 167 of file FindLines.cpp.

typedef std::vector<SingleLine> HuginLines::Lines

vector of extracted lines from image

Definition at line 50 of file LinesTypes.h.


Enumeration Type Documentation

enum HuginLines::LineStatus

enumeration for different line status

Enumerator:
valid_line 
valid_line_disabled 
bad_length 
bad_orientation 
bad_curvature 

Definition at line 33 of file LinesTypes.h.


Function Documentation

template<class SrcImageIterator, class SrcAccessor, class DestImage>
double HuginLines::resize_image ( const triple< SrcImageIterator, SrcImageIterator, SrcAccessor >  src,
DestImage &  dest,
int  resize_dimension 
)

Definition at line 42 of file FindLines.cpp.

References vigra::omp::copyImage(), vigra_ext::destImage(), and vigra_ext::destImageRange().

Referenced by detectEdges().

vigra::BImage* HuginLines::detectEdges ( const UInt8RGBImage &  input,
const double  scale,
const double  threshold,
const unsigned int  resize_dimension,
double &  size_factor 
)

Definition at line 79 of file FindLines.cpp.

References vigra_ext::destImage(), resize_image(), and vigra_ext::srcImageRange().

Referenced by _getVerticalLines(), and LensCalFrame::OnFindLines().

vigra::BImage* HuginLines::detectEdges ( const BImage &  input,
const double  scale,
const double  threshold,
const unsigned int  resize_dimension,
double &  size_factor 
)

Definition at line 91 of file FindLines.cpp.

References vigra_ext::destImage(), resize_image(), and vigra_ext::srcImageRange().

double HuginLines::calculate_focal_length_pixels ( double  focal_length,
double  cropFactor,
double  width,
double  height 
)

Definition at line 103 of file FindLines.cpp.

Referenced by findLines().

LINESIMPEX HuginLines::Lines HuginLines::findLines ( vigra::BImage &  edge,
double  length_threshold,
double  focal_length,
double  crop_factor 
)

find straightish non-crossing lines find straightish non-crossing lines in an edge map using 8-neighborhood operations.

(Points on the edges of the image cannot be line points).

Parameters:
edge edge image (e.g. created with HuginLines::detectEdges
length_threshold minimum length of a line, given in ratio to longest images dimension (0<length_threshold<1)
focal_length focal length of the lens (used for estimate which curvature the lines can have)
crop_factor crop factor of the camera/lens
Returns:
the found lines as HuginLines::Lines, contains also the invalid lines (e.g. too short, too curved), use Lines[].status to get result

Definition at line 118 of file FindLines.cpp.

References calculate_focal_length_pixels(), edgeMap2linePts(), and linePts2lineList().

Referenced by _getVerticalLines(), and LensCalFrame::OnFindLines().

LINESIMPEX void HuginLines::ScaleLines ( HuginLines::Lines lines,
const double  scale 
)

scales the given lines with given factor use in conjugation with HuginLines::detectEdges to scale the lines to image space because edge image to scaled to smaller size for faster computation

Definition at line 133 of file FindLines.cpp.

References celeste::line.

Referenced by ImageLineList::ScaleLines().

LINESIMPEX HuginBase::CPVector HuginLines::GetControlPoints ( const SingleLine &  line,
const unsigned int  imgNr,
const unsigned int  lineNr,
const unsigned int  numberOfCtrlPoints 
)

returns a HuginBase::CPVector with cps_per_lines

Parameters:
line line from which the control points should be created
imgNr number of the image in the HuginBase::Panorama class
lineNr number of the line to be created (must be >=3, line 1 and 2 are horizontal and vertical lines)
numberOfCtrlPoints number of control points to create
Returns:
HuginBase::CPVector with all control points

Definition at line 144 of file FindLines.cpp.

References celeste::line.

Referenced by LensCalFrame::GetPanorama().

vigra::Point2D HuginLines::GetFootpoint ( vigra::Point2D  p,
vigra::Point2D  p1,
vigra::Point2D  p2 
)

Definition at line 170 of file FindLines.cpp.

References hugin_utils::norm(), and hugin_utils::sqr().

Referenced by FitLine().

VerticalLine HuginLines::FitLine ( SingleLine  line  ) 

Definition at line 179 of file FindLines.cpp.

References HuginLines::VerticalLine::end, GetFootpoint(), celeste::line, and HuginLines::VerticalLine::start.

Referenced by FilterLines().

VerticalLineVector HuginLines::FilterLines ( Lines  lines,
double  roll 
)

Definition at line 219 of file FindLines.cpp.

References DEG_TO_RAD, HuginLines::VerticalLine::end, FitLine(), and valid_line.

Referenced by _getVerticalLines().

bool HuginLines::SortByError ( const HuginBase::ControlPoint cp1,
const HuginBase::ControlPoint cp2 
)

Definition at line 244 of file FindLines.cpp.

References HuginBase::ControlPoint::error.

Referenced by _getVerticalLines().

template<class ImageType>
HuginBase::CPVector HuginLines::_getVerticalLines ( const HuginBase::Panorama pano,
const unsigned int  imgNr,
ImageType image,
const unsigned int  nrLines 
)

Definition at line 250 of file FindLines.cpp.

References HuginBase::Panorama::addImage(), HuginBase::CalculateCPStatisticsError::calcCtrlPntsErrorStats(), HuginBase::SrcPanoImage::calcFocalLength(), DEG_TO_RAD, HuginBase::SrcPanoImage::deleteAllMasks(), detectEdges(), HuginBase::PanoramaOptions::EQUIRECTANGULAR, HuginBase::ControlPoint::error, FilterLines(), findLines(), HuginBase::Panorama::getImage(), HuginBase::CalculateFitPanorama::getResultHeight(), HuginBase::CalculateFitPanorama::getResultHorizontalFOV(), HuginBase::PanoramaOptions::getROI(), HuginBase::Panorama::getSrcImage(), HuginBase::ControlPoint::image1Nr, HuginBase::ControlPoint::image2Nr, vigra_ext::INTERP_CUBIC, vigra_ext::ROIImage< RemapImage, AlphaImage >::m_image, celeste::max(), MAX_RESIZE_DIM, celeste::min(), HuginBase::PTools::optimize(), HuginBase::PanoramaOptions::outputExposureValue, HuginBase::BaseSrcPanoImage::RECTILINEAR, HuginBase::Nona::RemappedPanoImage< RemapImage, AlphaImage >::remapImage(), hugin_utils::roundi(), HuginBase::PanoramaAlgorithm::run(), HuginBase::BaseSrcPanoImage::setActive(), HuginBase::BaseSrcPanoImage::setEMoRParams(), HuginBase::BaseSrcPanoImage::setExposureValue(), HuginBase::PanoramaOptions::setHeight(), HuginBase::PanoramaOptions::setHFOV(), HuginBase::Panorama::setOptions(), HuginBase::Nona::RemappedPanoImage< RemapImage, AlphaImage >::setPanoImage(), HuginBase::BaseSrcPanoImage::setPitch(), HuginBase::PanoramaOptions::setProjection(), HuginBase::BaseSrcPanoImage::setRoll(), HuginBase::PanoramaOptions::setWidth(), HuginBase::BaseSrcPanoImage::setX(), HuginBase::BaseSrcPanoImage::setY(), HuginBase::BaseSrcPanoImage::setYaw(), HuginBase::BaseSrcPanoImage::setZ(), SortByError(), hugin_utils::sqr(), vigra_ext::srcImage(), vigra_ext::srcImageRange(), and HuginBase::ControlPoint::X.

Referenced by GetVerticalLines().

LINESIMPEX HuginBase::CPVector HuginLines::GetVerticalLines ( const HuginBase::Panorama pano,
const unsigned int  imgNr,
vigra::UInt8RGBImage &  image,
const unsigned int  nrLines 
)

searches for vertical control points in given image

Parameters:
pano panorama object in which is searched
imgNr number of image in which should be searched
image vigra image in which should be searched
nrLine maximal number of lines to return
Returns:
HuginBase::CPVector with all vertical control points

Definition at line 460 of file FindLines.cpp.

References _getVerticalLines().

Referenced by LoadGrayImageAndFindLines(), and LoadImageAndFindLines().

LINESIMPEX HuginBase::CPVector HuginLines::GetVerticalLines ( const HuginBase::Panorama pano,
const unsigned int  imgNr,
vigra::BImage &  image,
const unsigned int  nrLines 
)

Definition at line 465 of file FindLines.cpp.

References _getVerticalLines().

LINESIMPEX vigra::BImage* HuginLines::detectEdges ( const vigra::UInt8RGBImage &  input,
const double  scale,
const double  threshold,
const unsigned int  resize_dimension,
double &  size_factor 
)

detect and mark edges in an edge image using Canny's algorithm

Parameters:
input input image, on which the algorithm should run
scale scale factor in pixel (precondition: scale > 0)
threshold threshold for edge detection algorithm (precondition: threshold > 0)
resize_dimension maximum dimension on which the algorithm should work
size_factor contains the scale factor for transform from edge image to input image
Returns:
image with the marked edges

LINESIMPEX vigra::BImage* HuginLines::detectEdges ( const vigra::BImage &  input,
const double  scale,
const double  threshold,
const unsigned int  resize_dimension,
double &  size_factor 
)

BImage HuginLines::edgeMap2linePts ( BImage &  input  ) 

Definition at line 46 of file FindN8Lines.cpp.

References vigra::omp::copyImage(), celeste::line, N8_bg, N8_end, and N8_mid.

Referenced by findLines().

float HuginLines::ccdist ( int  dx,
int  dy 
) [inline]

Definition at line 274 of file FindN8Lines.cpp.

References celeste::max(), and celeste::min().

Referenced by CtoAcc(), and linePts2lineList().

float HuginLines::eudist ( int  dx,
int  dy 
) [inline]

Definition at line 281 of file FindN8Lines.cpp.

Referenced by CtoAeu().

static double HuginLines::CtoAcc ( vector< Point2D > &  pts,
int  start,
int  count,
double &  C,
double &  A 
) [static]

Definition at line 288 of file FindN8Lines.cpp.

References ccdist().

static double HuginLines::CtoAeu ( vector< Point2D > &  pts,
int  start,
int  count,
double &  C,
double &  A 
) [static]

Definition at line 310 of file FindN8Lines.cpp.

References eudist().

float HuginLines::scurv ( Point2D &  l,
Point2D &  m,
Point2D &  r 
) [inline]

Definition at line 334 of file FindN8Lines.cpp.

void HuginLines::vcurv ( Point2D &  l,
Point2D &  m,
Point2D &  r,
float &  vx,
float &  vy 
) [inline]

Definition at line 343 of file FindN8Lines.cpp.

static int HuginLines::lineFilter ( vector< Point2D > &  pts,
int  lmin,
double  flpix,
double  xcen,
double  ycen 
) [static]

Definition at line 363 of file FindN8Lines.cpp.

Referenced by linePts2lineList().

int HuginLines::linePts2lineList ( BImage &  img,
int  minsize,
double  flpix,
Lines lines 
)

Definition at line 442 of file FindN8Lines.cpp.

References bad_curvature, bad_length, bad_orientation, ccdist(), celeste::line, lineFilter(), N8_bg, N8_end, and valid_line.

Referenced by findLines().

vigra::BImage HuginLines::edgeMap2linePts ( vigra::BImage &  input  ) 

marks line point

Parameters:
input input image (should be black edges on white background)
Returns:
image with marked lines (background = 0, end points = 1, interior points = 2)

int HuginLines::linePts2lineList ( vigra::BImage &  img,
int  minsize,
double  flPix,
Lines lines 
)

converts a linePts image to a list of lines

Parameters:
img lineimage
minsize minimum length of line given in
flPix focal length in pixel (determines the maximal allowed curvature of the line)
lines detected lines
Returns:
number of detected lines


Generated on 3 Sep 2015 for Hugintrunk by  doxygen 1.4.7