The MASM Forum Archive 2004 to 2012
General Forums => The Campus => Topic started by: Farabi on July 15, 2010, 02:42:15 PM
Quote
void cvExtractSURF(const CvArr* image, const CvArr* mask, CvSeq** keypoints, CvSeq** descriptors, CvMemStorage* storage, CvSURFParams params)¶
Extracts Speeded Up Robust Features from an image.
Parameters:
* image – The input 8-bit grayscale image
* mask – The optional input 8-bit mask. The features are only found in the areas that contain more than 50 % of non-zero mask pixels
* keypoints – The output parameter; double pointer to the sequence of keypoints. The sequence of CvSURFPoint structures is as follows:
typedef struct CvSURFPoint
{
CvPoint2D32f pt; // position of the feature within the image
int laplacian; // -1, 0 or +1. sign of the laplacian at the point.
// can be used to speedup feature comparison
// (normally features with laplacians of different
// signs can not match)
int size; // size of the feature
float dir; // orientation of the feature: 0..360 degrees
float hessian; // value of the hessian (can be used to
// approximately estimate the feature strengths;
// see also params.hessianThreshold)
}
CvSURFPoint;
Parameters:
* descriptors – The optional output parameter; double pointer to the sequence of descriptors. Depending on the params.extended value, each element of the sequence will be either a 64-element or a 128-element floating-point ( CV_32F ) vector. If the parameter is NULL, the descriptors are not computed
* storage – Memory storage where keypoints and descriptors will be stored
* params – Various algorithm parameters put to the structure CvSURFParams:
typedef struct CvSURFParams
{
int extended; // 0 means basic descriptors (64 elements each),
// 1 means extended descriptors (128 elements each)
double hessianThreshold; // only features with keypoint.hessian
// larger than that are extracted.
// good default value is ~300-500 (can depend on the
// average local contrast and sharpness of the image).
// user can further filter out some features based on
// their hessian values and other characteristics.
int nOctaves; // the number of octaves to be used for extraction.
// With each next octave the feature size is doubled
// (3 by default)
int nOctaveLayers; // The number of layers within each octave
// (4 by default)
}
CvSURFParams;
CvSURFParams cvSURFParams(double hessianThreshold, int extended=0);
// returns default parameters
The function cvExtractSURF finds robust features in the image, as described in Bay06 . For each feature it returns its location, size, orientation and optionally the descriptor, basic or extended. The function can be used for object tracking and localization, image stitching etc.
http://opencv.willowgarage.com/documentation/c/feature_detection.html
fOpenCVcvExtractSURF proc uses esi edi image:dword,_mask:dword,keypoints:dword,descriptors:dword,storage:dword,params:CvSURFParams
push params.nOctaveLayers
push params.nOctaves
push dword ptr params.hessianThreshold[4]
push dword ptr params.hessianThreshold[0]
push params.extended
push storage
push descriptors
push keypoints
push _mask
push image
call cvExtractSURF
add esp,10*4
ret
fOpenCVcvExtractSURF endp
It did not work.