Similarity

aidecv~ Similarity

new Similarity(name)

Description:
  • Template to implement a similarity hook mechanism. A typical implementation is of the form:

    #include "Similarity.hpp"
    namespace aidecv {
      class SomethingSimilarity : public Similarity {
      public:
        SomethingSimilarity() : Similarity("something") {}
        double get(Image& target, const Image& source) {
          const cv::Mat& img = target.channels.at("input"), src = source.channels.at("input"), alpha = source.channels.at("alpha");
          // Implements the similarity
        }
      } somethingSimilarity;
    }
    
Parameters:
Name Type Description
name string

The 'similarity' operation name to register for this similarity.

Methods

set(target, source) → {double}

Description:
  • Implements the similarity operation.

Parameters:
Name Type Description
target Mat

The input/output image.

source Mat

The source image to compare with.

Returns:

The similarity value.

Type
double

(static) getSimilarities() → {Map}

Description:
  • Returns the similarity table

Returns:

A std::map < std::string, Similarity * > with the register similarities indexed by the 'similarity' operation name.

Type
Map