Skip to content

getDefaultName() isn't overloaded in Feature2D nor its children  #6387

@artivis

Description

@artivis

Please state the information for your system

  • OpenCV version: 3.1
  • Host OS: Linux (Ubuntu 14.04)
  • GCC 4.8.4

In which part of the OpenCV library you got the issue?

  • features2D

Expected behaviour

cv::Feature2D my_feature2d;

cv::String name = my_feature2d.getDefaultName();

std::cout << "I'm of type : " << name << std::endl;

// in the console
// I'm of type : Feature2D

// Another example

cv::Ptr<Feature2D> f2d = xfeatures2d::SIFT::create();

cv::String name = f2d->getDefaultName();

std::cout << "I'm of type : " << name << std::endl;

// in the console
// I'm of type : Feature2D.SIFT

Actual behaviour

// in the console
I'm of type : my_object

// prints " my_object " as implemented in base class Algorithm.

Additional description

The same manner the function read() / write() end up with an empty yaml file.

Code example to reproduce the issue / Steps to reproduce the issue

Please try to give a full example which will compile as is.

#include <opencv2/features2d/features2d.hpp>
#include <opencv2/xfeatures2d/nonfree.hpp>
#include <iostream>

int main()
{
    cv::Feature2D my_feature2d;
    cv::String name = my_feature2d.getDefaultName();

    std::cout << "I'm of type : " << name << std::endl;

    cv::Ptr<cv::Feature2D> f2d = cv::xfeatures2d::SIFT::create();
    name = f2d->getDefaultName();

    std::cout << "I'm of type : " << name << std::endl;

    cv::FileStorage fs("/tmp/whatever.yaml", cv::FileStorage::WRITE);
    f2d->write(fs);

    return 0;
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions