View Source Evision.FlannBasedMatcher (Evision v0.1.14)
Link to this section Summary
Types
Type that represents an Evision.FlannBasedMatcher
struct.
Functions
Adds descriptors to train a CPU(trainDescCollectionis) or GPU(utrainDescCollectionis) descriptor collection.
Clears the train descriptor collections.
Clones the matcher.
Returns true if there are no train descriptors in the both collections.
Keyword Arguments
- indexParams:
Ptr<flann::IndexParams>
. - searchParams:
Ptr<flann::SearchParams>
.
Return
Python prototype (for reference):
Keyword Arguments
- indexParams:
Ptr<flann::IndexParams>
. - searchParams:
Ptr<flann::SearchParams>
.
Return
Python prototype (for reference):
Returns a constant link to the train descriptor collection trainDescCollection .
Returns true if the descriptor matcher supports masking permissible matches.
Positional Arguments
queryDescriptors:
Evision.Mat
.
Variant 1:
Finds the k best matches for each descriptor from a query set.
Finds the k best matches for each descriptor from a query set.
Positional Arguments
queryDescriptors:
Evision.Mat
.
Variant 1:
Finds the best match for each descriptor from a query set.
Finds the best match for each descriptor from a query set.
Positional Arguments
queryDescriptors:
Evision.Mat
.
Variant 1:
For each query descriptor, finds the training descriptors not farther than the specified distance.
For each query descriptor, finds the training descriptors not farther than the specified distance.
Trains a descriptor matcher
Link to this section Types
@type t() :: %Evision.FlannBasedMatcher{ref: reference()}
Type that represents an Evision.FlannBasedMatcher
struct.
ref.
reference()
The underlying erlang resource variable.
Link to this section Functions
@spec add(t(), [Evision.Mat.maybe_mat_in()]) :: :ok | {:error, String.t()}
Adds descriptors to train a CPU(trainDescCollectionis) or GPU(utrainDescCollectionis) descriptor collection.
Positional Arguments
descriptors:
[Evision.Mat]
.Descriptors to add. Each descriptors[i] is a set of descriptors from the same train image.
If the collection is not empty, the new descriptors are added to existing train descriptors.
Python prototype (for reference):
add(descriptors) -> None
Clears the train descriptor collections.
Python prototype (for reference):
clear() -> None
@spec clone(t()) :: Evision.DescriptorMatcher.t() | {:error, String.t()}
Clones the matcher.
Keyword Arguments
emptyTrainData:
bool
.If emptyTrainData is false, the method creates a deep copy of the object, that is, copies both parameters and train data. If emptyTrainData is true, the method creates an object copy with the current parameters but with empty train data.
Return
- retval:
Evision.DescriptorMatcher
Python prototype (for reference):
clone([, emptyTrainData]) -> retval
Return
- retval:
Evision.FlannBasedMatcher
Python prototype (for reference):
create() -> retval
Returns true if there are no train descriptors in the both collections.
Return
- retval:
bool
Python prototype (for reference):
empty() -> retval
Keyword Arguments
- indexParams:
Ptr<flann::IndexParams>
. - searchParams:
Ptr<flann::SearchParams>
.
Return
Python prototype (for reference):
FlannBasedMatcher([, indexParams[, searchParams]]) -> <FlannBasedMatcher object>
Keyword Arguments
- indexParams:
Ptr<flann::IndexParams>
. - searchParams:
Ptr<flann::SearchParams>
.
Return
Python prototype (for reference):
FlannBasedMatcher([, indexParams[, searchParams]]) -> <FlannBasedMatcher object>
@spec getTrainDescriptors(t()) :: [Evision.Mat.t()] | {:error, String.t()}
Returns a constant link to the train descriptor collection trainDescCollection .
Return
- retval:
std::vector<Mat>
Python prototype (for reference):
getTrainDescriptors() -> retval
Returns true if the descriptor matcher supports masking permissible matches.
Return
- retval:
bool
Python prototype (for reference):
isMaskSupported() -> retval
@spec knnMatch(t(), Evision.Mat.maybe_mat_in(), integer()) :: [[Evision.DMatch.t()]] | {:error, String.t()}
Positional Arguments
queryDescriptors:
Evision.Mat
.Query set of descriptors.
k:
int
.Count of best matches found per each query descriptor or less if a query descriptor has less than k possible matches in total.
Keyword Arguments
masks:
[Evision.Mat]
.Set of masks. Each masks[i] specifies permissible matches between the input query descriptors and stored train descriptors from the i-th image trainDescCollection[i].
compactResult:
bool
.Parameter used when the mask (or masks) is not empty. If compactResult is false, the matches vector has the same size as queryDescriptors rows. If compactResult is true, the matches vector does not contain matches for fully masked-out query descriptors.
Return
matches:
[[Evision.DMatch]]
.Matches. Each matches[i] is k or less matches for the same query descriptor.
Has overloading in C++
Python prototype (for reference):
knnMatch(queryDescriptors, k[, masks[, compactResult]]) -> matches
@spec knnMatch( t(), Evision.Mat.maybe_mat_in(), integer(), [{atom(), term()}, ...] | nil ) :: [[Evision.DMatch.t()]] | {:error, String.t()}
@spec knnMatch(t(), Evision.Mat.maybe_mat_in(), Evision.Mat.maybe_mat_in(), integer()) :: [[Evision.DMatch.t()]] | {:error, String.t()}
Variant 1:
Finds the k best matches for each descriptor from a query set.
Positional Arguments
queryDescriptors:
Evision.Mat
.Query set of descriptors.
trainDescriptors:
Evision.Mat
.Train set of descriptors. This set is not added to the train descriptors collection stored in the class object.
k:
int
.Count of best matches found per each query descriptor or less if a query descriptor has less than k possible matches in total.
Keyword Arguments
mask:
Evision.Mat
.Mask specifying permissible matches between an input query and train matrices of descriptors.
compactResult:
bool
.Parameter used when the mask (or masks) is not empty. If compactResult is false, the matches vector has the same size as queryDescriptors rows. If compactResult is true, the matches vector does not contain matches for fully masked-out query descriptors.
Return
matches:
[[Evision.DMatch]]
.Matches. Each matches[i] is k or less matches for the same query descriptor.
These extended variants of DescriptorMatcher::match methods find several best matches for each query descriptor. The matches are returned in the distance increasing order. See DescriptorMatcher::match for the details about query and train descriptors.
Python prototype (for reference):
knnMatch(queryDescriptors, trainDescriptors, k[, mask[, compactResult]]) -> matches
Variant 2:
Positional Arguments
queryDescriptors:
Evision.Mat
.Query set of descriptors.
k:
int
.Count of best matches found per each query descriptor or less if a query descriptor has less than k possible matches in total.
Keyword Arguments
masks:
[Evision.Mat]
.Set of masks. Each masks[i] specifies permissible matches between the input query descriptors and stored train descriptors from the i-th image trainDescCollection[i].
compactResult:
bool
.Parameter used when the mask (or masks) is not empty. If compactResult is false, the matches vector has the same size as queryDescriptors rows. If compactResult is true, the matches vector does not contain matches for fully masked-out query descriptors.
Return
matches:
[[Evision.DMatch]]
.Matches. Each matches[i] is k or less matches for the same query descriptor.
Has overloading in C++
Python prototype (for reference):
knnMatch(queryDescriptors, k[, masks[, compactResult]]) -> matches
@spec knnMatch( t(), Evision.Mat.maybe_mat_in(), Evision.Mat.maybe_mat_in(), integer(), [{atom(), term()}, ...] | nil ) :: [[Evision.DMatch.t()]] | {:error, String.t()}
Finds the k best matches for each descriptor from a query set.
Positional Arguments
queryDescriptors:
Evision.Mat
.Query set of descriptors.
trainDescriptors:
Evision.Mat
.Train set of descriptors. This set is not added to the train descriptors collection stored in the class object.
k:
int
.Count of best matches found per each query descriptor or less if a query descriptor has less than k possible matches in total.
Keyword Arguments
mask:
Evision.Mat
.Mask specifying permissible matches between an input query and train matrices of descriptors.
compactResult:
bool
.Parameter used when the mask (or masks) is not empty. If compactResult is false, the matches vector has the same size as queryDescriptors rows. If compactResult is true, the matches vector does not contain matches for fully masked-out query descriptors.
Return
matches:
[[Evision.DMatch]]
.Matches. Each matches[i] is k or less matches for the same query descriptor.
These extended variants of DescriptorMatcher::match methods find several best matches for each query descriptor. The matches are returned in the distance increasing order. See DescriptorMatcher::match for the details about query and train descriptors.
Python prototype (for reference):
knnMatch(queryDescriptors, trainDescriptors, k[, mask[, compactResult]]) -> matches
@spec match(t(), Evision.Mat.maybe_mat_in()) :: [Evision.DMatch.t()] | {:error, String.t()}
Positional Arguments
queryDescriptors:
Evision.Mat
.Query set of descriptors.
Keyword Arguments
masks:
[Evision.Mat]
.Set of masks. Each masks[i] specifies permissible matches between the input query descriptors and stored train descriptors from the i-th image trainDescCollection[i].
Return
matches:
[Evision.DMatch]
.Matches. If a query descriptor is masked out in mask , no match is added for this descriptor. So, matches size may be smaller than the query descriptors count.
Has overloading in C++
Python prototype (for reference):
match(queryDescriptors[, masks]) -> matches
@spec match(t(), Evision.Mat.maybe_mat_in(), [{atom(), term()}, ...] | nil) :: [Evision.DMatch.t()] | {:error, String.t()}
@spec match(t(), Evision.Mat.maybe_mat_in(), Evision.Mat.maybe_mat_in()) :: [Evision.DMatch.t()] | {:error, String.t()}
Variant 1:
Finds the best match for each descriptor from a query set.
Positional Arguments
queryDescriptors:
Evision.Mat
.Query set of descriptors.
trainDescriptors:
Evision.Mat
.Train set of descriptors. This set is not added to the train descriptors collection stored in the class object.
Keyword Arguments
mask:
Evision.Mat
.Mask specifying permissible matches between an input query and train matrices of descriptors.
Return
matches:
[Evision.DMatch]
.Matches. If a query descriptor is masked out in mask , no match is added for this descriptor. So, matches size may be smaller than the query descriptors count.
In the first variant of this method, the train descriptors are passed as an input argument. In the second variant of the method, train descriptors collection that was set by DescriptorMatcher::add is used. Optional mask (or masks) can be passed to specify which query and training descriptors can be matched. Namely, queryDescriptors[i] can be matched with trainDescriptors[j] only if mask.at\<uchar>(i,j) is non-zero.
Python prototype (for reference):
match(queryDescriptors, trainDescriptors[, mask]) -> matches
Variant 2:
Positional Arguments
queryDescriptors:
Evision.Mat
.Query set of descriptors.
Keyword Arguments
masks:
[Evision.Mat]
.Set of masks. Each masks[i] specifies permissible matches between the input query descriptors and stored train descriptors from the i-th image trainDescCollection[i].
Return
matches:
[Evision.DMatch]
.Matches. If a query descriptor is masked out in mask , no match is added for this descriptor. So, matches size may be smaller than the query descriptors count.
Has overloading in C++
Python prototype (for reference):
match(queryDescriptors[, masks]) -> matches
@spec match( t(), Evision.Mat.maybe_mat_in(), Evision.Mat.maybe_mat_in(), [{atom(), term()}, ...] | nil ) :: [Evision.DMatch.t()] | {:error, String.t()}
Finds the best match for each descriptor from a query set.
Positional Arguments
queryDescriptors:
Evision.Mat
.Query set of descriptors.
trainDescriptors:
Evision.Mat
.Train set of descriptors. This set is not added to the train descriptors collection stored in the class object.
Keyword Arguments
mask:
Evision.Mat
.Mask specifying permissible matches between an input query and train matrices of descriptors.
Return
matches:
[Evision.DMatch]
.Matches. If a query descriptor is masked out in mask , no match is added for this descriptor. So, matches size may be smaller than the query descriptors count.
In the first variant of this method, the train descriptors are passed as an input argument. In the second variant of the method, train descriptors collection that was set by DescriptorMatcher::add is used. Optional mask (or masks) can be passed to specify which query and training descriptors can be matched. Namely, queryDescriptors[i] can be matched with trainDescriptors[j] only if mask.at\<uchar>(i,j) is non-zero.
Python prototype (for reference):
match(queryDescriptors, trainDescriptors[, mask]) -> matches
@spec radiusMatch(t(), Evision.Mat.maybe_mat_in(), number()) :: [[Evision.DMatch.t()]] | {:error, String.t()}
Positional Arguments
queryDescriptors:
Evision.Mat
.Query set of descriptors.
maxDistance:
float
.Threshold for the distance between matched descriptors. Distance means here metric distance (e.g. Hamming distance), not the distance between coordinates (which is measured in Pixels)!
Keyword Arguments
masks:
[Evision.Mat]
.Set of masks. Each masks[i] specifies permissible matches between the input query descriptors and stored train descriptors from the i-th image trainDescCollection[i].
compactResult:
bool
.Parameter used when the mask (or masks) is not empty. If compactResult is false, the matches vector has the same size as queryDescriptors rows. If compactResult is true, the matches vector does not contain matches for fully masked-out query descriptors.
Return
matches:
[[Evision.DMatch]]
.Found matches.
Has overloading in C++
Python prototype (for reference):
radiusMatch(queryDescriptors, maxDistance[, masks[, compactResult]]) -> matches
@spec radiusMatch( t(), Evision.Mat.maybe_mat_in(), number(), [{atom(), term()}, ...] | nil ) :: [[Evision.DMatch.t()]] | {:error, String.t()}
@spec radiusMatch( t(), Evision.Mat.maybe_mat_in(), Evision.Mat.maybe_mat_in(), number() ) :: [[Evision.DMatch.t()]] | {:error, String.t()}
Variant 1:
For each query descriptor, finds the training descriptors not farther than the specified distance.
Positional Arguments
queryDescriptors:
Evision.Mat
.Query set of descriptors.
trainDescriptors:
Evision.Mat
.Train set of descriptors. This set is not added to the train descriptors collection stored in the class object.
maxDistance:
float
.Threshold for the distance between matched descriptors. Distance means here metric distance (e.g. Hamming distance), not the distance between coordinates (which is measured in Pixels)!
Keyword Arguments
mask:
Evision.Mat
.Mask specifying permissible matches between an input query and train matrices of descriptors.
compactResult:
bool
.Parameter used when the mask (or masks) is not empty. If compactResult is false, the matches vector has the same size as queryDescriptors rows. If compactResult is true, the matches vector does not contain matches for fully masked-out query descriptors.
Return
matches:
[[Evision.DMatch]]
.Found matches.
For each query descriptor, the methods find such training descriptors that the distance between the query descriptor and the training descriptor is equal or smaller than maxDistance. Found matches are returned in the distance increasing order.
Python prototype (for reference):
radiusMatch(queryDescriptors, trainDescriptors, maxDistance[, mask[, compactResult]]) -> matches
Variant 2:
Positional Arguments
queryDescriptors:
Evision.Mat
.Query set of descriptors.
maxDistance:
float
.Threshold for the distance between matched descriptors. Distance means here metric distance (e.g. Hamming distance), not the distance between coordinates (which is measured in Pixels)!
Keyword Arguments
masks:
[Evision.Mat]
.Set of masks. Each masks[i] specifies permissible matches between the input query descriptors and stored train descriptors from the i-th image trainDescCollection[i].
compactResult:
bool
.Parameter used when the mask (or masks) is not empty. If compactResult is false, the matches vector has the same size as queryDescriptors rows. If compactResult is true, the matches vector does not contain matches for fully masked-out query descriptors.
Return
matches:
[[Evision.DMatch]]
.Found matches.
Has overloading in C++
Python prototype (for reference):
radiusMatch(queryDescriptors, maxDistance[, masks[, compactResult]]) -> matches
radiusMatch(self, queryDescriptors, trainDescriptors, maxDistance, opts)
View Source@spec radiusMatch( t(), Evision.Mat.maybe_mat_in(), Evision.Mat.maybe_mat_in(), number(), [{atom(), term()}, ...] | nil ) :: [[Evision.DMatch.t()]] | {:error, String.t()}
For each query descriptor, finds the training descriptors not farther than the specified distance.
Positional Arguments
queryDescriptors:
Evision.Mat
.Query set of descriptors.
trainDescriptors:
Evision.Mat
.Train set of descriptors. This set is not added to the train descriptors collection stored in the class object.
maxDistance:
float
.Threshold for the distance between matched descriptors. Distance means here metric distance (e.g. Hamming distance), not the distance between coordinates (which is measured in Pixels)!
Keyword Arguments
mask:
Evision.Mat
.Mask specifying permissible matches between an input query and train matrices of descriptors.
compactResult:
bool
.Parameter used when the mask (or masks) is not empty. If compactResult is false, the matches vector has the same size as queryDescriptors rows. If compactResult is true, the matches vector does not contain matches for fully masked-out query descriptors.
Return
matches:
[[Evision.DMatch]]
.Found matches.
For each query descriptor, the methods find such training descriptors that the distance between the query descriptor and the training descriptor is equal or smaller than maxDistance. Found matches are returned in the distance increasing order.
Python prototype (for reference):
radiusMatch(queryDescriptors, trainDescriptors, maxDistance[, mask[, compactResult]]) -> matches
@spec read(t(), Evision.FileNode.t()) :: :ok | {:error, String.t()}
@spec read(t(), binary()) :: :ok | {:error, String.t()}
Variant 1:
Positional Arguments
- arg1:
Evision.FileNode
Python prototype (for reference):
read(arg1) -> None
Variant 2:
Positional Arguments
- fileName:
String
Python prototype (for reference):
read(fileName) -> None
Trains a descriptor matcher
Trains a descriptor matcher (for example, the flann index). In all methods to match, the method train() is run every time before matching. Some descriptor matchers (for example, BruteForceMatcher) have an empty implementation of this method. Other matchers really train their inner structures (for example, FlannBasedMatcher trains flann::Index ).
Python prototype (for reference):
train() -> None
@spec write(t(), Evision.FileStorage.t()) :: :ok | {:error, String.t()}
@spec write(t(), binary()) :: :ok | {:error, String.t()}
Variant 1:
Positional Arguments
Keyword Arguments
- name:
String
.
Python prototype (for reference):
write(fs[, name]) -> None
Variant 2:
Positional Arguments
- fileName:
String
Python prototype (for reference):
write(fileName) -> None
@spec write(t(), Evision.FileStorage.t(), [{atom(), term()}, ...] | nil) :: :ok | {:error, String.t()}
Positional Arguments
Keyword Arguments
- name:
String
.
Python prototype (for reference):
write(fs[, name]) -> None