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 7615413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:38:21+00:00 2026-05-31T02:38:21+00:00

I am trying to practice good de-coupled architecture in my computer vision app. Since

  • 0

I am trying to practice good de-coupled architecture in my computer vision app. Since I am using a .net library (EMGU.CV) that wraps native OpenCV routines, I need to use C# interfaces to abstract out the EMGU classes in order to be able to subsitute them in future.

A concrete example is:

In EMGU I have a foreground detector class, that exposes Image<T,T> class. This call is purely EMGU-oriented.

I am working on IBackgroundDetector for my application, that presumably would support different background detectors, including EMGU.

So for a method in my interface

interface IBackgroundDetector
{
   SomeGeneralImageType GetCurrentBackgroundFrame(SomeGeneralImage CameraFrame);
}

How do I go about creating this SomeGeneralImageType class to get the good architecture?

  • 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-31T02:38:22+00:00Added an answer on May 31, 2026 at 2:38 am

    The idea is to create an Interface called ISomeGeneralImageType.
    Declare a bunch of methods you would need for an Image (look at C#’s Image as an example for what you’d probably need)

    Then for each Image type you create just inherit the interface ISomeGeneralImageType and implement the methods.

    The way you would do this is by using encapsulation to hide all the complicated stuff you would usually do.

    For Example (I really don’t know the real interface of your object, this is just to show the idea):

    interface ISomeGeneralImageType
    {
       void SetHeight(int height);
       Byte[] GetBitBuffer();
    }
    
    class ImageEMGU : ISomeGeneralImageType
    {
        private Image<T,T> innerImage;
    
        public override Byte[] GetBitBuffer()
        { 
           innerImage.GetMeSomeBits()
        }
    
        public override  SetHeight(int height)
        {
           innerImage.EMGUHight(height);
        }
    }
    

    Then you could use your background detector on any image that implements your interface:

    interface IBackgroundDetector
    {
       SomeGeneralImageType GetCurrentBackgroundFrame(ISomeGeneralImage CameraFrame);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to find a good organization practice of my javascript (jquery) files when
I'm using Eclipse with C++ plugins on my macbook, trying some practice projects to
Im trying to find a best practice to load usercontrols using Ajax. My first
I am a newb and I am trying to better myself at good practice
I'm trying to write an app that consists of an activity that manages a
I have read that it is a good practice to not use too many
I know that it is not a good practice to call a method in
I am trying to build an ASP.NET 3.5 website that allows users to log
I'm trying to figure out what the best practice is for using jQuery in
I'm trying to make a secure login that prevents SQLInjection using the OWASP specification

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.