Making mosaic images with ffmpeg
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.

41 lines
1.0 KiB

#pragma once
#include <av/av.hpp>
#include <fingerprint_traits.hpp>
#include <boost/serialization/access.hpp>
#include <boost/serialization/array.hpp>
#include <boost/serialization/utility.hpp>
#include <array>
#include <string>
#include <utility>
#include <vector>
namespace fingerprints {
struct wvlt_rgb {
// a double for (x, y) location represented in a single int
using coefficient = std::pair<int, double>;
using pre_fingerprint = std::array<std::vector<double>, 3>;
std::array<coefficient, 20> reds;
std::array<coefficient, 20> greens;
std::array<coefficient, 20> blues;
static pre_fingerprint pre_calculate(av::frame const & frame);
static wvlt_rgb calculate(av::frame const & frame);
double distance_to(pre_fingerprint const & fingerprint) const;
static std::string name(){ return "wvlt-rgb-20x20x20"; }
private:
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive & ar, const unsigned int /*version*/){
ar & reds;
ar & greens;
ar & blues;
}
};
} // namespace fingerprints