Commit 8fa8fa80 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

Merge pull request #233 from vpisarev/features2d_fixes

Features2d fixes
parents c9fb3913 0f38313f
......@@ -351,7 +351,7 @@ void RetinaOCLImpl::setupIPLMagnoChannel(const bool normaliseOutput, const float
_retinaParameters.IplMagno.localAdaptintegration_k = localAdaptintegration_k;
}
void RetinaOCLImpl::run(const InputArray input)
void RetinaOCLImpl::run(InputArray input)
{
oclMat &inputMatToConvert = getOclMatRef(input);
bool colorMode = convertToColorPlanes(inputMatToConvert, _inputBuffer);
......
......@@ -78,7 +78,7 @@ class CV_EXPORTS Saliency : public virtual Algorithm
* \param saliencyMap The computed saliency map.
* \return true if the saliency map is computed, false otherwise
*/
bool computeSaliency( const InputArray image, OutputArray saliencyMap );
bool computeSaliency( InputArray image, OutputArray saliencyMap );
/**
* \brief Get the name of the specific saliency type
......@@ -88,7 +88,7 @@ class CV_EXPORTS Saliency : public virtual Algorithm
protected:
virtual bool computeSaliencyImpl( const InputArray image, OutputArray saliencyMap ) = 0;
virtual bool computeSaliencyImpl( InputArray image, OutputArray saliencyMap ) = 0;
String className;
};
......@@ -114,7 +114,7 @@ class CV_EXPORTS StaticSaliency : public virtual Saliency
*/
bool computeBinaryMap( const Mat& saliencyMap, Mat& binaryMap );
protected:
virtual bool computeSaliencyImpl( const InputArray image, OutputArray saliencyMap )=0;
virtual bool computeSaliencyImpl( InputArray image, OutputArray saliencyMap )=0;
};
......@@ -123,7 +123,7 @@ class CV_EXPORTS MotionSaliency : public virtual Saliency
{
protected:
virtual bool computeSaliencyImpl( const InputArray image, OutputArray saliencyMap )=0;
virtual bool computeSaliencyImpl( InputArray image, OutputArray saliencyMap )=0;
};
......@@ -132,7 +132,7 @@ class CV_EXPORTS Objectness : public virtual Saliency
{
protected:
virtual bool computeSaliencyImpl( const InputArray image, OutputArray saliencyMap )=0;
virtual bool computeSaliencyImpl( InputArray image, OutputArray saliencyMap )=0;
};
......
......@@ -94,7 +94,7 @@ public:
}
protected:
bool computeSaliencyImpl( const InputArray image, OutputArray saliencyMap );
bool computeSaliencyImpl( InputArray image, OutputArray saliencyMap );
int resImWidth;
int resImHeight;
......@@ -154,7 +154,7 @@ protected:
The saliency map is given by a single *Mat* (one for each frame of an hypothetical video
stream).
*/
bool computeSaliencyImpl( const InputArray image, OutputArray saliencyMap );
bool computeSaliencyImpl( InputArray image, OutputArray saliencyMap );
private:
......@@ -268,7 +268,7 @@ protected:
specialized algorithm, the objectnessBoundingBox is a *vector\<Vec4i\>*. Each bounding box is
represented by a *Vec4i* for (minX, minY, maxX, maxY).
*/
bool computeSaliencyImpl( const InputArray image, OutputArray objectnessBoundingBox );
bool computeSaliencyImpl( InputArray image, OutputArray objectnessBoundingBox );
private:
......
......@@ -460,7 +460,7 @@ void ObjectnessBING::write() const
}
bool ObjectnessBING::computeSaliencyImpl( const InputArray image, OutputArray objectnessBoundingBox )
bool ObjectnessBING::computeSaliencyImpl( InputArray image, OutputArray objectnessBoundingBox )
{
ValStructVec<float, Vec4i> finalBoxes;
getObjBndBoxesForSingleImage( image.getMat(), finalBoxes, 250 );
......
......@@ -501,7 +501,7 @@ bool MotionSaliencyBinWangApr2014::templateReplacement( const Mat& finalBFMask,
return true;
}
bool MotionSaliencyBinWangApr2014::computeSaliencyImpl( const InputArray image, OutputArray saliencyMap )
bool MotionSaliencyBinWangApr2014::computeSaliencyImpl( InputArray image, OutputArray saliencyMap )
{
Mat highResBFMask;
Mat lowResBFMask;
......
......@@ -62,7 +62,7 @@ Ptr<Saliency> Saliency::create( const String& saliencyType )
return Ptr<Saliency>();
}
bool Saliency::computeSaliency( const InputArray image, OutputArray saliencyMap )
bool Saliency::computeSaliency( InputArray image, OutputArray saliencyMap )
{
if( image.empty() )
return false;
......
......@@ -73,7 +73,7 @@ void StaticSaliencySpectralResidual::write( cv::FileStorage& /*fs*/) const
//params.write( fs );
}
bool StaticSaliencySpectralResidual::computeSaliencyImpl( const InputArray image, OutputArray saliencyMap )
bool StaticSaliencySpectralResidual::computeSaliencyImpl( InputArray image, OutputArray saliencyMap )
{
Mat grayTemp, grayDown;
std::vector<Mat> mv;
......
......@@ -1240,3 +1240,31 @@ TEST(DISABLED_Features2d_SURF_using_mask, regression)
FeatureDetectorUsingMaskTest test(SURF::create());
test.safe_run();
}
TEST( XFeatures2d_DescriptorExtractor, batch )
{
string path = string(cvtest::TS::ptr()->get_data_path() + "detectors_descriptors_evaluation/images_datasets/graf");
vector<Mat> imgs, descriptors;
vector<vector<KeyPoint> > keypoints;
int i, n = 6;
Ptr<SIFT> sift = SIFT::create();
for( i = 0; i < n; i++ )
{
string imgname = format("%s/img%d.png", path.c_str(), i+1);
Mat img = imread(imgname, 0);
imgs.push_back(img);
}
sift->detect(imgs, keypoints);
sift->compute(imgs, keypoints, descriptors);
ASSERT_EQ((int)keypoints.size(), n);
ASSERT_EQ((int)descriptors.size(), n);
for( i = 0; i < n; i++ )
{
EXPECT_GT((int)keypoints[i].size(), 100);
EXPECT_GT(descriptors[i].rows, 100);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment