cv.BinaryDescriptor - MATLAB File Help | Go to online doc for cv.BinaryDescriptor |
Class implements both functionalities for detection of lines and computation of their binary descriptor
Class' interface is mainly based on the ones of classical detectors and
extractors, such as Feature2d's Feature Detection and Description and
Descriptor Matchers. Retrieved information about lines is stored in
KeyLine
objects.
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.
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 {B_1, B_2, ..., B_m}
,
whose length equals the one of line.
If we indicate with d_L
the direction of line, the orthogonal and
clockwise direction to line d_perp
can be determined; these two
directions, are used to construct a reference frame centered in the
middle point of line. The gradients of pixels g'
inside LSR can be
projected to the newly determined frame, obtaining their local equivalent
g' = (g^T * d_perp, g^T * d_L)^T <=> (g'_{d_perp}, g'_{d_L})^T
.
Later on, a Gaussian function is applied to all LSR's pixels along
d_perp
direction; first, we assign a global weighting coefficient
f_g(i) = (1/sqrt(2*pi)*sigma_g)*exp(-d_i^2/2*sigma_g^2)
to i
-th row
in LSR, where d_i
is the distance of i
-th row from the center row in
LSR, sigma_g = 0.5(m * w - 1)
and w
is the width of bands (the same
for every band). Secondly, considering a band B_j
and its neighbor
bands B_{j-1}, B_{j+1}
, we assign a local weighting
F_l(k) = (1/sqrt(2*pi)*sigma_l)*exp(-d_k'^2/2*sigma_l^2)
, where d_k'
is the distance of k
-th row from the center row in B_j
and
sigma_l = w
. 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 B_j
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:
LBD = (BD_1^T, BD_2^T, ... , BD_m^T)^T
To compute a band descriptor B_j
, each k
-th row in it is considered
and the gradients in such row are accumulated:
V1_j^k = lambda * sum[g'_{d_perp} > 0] ( g'_{d_perp} )
V2_j^k = lambda * sum[g'_{d_perp} < 0] ( -g'_{d_perp} )
V3_j^k = lambda * sum[g'_{d_L} > 0] ( g'_{d_L} )
V4_j^k = lambda * sum[g'_{d_L} < 0] ( -g'_{d_L} )
with \lambda = f_g(k) * f_l(k)
By stacking previous results, we obtain the band description matrix (BDM)
BDM_j = [V1_j^1, V1_j^2, ..., V1_j^n ;
V2_j^1, V2_j^2, ..., V2_j^n ;
V3_j^1, V3_j^2, ..., V3_j^n ;
V4_j^1, V4_j^2, ..., V4_j^n ] in R^(4xn)
with n
the number of rows in band B_j
:
n = {2w, j = 1||m;
{3w, else.
Each BD_j
can be obtained using the standard deviation vector S_j
and mean vector M_j
of BDM_J
. Thus, finally:
LBD = (M_1^T, S_1^T, M_2^T, S_2^T, ..., M_m^T, S_m^T)^T in R^(8m)
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.
[LBD]:
HK Yuen, John Princen, John Illingworth, and Josef Kittler. "Comparative study of hough transform methods for circle finding". Image and Vision Computing, 8(1):71-77, 1990.
[EDL]:
R Grompone Von Gioi, Jeremie Jakubowicz, Jean-Michel Morel, and Gregory Randall. "LSD: A fast line segment detector with a false detection control". IEEE Transactions on Pattern Analysis and Machine Intelligence, 32(4):722-732, 2010.
Superclasses | handle |
Sealed | false |
Construct on load | false |
BinaryDescriptor | Create a BinaryDescriptor object with default parameters (or with the ones provided) |
NumOfOctaves | Number of octaves |
ReductionRatio | Reduction ratio (used in Gaussian pyramids) |
WidthOfBand | Width of bands |
id | Object ID |
addlistener | Add listener for event. | |
clear | Clears the algorithm state | |
compute | Requires descriptors computation | |
defaultNorm | Returns the default norm type | |
delete | Destructor | |
descriptorSize | Returns the descriptor size | |
descriptorType | Returns the descriptor type | |
detect | Requires line detection | |
detectAndCompute | Define operator to perform detection of KeyLines and computation of descriptors in a row | |
empty | Checks if detector object is empty | |
eq | == (EQ) Test handle equality. | |
findobj | Find objects matching specified conditions. | |
findprop | Find property of MATLAB handle object. | |
ge | >= (GE) Greater than or equal relation for handles. | |
getDefaultName | Returns the algorithm string identifier | |
gt | > (GT) Greater than relation for handles. | |
Sealed | isvalid | Test handle validity. |
le | <= (LE) Less than or equal relation for handles. | |
listener | Add listener for event without binding the listener to the source object. | |
load | Loads algorithm from a file or a string | |
lt | < (LT) Less than relation for handles. | |
ne | ~= (NE) Not equal relation for handles. | |
notify | Notify listeners of event. | |
save | Saves the algorithm parameters to a file |
ObjectBeingDestroyed | Notifies listeners that a particular object has been destroyed. |