Merge pull request #771 from gpsinghsandhu:surfFeatureFinder
This commit is contained in:
commit
977562b614
@ -348,8 +348,15 @@ SurfFeaturesFinder::SurfFeaturesFinder(double hess_thresh, int num_octaves, int
|
|||||||
void SurfFeaturesFinder::find(const Mat &image, ImageFeatures &features)
|
void SurfFeaturesFinder::find(const Mat &image, ImageFeatures &features)
|
||||||
{
|
{
|
||||||
Mat gray_image;
|
Mat gray_image;
|
||||||
CV_Assert(image.type() == CV_8UC3);
|
CV_Assert((image.type() == CV_8UC3) || (image.type() == CV_8UC1));
|
||||||
cvtColor(image, gray_image, CV_BGR2GRAY);
|
if(image.type() == CV_8UC3)
|
||||||
|
{
|
||||||
|
cvtColor(image, gray_image, CV_BGR2GRAY);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gray_image = image;
|
||||||
|
}
|
||||||
if (surf == 0)
|
if (surf == 0)
|
||||||
{
|
{
|
||||||
detector_->detect(gray_image, features.keypoints);
|
detector_->detect(gray_image, features.keypoints);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user