[][src]Module opencv::line_descriptor

Binary descriptors for lines extracted from an image

Introduction

One of the most challenging activities in computer vision is the extraction of useful information from a given image. Such information, usually comes in the form of points that preserve some kind of property (for instance, they are scale-invariant) and are actually representative of input image.

The goal of this module is seeking a new kind of representative information inside an image and providing the functionalities for its extraction and representation. In particular, differently from previous methods for detection of relevant elements inside an image, lines are extracted in place of points; a new class is defined ad hoc to summarize a line's properties, for reuse and plotting purposes.

Computation of binary descriptors

To obtatin a binary descriptor representing a certain line detected from a certain octave of an image, we first compute a non-binary descriptor as described in LBD . Such algorithm works on lines extracted using EDLine detector, as explained in EDL . Given a line, we consider a rectangular region centered at it and called line support region (LSR). Such region is divided into a set of bands inline formula, whose length equals the one of line.

If we indicate with inline formula the direction of line, the orthogonal and clockwise direction to line inline formula can be determined; these two directions, are used to construct a reference frame centered in the middle point of line. The gradients of pixels inline formula inside LSR can be projected to the newly determined frame, obtaining their local equivalent inline formula.

Later on, a Gaussian function is applied to all LSR's pixels along inline formula direction; first, we assign a global weighting coefficient inline formula to i-th row in LSR, where inline formula is the distance of i-th row from the center row in LSR, inline formula and inline formula is the width of bands (the same for every band). Secondly, considering a band inline formula and its neighbor bands inline formula, we assign a local weighting inline formula, where inline formula is the distance of k-th row from the center row in inline formula and inline formula. Using the global and local weights, we obtain, at the same time, the reduction of role played by gradients far from line and of boundary effect, respectively.

Each band inline formula in LSR has an associated band descriptor(BD) which is computed considering previous and next band (top and bottom bands are ignored when computing descriptor for first and last band). Once each band has been assignen its BD, the LBD descriptor of line is simply given by

block formula

To compute a band descriptor inline formula, each k-th row in it is considered and the gradients in such row are accumulated:

block formula

with inline formula.

By stacking previous results, we obtain the band description matrix (BDM)

block formula

with inline formula the number of rows in band inline formula:

block formula

Each inline formula can be obtained using the standard deviation vector inline formula and mean vector inline formula of inline formula. Thus, finally:

block formula

Once the LBD has been obtained, it must be converted into a binary form. For such purpose, we consider 32 possible pairs of BD inside it; each couple of BD is compared bit by bit and comparison generates an 8 bit string. Concatenating 32 comparison strings, we get the 256-bit final binary representation of a single LBD.

Structs

BinaryDescriptor

Class implements both functionalities for detection of lines and computation of their binary descriptor.

BinaryDescriptorMatcher

furnishes all functionalities for querying a dataset provided by user or internal to class (that user must, anyway, populate) on the model of @ref features2d_match

BinaryDescriptor_Params

List of BinaryDescriptor parameters:

DrawLinesMatchesFlags

struct for drawing options

KeyLine

A class to represent a line

LSDDetector
LSDParam

Lines extraction methodology

Constants

MLN10
RELATIVE_ERROR_FACTOR
UINT32_1

Functions

draw_keylines

Draws keylines.

draw_line_matches

Draws the found matches of keylines from two images.