Version: 1.0
image_frequencies.h
Go to the documentation of this file.
1 // Copyright (c) 2020, the GRAPHGEN contributors, as
2 // shown by the AUTHORS file. All rights reserved.
3 //
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
6 
7 #ifndef GRAPHGEN_IMAGE_FREQUENCIES_H_
8 #define GRAPHGEN_IMAGE_FREQUENCIES_H_
9 
10 #include <filesystem>
11 
12 #include <opencv2/core.hpp>
13 #include <opencv2/imgcodecs.hpp>
14 #include <opencv2/imgproc.hpp>
15 
16 #include "rule_set.h"
17 #include "config_data.h"
18 
19 struct mask {
20  cv::Mat1b mask_;
21  int top_ = 0, bottom_ = 0, left_ = 0, right_ = 0;
22  int border_ = 0;
23  int exp_;
24  int increment_ = 0;
25  const rule_set& rs_;
26 
27  mask(const rule_set& rs);
28  size_t MaskToLinearMask(const cv::Mat1b& r_img) const;
29 };
30 
31 //void CalculateConfigurationsFrequencyOnImage(const cv::Mat1b& img, const mask &msk, rule_set &rs);
32 bool GetBinaryImage(const std::string &FileName, cv::Mat1b& binary);
33 bool LoadFileList(std::vector<std::pair<std::string, bool>>& filenames, const std::string& files_path);
34 //bool CalculateRulesFrequencies(const pixel_set& ps, std::vector<std::pair<std::filesystem::path, bool>>& paths, rule_set& rs);
35 //void CalculateRulesFrequencies(const pixel_set &ps, const std::vector<std::string> &paths, rule_set &rs);
36 bool AddFrequenciesToRuleset(rule_set& rs, bool force = false, bool is_thinning = false);
37 
38 #endif // !GRAPHGEN_IMAGE_FREQUENCIES_H_
bool AddFrequenciesToRuleset(rule_set &rs, bool force=false, bool is_thinning=false)
bool LoadFileList(std::vector< std::pair< std::string, bool >> &filenames, const std::string &files_path)
bool GetBinaryImage(const std::string &FileName, cv::Mat1b &binary)
int increment_
size_t MaskToLinearMask(const cv::Mat1b &r_img) const
mask(const rule_set &rs)
cv::Mat1b mask_
const rule_set & rs_
std::string binary(size_t u, size_t nbits)
Definition: utilities.cpp:11