@ -1 +1 @@ |
||||
See http://code.opencv.org/projects/opencv/wiki/OpenCV4Android |
||||
See http://opencv.org/android |
||||
|
@ -0,0 +1,39 @@ |
||||
project(libopencv_info) |
||||
if(NOT ANDROID_PACKAGE_RELEASE) |
||||
set(ANDROID_PACKAGE_RELEASE 1) |
||||
endif() |
||||
|
||||
if(NOT ANDROID_PACKAGE_PLATFORM) |
||||
if(ARMEABI_V7A) |
||||
if(NEON) |
||||
set(ANDROID_PACKAGE_PLATFORM armv7a_neon) |
||||
else() |
||||
set(ANDROID_PACKAGE_PLATFORM armv7a) |
||||
endif() |
||||
elseif(ARMEABI_V6) |
||||
set(ANDROID_PACKAGE_PLATFORM armv6) |
||||
elseif(ARMEABI) |
||||
set(ANDROID_PACKAGE_PLATFORM armv5) |
||||
elseif(X86) |
||||
set(ANDROID_PACKAGE_PLATFORM x86) |
||||
elseif(MIPS) |
||||
set(ANDROID_PACKAGE_PLATFORM mips) |
||||
else() |
||||
message(ERROR "Can not automatically determine the value for ANDROID_PACKAGE_PLATFORM") |
||||
endif() |
||||
endif() |
||||
|
||||
add_definitions(-DANDROID_PACKAGE_RELEASE=${ANDROID_PACKAGE_RELEASE} -DANDROID_PACKAGE_PLATFORM="${ANDROID_PACKAGE_PLATFORM}") |
||||
|
||||
include_directories(jni/BinderComponent jni/include "${OpenCV_SOURCE_DIR}/modules/core/include") |
||||
|
||||
add_library(opencv_info SHARED info.c) |
||||
|
||||
set_target_properties(${the_module} PROPERTIES |
||||
ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH} |
||||
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH} |
||||
INSTALL_NAME_DIR lib |
||||
) |
||||
|
||||
get_filename_component(lib_name "opencv_info" NAME) |
||||
install(FILES "${LIBRARY_OUTPUT_PATH}/${lib_name}" DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT main) |
@ -0,0 +1,31 @@ |
||||
#include "opencv2/core/version.hpp" |
||||
#include <jni.h> |
||||
|
||||
const char* GetPackageName(void); |
||||
const char* GetRevision(void); |
||||
const char* GetLibraryList(void); |
||||
JNIEXPORT jstring JNICALL Java_org_opencv_android_StaticHelper_getLibraryList(JNIEnv *, jclass); |
||||
|
||||
#define PACKAGE_NAME "org.opencv.lib_v" CVAUX_STR(CV_MAJOR_VERSION) CVAUX_STR(CV_MINOR_VERSION) "_" ANDROID_PACKAGE_PLATFORM |
||||
#define PACKAGE_REVISION CVAUX_STR(CV_SUBMINOR_VERSION) CVAUX_STR(ANDROID_PACKAGE_RELEASE) |
||||
|
||||
const char* GetPackageName(void) |
||||
{ |
||||
return PACKAGE_NAME; |
||||
} |
||||
|
||||
const char* GetRevision(void) |
||||
{ |
||||
return PACKAGE_REVISION; |
||||
} |
||||
|
||||
const char* GetLibraryList(void) |
||||
{ |
||||
return ""; |
||||
} |
||||
|
||||
JNIEXPORT jstring JNICALL Java_org_opencv_android_StaticHelper_getLibraryList(JNIEnv * env, jclass clazz) |
||||
{ |
||||
(void)clazz; |
||||
return (*env)->NewStringUTF(env, GetLibraryList()); |
||||
} |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 49 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 55 KiB |
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 37 KiB |
@ -0,0 +1,189 @@ |
||||
Data Structures |
||||
============================= |
||||
|
||||
.. ocv:class:: oclMat |
||||
|
||||
OpenCV C++ 1-D or 2-D dense array class :: |
||||
|
||||
class CV_EXPORTS oclMat |
||||
{ |
||||
public: |
||||
//! default constructor |
||||
oclMat(); |
||||
//! constructs oclMatrix of the specified size and type (_type is CV_8UC1, CV_64FC3, CV_32SC(12) etc.) |
||||
oclMat(int rows, int cols, int type); |
||||
oclMat(Size size, int type); |
||||
//! constucts oclMatrix and fills it with the specified value _s. |
||||
oclMat(int rows, int cols, int type, const Scalar &s); |
||||
oclMat(Size size, int type, const Scalar &s); |
||||
//! copy constructor |
||||
oclMat(const oclMat &m); |
||||
|
||||
//! constructor for oclMatrix headers pointing to user-allocated data |
||||
oclMat(int rows, int cols, int type, void *data, size_t step = Mat::AUTO_STEP); |
||||
oclMat(Size size, int type, void *data, size_t step = Mat::AUTO_STEP); |
||||
|
||||
//! creates a matrix header for a part of the bigger matrix |
||||
oclMat(const oclMat &m, const Range &rowRange, const Range &colRange); |
||||
oclMat(const oclMat &m, const Rect &roi); |
||||
|
||||
//! builds oclMat from Mat. Perfom blocking upload to device. |
||||
explicit oclMat (const Mat &m); |
||||
|
||||
//! destructor - calls release() |
||||
~oclMat(); |
||||
|
||||
//! assignment operators |
||||
oclMat &operator = (const oclMat &m); |
||||
//! assignment operator. Perfom blocking upload to device. |
||||
oclMat &operator = (const Mat &m); |
||||
|
||||
|
||||
//! pefroms blocking upload data to oclMat. |
||||
void upload(const cv::Mat &m); |
||||
|
||||
|
||||
//! downloads data from device to host memory. Blocking calls. |
||||
operator Mat() const; |
||||
void download(cv::Mat &m) const; |
||||
|
||||
|
||||
//! returns a new oclMatrix header for the specified row |
||||
oclMat row(int y) const; |
||||
//! returns a new oclMatrix header for the specified column |
||||
oclMat col(int x) const; |
||||
//! ... for the specified row span |
||||
oclMat rowRange(int startrow, int endrow) const; |
||||
oclMat rowRange(const Range &r) const; |
||||
//! ... for the specified column span |
||||
oclMat colRange(int startcol, int endcol) const; |
||||
oclMat colRange(const Range &r) const; |
||||
|
||||
//! returns deep copy of the oclMatrix, i.e. the data is copied |
||||
oclMat clone() const; |
||||
//! copies the oclMatrix content to "m". |
||||
// It calls m.create(this->size(), this->type()). |
||||
// It supports any data type |
||||
void copyTo( oclMat &m ) const; |
||||
//! copies those oclMatrix elements to "m" that are marked with non-zero mask elements. |
||||
//It supports 8UC1 8UC4 32SC1 32SC4 32FC1 32FC4 |
||||
void copyTo( oclMat &m, const oclMat &mask ) const; |
||||
//! converts oclMatrix to another datatype with optional scalng. See cvConvertScale. |
||||
//It supports 8UC1 8UC4 32SC1 32SC4 32FC1 32FC4 |
||||
void convertTo( oclMat &m, int rtype, double alpha = 1, double beta = 0 ) const; |
||||
|
||||
void assignTo( oclMat &m, int type = -1 ) const; |
||||
|
||||
//! sets every oclMatrix element to s |
||||
//It supports 8UC1 8UC4 32SC1 32SC4 32FC1 32FC4 |
||||
oclMat &operator = (const Scalar &s); |
||||
//! sets some of the oclMatrix elements to s, according to the mask |
||||
//It supports 8UC1 8UC4 32SC1 32SC4 32FC1 32FC4 |
||||
oclMat &setTo(const Scalar &s, const oclMat &mask = oclMat()); |
||||
//! creates alternative oclMatrix header for the same data, with different |
||||
// number of channels and/or different number of rows. see cvReshape. |
||||
oclMat reshape(int cn, int rows = 0) const; |
||||
|
||||
//! allocates new oclMatrix data unless the oclMatrix already has specified size and type. |
||||
// previous data is unreferenced if needed. |
||||
void create(int rows, int cols, int type); |
||||
void create(Size size, int type); |
||||
//! decreases reference counter; |
||||
// deallocate the data when reference counter reaches 0. |
||||
void release(); |
||||
|
||||
//! swaps with other smart pointer |
||||
void swap(oclMat &mat); |
||||
|
||||
//! locates oclMatrix header within a parent oclMatrix. See below |
||||
void locateROI( Size &wholeSize, Point &ofs ) const; |
||||
//! moves/resizes the current oclMatrix ROI inside the parent oclMatrix. |
||||
oclMat &adjustROI( int dtop, int dbottom, int dleft, int dright ); |
||||
//! extracts a rectangular sub-oclMatrix |
||||
// (this is a generalized form of row, rowRange etc.) |
||||
oclMat operator()( Range rowRange, Range colRange ) const; |
||||
oclMat operator()( const Rect &roi ) const; |
||||
|
||||
//! returns true if the oclMatrix data is continuous |
||||
// (i.e. when there are no gaps between successive rows). |
||||
// similar to CV_IS_oclMat_CONT(cvoclMat->type) |
||||
bool isContinuous() const; |
||||
//! returns element size in bytes, |
||||
// similar to CV_ELEM_SIZE(cvMat->type) |
||||
size_t elemSize() const; |
||||
//! returns the size of element channel in bytes. |
||||
size_t elemSize1() const; |
||||
//! returns element type, similar to CV_MAT_TYPE(cvMat->type) |
||||
int type() const; |
||||
//! returns element type, i.e. 8UC3 returns 8UC4 because in ocl |
||||
//! 3 channels element actually use 4 channel space |
||||
int ocltype() const; |
||||
//! returns element type, similar to CV_MAT_DEPTH(cvMat->type) |
||||
int depth() const; |
||||
//! returns element type, similar to CV_MAT_CN(cvMat->type) |
||||
int channels() const; |
||||
//! returns element type, return 4 for 3 channels element, |
||||
//!becuase 3 channels element actually use 4 channel space |
||||
int oclchannels() const; |
||||
//! returns step/elemSize1() |
||||
size_t step1() const; |
||||
//! returns oclMatrix size: |
||||
// width == number of columns, height == number of rows |
||||
Size size() const; |
||||
//! returns true if oclMatrix data is NULL |
||||
bool empty() const; |
||||
|
||||
//! returns pointer to y-th row |
||||
uchar *ptr(int y = 0); |
||||
const uchar *ptr(int y = 0) const; |
||||
|
||||
//! template version of the above method |
||||
template<typename _Tp> _Tp *ptr(int y = 0); |
||||
template<typename _Tp> const _Tp *ptr(int y = 0) const; |
||||
|
||||
//! matrix transposition |
||||
oclMat t() const; |
||||
|
||||
/*! includes several bit-fields: |
||||
- the magic signature |
||||
- continuity flag |
||||
- depth |
||||
- number of channels |
||||
*/ |
||||
int flags; |
||||
//! the number of rows and columns |
||||
int rows, cols; |
||||
//! a distance between successive rows in bytes; includes the gap if any |
||||
size_t step; |
||||
//! pointer to the data(OCL memory object) |
||||
uchar *data; |
||||
|
||||
//! pointer to the reference counter; |
||||
// when oclMatrix points to user-allocated data, the pointer is NULL |
||||
int *refcount; |
||||
|
||||
//! helper fields used in locateROI and adjustROI |
||||
//datastart and dataend are not used in current version |
||||
uchar *datastart; |
||||
uchar *dataend; |
||||
|
||||
//! OpenCL context associated with the oclMat object. |
||||
Context *clCxt; |
||||
//add offset for handle ROI, calculated in byte |
||||
int offset; |
||||
//add wholerows and wholecols for the whole matrix, datastart and dataend are no longer used |
||||
int wholerows; |
||||
int wholecols; |
||||
}; |
||||
|
||||
Basically speaking, the oclMat is the mirror of Mat with the extension of ocl feature, the members have the same meaning and useage of Mat except following: |
||||
|
||||
datastart and dataend are replaced with wholerows and wholecols |
||||
|
||||
add clCxt for oclMat |
||||
|
||||
Only basic flags are supported in oclMat(i.e. depth number of channels) |
||||
|
||||
All the 3-channel matrix(i.e. RGB image) are represented by 4-channel matrix in oclMat. It means 3-channel image have 4-channel space with the last channel unused. We provide a transparent interface to handle the difference between OpenCV Mat and oclMat. |
||||
|
||||
For example: If a oclMat has 3 channels, channels() returns 3 and oclchannels() returns 4 |
@ -0,0 +1,502 @@ |
||||
Feature Detection And Description |
||||
================================= |
||||
|
||||
.. highlight:: cpp |
||||
|
||||
ocl::Canny |
||||
------------------- |
||||
Finds edges in an image using the [Canny86]_ algorithm. |
||||
|
||||
.. ocv:function:: void ocl::Canny(const oclMat& image, oclMat& edges, double low_thresh, double high_thresh, int apperture_size = 3, bool L2gradient = false) |
||||
|
||||
.. ocv:function:: void ocl::Canny(const oclMat& image, CannyBuf& buf, oclMat& edges, double low_thresh, double high_thresh, int apperture_size = 3, bool L2gradient = false) |
||||
|
||||
.. ocv:function:: void ocl::Canny(const oclMat& dx, const oclMat& dy, oclMat& edges, double low_thresh, double high_thresh, bool L2gradient = false) |
||||
|
||||
.. ocv:function:: void ocl::Canny(const oclMat& dx, const oclMat& dy, CannyBuf& buf, oclMat& edges, double low_thresh, double high_thresh, bool L2gradient = false) |
||||
|
||||
:param image: Single-channel 8-bit input image. |
||||
|
||||
:param dx: First derivative of image in the vertical direction. Support only ``CV_32S`` type. |
||||
|
||||
:param dy: First derivative of image in the horizontal direction. Support only ``CV_32S`` type. |
||||
|
||||
:param edges: Output edge map. It has the same size and type as ``image`` . |
||||
|
||||
:param low_thresh: First threshold for the hysteresis procedure. |
||||
|
||||
:param high_thresh: Second threshold for the hysteresis procedure. |
||||
|
||||
:param apperture_size: Aperture size for the :ocv:func:`Sobel` operator. |
||||
|
||||
:param L2gradient: Flag indicating whether a more accurate :math:`L_2` norm :math:`=\sqrt{(dI/dx)^2 + (dI/dy)^2}` should be used to compute the image gradient magnitude ( ``L2gradient=true`` ), or a faster default :math:`L_1` norm :math:`=|dI/dx|+|dI/dy|` is enough ( ``L2gradient=false`` ). |
||||
|
||||
:param buf: Optional buffer to avoid extra memory allocations (for many calls with the same sizes). |
||||
|
||||
.. seealso:: :ocv:func:`Canny` |
||||
|
||||
|
||||
ocl::BruteForceMatcher_OCL |
||||
-------------------------- |
||||
.. ocv:class:: ocl::BruteForceMatcher_OCL_base |
||||
|
||||
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 :ocv: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. |
||||
|
||||
.. seealso:: :ocv:class:`DescriptorMatcher`, :ocv:class:`BruteForceMatcher` |
||||
|
||||
|
||||
|
||||
ocl::BruteForceMatcher_OCL_base::match |
||||
-------------------------------------- |
||||
Finds the best match for each descriptor from a query set with train descriptors. |
||||
|
||||
.. ocv:function:: void ocl::BruteForceMatcher_OCL_base::match(const oclMat& query, const oclMat& train, std::vector<DMatch>& matches, const oclMat& mask = oclMat()) |
||||
|
||||
.. ocv:function:: void ocl::BruteForceMatcher_OCL_base::matchSingle(const oclMat& query, const oclMat& train, oclMat& trainIdx, oclMat& distance, const oclMat& mask = oclMat()) |
||||
|
||||
.. ocv:function:: void ocl::BruteForceMatcher_OCL_base::match(const oclMat& query, std::vector<DMatch>& matches, const std::vector<oclMat>& masks = std::vector<oclMat>()) |
||||
|
||||
.. ocv:function:: void ocl::BruteForceMatcher_OCL_base::matchCollection(const oclMat& query, const oclMat& trainCollection, oclMat& trainIdx, oclMat& imgIdx, oclMat& distance, const oclMat& masks) |
||||
|
||||
.. seealso:: :ocv:func:`DescriptorMatcher::match` |
||||
|
||||
|
||||
|
||||
ocl::BruteForceMatcher_OCL_base::makeGpuCollection |
||||
-------------------------------------------------- |
||||
Performs a GPU collection of train descriptors and masks in a suitable format for the :ocv:func:`ocl::BruteForceMatcher_OCL_base::matchCollection` function. |
||||
|
||||
.. ocv:function:: void ocl::BruteForceMatcher_OCL_base::makeGpuCollection(oclMat& trainCollection, oclMat& maskCollection, const vector<oclMat>& masks = std::vector<oclMat>()) |
||||
|
||||
|
||||
|
||||
ocl::BruteForceMatcher_OCL_base::matchDownload |
||||
---------------------------------------------- |
||||
Downloads matrices obtained via :ocv:func:`ocl::BruteForceMatcher_OCL_base::matchSingle` or :ocv:func:`ocl::BruteForceMatcher_OCL_base::matchCollection` to vector with :ocv:class:`DMatch`. |
||||
|
||||
.. ocv:function:: void ocl::BruteForceMatcher_OCL_base::matchDownload(const oclMat& trainIdx, const oclMat& distance, std::vector<DMatch>&matches) |
||||
|
||||
.. ocv:function:: void ocl::BruteForceMatcher_OCL_base::matchDownload(const oclMat& trainIdx, oclMat& imgIdx, const oclMat& distance, std::vector<DMatch>&matches) |
||||
|
||||
|
||||
|
||||
ocl::BruteForceMatcher_OCL_base::matchConvert |
||||
--------------------------------------------- |
||||
Converts matrices obtained via :ocv:func:`ocl::BruteForceMatcher_OCL_base::matchSingle` or :ocv:func:`ocl::BruteForceMatcher_OCL_base::matchCollection` to vector with :ocv:class:`DMatch`. |
||||
|
||||
.. ocv:function:: void ocl::BruteForceMatcher_OCL_base::matchConvert(const Mat& trainIdx, const Mat& distance, std::vector<DMatch>&matches) |
||||
|
||||
.. ocv:function:: void ocl::BruteForceMatcher_OCL_base::matchConvert(const Mat& trainIdx, const Mat& imgIdx, const Mat& distance, std::vector<DMatch>&matches) |
||||
|
||||
|
||||
|
||||
ocl::BruteForceMatcher_OCL_base::knnMatch |
||||
----------------------------------------- |
||||
Finds the ``k`` best matches for each descriptor from a query set with train descriptors. |
||||
|
||||
.. ocv:function:: void ocl::BruteForceMatcher_OCL_base::knnMatch(const oclMat& query, const oclMat& train, std::vector< std::vector<DMatch> >&matches, int k, const oclMat& mask = oclMat(), bool compactResult = false) |
||||
|
||||
.. ocv:function:: void ocl::BruteForceMatcher_OCL_base::knnMatchSingle(const oclMat& query, const oclMat& train, oclMat& trainIdx, oclMat& distance, oclMat& allDist, int k, const oclMat& mask = oclMat()) |
||||
|
||||
.. ocv:function:: void ocl::BruteForceMatcher_OCL_base::knnMatch(const oclMat& query, std::vector< std::vector<DMatch> >&matches, int k, const std::vector<oclMat>&masks = std::vector<oclMat>(), bool compactResult = false ) |
||||
|
||||
.. ocv:function:: void ocl::BruteForceMatcher_OCL_base::knnMatch2Collection(const oclMat& query, const oclMat& trainCollection, oclMat& trainIdx, oclMat& imgIdx, oclMat& distance, const oclMat& maskCollection = oclMat()) |
||||
|
||||
:param query: Query set of descriptors. |
||||
|
||||
:param train: Training set of descriptors. It is not be added to train descriptors collection stored in the class object. |
||||
|
||||
:param k: Number of the best matches per each query descriptor (or less if it is not possible). |
||||
|
||||
:param mask: Mask specifying permissible matches between the input query and train matrices of descriptors. |
||||
|
||||
:param compactResult: If ``compactResult`` is ``true`` , the ``matches`` vector does not contain matches for fully masked-out query descriptors. |
||||
|
||||
|
||||
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. |
||||
|
||||
.. seealso:: :ocv:func:`DescriptorMatcher::knnMatch` |
||||
|
||||
|
||||
|
||||
ocl::BruteForceMatcher_OCL_base::knnMatchDownload |
||||
------------------------------------------------- |
||||
Downloads matrices obtained via :ocv:func:`ocl::BruteForceMatcher_OCL_base::knnMatchSingle` or :ocv:func:`ocl::BruteForceMatcher_OCL_base::knnMatch2Collection` to vector with :ocv:class:`DMatch`. |
||||
|
||||
.. ocv:function:: void ocl::BruteForceMatcher_OCL_base::knnMatchDownload(const oclMat& trainIdx, const oclMat& distance, std::vector< std::vector<DMatch> >&matches, bool compactResult = false) |
||||
|
||||
.. ocv:function:: void ocl::BruteForceMatcher_OCL_base::knnMatch2Download(const oclMat& trainIdx, const oclMat& imgIdx, const oclMat& distance, std::vector< std::vector<DMatch> >& matches, bool compactResult = false) |
||||
|
||||
If ``compactResult`` is ``true`` , the ``matches`` vector does not contain matches for fully masked-out query descriptors. |
||||
|
||||
|
||||
|
||||
ocl::BruteForceMatcher_OCL_base::knnMatchConvert |
||||
------------------------------------------------ |
||||
Converts matrices obtained via :ocv:func:`ocl::BruteForceMatcher_OCL_base::knnMatchSingle` or :ocv:func:`ocl::BruteForceMatcher_OCL_base::knnMatch2Collection` to CPU vector with :ocv:class:`DMatch`. |
||||
|
||||
.. ocv:function:: void ocl::BruteForceMatcher_OCL_base::knnMatchConvert(const Mat& trainIdx, const Mat& distance, std::vector< std::vector<DMatch> >&matches, bool compactResult = false) |
||||
|
||||
.. ocv:function:: void ocl::BruteForceMatcher_OCL_base::knnMatch2Convert(const Mat& trainIdx, const Mat& imgIdx, const Mat& distance, std::vector< std::vector<DMatch> >& matches, bool compactResult = false) |
||||
|
||||
If ``compactResult`` is ``true`` , the ``matches`` vector does not contain matches for fully masked-out query descriptors. |
||||
|
||||
|
||||
|
||||
ocl::BruteForceMatcher_OCL_base::radiusMatch |
||||
-------------------------------------------- |
||||
For each query descriptor, finds the best matches with a distance less than a given threshold. |
||||
|
||||
.. ocv:function:: void ocl::BruteForceMatcher_OCL_base::radiusMatch(const oclMat& query, const oclMat& train, std::vector< std::vector<DMatch> >&matches, float maxDistance, const oclMat& mask = oclMat(), bool compactResult = false) |
||||
|
||||
.. ocv:function:: void ocl::BruteForceMatcher_OCL_base::radiusMatchSingle(const oclMat& query, const oclMat& train, oclMat& trainIdx, oclMat& distance, oclMat& nMatches, float maxDistance, const oclMat& mask = oclMat()) |
||||
|
||||
.. ocv:function:: void ocl::BruteForceMatcher_OCL_base::radiusMatch(const oclMat& query, std::vector< std::vector<DMatch> >&matches, float maxDistance, const std::vector<oclMat>& masks = std::vector<oclMat>(), bool compactResult = false) |
||||
|
||||
.. ocv:function:: void ocl::BruteForceMatcher_OCL_base::radiusMatchCollection(const oclMat& query, oclMat& trainIdx, oclMat& imgIdx, oclMat& distance, oclMat& nMatches, float maxDistance, const std::vector<oclMat>& masks = std::vector<oclMat>()) |
||||
|
||||
:param query: Query set of descriptors. |
||||
|
||||
:param train: Training set of descriptors. It is not added to train descriptors collection stored in the class object. |
||||
|
||||
:param maxDistance: Distance threshold. |
||||
|
||||
:param mask: Mask specifying permissible matches between the input query and train matrices of descriptors. |
||||
|
||||
:param compactResult: If ``compactResult`` is ``true`` , the ``matches`` vector does not contain matches for fully masked-out query descriptors. |
||||
|
||||
|
||||
The function returns detected matches in the increasing order by distance. |
||||
|
||||
The methods work only on devices with the compute capability :math:`>=` 1.1. |
||||
|
||||
The third variant of the method stores the results in GPU memory and does not store the points by the distance. |
||||
|
||||
.. seealso:: :ocv:func:`DescriptorMatcher::radiusMatch` |
||||
|
||||
|
||||
|
||||
ocl::BruteForceMatcher_OCL_base::radiusMatchDownload |
||||
---------------------------------------------------- |
||||
Downloads matrices obtained via :ocv:func:`ocl::BruteForceMatcher_OCL_base::radiusMatchSingle` or :ocv:func:`ocl::BruteForceMatcher_OCL_base::radiusMatchCollection` to vector with :ocv:class:`DMatch`. |
||||
|
||||
.. ocv:function:: void ocl::BruteForceMatcher_OCL_base::radiusMatchDownload(const oclMat& trainIdx, const oclMat& distance, const oclMat& nMatches, std::vector< std::vector<DMatch> >&matches, bool compactResult = false) |
||||
|
||||
.. ocv:function:: void ocl::BruteForceMatcher_OCL_base::radiusMatchDownload(const oclMat& trainIdx, const oclMat& imgIdx, const oclMat& distance, const oclMat& nMatches, std::vector< std::vector<DMatch> >& matches, bool compactResult = false) |
||||
|
||||
If ``compactResult`` is ``true`` , the ``matches`` vector does not contain matches for fully masked-out query descriptors. |
||||
|
||||
|
||||
|
||||
|
||||
ocl::BruteForceMatcher_OCL_base::radiusMatchConvert |
||||
--------------------------------------------------- |
||||
Converts matrices obtained via :ocv:func:`ocl::BruteForceMatcher_OCL_base::radiusMatchSingle` or :ocv:func:`ocl::BruteForceMatcher_OCL_base::radiusMatchCollection` to vector with :ocv:class:`DMatch`. |
||||
|
||||
.. ocv:function:: void ocl::BruteForceMatcher_OCL_base::radiusMatchConvert(const Mat& trainIdx, const Mat& distance, const Mat& nMatches, std::vector< std::vector<DMatch> >&matches, bool compactResult = false) |
||||
|
||||
.. ocv:function:: void ocl::BruteForceMatcher_OCL_base::radiusMatchConvert(const Mat& trainIdx, const Mat& imgIdx, const Mat& distance, const Mat& nMatches, std::vector< std::vector<DMatch> >& matches, bool compactResult = false) |
||||
|
||||
If ``compactResult`` is ``true`` , the ``matches`` vector does not contain matches for fully masked-out query descriptors. |
||||
|
||||
ocl::HOGDescriptor |
||||
------------------ |
||||
|
||||
.. ocv:class:: ocl::HOGDescriptor |
||||
|
||||
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. |
||||
|
||||
|
||||
|
||||
ocl::HOGDescriptor::HOGDescriptor |
||||
------------------------------------- |
||||
Creates the ``HOG`` descriptor and detector. |
||||
|
||||
.. ocv:function:: ocl::HOGDescriptor::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) |
||||
|
||||
:param win_size: Detection window size. Align to block size and block stride. |
||||
|
||||
:param block_size: Block size in pixels. Align to cell size. Only (16,16) is supported for now. |
||||
|
||||
:param block_stride: Block stride. It must be a multiple of cell size. |
||||
|
||||
:param cell_size: Cell size. Only (8, 8) is supported for now. |
||||
|
||||
:param nbins: Number of bins. Only 9 bins per cell are supported for now. |
||||
|
||||
:param win_sigma: Gaussian smoothing window parameter. |
||||
|
||||
:param threshold_L2hys: L2-Hys normalization method shrinkage. |
||||
|
||||
:param gamma_correction: Flag to specify whether the gamma correction preprocessing is required or not. |
||||
|
||||
:param nlevels: Maximum number of detection window increases. |
||||
|
||||
|
||||
|
||||
ocl::HOGDescriptor::getDescriptorSize |
||||
----------------------------------------- |
||||
Returns the number of coefficients required for the classification. |
||||
|
||||
.. ocv:function:: size_t ocl::HOGDescriptor::getDescriptorSize() const |
||||
|
||||
|
||||
|
||||
ocl::HOGDescriptor::getBlockHistogramSize |
||||
--------------------------------------------- |
||||
Returns the block histogram size. |
||||
|
||||
.. ocv:function:: size_t ocl::HOGDescriptor::getBlockHistogramSize() const |
||||
|
||||
|
||||
|
||||
ocl::HOGDescriptor::setSVMDetector |
||||
-------------------------------------- |
||||
Sets coefficients for the linear SVM classifier. |
||||
|
||||
.. ocv:function:: void ocl::HOGDescriptor::setSVMDetector(const vector<float>& detector) |
||||
|
||||
|
||||
|
||||
ocl::HOGDescriptor::getDefaultPeopleDetector |
||||
------------------------------------------------ |
||||
Returns coefficients of the classifier trained for people detection (for default window size). |
||||
|
||||
.. ocv:function:: static vector<float> ocl::HOGDescriptor::getDefaultPeopleDetector() |
||||
|
||||
|
||||
|
||||
ocl::HOGDescriptor::getPeopleDetector48x96 |
||||
---------------------------------------------- |
||||
Returns coefficients of the classifier trained for people detection (for 48x96 windows). |
||||
|
||||
.. ocv:function:: static vector<float> ocl::HOGDescriptor::getPeopleDetector48x96() |
||||
|
||||
|
||||
|
||||
ocl::HOGDescriptor::getPeopleDetector64x128 |
||||
----------------------------------------------- |
||||
Returns coefficients of the classifier trained for people detection (for 64x128 windows). |
||||
|
||||
.. ocv:function:: static vector<float> ocl::HOGDescriptor::getPeopleDetector64x128() |
||||
|
||||
|
||||
|
||||
ocl::HOGDescriptor::detect |
||||
------------------------------ |
||||
Performs object detection without a multi-scale window. |
||||
|
||||
.. ocv:function:: void ocl::HOGDescriptor::detect(const oclMat& img, vector<Point>& found_locations, double hit_threshold=0, Size win_stride=Size(), Size padding=Size()) |
||||
|
||||
:param img: Source image. ``CV_8UC1`` and ``CV_8UC4`` types are supported for now. |
||||
|
||||
:param found_locations: Left-top corner points of detected objects boundaries. |
||||
|
||||
:param hit_threshold: Threshold for the distance between features and SVM classifying plane. Usually it is 0 and should be specfied in the detector coefficients (as the last free coefficient). But if the free coefficient is omitted (which is allowed), you can specify it manually here. |
||||
|
||||
:param win_stride: Window stride. It must be a multiple of block stride. |
||||
|
||||
:param padding: Mock parameter to keep the CPU interface compatibility. It must be (0,0). |
||||
|
||||
|
||||
|
||||
ocl::HOGDescriptor::detectMultiScale |
||||
---------------------------------------- |
||||
Performs object detection with a multi-scale window. |
||||
|
||||
.. ocv:function:: void ocl::HOGDescriptor::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) |
||||
|
||||
:param img: Source image. See :ocv:func:`ocl::HOGDescriptor::detect` for type limitations. |
||||
|
||||
:param found_locations: Detected objects boundaries. |
||||
|
||||
:param hit_threshold: Threshold for the distance between features and SVM classifying plane. See :ocv:func:`ocl::HOGDescriptor::detect` for details. |
||||
|
||||
:param win_stride: Window stride. It must be a multiple of block stride. |
||||
|
||||
:param padding: Mock parameter to keep the CPU interface compatibility. It must be (0,0). |
||||
|
||||
:param scale0: Coefficient of the detection window increase. |
||||
|
||||
:param group_threshold: Coefficient to regulate the similarity threshold. When detected, some objects can be covered by many rectangles. 0 means not to perform grouping. See :ocv:func:`groupRectangles` . |
||||
|
||||
|
||||
|
||||
ocl::HOGDescriptor::getDescriptors |
||||
-------------------------------------- |
||||
Returns block descriptors computed for the whole image. |
||||
|
||||
.. ocv:function:: void ocl::HOGDescriptor::getDescriptors(const oclMat& img, Size win_stride, oclMat& descriptors, int descr_format=DESCR_FORMAT_COL_BY_COL) |
||||
|
||||
:param img: Source image. See :ocv:func:`ocl::HOGDescriptor::detect` for type limitations. |
||||
|
||||
:param win_stride: Window stride. It must be a multiple of block stride. |
||||
|
||||
:param descriptors: 2D array of descriptors. |
||||
|
||||
:param descr_format: Descriptor storage format: |
||||
|
||||
* **DESCR_FORMAT_ROW_BY_ROW** - Row-major order. |
||||
|
||||
* **DESCR_FORMAT_COL_BY_COL** - Column-major order. |
||||
|
||||
The function is mainly used to learn the classifier. |
@ -0,0 +1,283 @@ |
||||
Image Filtering |
||||
============================= |
||||
|
||||
.. highlight:: cpp |
||||
|
||||
ocl::Sobel |
||||
------------------ |
||||
Returns void |
||||
|
||||
.. ocv:function:: void Sobel(const oclMat &src, oclMat &dst, int ddepth, int dx, int dy, int ksize = 3, double scale = 1, double delta = 0.0, int bordertype = BORDER_DEFAULT) |
||||
|
||||
:param src: The source image |
||||
|
||||
:param dst: The destination image; It will have the same size as src |
||||
|
||||
:param ddepth: The destination image depth |
||||
|
||||
:param dx: Order of the derivative x |
||||
|
||||
:param dy: Order of the derivative y |
||||
|
||||
:param ksize: Size of the extended Sobel kernel |
||||
|
||||
:param scale: The optional scale factor for the computed derivative values(by default, no scaling is applied) |
||||
|
||||
:param delta: The optional delta value, added to the results prior to storing them in dst |
||||
|
||||
:param bordertype: Pixel extrapolation method. |
||||
|
||||
The function computes the first x- or y- spatial image derivative using Sobel operator. Surpport 8UC1 8UC4 32SC1 32SC4 32FC1 32FC4 data type. |
||||
|
||||
ocl::Scharr |
||||
------------------ |
||||
Returns void |
||||
|
||||
.. ocv:function:: void Scharr(const oclMat &src, oclMat &dst, int ddepth, int dx, int dy, double scale = 1, double delta = 0.0, int bordertype = BORDER_DEFAULT) |
||||
|
||||
:param src: The source image |
||||
|
||||
:param dst: The destination image; It will have the same size as src |
||||
|
||||
:param ddepth: The destination image depth |
||||
|
||||
:param dx: Order of the derivative x |
||||
|
||||
:param dy: Order of the derivative y |
||||
|
||||
:param scale: The optional scale factor for the computed derivative values(by default, no scaling is applied) |
||||
|
||||
:param delta: The optional delta value, added to the results prior to storing them in dst |
||||
|
||||
:param bordertype: Pixel extrapolation method. |
||||
|
||||
The function computes the first x- or y- spatial image derivative using Scharr operator. Surpport 8UC1 8UC4 32SC1 32SC4 32FC1 32FC4 data type. |
||||
|
||||
ocl::GaussianBlur |
||||
------------------ |
||||
Returns void |
||||
|
||||
.. ocv:function:: void GaussianBlur(const oclMat &src, oclMat &dst, Size ksize, double sigma1, double sigma2 = 0, int bordertype = BORDER_DEFAULT) |
||||
|
||||
:param src: The source image |
||||
|
||||
:param dst: The destination image; It will have the same size and the same type as src |
||||
|
||||
:param ksize: The Gaussian kernel size; ksize.width and ksize.height can differ, but they both must be positive and odd. Or, they can be zero's, then they are computed from sigma |
||||
|
||||
:param sigma1sigma2: The Gaussian kernel standard deviations in X and Y direction. If sigmaY is zero, it is set to be equal to sigmaX. If they are both zeros, they are computed from ksize.width and ksize.height. To fully control the result regardless of possible future modification of all this semantics, it is recommended to specify all of ksize, sigmaX and sigmaY |
||||
|
||||
:param bordertype: Pixel extrapolation method. |
||||
|
||||
The function convolves the source image with the specified Gaussian kernel. In-place filtering is supported. Surpport 8UC1 8UC4 32SC1 32SC4 32FC1 32FC4 data type. |
||||
|
||||
ocl::boxFilter |
||||
------------------ |
||||
Returns void |
||||
|
||||
.. ocv:function:: void boxFilter(const oclMat &src, oclMat &dst, int ddepth, Size ksize, Point anchor = Point(-1, -1), int borderType = BORDER_DEFAULT) |
||||
|
||||
:param src: The source image |
||||
|
||||
:param dst: The destination image; It will have the same size and the same type as src |
||||
|
||||
:param ddepth: The desired depth of the destination image |
||||
|
||||
:param ksize: The smoothing kernel size. It must be positive and odd |
||||
|
||||
:param anchor: The anchor point. The default value Point(-1,-1) means that the anchor is at the kernel center. |
||||
|
||||
:param bordertype: Pixel extrapolation method. |
||||
|
||||
Smoothes image using box filter.Supports data type: CV_8UC1, CV_8UC4, CV_32FC1 and CV_32FC4. |
||||
|
||||
ocl::Laplacian |
||||
------------------ |
||||
Returns void |
||||
|
||||
.. ocv:function:: void Laplacian(const oclMat &src, oclMat &dst, int ddepth, int ksize = 1, double scale = 1) |
||||
|
||||
:param src: The source image |
||||
|
||||
:param dst: The destination image; It will have the same size and the same type as src |
||||
|
||||
:param ddepth: The desired depth of the destination image |
||||
|
||||
:param ksize: The aperture size used to compute the second-derivative filters. It must be positive and odd |
||||
|
||||
:param scale: The optional scale factor for the computed Laplacian values (by default, no scaling is applied |
||||
|
||||
The function calculates the Laplacian of the source image by adding up the second x and y derivatives calculated using the Sobel operator. |
||||
|
||||
ocl::convolve |
||||
------------------ |
||||
Returns void |
||||
|
||||
.. ocv:function:: void convolve(const oclMat &image, const oclMat &temp1, oclMat &result) |
||||
|
||||
:param image: The source image |
||||
|
||||
:param temp1: Convolution kernel, a single-channel floating point matrix. |
||||
|
||||
:param result: The destination image |
||||
|
||||
Convolves an image with the kernel. Supports only CV_32FC1 data types and do not support ROI. |
||||
|
||||
ocl::bilateralFilter |
||||
-------------------- |
||||
Returns void |
||||
|
||||
.. ocv:function:: void bilateralFilter(const oclMat &src, oclMat &dst, int d, double sigmaColor, double sigmaSpave, int borderType=BORDER_DEFAULT) |
||||
|
||||
:param src: The source image |
||||
|
||||
:param dst: The destination image; will have the same size and the same type as src |
||||
|
||||
:param d: The diameter of each pixel neighborhood, that is used during filtering. If it is non-positive, it's computed from sigmaSpace |
||||
|
||||
:param sigmaColor: Filter sigma in the color space. Larger value of the parameter means that farther colors within the pixel neighborhood (see sigmaSpace) will be mixed together, resulting in larger areas of semi-equal color |
||||
|
||||
:param sigmaSpave: Filter sigma in the coordinate space. Larger value of the parameter means that farther pixels will influence each other (as long as their colors are close enough; see sigmaColor). Then d>0, it specifies the neighborhood size regardless of sigmaSpace, otherwise d is proportional to sigmaSpace. |
||||
|
||||
:param borderType: Pixel extrapolation method. |
||||
|
||||
Applies bilateral filter to the image. Supports 8UC1 8UC4 data types. |
||||
|
||||
ocl::copyMakeBorder |
||||
-------------------- |
||||
Returns void |
||||
|
||||
.. ocv:function:: void copyMakeBorder(const oclMat &src, oclMat &dst, int top, int bottom, int left, int right, int boardtype, const Scalar &value = Scalar()) |
||||
|
||||
:param src: The source image |
||||
|
||||
:param dst: The destination image; will have the same type as src and the size size(src.cols+left+right, src.rows+top+bottom) |
||||
|
||||
:param topbottomleftright: Specify how much pixels in each direction from the source image rectangle one needs to extrapolate, e.g. top=1, bottom=1, left=1, right=1mean that 1 pixel-wide border needs to be built |
||||
|
||||
:param bordertype: Pixel extrapolation method. |
||||
|
||||
:param value: The border value if borderType==BORDER CONSTANT |
||||
|
||||
Forms a border around the image. Supports 8UC1 8UC4 32SC1 32SC4 32FC1 32FC4 data types. |
||||
|
||||
ocl::dilate |
||||
------------------ |
||||
Returns void |
||||
|
||||
.. ocv:function:: void dilate( const oclMat &src, oclMat &dst, const Mat &kernel, Point anchor = Point(-1, -1), int iterations = 1, int borderType = BORDER_CONSTANT, const Scalar &borderValue = morphologyDefaultBorderValue()) |
||||
|
||||
:param src: The source image |
||||
|
||||
:param dst: The destination image; It will have the same size and the same type as src |
||||
|
||||
:param kernel: The structuring element used for dilation. If element=Mat(), a 3times 3 rectangular structuring element is used |
||||
|
||||
:param anchor: Position of the anchor within the element. The default value (-1, -1) means that the anchor is at the element center, only default value is supported |
||||
|
||||
:param iterations: The number of times dilation is applied |
||||
|
||||
:param bordertype: Pixel extrapolation method. |
||||
|
||||
:param value: The border value if borderType==BORDER CONSTANT |
||||
|
||||
The function dilates the source image using the specified structuring element that determines the shape of a pixel neighborhood over which the maximum is taken. Supports 8UC1 8UC4 data types. |
||||
|
||||
ocl::erode |
||||
------------------ |
||||
Returns void |
||||
|
||||
.. ocv:function:: void erode( const oclMat &src, oclMat &dst, const Mat &kernel, Point anchor = Point(-1, -1), int iterations = 1, int borderType = BORDER_CONSTANT, const Scalar &borderValue = morphologyDefaultBorderValue()) |
||||
|
||||
:param src: The source image |
||||
|
||||
:param dst: The destination image; It will have the same size and the same type as src |
||||
|
||||
:param kernel: The structuring element used for dilation. If element=Mat(), a 3times 3 rectangular structuring element is used |
||||
|
||||
:param anchor: Position of the anchor within the element. The default value (-1, -1) means that the anchor is at the element center, only default value is supported |
||||
|
||||
:param iterations: The number of times dilation is applied |
||||
|
||||
:param bordertype: Pixel extrapolation method. |
||||
|
||||
:param value: The border value if borderType==BORDER CONSTANT |
||||
|
||||
The function erodes the source image using the specified structuring element that determines the shape of a pixel neighborhood over which the minimum is taken. Supports 8UC1 8UC4 data types. |
||||
|
||||
ocl::morphologyEx |
||||
------------------ |
||||
Returns void |
||||
|
||||
.. ocv:function:: void morphologyEx( const oclMat &src, oclMat &dst, int op, const Mat &kernel, Point anchor = Point(-1, -1), int iterations = 1, int borderType = BORDER_CONSTANT, const Scalar &borderValue = morphologyDefaultBorderValue()) |
||||
|
||||
:param src: The source image |
||||
|
||||
:param dst: The destination image; It will have the same size and the same type as src |
||||
|
||||
:param op: Type of morphological operation, one of the following: ERODE DILTATE OPEN CLOSE GRADIENT TOPHAT BLACKHAT |
||||
|
||||
:param kernel: The structuring element used for dilation. If element=Mat(), a 3times 3 rectangular structuring element is used |
||||
|
||||
:param anchor: Position of the anchor within the element. The default value (-1, -1) means that the anchor is at the element center, only default value is supported |
||||
|
||||
:param iterations: The number of times dilation is applied |
||||
|
||||
:param bordertype: Pixel extrapolation method. |
||||
|
||||
:param value: The border value if borderType==BORDER CONSTANT |
||||
|
||||
A wrapper for erode and dilate. Supports 8UC1 8UC4 data types. |
||||
|
||||
ocl::pyrDown |
||||
------------------- |
||||
Smoothes an image and downsamples it. |
||||
|
||||
.. ocv:function:: void ocl::pyrDown(const oclMat& src, oclMat& dst) |
||||
|
||||
:param src: Source image. |
||||
|
||||
:param dst: Destination image. Will have ``Size((src.cols+1)/2, (src.rows+1)/2)`` size and the same type as ``src`` . |
||||
|
||||
.. seealso:: :ocv:func:`pyrDown` |
||||
|
||||
|
||||
|
||||
ocl::pyrUp |
||||
------------------- |
||||
Upsamples an image and then smoothes it. |
||||
|
||||
.. ocv:function:: void ocl::pyrUp(const oclMat& src, oclMat& dst) |
||||
|
||||
:param src: Source image. |
||||
|
||||
:param dst: Destination image. Will have ``Size(src.cols*2, src.rows*2)`` size and the same type as ``src`` . |
||||
|
||||
.. seealso:: :ocv:func:`pyrUp` |
||||
|
||||
ocl::columnSum |
||||
------------------ |
||||
Computes a vertical (column) sum. |
||||
|
||||
.. ocv:function:: void ocl::columnSum(const oclMat& src, oclMat& sum) |
||||
|
||||
:param src: Source image. Only ``CV_32FC1`` images are supported for now. |
||||
|
||||
:param sum: Destination image of the ``CV_32FC1`` type. |
||||
|
||||
|
||||
ocl::blendLinear |
||||
------------------- |
||||
Performs linear blending of two images. |
||||
|
||||
.. ocv:function:: void ocl::blendLinear(const oclMat& img1, const oclMat& img2, const oclMat& weights1, const oclMat& weights2, oclMat& result) |
||||
|
||||
:param img1: First image. Supports only ``CV_8U`` and ``CV_32F`` depth. |
||||
|
||||
:param img2: Second image. Must have the same size and the same type as ``img1`` . |
||||
|
||||
:param weights1: Weights for first image. Must have tha same size as ``img1`` . Supports only ``CV_32F`` type. |
||||
|
||||
:param weights2: Weights for second image. Must have tha same size as ``img2`` . Supports only ``CV_32F`` type. |
||||
|
||||
:param result: Destination image. |
@ -0,0 +1,331 @@ |
||||
Image Processing |
||||
============================= |
||||
|
||||
.. highlight:: cpp |
||||
|
||||
ocl::cornerHarris |
||||
------------------ |
||||
Returns void |
||||
|
||||
.. ocv:function:: void cornerHarris(const oclMat &src, oclMat &dst, int blockSize, int ksize, double k, int bordertype = cv::BORDER_DEFAULT) |
||||
|
||||
:param src: Source image. Only CV_8UC1 and CV_32FC1 images are supported now. |
||||
|
||||
:param dst: Destination image containing cornerness values. It has the same size as src and CV_32FC1 type. |
||||
|
||||
:param blockSize: Neighborhood size |
||||
|
||||
:param ksize: Aperture parameter for the Sobel operator |
||||
|
||||
:param k: Harris detector free parameter |
||||
|
||||
:param bordertype: Pixel extrapolation method. Only BORDER_REFLECT101, BORDER_REFLECT, BORDER_CONSTANT and BORDER_REPLICATE are supported now. |
||||
|
||||
Calculate Harris corner. |
||||
|
||||
ocl::cornerMinEigenVal |
||||
------------------------ |
||||
Returns void |
||||
|
||||
.. ocv:function:: void cornerMinEigenVal(const oclMat &src, oclMat &dst, int blockSize, int ksize, int bordertype = cv::BORDER_DEFAULT) |
||||
|
||||
:param src: Source image. Only CV_8UC1 and CV_32FC1 images are supported now. |
||||
|
||||
:param dst: Destination image containing cornerness values. It has the same size as src and CV_32FC1 type. |
||||
|
||||
:param blockSize: Neighborhood size |
||||
|
||||
:param ksize: Aperture parameter for the Sobel operator |
||||
|
||||
:param bordertype: Pixel extrapolation method. Only BORDER_REFLECT101, BORDER_REFLECT, BORDER_CONSTANT and BORDER_REPLICATE are supported now. |
||||
|
||||
Calculate MinEigenVal. |
||||
|
||||
ocl::calcHist |
||||
------------------ |
||||
Returns void |
||||
|
||||
.. ocv:function:: void calcHist(const oclMat &mat_src, oclMat &mat_hist) |
||||
|
||||
:param src: Source arrays. They all should have the same depth, CV 8U, and the same size. Each of them can have an arbitrary number of channels. |
||||
|
||||
:param dst: The output histogram, a dense or sparse dims-dimensional |
||||
|
||||
Calculates histogram of one or more arrays. Supports only 8UC1 data type. |
||||
|
||||
ocl::remap |
||||
------------------ |
||||
Returns void |
||||
|
||||
.. ocv:function:: void remap(const oclMat &src, oclMat &dst, oclMat &map1, oclMat &map2, int interpolation, int bordertype, const Scalar &value = Scalar()) |
||||
|
||||
:param src: Source image. Only CV_8UC1 and CV_32FC1 images are supported now. |
||||
|
||||
:param dst: Destination image containing cornerness values. It has the same size as src and CV_32FC1 type. |
||||
|
||||
:param map1: The first map of either (x,y) points or just x values having the type CV_16SC2 , CV_32FC1 , or CV_32FC2 . See covertMaps() for details on converting a floating point representation to fixed-point for speed. |
||||
|
||||
:param map2: The second map of y values having the type CV_32FC1 , or none (empty map if map1 is (x,y) points), respectively. |
||||
|
||||
:param interpolation: The interpolation method |
||||
|
||||
:param bordertype: Pixel extrapolation method. Only BORDER_CONSTANT are supported now. |
||||
|
||||
:param value: The border value if borderType==BORDER CONSTANT |
||||
|
||||
The function remap transforms the source image using the specified map: dst (x ,y) = src (map1(x , y) , map2(x , y)) where values of pixels with non-integer coordinates are computed using one of available interpolation methods. map1 and map2 can be encoded as separate floating-point maps in map1 and map2 respectively, or interleaved floating-point maps of (x,y) in map1. Supports CV_8UC1, CV_8UC3, CV_8UC4, CV_32FC1 , CV_32FC3 and CV_32FC4 data types. |
||||
|
||||
ocl::resize |
||||
------------------ |
||||
Returns void |
||||
|
||||
.. ocv:function:: void resize(const oclMat &src, oclMat &dst, Size dsize, double fx = 0, double fy = 0, int interpolation = INTER_LINEAR) |
||||
|
||||
:param src: Source image. |
||||
|
||||
:param dst: Destination image. |
||||
|
||||
:param dsize: he destination image size. If it is zero, then it is computed as: dsize = Size(round(fx*src.cols), round(fy*src.rows)). Either dsize or both fx or fy must be non-zero. |
||||
|
||||
:param fx: The scale factor along the horizontal axis. When 0, it is computed as (double)dsize.width/src.cols |
||||
|
||||
:param fy: The scale factor along the vertical axis. When 0, it is computed as (double)dsize.height/src.rows |
||||
|
||||
:param interpolation: The interpolation method: INTER NEAREST or INTER LINEAR |
||||
|
||||
Resizes an image. Supports CV_8UC1, CV_8UC3, CV_8UC4, CV_32FC1 , CV_32FC3 and CV_32FC4 data types. |
||||
|
||||
ocl::warpAffine |
||||
------------------ |
||||
Returns void |
||||
|
||||
.. ocv:function:: void warpAffine(const oclMat &src, oclMat &dst, const Mat &M, Size dsize, int flags = INTER_LINEAR) |
||||
|
||||
:param src: Source image. |
||||
|
||||
:param dst: Destination image. |
||||
|
||||
:param M: 2times 3 transformation matrix |
||||
|
||||
:param dsize: Size of the destination image |
||||
|
||||
:param flags: A combination of interpolation methods, see cv::resize, and the optional flag WARP INVERSE MAP that means that M is the inverse transformation (dst to $src) |
||||
|
||||
The function warpAffine transforms the source image using the specified matrix. Supports INTER_NEAREST, INTER_LINEAR, INTER_CUBIC types. |
||||
|
||||
ocl::warpPerspective |
||||
--------------------- |
||||
Returns void |
||||
|
||||
.. ocv:function:: void warpPerspective(const oclMat &src, oclMat &dst, const Mat &M, Size dsize, int flags = INTER_LINEAR) |
||||
|
||||
:param src: Source image. |
||||
|
||||
:param dst: Destination image. |
||||
|
||||
:param M: 2times 3 transformation matrix |
||||
|
||||
:param dsize: Size of the destination image |
||||
|
||||
:param flags: A combination of interpolation methods, see cv::resize, and the optional flag WARP INVERSE MAP that means that M is the inverse transformation (dst to $src) |
||||
|
||||
Applies a perspective transformation to an image. Supports INTER_NEAREST, INTER_LINEAR, INTER_CUBIC types. |
||||
|
||||
ocl::cvtColor |
||||
------------------ |
||||
Returns void |
||||
|
||||
.. ocv:function:: void cvtColor(const oclMat &src, oclMat &dst, int code , int dcn = 0) |
||||
|
||||
:param src: Source image. |
||||
|
||||
:param dst: Destination image. |
||||
|
||||
:param code:The color space conversion code |
||||
|
||||
:param dcn: The number of channels in the destination image; if the parameter is 0, the number of the channels will be derived automatically from src and the code |
||||
|
||||
Converts image from one color space to another.For now, only RGB2GRAY is supportted. Supports.CV_8UC1,CV_8UC4,CV_32SC1,CV_32SC4,CV_32FC1,CV_32FC4 |
||||
|
||||
ocl::threshold |
||||
------------------ |
||||
Returns Threshold value |
||||
|
||||
.. ocv:function:: double threshold(const oclMat &src, oclMat &dst, double thresh, double maxVal, int type = THRESH_TRUNC) |
||||
|
||||
:param src: The source array |
||||
|
||||
:param dst: Destination array; will have the same size and the same type as src |
||||
|
||||
:param thresh: Threshold value |
||||
|
||||
:param maxVal: Maximum value to use with THRESH BINARY and THRESH BINARY INV thresholding types |
||||
|
||||
:param type: Thresholding type |
||||
|
||||
The function applies fixed-level thresholding to a single-channel array. The function is typically used to get a bi-level (binary) image out of a grayscale image or for removing a noise, i.e. filtering out pixels with too small or too large values. There are several types of thresholding that the function supports that are determined by thresholdType. Supports only CV_32FC1 and CV_8UC1 data type. |
||||
|
||||
ocl::buildWarpPlaneMaps |
||||
----------------------- |
||||
Builds plane warping maps. |
||||
|
||||
.. ocv:function:: void ocl::buildWarpPlaneMaps(Size src_size, Rect dst_roi, const Mat& R, double f, double s, double dist, oclMat& map_x, oclMat& map_y) |
||||
|
||||
|
||||
|
||||
ocl::buildWarpCylindricalMaps |
||||
----------------------------- |
||||
Builds cylindrical warping maps. |
||||
|
||||
.. ocv:function:: void ocl::buildWarpCylindricalMaps(Size src_size, Rect dst_roi, const Mat& R, double f, double s, oclMat& map_x, oclMat& map_y) |
||||
|
||||
|
||||
|
||||
|
||||
ocl::buildWarpSphericalMaps |
||||
--------------------------- |
||||
Builds spherical warping maps. |
||||
|
||||
.. ocv:function:: void ocl::buildWarpSphericalMaps(Size src_size, Rect dst_roi, const Mat& R, double f, double s, oclMat& map_x, oclMat& map_y) |
||||
|
||||
|
||||
ocl::buildWarpPerspectiveMaps |
||||
----------------------------- |
||||
Builds transformation maps for perspective transformation. |
||||
|
||||
.. ocv:function:: void buildWarpAffineMaps(const Mat& M, bool inverse, Size dsize, oclMat& xmap, oclMat& ymap) |
||||
|
||||
:param M: *3x3* transformation matrix. |
||||
|
||||
:param inverse: Flag specifying that ``M`` is an inverse transformation ( ``dst=>src`` ). |
||||
|
||||
:param dsize: Size of the destination image. |
||||
|
||||
:param xmap: X values with ``CV_32FC1`` type. |
||||
|
||||
:param ymap: Y values with ``CV_32FC1`` type. |
||||
|
||||
.. seealso:: :ocv:func:`ocl::warpPerspective` , :ocv:func:`ocl::remap` |
||||
|
||||
|
||||
ocl::buildWarpAffineMaps |
||||
------------------------ |
||||
Builds transformation maps for affine transformation. |
||||
|
||||
.. ocv:function:: void buildWarpAffineMaps(const Mat& M, bool inverse, Size dsize, oclMat& xmap, oclMat& ymap) |
||||
|
||||
:param M: *2x3* transformation matrix. |
||||
|
||||
:param inverse: Flag specifying that ``M`` is an inverse transformation ( ``dst=>src`` ). |
||||
|
||||
:param dsize: Size of the destination image. |
||||
|
||||
:param xmap: X values with ``CV_32FC1`` type. |
||||
|
||||
:param ymap: Y values with ``CV_32FC1`` type. |
||||
|
||||
.. seealso:: :ocv:func:`ocl::warpAffine` , :ocv:func:`ocl::remap` |
||||
|
||||
ocl::PyrLKOpticalFlow |
||||
--------------------- |
||||
.. ocv:class:: ocl::PyrLKOpticalFlow |
||||
|
||||
Class used for calculating an optical flow. :: |
||||
|
||||
class PyrLKOpticalFlow |
||||
{ |
||||
public: |
||||
PyrLKOpticalFlow(); |
||||
|
||||
void sparse(const oclMat& prevImg, const oclMat& nextImg, const oclMat& prevPts, oclMat& nextPts, |
||||
oclMat& status, oclMat* err = 0); |
||||
|
||||
void dense(const oclMat& prevImg, const oclMat& nextImg, oclMat& u, oclMat& v, oclMat* err = 0); |
||||
|
||||
Size winSize; |
||||
int maxLevel; |
||||
int iters; |
||||
double derivLambda; |
||||
bool useInitialFlow; |
||||
float minEigThreshold; |
||||
bool getMinEigenVals; |
||||
|
||||
void releaseMemory(); |
||||
}; |
||||
|
||||
The class can calculate an optical flow for a sparse feature set or dense optical flow using the iterative Lucas-Kanade method with pyramids. |
||||
|
||||
.. seealso:: :ocv:func:`calcOpticalFlowPyrLK` |
||||
|
||||
|
||||
|
||||
ocl::PyrLKOpticalFlow::sparse |
||||
----------------------------- |
||||
Calculate an optical flow for a sparse feature set. |
||||
|
||||
.. ocv:function:: void ocl::PyrLKOpticalFlow::sparse(const oclMat& prevImg, const oclMat& nextImg, const oclMat& prevPts, oclMat& nextPts, oclMat& status, oclMat* err = 0) |
||||
|
||||
:param prevImg: First 8-bit input image (supports both grayscale and color images). |
||||
|
||||
:param nextImg: Second input image of the same size and the same type as ``prevImg`` . |
||||
|
||||
:param prevPts: Vector of 2D points for which the flow needs to be found. It must be one row matrix with CV_32FC2 type. |
||||
|
||||
:param nextPts: Output vector of 2D points (with single-precision floating-point coordinates) containing the calculated new positions of input features in the second image. When ``useInitialFlow`` is true, the vector must have the same size as in the input. |
||||
|
||||
:param status: Output status vector (CV_8UC1 type). Each element of the vector is set to 1 if the flow for the corresponding features has been found. Otherwise, it is set to 0. |
||||
|
||||
:param err: Output vector (CV_32FC1 type) that contains the difference between patches around the original and moved points or min eigen value if ``getMinEigenVals`` is checked. It can be NULL, if not needed. |
||||
|
||||
.. seealso:: :ocv:func:`calcOpticalFlowPyrLK` |
||||
|
||||
|
||||
|
||||
ocl::PyrLKOpticalFlow::dense |
||||
----------------------------- |
||||
Calculate dense optical flow. |
||||
|
||||
.. ocv:function:: void ocl::PyrLKOpticalFlow::dense(const oclMat& prevImg, const oclMat& nextImg, oclMat& u, oclMat& v, oclMat* err = 0) |
||||
|
||||
:param prevImg: First 8-bit grayscale input image. |
||||
|
||||
:param nextImg: Second input image of the same size and the same type as ``prevImg`` . |
||||
|
||||
:param u: Horizontal component of the optical flow of the same size as input images, 32-bit floating-point, single-channel |
||||
|
||||
:param v: Vertical component of the optical flow of the same size as input images, 32-bit floating-point, single-channel |
||||
|
||||
:param err: Output vector (CV_32FC1 type) that contains the difference between patches around the original and moved points or min eigen value if ``getMinEigenVals`` is checked. It can be NULL, if not needed. |
||||
|
||||
|
||||
|
||||
ocl::PyrLKOpticalFlow::releaseMemory |
||||
------------------------------------ |
||||
Releases inner buffers memory. |
||||
|
||||
.. ocv:function:: void ocl::PyrLKOpticalFlow::releaseMemory() |
||||
|
||||
|
||||
ocl::interpolateFrames |
||||
---------------------- |
||||
Interpolate frames (images) using provided optical flow (displacement field). |
||||
|
||||
.. ocv:function:: void ocl::interpolateFrames(const oclMat& frame0, const oclMat& frame1, const oclMat& fu, const oclMat& fv, const oclMat& bu, const oclMat& bv, float pos, oclMat& newFrame, oclMat& buf) |
||||
|
||||
:param frame0: First frame (32-bit floating point images, single channel). |
||||
|
||||
:param frame1: Second frame. Must have the same type and size as ``frame0`` . |
||||
|
||||
:param fu: Forward horizontal displacement. |
||||
|
||||
:param fv: Forward vertical displacement. |
||||
|
||||
:param bu: Backward horizontal displacement. |
||||
|
||||
:param bv: Backward vertical displacement. |
||||
|
||||
:param pos: New frame position. |
||||
|
||||
:param newFrame: Output image. |
||||
|
||||
:param buf: Temporary buffer, will have width x 6*height size, CV_32FC1 type and contain 6 oclMat: occlusion masks for first frame, occlusion masks for second, interpolated forward horizontal flow, interpolated forward vertical flow, interpolated backward horizontal flow, interpolated backward vertical flow. |