OpenCV
3.0.0
Open Source Computer Vision
|
#include "descriptor.hpp"
Public Member Functions | |
LSDDetector () | |
void | detect (const Mat &image, std::vector< KeyLine > &keypoints, int scale, int numOctaves, const Mat &mask=Mat()) |
Detect lines inside an image. More... | |
void | detect (const std::vector< Mat > &images, std::vector< std::vector< KeyLine > > &keylines, int scale, int numOctaves, const std::vector< Mat > &masks=std::vector< Mat >()) const |
Public Member Functions inherited from cv::Algorithm | |
Algorithm () | |
virtual | ~Algorithm () |
virtual void | clear () |
Clears the algorithm state. More... | |
virtual bool | empty () const |
Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read. More... | |
virtual String | getDefaultName () const |
virtual void | read (const FileNode &fn) |
Reads algorithm parameters from a file storage. More... | |
virtual void | save (const String &filename) const |
virtual void | write (FileStorage &fs) const |
Stores algorithm parameters in a file storage. More... | |
Static Public Member Functions | |
static Ptr< LSDDetector > | createLSDDetector () |
Creates ad LSDDetector object, using smart pointers. More... | |
Static Public Member Functions inherited from cv::Algorithm | |
template<typename _Tp > | |
static Ptr< _Tp > | load (const String &filename, const String &objname=String()) |
Loads algorithm from the file. More... | |
template<typename _Tp > | |
static Ptr< _Tp > | loadFromString (const String &strModel, const String &objname=String()) |
Loads algorithm from a String. More... | |
template<typename _Tp > | |
static Ptr< _Tp > | read (const FileNode &fn) |
Reads algorithm from the file node. More... | |
The lines extraction methodology described in the following is mainly based on [128] . The extraction starts with a Gaussian pyramid generated from an original image, downsampled N-1 times, blurred N times, to obtain N layers (one for each octave), with layer 0 corresponding to input image. Then, from each layer (octave) in the pyramid, lines are extracted using LSD algorithm.
Differently from EDLine lines extractor used in original article, LSD furnishes information only about lines extremes; thus, additional information regarding slope and equation of line are computed via analytic methods. The number of pixels is obtained using LineIterator. Extracted lines are returned in the form of KeyLine objects, but since extraction is based on a method different from the one used in BinaryDescriptor class, data associated to a line's extremes in original image and in octave it was extracted from, coincide. KeyLine's field class_id is used as an index to indicate the order of extraction of a line inside a single octave.
|
inline |
|
static |
Creates ad LSDDetector object, using smart pointers.
void cv::line_descriptor::LSDDetector::detect | ( | const Mat & | image, |
std::vector< KeyLine > & | keypoints, | ||
int | scale, | ||
int | numOctaves, | ||
const Mat & | mask = Mat() |
||
) |
Detect lines inside an image.
image | input image |
keypoints | vector that will store extracted lines for one or more images |
scale | scale factor used in pyramids generation |
numOctaves | number of octaves inside pyramid |
mask | mask matrix to detect only KeyLines of interest |
void cv::line_descriptor::LSDDetector::detect | ( | const std::vector< Mat > & | images, |
std::vector< std::vector< KeyLine > > & | keylines, | ||
int | scale, | ||
int | numOctaves, | ||
const std::vector< Mat > & | masks = std::vector< Mat >() |
||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
images | input images |
keylines | set of vectors that will store extracted lines for one or more images |
scale | scale factor used in pyramids generation |
numOctaves | number of octaves inside pyramid |
masks | vector of mask matrices to detect only KeyLines of interest from each input image |