You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.3 KiB
48 lines
1.3 KiB
11 years ago
|
#pragma once
|
||
|
|
||
10 years ago
|
#include <av.hpp>
|
||
|
#include <fingerprint_traits.hpp>
|
||
11 years ago
|
|
||
|
#include <boost/serialization/access.hpp>
|
||
|
#include <boost/serialization/array.hpp>
|
||
|
#include <boost/serialization/utility.hpp>
|
||
|
|
||
|
#include <utility>
|
||
|
#include <array>
|
||
|
#include <iosfwd>
|
||
10 years ago
|
#include <vector>
|
||
11 years ago
|
|
||
|
namespace boost {
|
||
|
namespace serialization {
|
||
|
template<class Archive, class T, size_t N>
|
||
|
void serialize(Archive & ar, std::array<T,N> & a, const unsigned int /*version*/) {
|
||
|
ar & make_array(a.data(), a.size());
|
||
|
}
|
||
|
} // namespace serialization
|
||
|
} // namespace boost
|
||
|
|
||
|
struct rgb_wavelet_coefficients {
|
||
|
// a double for (x, y) location represented in a single int
|
||
|
using coefficient = std::pair<int, double>;
|
||
10 years ago
|
using pre_fingerprint = std::array<std::vector<double>, 3>;
|
||
11 years ago
|
|
||
|
std::array<coefficient, 20> reds;
|
||
|
std::array<coefficient, 20> greens;
|
||
|
std::array<coefficient, 20> blues;
|
||
|
|
||
10 years ago
|
static pre_fingerprint pre_calculate(av::frame const & frame);
|
||
|
static rgb_wavelet_coefficients calculate(av::frame const & frame);
|
||
|
double distance_to(pre_fingerprint const & fingerprint) const;
|
||
11 years ago
|
|
||
|
private:
|
||
|
friend class boost::serialization::access;
|
||
|
template<class Archive>
|
||
|
void serialize(Archive & ar, const unsigned int /*version*/){
|
||
|
ar & reds;
|
||
|
ar & greens;
|
||
|
ar & blues;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
std::ostream& operator<<(std::ostream& out, rgb_wavelet_coefficients const & x);
|