FindLines.cpp File Reference

functions for finding lines More...

#include "vigra/edgedetection.hxx"
#include "FindLines.h"
#include "FindN8Lines.h"
#include <algorithms/nona/FitPanorama.h>
#include <algorithms/basic/CalculateOptimalROI.h>
#include <nona/RemappedPanoImage.h>
#include <algorithms/optimizer/PTOptimizer.h>
#include "algorithms/basic/CalculateCPStatistics.h"

Include dependency graph for FindLines.cpp:

Include dependency graph

Go to the source code of this file.

Namespaces

namespace  HuginLines

Classes

struct  HuginLines::VerticalLine

Defines

#define MAX_RESIZE_DIM   1600

Typedefs

typedef std::vector< VerticalLine > VerticalLineVector

Functions

template<class ImageType>
double resize_image (ImageType &in, ImageType &out, int resize_dimension)
vigra::BImage * detectEdges (UInt8RGBImage input, double scale, double threshold, unsigned int resize_dimension, double &size_factor)
 detect and mark edges in an edge image using Canny's algorithm
vigra::BImage * detectEdges (BImage input, double scale, double threshold, 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. (Points on the edges of the image cannot be line points).
void ScaleLines (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)


Detailed Description

functions for finding lines

Definition in file FindLines.cpp.


Define Documentation

#define MAX_RESIZE_DIM   1600
 

Definition at line 165 of file FindLines.cpp.

Referenced by HuginLines::_getVerticalLines().


Typedef Documentation

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

Definition at line 173 of file FindLines.cpp.

Referenced by HuginLines::_getVerticalLines(), and HuginLines::FilterLines().


Function Documentation

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

Definition at line 256 of file FindLines.cpp.

References HuginBase::Panorama::addCtrlPoint(), HuginBase::Panorama::addImage(), HuginBase::CalculateCPStatisticsError::calcCtrlPntsErrorStats(), HuginBase::SrcPanoImage::calcFocalLength(), HuginBase::PTools::Transform::createTransform(), DEG_TO_RAD, HuginBase::SrcPanoImage::deleteAllMasks(), HuginLines::detectEdges(), HuginBase::ControlPoint::error, HuginLines::FilterLines(), HuginLines::findLines(), HuginBase::Panorama::getCtrlPoints(), HuginBase::SrcPanoImage::getHeight(), HuginBase::Panorama::getImage(), HuginBase::CalculateFitPanorama::getResultHeight(), HuginBase::CalculateFitPanorama::getResultHorizontalFOV(), HuginBase::PanoramaOptions::getROI(), HuginBase::Panorama::getSrcImage(), HuginBase::SrcPanoImage::getWidth(), HuginBase::ControlPoint::image1Nr, HuginBase::ControlPoint::image2Nr, ImageType, HuginLines::Lines, vigra_ext::ROIImage< RemapImage, AlphaImage >::m_image, celeste::max(), MAX_RESIZE_DIM, celeste::min(), HuginBase::ControlPoint::mode, HuginBase::PTools::optimize(), HuginBase::PanoramaOptions::outputExposureValue, HuginBase::Nona::RemappedPanoImage< RemapImage, AlphaImage >::remapImage(), HuginBase::PanoramaAlgorithm::run(), HuginBase::BaseSrcPanoImage::setActive(), HuginBase::BaseSrcPanoImage::setEMoRParams(), HuginBase::BaseSrcPanoImage::setExposureValue(), HuginBase::PanoramaOptions::setHeight(), HuginBase::PanoramaOptions::setHFOV(), HuginBase::Panorama::setOptimizeVector(), 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(), HuginBase::PTools::Transform::transformImgCoord(), HuginLines::VerticalLineVector, HuginBase::ControlPoint::x1, HuginBase::ControlPoint::x2, HuginBase::ControlPoint::y1, and HuginBase::ControlPoint::y2.

Referenced by HuginLines::GetVerticalLines().

double calculate_focal_length_pixels double  focal_length,
double  cropFactor,
double  width,
double  height
 

Definition at line 109 of file FindLines.cpp.

Referenced by HuginLines::findLines().

vigra::BImage* detectEdges BImage  input,
double  scale,
double  threshold,
unsigned int  resize_dimension,
double &  size_factor
 

Definition at line 96 of file FindLines.cpp.

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

Referenced by HuginLines::_getVerticalLines().

vigra::BImage* detectEdges vigra::UInt8RGBImage  input,
double  scale,
double  threshold,
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

Definition at line 79 of file FindLines.cpp.

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

VerticalLineVector FilterLines Lines  lines,
double  roll
 

Definition at line 225 of file FindLines.cpp.

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

Referenced by HuginLines::_getVerticalLines().

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 124 of file FindLines.cpp.

References HuginLines::calculate_focal_length_pixels(), HuginLines::edgeMap2linePts(), HuginLines::linePts2lineList(), and HuginLines::Lines.

Referenced by HuginLines::_getVerticalLines().

VerticalLine FitLine SingleLine  line  ) 
 

Definition at line 185 of file FindLines.cpp.

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

Referenced by HuginLines::FilterLines().

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 150 of file FindLines.cpp.

References HuginLines::SingleLine::line.

Referenced by LensCalFrame::GetPanorama().

vigra::Point2D GetFootpoint vigra::Point2D  p,
vigra::Point2D  p1,
vigra::Point2D  p2
 

Definition at line 176 of file FindLines.cpp.

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

Referenced by HuginLines::FitLine().

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

Definition at line 466 of file FindLines.cpp.

References HuginLines::_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 461 of file FindLines.cpp.

References HuginLines::_getVerticalLines().

Referenced by LoadGrayImageAndFindLines(), and LoadImageAndFindLines().

template<class ImageType>
double resize_image ImageType in,
ImageType out,
int  resize_dimension
 

Definition at line 43 of file FindLines.cpp.

References vigra_ext::destImage(), vigra_ext::destImageRange(), out, and vigra_ext::srcImageRange().

Referenced by HuginLines::detectEdges().

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 139 of file FindLines.cpp.

Referenced by ImageLineList::ScaleLines().

bool SortByError const HuginBase::ControlPoint cp1,
const HuginBase::ControlPoint cp2
 

Definition at line 250 of file FindLines.cpp.

References HuginBase::ControlPoint::error.


Generated on Fri Aug 22 01:25:52 2014 for Hugintrunk by  doxygen 1.3.9.1