Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7610361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:23:59+00:00 2026-05-31T01:23:59+00:00

In the computer vision library, the base class DescriptorExtractor (used to extract descriptors from

  • 0

In the computer vision library, the base class DescriptorExtractor (used to extract descriptors from keypoints in one image) is written like that :

class DescriptorExtractor
{
public:
  virtual ~DescriptorExtractor();
  void compute( const Mat& image, vector<KeyPoint>& keypoints, Mat& descriptors ) const;
protected:
  virtual void computeImpl(const Mat& image, vector<KeyPoint>& keypoints, Mat& descriptors ) const = 0;
};

And for different types of descriptors, like Surf of Sift, we derive from base class:

class SurfDescriptorExtractor : public DescriptorExtractor
{
public:
  SurfDescriptorExtractor(..){..}
protected:
  virtual void computeImpl(const Mat& image, vector<KeyPoint>& keypoints, Mat& descriptors ) const;
  SURF surf;
};

And the protected method computeImpl is (re)implemented.
I wrote a new descriptor extractor MyDescriptorExtractor which need current image (as others in opencv) and previous image too like that (?):

class MyDescriptorExtractor: public DescriptorExtractor
{
public:
  ...
protected:
  virtual void computeImpl(const Mat& image, const Mat& prev_image, vector<KeyPoint>& keypoints, Mat& descriptors ) const;
}

I want this new class to be compatible with opencv methods using DescriptorExtractor as argument. What is the best way to do this ? Problem is that base class method compute will not have the same signature …

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T01:24:00+00:00Added an answer on May 31, 2026 at 1:24 am

    Note that subclassing should still obey the Liskov substitution principle.

    Still, the solution is to pass the parameter you need in the constructor of MyDescriptorExtractor, which allows you to keep the same signature.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to apply operations from the OpenCV computer vision library, in real time,
I'm familiar with Computer Vision ( Well, know OF it ), of which one
I am just learning about computer vision and C#. It seems like two prominent
I downloaded the Emgu CV (Computer Vision) library and I'm just having a look
I have a computer vision set up with two cameras. One of this cameras
I'm reading some paper about computer vision. It looks like a simple fact but
When dealing with image processing and computer vision these two terms come up perennially
I've noticed that Matlab is very popular among the computer vision and image processing
I am preparing a task for computer vision class, which involves training a simple
I'm working on my task in computer vision course. One of sub-tasks is gradient

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.