Finds edges in an image using the [Canny86] algorithm.
Parameters: |
|
---|
See also
Brute-force descriptor matcher. For each descriptor in the first set, this matcher finds the closest descriptor in the second set by trying each one. This descriptor matcher supports masking permissible matches between descriptor sets.
class BruteForceMatcher_OCL_base
{
public:
enum DistType {L1Dist = 0, L2Dist, HammingDist};
// Add descriptors to train descriptor collection.
void add(const std::vector<oclMat>& descCollection);
// Get train descriptors collection.
const std::vector<oclMat>& getTrainDescriptors() const;
// Clear train descriptors collection.
void clear();
// Return true if there are no train descriptors in collection.
bool empty() const;
// Return true if the matcher supports mask in match methods.
bool isMaskSupported() const;
void matchSingle(const oclMat& query, const oclMat& train,
oclMat& trainIdx, oclMat& distance,
const oclMat& mask = oclMat());
static void matchDownload(const oclMat& trainIdx,
const oclMat& distance, std::vector<DMatch>& matches);
static void matchConvert(const Mat& trainIdx,
const Mat& distance, std::vector<DMatch>& matches);
void match(const oclMat& query, const oclMat& train,
std::vector<DMatch>& matches, const oclMat& mask = oclMat());
void makeGpuCollection(oclMat& trainCollection, oclMat& maskCollection,
const vector<oclMat>& masks = std::vector<oclMat>());
void matchCollection(const oclMat& query, const oclMat& trainCollection,
oclMat& trainIdx, oclMat& imgIdx, oclMat& distance,
const oclMat& maskCollection);
static void matchDownload(const oclMat& trainIdx, oclMat& imgIdx,
const oclMat& distance, std::vector<DMatch>& matches);
static void matchConvert(const Mat& trainIdx, const Mat& imgIdx,
const Mat& distance, std::vector<DMatch>& matches);
void match(const oclMat& query, std::vector<DMatch>& matches,
const std::vector<oclMat>& masks = std::vector<oclMat>());
void knnMatchSingle(const oclMat& query, const oclMat& train,
oclMat& trainIdx, oclMat& distance, oclMat& allDist, int k,
const oclMat& mask = oclMat());
static void knnMatchDownload(const oclMat& trainIdx, const oclMat& distance,
std::vector< std::vector<DMatch> >& matches, bool compactResult = false);
static void knnMatchConvert(const Mat& trainIdx, const Mat& distance,
std::vector< std::vector<DMatch> >& matches, bool compactResult = false);
void knnMatch(const oclMat& query, const oclMat& train,
std::vector< std::vector<DMatch> >& matches, int k,
const oclMat& mask = oclMat(), bool compactResult = false);
void knnMatch2Collection(const oclMat& query, const oclMat& trainCollection,
oclMat& trainIdx, oclMat& imgIdx, oclMat& distance,
const oclMat& maskCollection = oclMat());
static void knnMatch2Download(const oclMat& trainIdx, const oclMat& imgIdx, const oclMat& distance,
std::vector< std::vector<DMatch> >& matches, bool compactResult = false);
static void knnMatch2Convert(const Mat& trainIdx, const Mat& imgIdx, const Mat& distance,
std::vector< std::vector<DMatch> >& matches, bool compactResult = false);
void knnMatch(const oclMat& query, std::vector< std::vector<DMatch> >& matches, int k,
const std::vector<oclMat>& masks = std::vector<oclMat>(),
bool compactResult = false);
void radiusMatchSingle(const oclMat& query, const oclMat& train,
oclMat& trainIdx, oclMat& distance, oclMat& nMatches, float maxDistance,
const oclMat& mask = oclMat());
static void radiusMatchDownload(const oclMat& trainIdx, const oclMat& distance, const oclMat& nMatches,
std::vector< std::vector<DMatch> >& matches, bool compactResult = false);
static void radiusMatchConvert(const Mat& trainIdx, const Mat& distance, const Mat& nMatches,
std::vector< std::vector<DMatch> >& matches, bool compactResult = false);
void radiusMatch(const oclMat& query, const oclMat& train,
std::vector< std::vector<DMatch> >& matches, float maxDistance,
const oclMat& mask = oclMat(), bool compactResult = false);
void radiusMatchCollection(const oclMat& query, oclMat& trainIdx, oclMat& imgIdx, oclMat& distance, oclMat& nMatches, float maxDistance,
const std::vector<oclMat>& masks = std::vector<oclMat>());
static void radiusMatchDownload(const oclMat& trainIdx, const oclMat& imgIdx, const oclMat& distance, const oclMat& nMatches,
std::vector< std::vector<DMatch> >& matches, bool compactResult = false);
static void radiusMatchConvert(const Mat& trainIdx, const Mat& imgIdx, const Mat& distance, const Mat& nMatches,
std::vector< std::vector<DMatch> >& matches, bool compactResult = false);
void radiusMatch(const oclMat& query, std::vector< std::vector<DMatch> >& matches, float maxDistance,
const std::vector<oclMat>& masks = std::vector<oclMat>(), bool compactResult = false);
DistType distType;
private:
std::vector<oclMat> trainDescCollection;
};
The class BruteForceMatcher_OCL_base has an interface similar to the class DescriptorMatcher. It has two groups of match methods: for matching descriptors of one image with another image or with an image set. Also, all functions have an alternative to save results either to the GPU memory or to the CPU memory. BruteForceMatcher_OCL_base supports only the L1<float>, L2<float>, and Hamming distance types.
See also
Finds the best match for each descriptor from a query set with train descriptors.
See also
Performs a GPU collection of train descriptors and masks in a suitable format for the ocl::BruteForceMatcher_OCL_base::matchCollection() function.
Downloads matrices obtained via ocl::BruteForceMatcher_OCL_base::matchSingle() or ocl::BruteForceMatcher_OCL_base::matchCollection() to vector with DMatch.
Converts matrices obtained via ocl::BruteForceMatcher_OCL_base::matchSingle() or ocl::BruteForceMatcher_OCL_base::matchCollection() to vector with DMatch.
Finds the k best matches for each descriptor from a query set with train descriptors.
Parameters: |
|
---|
The function returns detected k (or less if not possible) matches in the increasing order by distance.
The third variant of the method stores the results in GPU memory.
See also
Downloads matrices obtained via ocl::BruteForceMatcher_OCL_base::knnMatchSingle() or ocl::BruteForceMatcher_OCL_base::knnMatch2Collection() to vector with DMatch.
If compactResult is true , the matches vector does not contain matches for fully masked-out query descriptors.
Converts matrices obtained via ocl::BruteForceMatcher_OCL_base::knnMatchSingle() or ocl::BruteForceMatcher_OCL_base::knnMatch2Collection() to CPU vector with DMatch.
If compactResult is true , the matches vector does not contain matches for fully masked-out query descriptors.
For each query descriptor, finds the best matches with a distance less than a given threshold.
Parameters: |
|
---|
The function returns detected matches in the increasing order by distance.
The methods work only on devices with the compute capability 1.1.
The third variant of the method stores the results in GPU memory and does not store the points by the distance.
See also
Downloads matrices obtained via ocl::BruteForceMatcher_OCL_base::radiusMatchSingle() or ocl::BruteForceMatcher_OCL_base::radiusMatchCollection() to vector with DMatch.
If compactResult is true , the matches vector does not contain matches for fully masked-out query descriptors.
Converts matrices obtained via ocl::BruteForceMatcher_OCL_base::radiusMatchSingle() or ocl::BruteForceMatcher_OCL_base::radiusMatchCollection() to vector with DMatch.
If compactResult is true , the matches vector does not contain matches for fully masked-out query descriptors.
The class implements Histogram of Oriented Gradients ([Dalal2005]) object detector.
struct CV_EXPORTS HOGDescriptor
{
enum { DEFAULT_WIN_SIGMA = -1 };
enum { DEFAULT_NLEVELS = 64 };
enum { DESCR_FORMAT_ROW_BY_ROW, DESCR_FORMAT_COL_BY_COL };
HOGDescriptor(Size win_size=Size(64, 128), Size block_size=Size(16, 16),
Size block_stride=Size(8, 8), Size cell_size=Size(8, 8),
int nbins=9, double win_sigma=DEFAULT_WIN_SIGMA,
double threshold_L2hys=0.2, bool gamma_correction=true,
int nlevels=DEFAULT_NLEVELS);
size_t getDescriptorSize() const;
size_t getBlockHistogramSize() const;
void setSVMDetector(const vector<float>& detector);
static vector<float> getDefaultPeopleDetector();
static vector<float> getPeopleDetector48x96();
static vector<float> getPeopleDetector64x128();
void detect(const oclMat& img, vector<Point>& found_locations,
double hit_threshold=0, Size win_stride=Size(),
Size padding=Size());
void detectMultiScale(const oclMat& img, vector<Rect>& found_locations,
double hit_threshold=0, Size win_stride=Size(),
Size padding=Size(), double scale0=1.05,
int group_threshold=2);
void getDescriptors(const oclMat& img, Size win_stride,
oclMat& descriptors,
int descr_format=DESCR_FORMAT_COL_BY_COL);
Size win_size;
Size block_size;
Size block_stride;
Size cell_size;
int nbins;
double win_sigma;
double threshold_L2hys;
bool gamma_correction;
int nlevels;
private:
// Hidden
}
Interfaces of all methods are kept similar to the CPU HOG descriptor and detector analogues as much as possible.
Creates the HOG descriptor and detector.
Parameters: |
|
---|
Returns the number of coefficients required for the classification.
Returns the block histogram size.
Sets coefficients for the linear SVM classifier.
Returns coefficients of the classifier trained for people detection (for default window size).
Returns coefficients of the classifier trained for people detection (for 48x96 windows).
Returns coefficients of the classifier trained for people detection (for 64x128 windows).
Performs object detection without a multi-scale window.
Parameters: |
|
---|
Performs object detection with a multi-scale window.
Parameters: |
|
---|
Returns block descriptors computed for the whole image.
Parameters: |
|
---|
The function is mainly used to learn the classifier.