1 // Copyright 2020 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef THIRD_PARTY_EMD_WRAPPER_H_ 6 #define THIRD_PARTY_EMD_WRAPPER_H_ 7 8 #include <vector> 9 #include "base/optional.h" 10 11 namespace opencv { 12 13 struct PointDistribution { 14 // The weight of each point. 15 std::vector<float> weights; 16 17 // The number of dimensions. 18 int dimensions; 19 20 // The positions of each point. Must have the same size as |weights|, and each 21 // element must have size |dimensions|. 22 std::vector<std::vector<float>> positions; 23 }; 24 25 base::Optional<double> EMD(const PointDistribution& distribution1, 26 const PointDistribution& distribution2); 27 } // namespace opencv 28 29 #endif // THIRD_PARTY_EMD_WRAPPER_H_ 30