mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 15:23:05 +04:00
Merge pull request #9330 from hrnr:akaze_ocl
[GSOC] Enable OCL for AKAZE (#9330)
* revert e0489cb - reenable OCL for AKAZE
* deal with conversion internally in AKAZE
* pass InputArray directly to AKAZE to allow distiguishing input Mat/UMat. deal with conversion there
* ensure that keypoints orientations are always computed. prevents misuse of internal AKAZE class.
* covert internal AKAZE functions to use InputArray/OutputArray
* make internal functions private in AKAZE
* split OCL and CPU paths in AKAZE
* create 2 separate pyramids, 1 for OCL and 1 for CPU
* template functions that use temporaries to always store them as correct type (UMat/Mat)
* remove variable used only in OCL path
causes unused variable warning
* update AKAZE documentation
* run ocl version only when ocl is enabled
* add tests for OCL path in AKAZE
* relax condition for keypoints angle
This commit is contained in:
committed by
Alexander Alekhin
parent
3a8dbebd37
commit
a5b5684670
@@ -169,38 +169,25 @@ namespace cv
|
||||
{
|
||||
CV_INSTRUMENT_REGION()
|
||||
|
||||
Mat img = image.getMat();
|
||||
if (img.channels() > 1)
|
||||
cvtColor(image, img, COLOR_BGR2GRAY);
|
||||
|
||||
Mat img1_32;
|
||||
if ( img.depth() == CV_32F )
|
||||
img1_32 = img;
|
||||
else if ( img.depth() == CV_8U )
|
||||
img.convertTo(img1_32, CV_32F, 1.0 / 255.0, 0);
|
||||
else if ( img.depth() == CV_16U )
|
||||
img.convertTo(img1_32, CV_32F, 1.0 / 65535.0, 0);
|
||||
|
||||
CV_Assert( ! img1_32.empty() );
|
||||
CV_Assert( ! image.empty() );
|
||||
|
||||
AKAZEOptions options;
|
||||
options.descriptor = descriptor;
|
||||
options.descriptor_channels = descriptor_channels;
|
||||
options.descriptor_size = descriptor_size;
|
||||
options.img_width = img.cols;
|
||||
options.img_height = img.rows;
|
||||
options.img_width = image.cols();
|
||||
options.img_height = image.rows();
|
||||
options.dthreshold = threshold;
|
||||
options.omax = octaves;
|
||||
options.nsublevels = sublevels;
|
||||
options.diffusivity = diffusivity;
|
||||
|
||||
AKAZEFeatures impl(options);
|
||||
impl.Create_Nonlinear_Scale_Space(img1_32);
|
||||
impl.Create_Nonlinear_Scale_Space(image);
|
||||
|
||||
if (!useProvidedKeypoints)
|
||||
{
|
||||
impl.Feature_Detection(keypoints);
|
||||
impl.Compute_Keypoints_Orientation(keypoints);
|
||||
}
|
||||
|
||||
if (!mask.empty())
|
||||
@@ -208,7 +195,7 @@ namespace cv
|
||||
KeyPointsFilter::runByPixelsMask(keypoints, mask.getMat());
|
||||
}
|
||||
|
||||
if( descriptors.needed() )
|
||||
if(descriptors.needed())
|
||||
{
|
||||
impl.Compute_Descriptors(keypoints, descriptors);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user