openCV library for Renesas RZ/A

Dependents:   RZ_A2M_Mbed_samples

Committer:
RyoheiHagimoto
Date:
Fri Jan 29 04:53:38 2021 +0000
Revision:
0:0e0631af0305
copied from https://github.com/d-kato/opencv-lib.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
RyoheiHagimoto 0:0e0631af0305 1 /*M///////////////////////////////////////////////////////////////////////////////////////
RyoheiHagimoto 0:0e0631af0305 2 //
RyoheiHagimoto 0:0e0631af0305 3 // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
RyoheiHagimoto 0:0e0631af0305 4 //
RyoheiHagimoto 0:0e0631af0305 5 // By downloading, copying, installing or using the software you agree to this license.
RyoheiHagimoto 0:0e0631af0305 6 // If you do not agree to this license, do not download, install,
RyoheiHagimoto 0:0e0631af0305 7 // copy or use the software.
RyoheiHagimoto 0:0e0631af0305 8 //
RyoheiHagimoto 0:0e0631af0305 9 //
RyoheiHagimoto 0:0e0631af0305 10 // License Agreement
RyoheiHagimoto 0:0e0631af0305 11 // For Open Source Computer Vision Library
RyoheiHagimoto 0:0e0631af0305 12 //
RyoheiHagimoto 0:0e0631af0305 13 // Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
RyoheiHagimoto 0:0e0631af0305 14 // Copyright (C) 2009, Willow Garage Inc., all rights reserved.
RyoheiHagimoto 0:0e0631af0305 15 // Third party copyrights are property of their respective owners.
RyoheiHagimoto 0:0e0631af0305 16 //
RyoheiHagimoto 0:0e0631af0305 17 // Redistribution and use in source and binary forms, with or without modification,
RyoheiHagimoto 0:0e0631af0305 18 // are permitted provided that the following conditions are met:
RyoheiHagimoto 0:0e0631af0305 19 //
RyoheiHagimoto 0:0e0631af0305 20 // * Redistribution's of source code must retain the above copyright notice,
RyoheiHagimoto 0:0e0631af0305 21 // this list of conditions and the following disclaimer.
RyoheiHagimoto 0:0e0631af0305 22 //
RyoheiHagimoto 0:0e0631af0305 23 // * Redistribution's in binary form must reproduce the above copyright notice,
RyoheiHagimoto 0:0e0631af0305 24 // this list of conditions and the following disclaimer in the documentation
RyoheiHagimoto 0:0e0631af0305 25 // and/or other materials provided with the distribution.
RyoheiHagimoto 0:0e0631af0305 26 //
RyoheiHagimoto 0:0e0631af0305 27 // * The name of the copyright holders may not be used to endorse or promote products
RyoheiHagimoto 0:0e0631af0305 28 // derived from this software without specific prior written permission.
RyoheiHagimoto 0:0e0631af0305 29 //
RyoheiHagimoto 0:0e0631af0305 30 // This software is provided by the copyright holders and contributors "as is" and
RyoheiHagimoto 0:0e0631af0305 31 // any express or implied warranties, including, but not limited to, the implied
RyoheiHagimoto 0:0e0631af0305 32 // warranties of merchantability and fitness for a particular purpose are disclaimed.
RyoheiHagimoto 0:0e0631af0305 33 // In no event shall the Intel Corporation or contributors be liable for any direct,
RyoheiHagimoto 0:0e0631af0305 34 // indirect, incidental, special, exemplary, or consequential damages
RyoheiHagimoto 0:0e0631af0305 35 // (including, but not limited to, procurement of substitute goods or services;
RyoheiHagimoto 0:0e0631af0305 36 // loss of use, data, or profits; or business interruption) however caused
RyoheiHagimoto 0:0e0631af0305 37 // and on any theory of liability, whether in contract, strict liability,
RyoheiHagimoto 0:0e0631af0305 38 // or tort (including negligence or otherwise) arising in any way out of
RyoheiHagimoto 0:0e0631af0305 39 // the use of this software, even if advised of the possibility of such damage.
RyoheiHagimoto 0:0e0631af0305 40 //
RyoheiHagimoto 0:0e0631af0305 41 //M*/
RyoheiHagimoto 0:0e0631af0305 42
RyoheiHagimoto 0:0e0631af0305 43 #ifndef OPENCV_MINIFLANN_HPP
RyoheiHagimoto 0:0e0631af0305 44 #define OPENCV_MINIFLANN_HPP
RyoheiHagimoto 0:0e0631af0305 45
RyoheiHagimoto 0:0e0631af0305 46 #include "opencv2/core.hpp"
RyoheiHagimoto 0:0e0631af0305 47 #include "opencv2/flann/defines.h"
RyoheiHagimoto 0:0e0631af0305 48
RyoheiHagimoto 0:0e0631af0305 49 namespace cv
RyoheiHagimoto 0:0e0631af0305 50 {
RyoheiHagimoto 0:0e0631af0305 51
RyoheiHagimoto 0:0e0631af0305 52 namespace flann
RyoheiHagimoto 0:0e0631af0305 53 {
RyoheiHagimoto 0:0e0631af0305 54
RyoheiHagimoto 0:0e0631af0305 55 struct CV_EXPORTS IndexParams
RyoheiHagimoto 0:0e0631af0305 56 {
RyoheiHagimoto 0:0e0631af0305 57 IndexParams();
RyoheiHagimoto 0:0e0631af0305 58 ~IndexParams();
RyoheiHagimoto 0:0e0631af0305 59
RyoheiHagimoto 0:0e0631af0305 60 String getString(const String& key, const String& defaultVal=String()) const;
RyoheiHagimoto 0:0e0631af0305 61 int getInt(const String& key, int defaultVal=-1) const;
RyoheiHagimoto 0:0e0631af0305 62 double getDouble(const String& key, double defaultVal=-1) const;
RyoheiHagimoto 0:0e0631af0305 63
RyoheiHagimoto 0:0e0631af0305 64 void setString(const String& key, const String& value);
RyoheiHagimoto 0:0e0631af0305 65 void setInt(const String& key, int value);
RyoheiHagimoto 0:0e0631af0305 66 void setDouble(const String& key, double value);
RyoheiHagimoto 0:0e0631af0305 67 void setFloat(const String& key, float value);
RyoheiHagimoto 0:0e0631af0305 68 void setBool(const String& key, bool value);
RyoheiHagimoto 0:0e0631af0305 69 void setAlgorithm(int value);
RyoheiHagimoto 0:0e0631af0305 70
RyoheiHagimoto 0:0e0631af0305 71 void getAll(std::vector<String>& names,
RyoheiHagimoto 0:0e0631af0305 72 std::vector<int>& types,
RyoheiHagimoto 0:0e0631af0305 73 std::vector<String>& strValues,
RyoheiHagimoto 0:0e0631af0305 74 std::vector<double>& numValues) const;
RyoheiHagimoto 0:0e0631af0305 75
RyoheiHagimoto 0:0e0631af0305 76 void* params;
RyoheiHagimoto 0:0e0631af0305 77 };
RyoheiHagimoto 0:0e0631af0305 78
RyoheiHagimoto 0:0e0631af0305 79 struct CV_EXPORTS KDTreeIndexParams : public IndexParams
RyoheiHagimoto 0:0e0631af0305 80 {
RyoheiHagimoto 0:0e0631af0305 81 KDTreeIndexParams(int trees=4);
RyoheiHagimoto 0:0e0631af0305 82 };
RyoheiHagimoto 0:0e0631af0305 83
RyoheiHagimoto 0:0e0631af0305 84 struct CV_EXPORTS LinearIndexParams : public IndexParams
RyoheiHagimoto 0:0e0631af0305 85 {
RyoheiHagimoto 0:0e0631af0305 86 LinearIndexParams();
RyoheiHagimoto 0:0e0631af0305 87 };
RyoheiHagimoto 0:0e0631af0305 88
RyoheiHagimoto 0:0e0631af0305 89 struct CV_EXPORTS CompositeIndexParams : public IndexParams
RyoheiHagimoto 0:0e0631af0305 90 {
RyoheiHagimoto 0:0e0631af0305 91 CompositeIndexParams(int trees = 4, int branching = 32, int iterations = 11,
RyoheiHagimoto 0:0e0631af0305 92 cvflann::flann_centers_init_t centers_init = cvflann::FLANN_CENTERS_RANDOM, float cb_index = 0.2f );
RyoheiHagimoto 0:0e0631af0305 93 };
RyoheiHagimoto 0:0e0631af0305 94
RyoheiHagimoto 0:0e0631af0305 95 struct CV_EXPORTS AutotunedIndexParams : public IndexParams
RyoheiHagimoto 0:0e0631af0305 96 {
RyoheiHagimoto 0:0e0631af0305 97 AutotunedIndexParams(float target_precision = 0.8f, float build_weight = 0.01f,
RyoheiHagimoto 0:0e0631af0305 98 float memory_weight = 0, float sample_fraction = 0.1f);
RyoheiHagimoto 0:0e0631af0305 99 };
RyoheiHagimoto 0:0e0631af0305 100
RyoheiHagimoto 0:0e0631af0305 101 struct CV_EXPORTS HierarchicalClusteringIndexParams : public IndexParams
RyoheiHagimoto 0:0e0631af0305 102 {
RyoheiHagimoto 0:0e0631af0305 103 HierarchicalClusteringIndexParams(int branching = 32,
RyoheiHagimoto 0:0e0631af0305 104 cvflann::flann_centers_init_t centers_init = cvflann::FLANN_CENTERS_RANDOM, int trees = 4, int leaf_size = 100 );
RyoheiHagimoto 0:0e0631af0305 105 };
RyoheiHagimoto 0:0e0631af0305 106
RyoheiHagimoto 0:0e0631af0305 107 struct CV_EXPORTS KMeansIndexParams : public IndexParams
RyoheiHagimoto 0:0e0631af0305 108 {
RyoheiHagimoto 0:0e0631af0305 109 KMeansIndexParams(int branching = 32, int iterations = 11,
RyoheiHagimoto 0:0e0631af0305 110 cvflann::flann_centers_init_t centers_init = cvflann::FLANN_CENTERS_RANDOM, float cb_index = 0.2f );
RyoheiHagimoto 0:0e0631af0305 111 };
RyoheiHagimoto 0:0e0631af0305 112
RyoheiHagimoto 0:0e0631af0305 113 struct CV_EXPORTS LshIndexParams : public IndexParams
RyoheiHagimoto 0:0e0631af0305 114 {
RyoheiHagimoto 0:0e0631af0305 115 LshIndexParams(int table_number, int key_size, int multi_probe_level);
RyoheiHagimoto 0:0e0631af0305 116 };
RyoheiHagimoto 0:0e0631af0305 117
RyoheiHagimoto 0:0e0631af0305 118 struct CV_EXPORTS SavedIndexParams : public IndexParams
RyoheiHagimoto 0:0e0631af0305 119 {
RyoheiHagimoto 0:0e0631af0305 120 SavedIndexParams(const String& filename);
RyoheiHagimoto 0:0e0631af0305 121 };
RyoheiHagimoto 0:0e0631af0305 122
RyoheiHagimoto 0:0e0631af0305 123 struct CV_EXPORTS SearchParams : public IndexParams
RyoheiHagimoto 0:0e0631af0305 124 {
RyoheiHagimoto 0:0e0631af0305 125 SearchParams( int checks = 32, float eps = 0, bool sorted = true );
RyoheiHagimoto 0:0e0631af0305 126 };
RyoheiHagimoto 0:0e0631af0305 127
RyoheiHagimoto 0:0e0631af0305 128 class CV_EXPORTS_W Index
RyoheiHagimoto 0:0e0631af0305 129 {
RyoheiHagimoto 0:0e0631af0305 130 public:
RyoheiHagimoto 0:0e0631af0305 131 CV_WRAP Index();
RyoheiHagimoto 0:0e0631af0305 132 CV_WRAP Index(InputArray features, const IndexParams& params, cvflann::flann_distance_t distType=cvflann::FLANN_DIST_L2);
RyoheiHagimoto 0:0e0631af0305 133 virtual ~Index();
RyoheiHagimoto 0:0e0631af0305 134
RyoheiHagimoto 0:0e0631af0305 135 CV_WRAP virtual void build(InputArray features, const IndexParams& params, cvflann::flann_distance_t distType=cvflann::FLANN_DIST_L2);
RyoheiHagimoto 0:0e0631af0305 136 CV_WRAP virtual void knnSearch(InputArray query, OutputArray indices,
RyoheiHagimoto 0:0e0631af0305 137 OutputArray dists, int knn, const SearchParams& params=SearchParams());
RyoheiHagimoto 0:0e0631af0305 138
RyoheiHagimoto 0:0e0631af0305 139 CV_WRAP virtual int radiusSearch(InputArray query, OutputArray indices,
RyoheiHagimoto 0:0e0631af0305 140 OutputArray dists, double radius, int maxResults,
RyoheiHagimoto 0:0e0631af0305 141 const SearchParams& params=SearchParams());
RyoheiHagimoto 0:0e0631af0305 142
RyoheiHagimoto 0:0e0631af0305 143 CV_WRAP virtual void save(const String& filename) const;
RyoheiHagimoto 0:0e0631af0305 144 CV_WRAP virtual bool load(InputArray features, const String& filename);
RyoheiHagimoto 0:0e0631af0305 145 CV_WRAP virtual void release();
RyoheiHagimoto 0:0e0631af0305 146 CV_WRAP cvflann::flann_distance_t getDistance() const;
RyoheiHagimoto 0:0e0631af0305 147 CV_WRAP cvflann::flann_algorithm_t getAlgorithm() const;
RyoheiHagimoto 0:0e0631af0305 148
RyoheiHagimoto 0:0e0631af0305 149 protected:
RyoheiHagimoto 0:0e0631af0305 150 cvflann::flann_distance_t distType;
RyoheiHagimoto 0:0e0631af0305 151 cvflann::flann_algorithm_t algo;
RyoheiHagimoto 0:0e0631af0305 152 int featureType;
RyoheiHagimoto 0:0e0631af0305 153 void* index;
RyoheiHagimoto 0:0e0631af0305 154 };
RyoheiHagimoto 0:0e0631af0305 155
RyoheiHagimoto 0:0e0631af0305 156 } } // namespace cv::flann
RyoheiHagimoto 0:0e0631af0305 157
RyoheiHagimoto 0:0e0631af0305 158 #endif