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

  • Home
  • SEARCH
  • 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 8836707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:33:25+00:00 2026-06-14T09:33:25+00:00

I have a bunch of different Feature classes which calculate image features. I have

  • 0

I have a bunch of different Feature classes which calculate image features.
I have to extract from these classes “key features” that will be used packed together as a search key.
And I will also store parts of the Feature classes. I can’t store entire feature classes because that would be quite inefficient.

Now, what I have thought of is writing a Stored_features class that puts together the “key features”.
My layout is:

   Facial_features
   |      |       |
   |      V       |
   | .---Feature1 V   <|-- Abstract_feature
   | | .---Feature2   <|---'
   V V V
  Stored_features

My problem is that such a Stored_features class would have a lot of getters and setters and as far as I know, getters and setters indicate bad design. Is there an easily maintainable way to avoid too many getters and setters here?

The point is I see my code get here very tightly coupled with this layout 🙁

EDIT:

My code extract as requested.

#include <opencv2/core/core.hpp>

class Abstract_feature{
public:
  virtual void calculate()=0;
  virtual void draw(cv::Mat& canvas)=0;
  /// to put values into Stored_features
  virtual void registrate_key_values(Stored_features&) const=0;
};

class Facial_features : Abstract_feature{
public:
  virtual void calculate()
  { 
    es.calculate; sc.calculate; 
    /*etc but iterating over a list of Abstract_feature's*/
  }
  Stored_features get_stored_features() const
  {
    return sf.clone();
  }
private:
  Stored_features sf;
  Head_size es;
  Skin_color sc;
};

class Head_size : public Abstract_feature{
  //you can guess the impl.
};    

class Stored_features{
public:
  typedef enum{SKIN_COLOR=0, HEAD_SIZE_WIDTH,HEAD_SIZE_HEIGHT} Name;
public:
  void set_key_feature(Name, double value);
  cv::Mat get_feature_vector() const {return key_values;}
private:
  cv::Mat key_values;
  // and here would come other features eg.
  cv::Rect head_roi; // I don't search based on these. (So I should not use getters/setters?)
};

Added opencv for it is an opencv-based project anyway.

  • 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-06-14T09:33:26+00:00Added an answer on June 14, 2026 at 9:33 am

    The size of a class should be its own issue.

    In this case I discovered that all I need is a pack() function for each feature class that removes all the data I do not want to store. Then I can store the classes as they are and don’t have to care about their sizes.

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

Sidebar

Related Questions

I have a bunch of third-party Java classes that use different property names for
I have a web application which features a bunch of different items, which are
I have a bunch of different objects that are commonly edited in the same
Let's say that I have a bunch of class instances that serve different purposes,
I have a bunch of different objects(and objec types) that i want to write
I have a bunch of different tables each of which have an ID column
I have a bunch of branches, each with different features. Usually I'll have some
I have a page that has a bunch of different iframes (A, B, C,
I have a bunch of different DIVs in a menu that affect different things
I have a long-form data that represents a bunch of different configurations of different

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.