├── 3rdparty ├── ncnn │ ├── include │ │ ├── benchmark.h │ │ ├── blob.h │ │ ├── cpu.h │ │ ├── layer.h │ │ ├── layer_type.h │ │ ├── layer_type_enum.h │ │ ├── mat.h │ │ ├── modelbin.h │ │ ├── net.h │ │ ├── opencv.h │ │ ├── paramdict.h │ │ └── platform.h │ └── lib │ │ └── ncnn.lib └── opencv │ ├── bin │ ├── opencv_core2413.dll │ ├── opencv_highgui2413.dll │ └── opencv_imgproc2413.dll │ ├── include │ ├── opencv │ │ ├── cv.h │ │ ├── cv.hpp │ │ ├── cvaux.h │ │ ├── cvaux.hpp │ │ ├── cvwimage.h │ │ ├── cxcore.h │ │ ├── cxcore.hpp │ │ ├── cxeigen.hpp │ │ ├── cxmisc.h │ │ ├── highgui.h │ │ └── ml.h │ └── opencv2 │ │ ├── calib3d.hpp │ │ ├── calib3d │ │ └── calib3d.hpp │ │ ├── contrib │ │ ├── contrib.hpp │ │ ├── detection_based_tracker.hpp │ │ ├── hybridtracker.hpp │ │ ├── openfabmap.hpp │ │ └── retina.hpp │ │ ├── core.hpp │ │ ├── core │ │ ├── affine.hpp │ │ ├── core.hpp │ │ ├── core_c.h │ │ ├── cuda_devptrs.hpp │ │ ├── devmem2d.hpp │ │ ├── eigen.hpp │ │ ├── gpumat.hpp │ │ ├── internal.hpp │ │ ├── mat.hpp │ │ ├── opengl_interop.hpp │ │ ├── opengl_interop_deprecated.hpp │ │ ├── operations.hpp │ │ ├── types_c.h │ │ ├── version.hpp │ │ └── wimage.hpp │ │ ├── features2d.hpp │ │ ├── features2d │ │ └── features2d.hpp │ │ ├── flann.hpp │ │ ├── flann │ │ ├── all_indices.h │ │ ├── allocator.h │ │ ├── any.h │ │ ├── autotuned_index.h │ │ ├── composite_index.h │ │ ├── config.h │ │ ├── defines.h │ │ ├── dist.h │ │ ├── dummy.h │ │ ├── dynamic_bitset.h │ │ ├── flann.hpp │ │ ├── flann_base.hpp │ │ ├── general.h │ │ ├── ground_truth.h │ │ ├── hdf5.h │ │ ├── heap.h │ │ ├── hierarchical_clustering_index.h │ │ ├── index_testing.h │ │ ├── kdtree_index.h │ │ ├── kdtree_single_index.h │ │ ├── kmeans_index.h │ │ ├── linear_index.h │ │ ├── logger.h │ │ ├── lsh_index.h │ │ ├── lsh_table.h │ │ ├── matrix.h │ │ ├── miniflann.hpp │ │ ├── nn_index.h │ │ ├── object_factory.h │ │ ├── params.h │ │ ├── random.h │ │ ├── result_set.h │ │ ├── sampling.h │ │ ├── saving.h │ │ ├── simplex_downhill.h │ │ └── timer.h │ │ ├── gpu │ │ ├── device │ │ │ ├── block.hpp │ │ │ ├── border_interpolate.hpp │ │ │ ├── color.hpp │ │ │ ├── common.hpp │ │ │ ├── datamov_utils.hpp │ │ │ ├── detail │ │ │ │ ├── color_detail.hpp │ │ │ │ ├── reduce.hpp │ │ │ │ ├── reduce_key_val.hpp │ │ │ │ ├── transform_detail.hpp │ │ │ │ ├── type_traits_detail.hpp │ │ │ │ └── vec_distance_detail.hpp │ │ │ ├── dynamic_smem.hpp │ │ │ ├── emulation.hpp │ │ │ ├── filters.hpp │ │ │ ├── funcattrib.hpp │ │ │ ├── functional.hpp │ │ │ ├── limits.hpp │ │ │ ├── reduce.hpp │ │ │ ├── saturate_cast.hpp │ │ │ ├── scan.hpp │ │ │ ├── simd_functions.hpp │ │ │ ├── static_check.hpp │ │ │ ├── transform.hpp │ │ │ ├── type_traits.hpp │ │ │ ├── utility.hpp │ │ │ ├── vec_distance.hpp │ │ │ ├── vec_math.hpp │ │ │ ├── vec_traits.hpp │ │ │ ├── warp.hpp │ │ │ ├── warp_reduce.hpp │ │ │ └── warp_shuffle.hpp │ │ ├── devmem2d.hpp │ │ ├── gpu.hpp │ │ ├── gpumat.hpp │ │ └── stream_accessor.hpp │ │ ├── highgui.hpp │ │ ├── highgui │ │ ├── cap_ios.h │ │ ├── highgui.hpp │ │ ├── highgui_c.h │ │ └── ios.h │ │ ├── imgproc.hpp │ │ ├── imgproc │ │ ├── imgproc.hpp │ │ ├── imgproc_c.h │ │ └── types_c.h │ │ ├── legacy │ │ ├── blobtrack.hpp │ │ ├── compat.hpp │ │ ├── legacy.hpp │ │ └── streams.hpp │ │ ├── ml.hpp │ │ ├── ml │ │ └── ml.hpp │ │ ├── nonfree │ │ ├── features2d.hpp │ │ ├── gpu.hpp │ │ ├── nonfree.hpp │ │ └── ocl.hpp │ │ ├── objdetect.hpp │ │ ├── objdetect │ │ └── objdetect.hpp │ │ ├── ocl │ │ ├── matrix_operations.hpp │ │ └── ocl.hpp │ │ ├── opencv.hpp │ │ ├── opencv_modules.hpp │ │ ├── photo.hpp │ │ ├── photo │ │ ├── photo.hpp │ │ └── photo_c.h │ │ ├── stitching.hpp │ │ ├── stitching │ │ ├── detail │ │ │ ├── autocalib.hpp │ │ │ ├── blenders.hpp │ │ │ ├── camera.hpp │ │ │ ├── exposure_compensate.hpp │ │ │ ├── matchers.hpp │ │ │ ├── motion_estimators.hpp │ │ │ ├── seam_finders.hpp │ │ │ ├── util.hpp │ │ │ ├── util_inl.hpp │ │ │ ├── warpers.hpp │ │ │ └── warpers_inl.hpp │ │ ├── stitcher.hpp │ │ └── warpers.hpp │ │ ├── superres.hpp │ │ ├── superres │ │ ├── optical_flow.hpp │ │ └── superres.hpp │ │ ├── ts.hpp │ │ ├── ts │ │ ├── gpu_perf.hpp │ │ ├── gpu_test.hpp │ │ ├── ts.hpp │ │ ├── ts_gtest.h │ │ └── ts_perf.hpp │ │ ├── video.hpp │ │ ├── video │ │ ├── background_segm.hpp │ │ ├── tracking.hpp │ │ └── video.hpp │ │ ├── videostab.hpp │ │ └── videostab │ │ ├── deblurring.hpp │ │ ├── fast_marching.hpp │ │ ├── fast_marching_inl.hpp │ │ ├── frame_source.hpp │ │ ├── global_motion.hpp │ │ ├── inpainting.hpp │ │ ├── log.hpp │ │ ├── motion_stabilizing.hpp │ │ ├── optical_flow.hpp │ │ ├── stabilizer.hpp │ │ └── videostab.hpp │ └── lib │ ├── opencv_core2413.lib │ ├── opencv_highgui2413.lib │ └── opencv_imgproc2413.lib ├── CMakeLists.txt ├── README.md ├── models ├── mobilefacenet.bin └── mobilefacenet.param ├── pic ├── Aaron_Peirsol_0003.jpg ├── Aaron_Peirsol_0004.jpg └── Aaron_Tippin_0001.jpg ├── src ├── main.cpp ├── mobilefacenet.cpp └── mobilefacenet.h └── tools └── build.bat /3rdparty/ncnn/include/benchmark.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making ncnn available. 2 | // 3 | // Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. 4 | // 5 | // Licensed under the BSD 3-Clause License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // https://opensource.org/licenses/BSD-3-Clause 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef NCNN_BENCHMARK_H 16 | #define NCNN_BENCHMARK_H 17 | 18 | #include "platform.h" 19 | #include "mat.h" 20 | #include "layer.h" 21 | 22 | namespace ncnn { 23 | 24 | // get now timestamp in ms 25 | double get_current_time(); 26 | 27 | #if NCNN_BENCHMARK 28 | 29 | void benchmark(const Layer* layer, double start, double end); 30 | void benchmark(const Layer* layer, const Mat& bottom_blob, Mat& top_blob, double start, double end); 31 | 32 | #endif // NCNN_BENCHMARK 33 | 34 | } // namespace ncnn 35 | 36 | #endif // NCNN_BENCHMARK_H 37 | -------------------------------------------------------------------------------- /3rdparty/ncnn/include/blob.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making ncnn available. 2 | // 3 | // Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. 4 | // 5 | // Licensed under the BSD 3-Clause License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // https://opensource.org/licenses/BSD-3-Clause 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef NCNN_BLOB_H 16 | #define NCNN_BLOB_H 17 | 18 | #include 19 | #include 20 | #include "platform.h" 21 | 22 | namespace ncnn { 23 | 24 | class Blob 25 | { 26 | public: 27 | // empty 28 | Blob(); 29 | 30 | public: 31 | #if NCNN_STRING 32 | // blob name 33 | std::string name; 34 | #endif // NCNN_STRING 35 | // layer index which produce this blob as output 36 | int producer; 37 | // layer index which need this blob as input 38 | std::vector consumers; 39 | }; 40 | 41 | } // namespace ncnn 42 | 43 | #endif // NCNN_BLOB_H 44 | -------------------------------------------------------------------------------- /3rdparty/ncnn/include/cpu.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making ncnn available. 2 | // 3 | // Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. 4 | // 5 | // Licensed under the BSD 3-Clause License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // https://opensource.org/licenses/BSD-3-Clause 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef NCNN_CPU_H 16 | #define NCNN_CPU_H 17 | 18 | namespace ncnn { 19 | 20 | // test optional cpu features 21 | // neon = armv7 neon or aarch64 asimd 22 | int cpu_support_arm_neon(); 23 | // vfpv4 = armv7 fp16 + fma 24 | int cpu_support_arm_vfpv4(); 25 | // asimdhp = aarch64 asimd half precision 26 | int cpu_support_arm_asimdhp(); 27 | 28 | // cpu info 29 | int get_cpu_count(); 30 | 31 | // bind all threads on little clusters if powersave enabled 32 | // affacts HMP arch cpu like ARM big.LITTLE 33 | // only implemented on android at the moment 34 | // switching powersave is expensive and not thread-safe 35 | // 0 = all cores enabled(default) 36 | // 1 = only little clusters enabled 37 | // 2 = only big clusters enabled 38 | // return 0 if success for setter function 39 | int get_cpu_powersave(); 40 | int set_cpu_powersave(int powersave); 41 | 42 | // misc function wrapper for openmp routines 43 | int get_omp_num_threads(); 44 | void set_omp_num_threads(int num_threads); 45 | 46 | int get_omp_dynamic(); 47 | void set_omp_dynamic(int dynamic); 48 | 49 | } // namespace ncnn 50 | 51 | #endif // NCNN_CPU_H 52 | -------------------------------------------------------------------------------- /3rdparty/ncnn/include/layer.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making ncnn available. 2 | // 3 | // Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. 4 | // 5 | // Licensed under the BSD 3-Clause License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // https://opensource.org/licenses/BSD-3-Clause 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef NCNN_LAYER_H 16 | #define NCNN_LAYER_H 17 | 18 | #include 19 | #include 20 | #include 21 | #include "mat.h" 22 | #include "modelbin.h" 23 | #include "paramdict.h" 24 | #include "platform.h" 25 | 26 | namespace ncnn { 27 | 28 | class Layer 29 | { 30 | public: 31 | // empty 32 | Layer(); 33 | // virtual destructor 34 | virtual ~Layer(); 35 | 36 | // load layer specific parameter from parsed dict 37 | // return 0 if success 38 | virtual int load_param(const ParamDict& pd); 39 | 40 | // load layer specific weight data from model binary 41 | // return 0 if success 42 | virtual int load_model(const ModelBin& mb); 43 | 44 | public: 45 | // one input and one output blob 46 | bool one_blob_only; 47 | 48 | // support inplace inference 49 | bool support_inplace; 50 | 51 | public: 52 | // implement inference 53 | // return 0 if success 54 | virtual int forward(const std::vector& bottom_blobs, std::vector& top_blobs) const; 55 | virtual int forward(const Mat& bottom_blob, Mat& top_blob) const; 56 | 57 | // implement inplace inference 58 | // return 0 if success 59 | virtual int forward_inplace(std::vector& bottom_top_blobs) const; 60 | virtual int forward_inplace(Mat& bottom_top_blob) const; 61 | 62 | public: 63 | #if NCNN_STRING 64 | // layer type name 65 | std::string type; 66 | // layer name 67 | std::string name; 68 | #endif // NCNN_STRING 69 | // blob index which this layer needs as input 70 | std::vector bottoms; 71 | // blob index which this layer produces as output 72 | std::vector tops; 73 | }; 74 | 75 | // layer factory function 76 | typedef Layer* (*layer_creator_func)(); 77 | 78 | struct layer_registry_entry 79 | { 80 | #if NCNN_STRING 81 | // layer type name 82 | const char* name; 83 | #endif // NCNN_STRING 84 | // layer factory entry 85 | layer_creator_func creator; 86 | }; 87 | 88 | #if NCNN_STRING 89 | // get layer type from type name 90 | int layer_to_index(const char* type); 91 | // create layer from type name 92 | Layer* create_layer(const char* type); 93 | #endif // NCNN_STRING 94 | // create layer from layer type 95 | Layer* create_layer(int index); 96 | 97 | #define DEFINE_LAYER_CREATOR(name) \ 98 | ::ncnn::Layer* name##_layer_creator() { return new name; } 99 | 100 | } // namespace ncnn 101 | 102 | #endif // NCNN_LAYER_H 103 | -------------------------------------------------------------------------------- /3rdparty/ncnn/include/layer_type.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making ncnn available. 2 | // 3 | // Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. 4 | // 5 | // Licensed under the BSD 3-Clause License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // https://opensource.org/licenses/BSD-3-Clause 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef NCNN_LAYER_TYPE_H 16 | #define NCNN_LAYER_TYPE_H 17 | 18 | namespace ncnn { 19 | 20 | namespace LayerType { 21 | enum 22 | { 23 | #include "layer_type_enum.h" 24 | CustomBit = (1<<8), 25 | }; 26 | } // namespace LayerType 27 | 28 | } // namespace ncnn 29 | 30 | #endif // NCNN_LAYER_TYPE_H 31 | -------------------------------------------------------------------------------- /3rdparty/ncnn/include/layer_type_enum.h: -------------------------------------------------------------------------------- 1 | AbsVal = 0, 2 | ArgMax = 1, 3 | BatchNorm = 2, 4 | Bias = 3, 5 | BNLL = 4, 6 | Concat = 5, 7 | Convolution = 6, 8 | Crop = 7, 9 | Deconvolution = 8, 10 | Dropout = 9, 11 | Eltwise = 10, 12 | ELU = 11, 13 | Embed = 12, 14 | Exp = 13, 15 | Flatten = 14, 16 | InnerProduct = 15, 17 | Input = 16, 18 | Log = 17, 19 | LRN = 18, 20 | MemoryData = 19, 21 | MVN = 20, 22 | Pooling = 21, 23 | Power = 22, 24 | PReLU = 23, 25 | Proposal = 24, 26 | Reduction = 25, 27 | ReLU = 26, 28 | Reshape = 27, 29 | ROIPooling = 28, 30 | Scale = 29, 31 | Sigmoid = 30, 32 | Slice = 31, 33 | Softmax = 32, 34 | Split = 33, 35 | SPP = 34, 36 | TanH = 35, 37 | Threshold = 36, 38 | Tile = 37, 39 | RNN = 38, 40 | LSTM = 39, 41 | BinaryOp = 40, 42 | UnaryOp = 41, 43 | ConvolutionDepthWise = 42, 44 | Padding = 43, 45 | Squeeze = 44, 46 | ExpandDims = 45, 47 | Normalize = 46, 48 | Permute = 47, 49 | PriorBox = 48, 50 | DetectionOutput = 49, 51 | Interp = 50, 52 | DeconvolutionDepthWise = 51, 53 | ShuffleChannel = 52, 54 | InstanceNorm = 53, 55 | Clip = 54, 56 | -------------------------------------------------------------------------------- /3rdparty/ncnn/include/modelbin.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making ncnn available. 2 | // 3 | // Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. 4 | // 5 | // Licensed under the BSD 3-Clause License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // https://opensource.org/licenses/BSD-3-Clause 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef NCNN_MODELBIN_H 16 | #define NCNN_MODELBIN_H 17 | 18 | #include 19 | #include "mat.h" 20 | #include "platform.h" 21 | 22 | namespace ncnn { 23 | 24 | class Net; 25 | class ModelBin 26 | { 27 | public: 28 | // element type 29 | // 0 = auto 30 | // 1 = float32 31 | // 2 = float16 32 | // 3 = uint8 33 | // load vec 34 | virtual Mat load(int w, int type) const = 0; 35 | // load image 36 | virtual Mat load(int w, int h, int type) const; 37 | // load dim 38 | virtual Mat load(int w, int h, int c, int type) const; 39 | }; 40 | 41 | #if NCNN_STDIO 42 | class ModelBinFromStdio : public ModelBin 43 | { 44 | public: 45 | // construct from file 46 | ModelBinFromStdio(FILE* binfp); 47 | 48 | virtual Mat load(int w, int type) const; 49 | 50 | protected: 51 | FILE* binfp; 52 | }; 53 | #endif // NCNN_STDIO 54 | 55 | class ModelBinFromMemory : public ModelBin 56 | { 57 | public: 58 | // construct from external memory 59 | ModelBinFromMemory(const unsigned char*& mem); 60 | 61 | virtual Mat load(int w, int type) const; 62 | 63 | protected: 64 | const unsigned char*& mem; 65 | }; 66 | 67 | class ModelBinFromMatArray : public ModelBin 68 | { 69 | public: 70 | // construct from weight blob array 71 | ModelBinFromMatArray(const Mat* weights); 72 | 73 | virtual Mat load(int w, int type) const; 74 | 75 | protected: 76 | mutable const Mat* weights; 77 | }; 78 | 79 | } // namespace ncnn 80 | 81 | #endif // NCNN_MODELBIN_H 82 | -------------------------------------------------------------------------------- /3rdparty/ncnn/include/paramdict.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making ncnn available. 2 | // 3 | // Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. 4 | // 5 | // Licensed under the BSD 3-Clause License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // https://opensource.org/licenses/BSD-3-Clause 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef NCNN_PARAMDICT_H 16 | #define NCNN_PARAMDICT_H 17 | 18 | #include 19 | #include "mat.h" 20 | #include "platform.h" 21 | 22 | // at most 20 parameters 23 | #define NCNN_MAX_PARAM_COUNT 20 24 | 25 | namespace ncnn { 26 | 27 | class Net; 28 | class ParamDict 29 | { 30 | public: 31 | // empty 32 | ParamDict(); 33 | 34 | // get int 35 | int get(int id, int def) const; 36 | // get float 37 | float get(int id, float def) const; 38 | // get array 39 | Mat get(int id, const Mat& def) const; 40 | 41 | // set int 42 | void set(int id, int i); 43 | // set float 44 | void set(int id, float f); 45 | // set array 46 | void set(int id, const Mat& v); 47 | 48 | protected: 49 | friend class Net; 50 | 51 | void clear(); 52 | 53 | #if NCNN_STDIO 54 | #if NCNN_STRING 55 | int load_param(FILE* fp); 56 | #endif // NCNN_STRING 57 | int load_param_bin(FILE* fp); 58 | #endif // NCNN_STDIO 59 | int load_param(const unsigned char*& mem); 60 | 61 | protected: 62 | struct 63 | { 64 | int loaded; 65 | union { int i; float f; }; 66 | Mat v; 67 | } params[NCNN_MAX_PARAM_COUNT]; 68 | }; 69 | 70 | } // namespace ncnn 71 | 72 | #endif // NCNN_PARAMDICT_H 73 | -------------------------------------------------------------------------------- /3rdparty/ncnn/include/platform.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making ncnn available. 2 | // 3 | // Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. 4 | // 5 | // Licensed under the BSD 3-Clause License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // https://opensource.org/licenses/BSD-3-Clause 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef NCNN_PLATFORM_H 16 | #define NCNN_PLATFORM_H 17 | 18 | #define NCNN_STDIO 1 19 | #define NCNN_STRING 1 20 | #define NCNN_OPENCV 0 21 | #define NCNN_BENCHMARK 0 22 | 23 | #endif // NCNN_PLATFORM_H 24 | -------------------------------------------------------------------------------- /3rdparty/ncnn/lib/ncnn.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GRAYKEY/mobilefacenet_ncnn/996c20b4156886dce318e84dbb5430de0c727788/3rdparty/ncnn/lib/ncnn.lib -------------------------------------------------------------------------------- /3rdparty/opencv/bin/opencv_core2413.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GRAYKEY/mobilefacenet_ncnn/996c20b4156886dce318e84dbb5430de0c727788/3rdparty/opencv/bin/opencv_core2413.dll -------------------------------------------------------------------------------- /3rdparty/opencv/bin/opencv_highgui2413.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GRAYKEY/mobilefacenet_ncnn/996c20b4156886dce318e84dbb5430de0c727788/3rdparty/opencv/bin/opencv_highgui2413.dll -------------------------------------------------------------------------------- /3rdparty/opencv/bin/opencv_imgproc2413.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GRAYKEY/mobilefacenet_ncnn/996c20b4156886dce318e84dbb5430de0c727788/3rdparty/opencv/bin/opencv_imgproc2413.dll -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv/cv.h: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_OLD_CV_H__ 44 | #define __OPENCV_OLD_CV_H__ 45 | 46 | #if defined(_MSC_VER) 47 | #define CV_DO_PRAGMA(x) __pragma(x) 48 | #define __CVSTR2__(x) #x 49 | #define __CVSTR1__(x) __CVSTR2__(x) 50 | #define __CVMSVCLOC__ __FILE__ "("__CVSTR1__(__LINE__)") : " 51 | #define CV_MSG_PRAGMA(_msg) CV_DO_PRAGMA(message (__CVMSVCLOC__ _msg)) 52 | #elif defined(__GNUC__) 53 | #define CV_DO_PRAGMA(x) _Pragma (#x) 54 | #define CV_MSG_PRAGMA(_msg) CV_DO_PRAGMA(message (_msg)) 55 | #else 56 | #define CV_DO_PRAGMA(x) 57 | #define CV_MSG_PRAGMA(_msg) 58 | #endif 59 | #define CV_WARNING(x) CV_MSG_PRAGMA("Warning: " #x) 60 | 61 | //CV_WARNING("This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module") 62 | 63 | #include "opencv2/core/core_c.h" 64 | #include "opencv2/core/core.hpp" 65 | #include "opencv2/imgproc/imgproc_c.h" 66 | #include "opencv2/imgproc/imgproc.hpp" 67 | #include "opencv2/video/tracking.hpp" 68 | #include "opencv2/features2d/features2d.hpp" 69 | #include "opencv2/flann/flann.hpp" 70 | #include "opencv2/calib3d/calib3d.hpp" 71 | #include "opencv2/objdetect/objdetect.hpp" 72 | #include "opencv2/legacy/compat.hpp" 73 | 74 | #if !defined(CV_IMPL) 75 | #define CV_IMPL extern "C" 76 | #endif //CV_IMPL 77 | 78 | #if defined(__cplusplus) 79 | #include "opencv2/core/internal.hpp" 80 | #endif //__cplusplus 81 | 82 | #endif // __OPENCV_OLD_CV_H_ 83 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv/cv.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_OLD_CV_HPP__ 44 | #define __OPENCV_OLD_CV_HPP__ 45 | 46 | //#if defined(__GNUC__) 47 | //#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module" 48 | //#endif 49 | 50 | #include 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv/cvaux.h: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // Intel License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000, Intel Corporation, all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of Intel Corporation may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the Intel Corporation or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | #ifndef __OPENCV_OLD_AUX_H__ 43 | #define __OPENCV_OLD_AUX_H__ 44 | 45 | //#if defined(__GNUC__) 46 | //#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module" 47 | //#endif 48 | 49 | #include "opencv2/core/core_c.h" 50 | #include "opencv2/core/core.hpp" 51 | #include "opencv2/imgproc/imgproc_c.h" 52 | #include "opencv2/imgproc/imgproc.hpp" 53 | #include "opencv2/video/tracking.hpp" 54 | #include "opencv2/video/background_segm.hpp" 55 | #include "opencv2/features2d/features2d.hpp" 56 | #include "opencv2/calib3d/calib3d.hpp" 57 | #include "opencv2/objdetect/objdetect.hpp" 58 | #include "opencv2/legacy/legacy.hpp" 59 | #include "opencv2/legacy/compat.hpp" 60 | #include "opencv2/legacy/blobtrack.hpp" 61 | #include "opencv2/contrib/contrib.hpp" 62 | 63 | #endif 64 | 65 | /* End of file. */ 66 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv/cvaux.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // Intel License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000, Intel Corporation, all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of Intel Corporation may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the Intel Corporation or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | #ifndef __OPENCV_OLD_AUX_HPP__ 43 | #define __OPENCV_OLD_AUX_HPP__ 44 | 45 | //#if defined(__GNUC__) 46 | //#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module" 47 | //#endif 48 | 49 | #include 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv/cvwimage.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 3 | // 4 | // By downloading, copying, installing or using the software you agree to 5 | // this license. If you do not agree to this license, do not download, 6 | // install, copy or use the software. 7 | // 8 | // License Agreement 9 | // For Open Source Computer Vision Library 10 | // 11 | // Copyright (C) 2008, Google, all rights reserved. 12 | // Third party copyrights are property of their respective owners. 13 | // 14 | // Redistribution and use in source and binary forms, with or without 15 | // modification, are permitted provided that the following conditions are met: 16 | // 17 | // * Redistribution's of source code must retain the above copyright notice, 18 | // this list of conditions and the following disclaimer. 19 | // 20 | // * Redistribution's in binary form must reproduce the above copyright notice, 21 | // this list of conditions and the following disclaimer in the documentation 22 | // and/or other materials provided with the distribution. 23 | // 24 | // * The name of Intel Corporation or contributors may not be used to endorse 25 | // or promote products derived from this software without specific 26 | // prior written permission. 27 | // 28 | // This software is provided by the copyright holders and contributors "as is" 29 | // and any express or implied warranties, including, but not limited to, the 30 | // implied warranties of merchantability and fitness for a particular purpose 31 | // are disclaimed. In no event shall the Intel Corporation or contributors be 32 | // liable for any direct, indirect, incidental, special, exemplary, or 33 | // consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | 40 | 41 | #ifndef __OPENCV_OLD_WIMAGE_HPP__ 42 | #define __OPENCV_OLD_WIMAGE_HPP__ 43 | 44 | #include "opencv2/core/wimage.hpp" 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv/cxcore.h: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_OLD_CXCORE_H__ 44 | #define __OPENCV_OLD_CXCORE_H__ 45 | 46 | //#if defined(__GNUC__) 47 | //#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module" 48 | //#endif 49 | 50 | #include "opencv2/core/core_c.h" 51 | #include "opencv2/core/core.hpp" 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv/cxcore.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_OLD_CXCORE_HPP__ 44 | #define __OPENCV_OLD_CXCORE_HPP__ 45 | 46 | //#if defined(__GNUC__) 47 | //#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module" 48 | //#endif 49 | 50 | #include 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv/cxeigen.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_OLD_EIGEN_HPP__ 44 | #define __OPENCV_OLD_EIGEN_HPP__ 45 | 46 | #include "opencv2/core/eigen.hpp" 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv/cxmisc.h: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | * // 3 | * // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | * // 5 | * // By downloading, copying, installing or using the software you agree to this license. 6 | * // If you do not agree to this license, do not download, install, 7 | * // copy or use the software. 8 | * // 9 | * // 10 | * // License Agreement 11 | * // For Open Source Computer Vision Library 12 | * // 13 | * // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | * // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | * // Third party copyrights are property of their respective owners. 16 | * // 17 | * // Redistribution and use in source and binary forms, with or without modification, 18 | * // are permitted provided that the following conditions are met: 19 | * // 20 | * // * Redistribution's of source code must retain the above copyright notice, 21 | * // this list of conditions and the following disclaimer. 22 | * // 23 | * // * Redistribution's in binary form must reproduce the above copyright notice, 24 | * // this list of conditions and the following disclaimer in the documentation 25 | * // and/or other materials provided with the distribution. 26 | * // 27 | * // * The name of the copyright holders may not be used to endorse or promote products 28 | * // derived from this software without specific prior written permission. 29 | * // 30 | * // This software is provided by the copyright holders and contributors "as is" and 31 | * // any express or implied warranties, including, but not limited to, the implied 32 | * // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | * // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | * // indirect, incidental, special, exemplary, or consequential damages 35 | * // (including, but not limited to, procurement of substitute goods or services; 36 | * // loss of use, data, or profits; or business interruption) however caused 37 | * // and on any theory of liability, whether in contract, strict liability, 38 | * // or tort (including negligence or otherwise) arising in any way out of 39 | * // the use of this software, even if advised of the possibility of such damage. 40 | * // 41 | * //M*/ 42 | 43 | #ifndef __OPENCV_OLD_CXMISC_H__ 44 | #define __OPENCV_OLD_CXMISC_H__ 45 | 46 | #include "opencv2/core/internal.hpp" 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv/highgui.h: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // Intel License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000, Intel Corporation, all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of Intel Corporation may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the Intel Corporation or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | #ifndef __OPENCV_OLD_HIGHGUI_H__ 43 | #define __OPENCV_OLD_HIGHGUI_H__ 44 | 45 | #include "opencv2/core/core_c.h" 46 | #include "opencv2/core/core.hpp" 47 | #include "opencv2/highgui/highgui_c.h" 48 | #include "opencv2/highgui/highgui.hpp" 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv/ml.h: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // Intel License Agreement 11 | // 12 | // Copyright (C) 2000, Intel Corporation, all rights reserved. 13 | // Third party copyrights are property of their respective owners. 14 | // 15 | // Redistribution and use in source and binary forms, with or without modification, 16 | // are permitted provided that the following conditions are met: 17 | // 18 | // * Redistribution's of source code must retain the above copyright notice, 19 | // this list of conditions and the following disclaimer. 20 | // 21 | // * Redistribution's in binary form must reproduce the above copyright notice, 22 | // this list of conditions and the following disclaimer in the documentation 23 | // and/or other materials provided with the distribution. 24 | // 25 | // * The name of Intel Corporation may not be used to endorse or promote products 26 | // derived from this software without specific prior written permission. 27 | // 28 | // This software is provided by the copyright holders and contributors "as is" and 29 | // any express or implied warranties, including, but not limited to, the implied 30 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 31 | // In no event shall the Intel Corporation or contributors be liable for any direct, 32 | // indirect, incidental, special, exemplary, or consequential damages 33 | // (including, but not limited to, procurement of substitute goods or services; 34 | // loss of use, data, or profits; or business interruption) however caused 35 | // and on any theory of liability, whether in contract, strict liability, 36 | // or tort (including negligence or otherwise) arising in any way out of 37 | // the use of this software, even if advised of the possibility of such damage. 38 | // 39 | //M*/ 40 | 41 | #ifndef __OPENCV_OLD_ML_H__ 42 | #define __OPENCV_OLD_ML_H__ 43 | 44 | #include "opencv2/core/core_c.h" 45 | #include "opencv2/core/core.hpp" 46 | #include "opencv2/ml/ml.hpp" 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/calib3d.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #include "opencv2/calib3d/calib3d.hpp" 44 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/contrib/detection_based_tracker.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if defined(__linux__) || defined(LINUX) || defined(__APPLE__) || defined(ANDROID) 4 | 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | class DetectionBasedTracker 11 | { 12 | public: 13 | struct Parameters 14 | { 15 | int minObjectSize; 16 | int maxObjectSize; 17 | double scaleFactor; 18 | int maxTrackLifetime; 19 | int minNeighbors; 20 | int minDetectionPeriod; //the minimal time between run of the big object detector (on the whole frame) in ms (1000 mean 1 sec), default=0 21 | 22 | Parameters(); 23 | }; 24 | 25 | DetectionBasedTracker(const std::string& cascadeFilename, const Parameters& params); 26 | virtual ~DetectionBasedTracker(); 27 | 28 | virtual bool run(); 29 | virtual void stop(); 30 | virtual void resetTracking(); 31 | 32 | virtual void process(const cv::Mat& imageGray); 33 | 34 | bool setParameters(const Parameters& params); 35 | const Parameters& getParameters(); 36 | 37 | 38 | typedef std::pair Object; 39 | virtual void getObjects(std::vector& result) const; 40 | virtual void getObjects(std::vector& result) const; 41 | 42 | protected: 43 | class SeparateDetectionWork; 44 | cv::Ptr separateDetectionWork; 45 | friend void* workcycleObjectDetectorFunction(void* p); 46 | 47 | 48 | struct InnerParameters 49 | { 50 | int numLastPositionsToTrack; 51 | int numStepsToWaitBeforeFirstShow; 52 | int numStepsToTrackWithoutDetectingIfObjectHasNotBeenShown; 53 | int numStepsToShowWithoutDetecting; 54 | 55 | float coeffTrackingWindowSize; 56 | float coeffObjectSizeToTrack; 57 | float coeffObjectSpeedUsingInPrediction; 58 | 59 | InnerParameters(); 60 | }; 61 | Parameters parameters; 62 | InnerParameters innerParameters; 63 | 64 | struct TrackedObject 65 | { 66 | typedef std::vector PositionsVector; 67 | 68 | PositionsVector lastPositions; 69 | 70 | int numDetectedFrames; 71 | int numFramesNotDetected; 72 | int id; 73 | 74 | TrackedObject(const cv::Rect& rect):numDetectedFrames(1), numFramesNotDetected(0) 75 | { 76 | lastPositions.push_back(rect); 77 | id=getNextId(); 78 | }; 79 | 80 | static int getNextId() 81 | { 82 | static int _id=0; 83 | return _id++; 84 | } 85 | }; 86 | 87 | int numTrackedSteps; 88 | std::vector trackedObjects; 89 | 90 | std::vector weightsPositionsSmoothing; 91 | std::vector weightsSizesSmoothing; 92 | 93 | cv::CascadeClassifier cascadeForTracking; 94 | 95 | 96 | void updateTrackedObjects(const std::vector& detectedObjects); 97 | cv::Rect calcTrackedObjectPositionToShow(int i) const; 98 | void detectInRegion(const cv::Mat& img, const cv::Rect& r, std::vector& detectedObjectsInRegions); 99 | }; 100 | 101 | namespace cv 102 | { 103 | using ::DetectionBasedTracker; 104 | } //end of cv namespace 105 | 106 | #endif 107 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/core.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #include "opencv2/core/core.hpp" 44 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/core/devmem2d.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #include "opencv2/core/cuda_devptrs.hpp" 44 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/core/version.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // Intel License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright( C) 2000, Intel Corporation, all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of Intel Corporation may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the Intel Corporation or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | //(including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort(including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | /* 43 | definition of the current version of OpenCV 44 | Usefull to test in user programs 45 | */ 46 | 47 | #ifndef __OPENCV_VERSION_HPP__ 48 | #define __OPENCV_VERSION_HPP__ 49 | 50 | #define CV_VERSION_EPOCH 2 51 | #define CV_VERSION_MAJOR 4 52 | #define CV_VERSION_MINOR 13 53 | #define CV_VERSION_REVISION 3 54 | 55 | #define CVAUX_STR_EXP(__A) #__A 56 | #define CVAUX_STR(__A) CVAUX_STR_EXP(__A) 57 | 58 | #define CVAUX_STRW_EXP(__A) L ## #__A 59 | #define CVAUX_STRW(__A) CVAUX_STRW_EXP(__A) 60 | 61 | #if CV_VERSION_REVISION 62 | # define CV_VERSION CVAUX_STR(CV_VERSION_EPOCH) "." CVAUX_STR(CV_VERSION_MAJOR) "." CVAUX_STR(CV_VERSION_MINOR) "." CVAUX_STR(CV_VERSION_REVISION) 63 | #else 64 | # define CV_VERSION CVAUX_STR(CV_VERSION_EPOCH) "." CVAUX_STR(CV_VERSION_MAJOR) "." CVAUX_STR(CV_VERSION_MINOR) 65 | #endif 66 | 67 | /* old style version constants*/ 68 | #define CV_MAJOR_VERSION CV_VERSION_EPOCH 69 | #define CV_MINOR_VERSION CV_VERSION_MAJOR 70 | #define CV_SUBMINOR_VERSION CV_VERSION_MINOR 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/features2d.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #include "opencv2/features2d/features2d.hpp" 44 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/flann.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #include "opencv2/flann/flann.hpp" 44 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/flann/config.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2011 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2011 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | *************************************************************************/ 28 | 29 | 30 | #ifndef OPENCV_FLANN_CONFIG_H_ 31 | #define OPENCV_FLANN_CONFIG_H_ 32 | 33 | #ifdef FLANN_VERSION_ 34 | #undef FLANN_VERSION_ 35 | #endif 36 | #define FLANN_VERSION_ "1.6.10" 37 | 38 | #endif /* OPENCV_FLANN_CONFIG_H_ */ 39 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/flann/dummy.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef OPENCV_FLANN_DUMMY_H_ 32 | #define OPENCV_FLANN_DUMMY_H_ 33 | 34 | namespace cvflann 35 | { 36 | 37 | #if (defined WIN32 || defined _WIN32 || defined WINCE) && defined CVAPI_EXPORTS 38 | __declspec(dllexport) 39 | #endif 40 | void dummyfunc(); 41 | 42 | } 43 | 44 | 45 | #endif /* OPENCV_FLANN_DUMMY_H_ */ 46 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/flann/general.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef OPENCV_FLANN_GENERAL_H_ 32 | #define OPENCV_FLANN_GENERAL_H_ 33 | 34 | #include "defines.h" 35 | #include 36 | #include 37 | 38 | namespace cvflann 39 | { 40 | 41 | class FLANNException : public std::runtime_error 42 | { 43 | public: 44 | FLANNException(const char* message) : std::runtime_error(message) { } 45 | 46 | FLANNException(const std::string& message) : std::runtime_error(message) { } 47 | }; 48 | 49 | } 50 | 51 | 52 | #endif /* OPENCV_FLANN_GENERAL_H_ */ 53 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/flann/ground_truth.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef OPENCV_FLANN_GROUND_TRUTH_H_ 32 | #define OPENCV_FLANN_GROUND_TRUTH_H_ 33 | 34 | #include "dist.h" 35 | #include "matrix.h" 36 | 37 | 38 | namespace cvflann 39 | { 40 | 41 | template 42 | void find_nearest(const Matrix& dataset, typename Distance::ElementType* query, int* matches, int nn, 43 | int skip = 0, Distance distance = Distance()) 44 | { 45 | typedef typename Distance::ResultType DistanceType; 46 | int n = nn + skip; 47 | 48 | std::vector match(n); 49 | std::vector dists(n); 50 | 51 | dists[0] = distance(dataset[0], query, dataset.cols); 52 | match[0] = 0; 53 | int dcnt = 1; 54 | 55 | for (size_t i=1; i=1 && dists[j] 83 | void compute_ground_truth(const Matrix& dataset, const Matrix& testset, Matrix& matches, 84 | int skip=0, Distance d = Distance()) 85 | { 86 | for (size_t i=0; i(dataset, testset[i], matches[i], (int)matches.cols, skip, d); 88 | } 89 | } 90 | 91 | 92 | } 93 | 94 | #endif //OPENCV_FLANN_GROUND_TRUTH_H_ 95 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/flann/linear_index.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef OPENCV_FLANN_LINEAR_INDEX_H_ 32 | #define OPENCV_FLANN_LINEAR_INDEX_H_ 33 | 34 | #include "general.h" 35 | #include "nn_index.h" 36 | 37 | namespace cvflann 38 | { 39 | 40 | struct LinearIndexParams : public IndexParams 41 | { 42 | LinearIndexParams() 43 | { 44 | (* this)["algorithm"] = FLANN_INDEX_LINEAR; 45 | } 46 | }; 47 | 48 | template 49 | class LinearIndex : public NNIndex 50 | { 51 | public: 52 | 53 | typedef typename Distance::ElementType ElementType; 54 | typedef typename Distance::ResultType DistanceType; 55 | 56 | 57 | LinearIndex(const Matrix& inputData, const IndexParams& params = LinearIndexParams(), 58 | Distance d = Distance()) : 59 | dataset_(inputData), index_params_(params), distance_(d) 60 | { 61 | } 62 | 63 | LinearIndex(const LinearIndex&); 64 | LinearIndex& operator=(const LinearIndex&); 65 | 66 | flann_algorithm_t getType() const 67 | { 68 | return FLANN_INDEX_LINEAR; 69 | } 70 | 71 | 72 | size_t size() const 73 | { 74 | return dataset_.rows; 75 | } 76 | 77 | size_t veclen() const 78 | { 79 | return dataset_.cols; 80 | } 81 | 82 | 83 | int usedMemory() const 84 | { 85 | return 0; 86 | } 87 | 88 | /** 89 | * Dummy implementation for other algorithms of addable indexes after that. 90 | */ 91 | void addIndex(const Matrix& /*wholeData*/, const Matrix& /*additionalData*/) 92 | { 93 | } 94 | 95 | void buildIndex() 96 | { 97 | /* nothing to do here for linear search */ 98 | } 99 | 100 | void saveIndex(FILE*) 101 | { 102 | /* nothing to do here for linear search */ 103 | } 104 | 105 | 106 | void loadIndex(FILE*) 107 | { 108 | /* nothing to do here for linear search */ 109 | 110 | index_params_["algorithm"] = getType(); 111 | } 112 | 113 | void findNeighbors(ResultSet& resultSet, const ElementType* vec, const SearchParams& /*searchParams*/) 114 | { 115 | ElementType* data = dataset_.data; 116 | for (size_t i = 0; i < dataset_.rows; ++i, data += dataset_.cols) { 117 | DistanceType dist = distance_(data, vec, dataset_.cols); 118 | resultSet.addPoint(dist, (int)i); 119 | } 120 | } 121 | 122 | IndexParams getParameters() const 123 | { 124 | return index_params_; 125 | } 126 | 127 | private: 128 | /** The dataset */ 129 | const Matrix dataset_; 130 | /** Index parameters */ 131 | IndexParams index_params_; 132 | /** Index distance */ 133 | Distance distance_; 134 | 135 | }; 136 | 137 | } 138 | 139 | #endif // OPENCV_FLANN_LINEAR_INDEX_H_ 140 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/flann/logger.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef OPENCV_FLANN_LOGGER_H 32 | #define OPENCV_FLANN_LOGGER_H 33 | 34 | #include 35 | #include 36 | 37 | #include "defines.h" 38 | 39 | 40 | namespace cvflann 41 | { 42 | 43 | class Logger 44 | { 45 | Logger() : stream(stdout), logLevel(FLANN_LOG_WARN) {} 46 | 47 | ~Logger() 48 | { 49 | if ((stream!=NULL)&&(stream!=stdout)) { 50 | fclose(stream); 51 | } 52 | } 53 | 54 | static Logger& instance() 55 | { 56 | static Logger logger; 57 | return logger; 58 | } 59 | 60 | void _setDestination(const char* name) 61 | { 62 | if (name==NULL) { 63 | stream = stdout; 64 | } 65 | else { 66 | stream = fopen(name,"w"); 67 | if (stream == NULL) { 68 | stream = stdout; 69 | } 70 | } 71 | } 72 | 73 | int _log(int level, const char* fmt, va_list arglist) 74 | { 75 | if (level > logLevel ) return -1; 76 | int ret = vfprintf(stream, fmt, arglist); 77 | return ret; 78 | } 79 | 80 | public: 81 | /** 82 | * Sets the logging level. All messages with lower priority will be ignored. 83 | * @param level Logging level 84 | */ 85 | static void setLevel(int level) { instance().logLevel = level; } 86 | 87 | /** 88 | * Sets the logging destination 89 | * @param name Filename or NULL for console 90 | */ 91 | static void setDestination(const char* name) { instance()._setDestination(name); } 92 | 93 | /** 94 | * Print log message 95 | * @param level Log level 96 | * @param fmt Message format 97 | * @return 98 | */ 99 | static int log(int level, const char* fmt, ...) 100 | { 101 | va_list arglist; 102 | va_start(arglist, fmt); 103 | int ret = instance()._log(level,fmt,arglist); 104 | va_end(arglist); 105 | return ret; 106 | } 107 | 108 | #define LOG_METHOD(NAME,LEVEL) \ 109 | static int NAME(const char* fmt, ...) \ 110 | { \ 111 | va_list ap; \ 112 | va_start(ap, fmt); \ 113 | int ret = instance()._log(LEVEL, fmt, ap); \ 114 | va_end(ap); \ 115 | return ret; \ 116 | } 117 | 118 | LOG_METHOD(fatal, FLANN_LOG_FATAL) 119 | LOG_METHOD(error, FLANN_LOG_ERROR) 120 | LOG_METHOD(warn, FLANN_LOG_WARN) 121 | LOG_METHOD(info, FLANN_LOG_INFO) 122 | 123 | private: 124 | FILE* stream; 125 | int logLevel; 126 | }; 127 | 128 | } 129 | 130 | #endif //OPENCV_FLANN_LOGGER_H 131 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/flann/matrix.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef OPENCV_FLANN_DATASET_H_ 32 | #define OPENCV_FLANN_DATASET_H_ 33 | 34 | #include 35 | 36 | #include "general.h" 37 | 38 | namespace cvflann 39 | { 40 | 41 | /** 42 | * Class that implements a simple rectangular matrix stored in a memory buffer and 43 | * provides convenient matrix-like access using the [] operators. 44 | */ 45 | template 46 | class Matrix 47 | { 48 | public: 49 | typedef T type; 50 | 51 | size_t rows; 52 | size_t cols; 53 | size_t stride; 54 | T* data; 55 | 56 | Matrix() : rows(0), cols(0), stride(0), data(NULL) 57 | { 58 | } 59 | 60 | Matrix(T* data_, size_t rows_, size_t cols_, size_t stride_ = 0) : 61 | rows(rows_), cols(cols_), stride(stride_), data(data_) 62 | { 63 | if (stride==0) stride = cols; 64 | } 65 | 66 | /** 67 | * Convenience function for deallocating the storage data. 68 | */ 69 | FLANN_DEPRECATED void free() 70 | { 71 | fprintf(stderr, "The cvflann::Matrix::free() method is deprecated " 72 | "and it does not do any memory deallocation any more. You are" 73 | "responsible for deallocating the matrix memory (by doing" 74 | "'delete[] matrix.data' for example)"); 75 | } 76 | 77 | /** 78 | * Operator that return a (pointer to a) row of the data. 79 | */ 80 | T* operator[](size_t index) const 81 | { 82 | return data+index*stride; 83 | } 84 | }; 85 | 86 | 87 | class UntypedMatrix 88 | { 89 | public: 90 | size_t rows; 91 | size_t cols; 92 | void* data; 93 | flann_datatype_t type; 94 | 95 | UntypedMatrix(void* data_, long rows_, long cols_) : 96 | rows(rows_), cols(cols_), data(data_) 97 | { 98 | } 99 | 100 | ~UntypedMatrix() 101 | { 102 | } 103 | 104 | 105 | template 106 | Matrix as() 107 | { 108 | return Matrix((T*)data, rows, cols); 109 | } 110 | }; 111 | 112 | 113 | 114 | } 115 | 116 | #endif //OPENCV_FLANN_DATASET_H_ 117 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/flann/object_factory.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef OPENCV_FLANN_OBJECT_FACTORY_H_ 32 | #define OPENCV_FLANN_OBJECT_FACTORY_H_ 33 | 34 | #include 35 | 36 | namespace cvflann 37 | { 38 | 39 | class CreatorNotFound 40 | { 41 | }; 42 | 43 | template 46 | class ObjectFactory 47 | { 48 | typedef ObjectFactory ThisClass; 49 | typedef std::map ObjectRegistry; 50 | 51 | // singleton class, private constructor 52 | ObjectFactory() {} 53 | 54 | public: 55 | 56 | bool subscribe(UniqueIdType id, ObjectCreator creator) 57 | { 58 | if (object_registry.find(id) != object_registry.end()) return false; 59 | 60 | object_registry[id] = creator; 61 | return true; 62 | } 63 | 64 | bool unregister(UniqueIdType id) 65 | { 66 | return object_registry.erase(id) == 1; 67 | } 68 | 69 | ObjectCreator create(UniqueIdType id) 70 | { 71 | typename ObjectRegistry::const_iterator iter = object_registry.find(id); 72 | 73 | if (iter == object_registry.end()) { 74 | throw CreatorNotFound(); 75 | } 76 | 77 | return iter->second; 78 | } 79 | 80 | static ThisClass& instance() 81 | { 82 | static ThisClass the_factory; 83 | return the_factory; 84 | } 85 | private: 86 | ObjectRegistry object_registry; 87 | }; 88 | 89 | } 90 | 91 | #endif /* OPENCV_FLANN_OBJECT_FACTORY_H_ */ 92 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/flann/params.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2011 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2011 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | *************************************************************************/ 28 | 29 | 30 | #ifndef OPENCV_FLANN_PARAMS_H_ 31 | #define OPENCV_FLANN_PARAMS_H_ 32 | 33 | #include "any.h" 34 | #include "general.h" 35 | #include 36 | #include 37 | 38 | 39 | namespace cvflann 40 | { 41 | 42 | typedef std::map IndexParams; 43 | 44 | struct SearchParams : public IndexParams 45 | { 46 | SearchParams(int checks = 32, float eps = 0, bool sorted = true ) 47 | { 48 | // how many leafs to visit when searching for neighbours (-1 for unlimited) 49 | (*this)["checks"] = checks; 50 | // search for eps-approximate neighbours (default: 0) 51 | (*this)["eps"] = eps; 52 | // only for radius search, require neighbours sorted by distance (default: true) 53 | (*this)["sorted"] = sorted; 54 | } 55 | }; 56 | 57 | 58 | template 59 | T get_param(const IndexParams& params, std::string name, const T& default_value) 60 | { 61 | IndexParams::const_iterator it = params.find(name); 62 | if (it != params.end()) { 63 | return it->second.cast(); 64 | } 65 | else { 66 | return default_value; 67 | } 68 | } 69 | 70 | template 71 | T get_param(const IndexParams& params, std::string name) 72 | { 73 | IndexParams::const_iterator it = params.find(name); 74 | if (it != params.end()) { 75 | return it->second.cast(); 76 | } 77 | else { 78 | throw FLANNException(std::string("Missing parameter '")+name+std::string("' in the parameters given")); 79 | } 80 | } 81 | 82 | inline void print_params(const IndexParams& params, std::ostream& stream) 83 | { 84 | IndexParams::const_iterator it; 85 | 86 | for(it=params.begin(); it!=params.end(); ++it) { 87 | stream << it->first << " : " << it->second << std::endl; 88 | } 89 | } 90 | 91 | inline void print_params(const IndexParams& params) 92 | { 93 | print_params(params, std::cout); 94 | } 95 | 96 | } 97 | 98 | 99 | #endif /* OPENCV_FLANN_PARAMS_H_ */ 100 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/flann/random.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef OPENCV_FLANN_RANDOM_H 32 | #define OPENCV_FLANN_RANDOM_H 33 | 34 | #include 35 | #include 36 | #include 37 | 38 | #include "general.h" 39 | 40 | namespace cvflann 41 | { 42 | 43 | /** 44 | * Seeds the random number generator 45 | * @param seed Random seed 46 | */ 47 | inline void seed_random(unsigned int seed) 48 | { 49 | srand(seed); 50 | } 51 | 52 | /* 53 | * Generates a random double value. 54 | */ 55 | /** 56 | * Generates a random double value. 57 | * @param high Upper limit 58 | * @param low Lower limit 59 | * @return Random double value 60 | */ 61 | inline double rand_double(double high = 1.0, double low = 0) 62 | { 63 | return low + ((high-low) * (std::rand() / (RAND_MAX + 1.0))); 64 | } 65 | 66 | /** 67 | * Generates a random integer value. 68 | * @param high Upper limit 69 | * @param low Lower limit 70 | * @return Random integer value 71 | */ 72 | inline int rand_int(int high = RAND_MAX, int low = 0) 73 | { 74 | return low + (int) ( double(high-low) * (std::rand() / (RAND_MAX + 1.0))); 75 | } 76 | 77 | /** 78 | * Random number generator that returns a distinct number from 79 | * the [0,n) interval each time. 80 | */ 81 | class UniqueRandom 82 | { 83 | std::vector vals_; 84 | int size_; 85 | int counter_; 86 | 87 | public: 88 | /** 89 | * Constructor. 90 | * @param n Size of the interval from which to generate 91 | * @return 92 | */ 93 | UniqueRandom(int n) 94 | { 95 | init(n); 96 | } 97 | 98 | /** 99 | * Initializes the number generator. 100 | * @param n the size of the interval from which to generate random numbers. 101 | */ 102 | void init(int n) 103 | { 104 | // create and initialize an array of size n 105 | vals_.resize(n); 106 | size_ = n; 107 | for (int i = 0; i < size_; ++i) vals_[i] = i; 108 | 109 | // shuffle the elements in the array 110 | std::random_shuffle(vals_.begin(), vals_.end()); 111 | 112 | counter_ = 0; 113 | } 114 | 115 | /** 116 | * Return a distinct random integer in greater or equal to 0 and less 117 | * than 'n' on each call. It should be called maximum 'n' times. 118 | * Returns: a random integer 119 | */ 120 | int next() 121 | { 122 | if (counter_ == size_) { 123 | return -1; 124 | } 125 | else { 126 | return vals_[counter_++]; 127 | } 128 | } 129 | }; 130 | 131 | } 132 | 133 | #endif //OPENCV_FLANN_RANDOM_H 134 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/flann/sampling.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | *************************************************************************/ 28 | 29 | 30 | #ifndef OPENCV_FLANN_SAMPLING_H_ 31 | #define OPENCV_FLANN_SAMPLING_H_ 32 | 33 | #include "matrix.h" 34 | #include "random.h" 35 | 36 | namespace cvflann 37 | { 38 | 39 | template 40 | Matrix random_sample(Matrix& srcMatrix, long size, bool remove = false) 41 | { 42 | Matrix newSet(new T[size * srcMatrix.cols], size,srcMatrix.cols); 43 | 44 | T* src,* dest; 45 | for (long i=0; i 63 | Matrix random_sample(const Matrix& srcMatrix, size_t size) 64 | { 65 | UniqueRandom rand((int)srcMatrix.rows); 66 | Matrix newSet(new T[size * srcMatrix.cols], size,srcMatrix.cols); 67 | 68 | T* src,* dest; 69 | for (size_t i=0; i 35 | 36 | 37 | namespace cvflann 38 | { 39 | 40 | /** 41 | * A start-stop timer class. 42 | * 43 | * Can be used to time portions of code. 44 | */ 45 | class StartStopTimer 46 | { 47 | clock_t startTime; 48 | 49 | public: 50 | /** 51 | * Value of the timer. 52 | */ 53 | double value; 54 | 55 | 56 | /** 57 | * Constructor. 58 | */ 59 | StartStopTimer() 60 | { 61 | reset(); 62 | } 63 | 64 | /** 65 | * Starts the timer. 66 | */ 67 | void start() 68 | { 69 | startTime = clock(); 70 | } 71 | 72 | /** 73 | * Stops the timer and updates timer value. 74 | */ 75 | void stop() 76 | { 77 | clock_t stopTime = clock(); 78 | value += ( (double)stopTime - startTime) / CLOCKS_PER_SEC; 79 | } 80 | 81 | /** 82 | * Resets the timer value to 0. 83 | */ 84 | void reset() 85 | { 86 | value = 0; 87 | } 88 | 89 | }; 90 | 91 | } 92 | 93 | #endif // FLANN_TIMER_H 94 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/gpu/device/dynamic_smem.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_GPU_DYNAMIC_SMEM_HPP__ 44 | #define __OPENCV_GPU_DYNAMIC_SMEM_HPP__ 45 | 46 | namespace cv { namespace gpu { namespace device 47 | { 48 | template struct DynamicSharedMem 49 | { 50 | __device__ __forceinline__ operator T*() 51 | { 52 | extern __shared__ int __smem[]; 53 | return (T*)__smem; 54 | } 55 | 56 | __device__ __forceinline__ operator const T*() const 57 | { 58 | extern __shared__ int __smem[]; 59 | return (T*)__smem; 60 | } 61 | }; 62 | 63 | // specialize for double to avoid unaligned memory access compile errors 64 | template<> struct DynamicSharedMem 65 | { 66 | __device__ __forceinline__ operator double*() 67 | { 68 | extern __shared__ double __smem_d[]; 69 | return (double*)__smem_d; 70 | } 71 | 72 | __device__ __forceinline__ operator const double*() const 73 | { 74 | extern __shared__ double __smem_d[]; 75 | return (double*)__smem_d; 76 | } 77 | }; 78 | }}} 79 | 80 | #endif // __OPENCV_GPU_DYNAMIC_SMEM_HPP__ 81 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/gpu/device/funcattrib.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_GPU_DEVICE_FUNCATTRIB_HPP_ 44 | #define __OPENCV_GPU_DEVICE_FUNCATTRIB_HPP_ 45 | 46 | #include 47 | 48 | namespace cv { namespace gpu { namespace device 49 | { 50 | template 51 | void printFuncAttrib(Func& func) 52 | { 53 | 54 | cudaFuncAttributes attrs; 55 | cudaFuncGetAttributes(&attrs, func); 56 | 57 | printf("=== Function stats ===\n"); 58 | printf("Name: \n"); 59 | printf("sharedSizeBytes = %d\n", attrs.sharedSizeBytes); 60 | printf("constSizeBytes = %d\n", attrs.constSizeBytes); 61 | printf("localSizeBytes = %d\n", attrs.localSizeBytes); 62 | printf("maxThreadsPerBlock = %d\n", attrs.maxThreadsPerBlock); 63 | printf("numRegs = %d\n", attrs.numRegs); 64 | printf("ptxVersion = %d\n", attrs.ptxVersion); 65 | printf("binaryVersion = %d\n", attrs.binaryVersion); 66 | printf("\n"); 67 | fflush(stdout); 68 | } 69 | }}} // namespace cv { namespace gpu { namespace device 70 | 71 | #endif /* __OPENCV_GPU_DEVICE_FUNCATTRIB_HPP_ */ 72 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/gpu/device/static_check.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_GPU_GPU_DEVICE_STATIC_CHECK_HPP__ 44 | #define __OPENCV_GPU_GPU_DEVICE_STATIC_CHECK_HPP__ 45 | 46 | #if defined(__CUDACC__) 47 | #define __OPENCV_GPU_HOST_DEVICE__ __host__ __device__ __forceinline__ 48 | #else 49 | #define __OPENCV_GPU_HOST_DEVICE__ 50 | #endif 51 | 52 | namespace cv { namespace gpu 53 | { 54 | namespace device 55 | { 56 | template struct Static {}; 57 | 58 | template<> struct Static 59 | { 60 | __OPENCV_GPU_HOST_DEVICE__ static void check() {}; 61 | }; 62 | } 63 | }} 64 | 65 | #undef __OPENCV_GPU_HOST_DEVICE__ 66 | 67 | #endif /* __OPENCV_GPU_GPU_DEVICE_STATIC_CHECK_HPP__ */ 68 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/gpu/device/transform.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_GPU_TRANSFORM_HPP__ 44 | #define __OPENCV_GPU_TRANSFORM_HPP__ 45 | 46 | #include "common.hpp" 47 | #include "utility.hpp" 48 | #include "detail/transform_detail.hpp" 49 | 50 | namespace cv { namespace gpu { namespace device 51 | { 52 | template 53 | static inline void transform(PtrStepSz src, PtrStepSz dst, UnOp op, const Mask& mask, cudaStream_t stream) 54 | { 55 | typedef TransformFunctorTraits ft; 56 | transform_detail::TransformDispatcher::cn == 1 && VecTraits::cn == 1 && ft::smart_shift != 1>::call(src, dst, op, mask, stream); 57 | } 58 | 59 | template 60 | static inline void transform(PtrStepSz src1, PtrStepSz src2, PtrStepSz dst, BinOp op, const Mask& mask, cudaStream_t stream) 61 | { 62 | typedef TransformFunctorTraits ft; 63 | transform_detail::TransformDispatcher::cn == 1 && VecTraits::cn == 1 && VecTraits::cn == 1 && ft::smart_shift != 1>::call(src1, src2, dst, op, mask, stream); 64 | } 65 | }}} 66 | 67 | #endif // __OPENCV_GPU_TRANSFORM_HPP__ 68 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/gpu/device/warp_reduce.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef OPENCV_GPU_WARP_REDUCE_HPP__ 44 | #define OPENCV_GPU_WARP_REDUCE_HPP__ 45 | 46 | namespace cv { namespace gpu { namespace device 47 | { 48 | template 49 | __device__ __forceinline__ T warp_reduce(volatile T *ptr , const unsigned int tid = threadIdx.x) 50 | { 51 | const unsigned int lane = tid & 31; // index of thread in warp (0..31) 52 | 53 | if (lane < 16) 54 | { 55 | T partial = ptr[tid]; 56 | 57 | ptr[tid] = partial = partial + ptr[tid + 16]; 58 | ptr[tid] = partial = partial + ptr[tid + 8]; 59 | ptr[tid] = partial = partial + ptr[tid + 4]; 60 | ptr[tid] = partial = partial + ptr[tid + 2]; 61 | ptr[tid] = partial = partial + ptr[tid + 1]; 62 | } 63 | 64 | return ptr[tid - lane]; 65 | } 66 | }}} // namespace cv { namespace gpu { namespace device { 67 | 68 | #endif /* OPENCV_GPU_WARP_REDUCE_HPP__ */ 69 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/gpu/devmem2d.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #include "opencv2/core/cuda_devptrs.hpp" 44 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/gpu/gpumat.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #include "opencv2/core/gpumat.hpp" 44 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/gpu/stream_accessor.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_GPU_STREAM_ACCESSOR_HPP__ 44 | #define __OPENCV_GPU_STREAM_ACCESSOR_HPP__ 45 | 46 | #include "opencv2/gpu/gpu.hpp" 47 | #include "cuda_runtime_api.h" 48 | 49 | namespace cv 50 | { 51 | namespace gpu 52 | { 53 | // This is only header file that depends on Cuda. All other headers are independent. 54 | // So if you use OpenCV binaries you do noot need to install Cuda Toolkit. 55 | // But of you wanna use GPU by yourself, may get cuda stream instance using the class below. 56 | // In this case you have to install Cuda Toolkit. 57 | struct StreamAccessor 58 | { 59 | CV_EXPORTS static cudaStream_t getStream(const Stream& stream); 60 | CV_EXPORTS static Stream wrapStream(cudaStream_t stream); 61 | }; 62 | } 63 | } 64 | 65 | #endif /* __OPENCV_GPU_STREAM_ACCESSOR_HPP__ */ 66 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/highgui.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #include "opencv2/highgui/highgui.hpp" 44 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/highgui/ios.h: -------------------------------------------------------------------------------- 1 | 2 | /*M/////////////////////////////////////////////////////////////////////////////////////// 3 | // 4 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 5 | // 6 | // By downloading, copying, installing or using the software you agree to this license. 7 | // If you do not agree to this license, do not download, install, 8 | // copy or use the software. 9 | // 10 | // 11 | // License Agreement 12 | // For Open Source Computer Vision Library 13 | // 14 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 15 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #include "opencv2/core/core.hpp" 45 | #import "opencv2/highgui/cap_ios.h" 46 | 47 | UIImage* MatToUIImage(const cv::Mat& image); 48 | void UIImageToMat(const UIImage* image, 49 | cv::Mat& m, bool alphaExist = false); 50 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/imgproc.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #include "opencv2/imgproc/imgproc.hpp" 44 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/legacy/streams.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // Intel License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000, Intel Corporation, all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of Intel Corporation may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the Intel Corporation or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | #ifndef __OPENCV_CVSTREAMS_H__ 43 | #define __OPENCV_CVSTREAMS_H__ 44 | 45 | #ifdef WIN32 46 | #include /* !!! IF YOU'VE GOT AN ERROR HERE, PLEASE READ BELOW !!! */ 47 | /***************** How to get Visual Studio understand streams.h ****************\ 48 | 49 | You need DirectShow SDK that is now a part of Platform SDK 50 | (Windows Server 2003 SP1 SDK or later), 51 | and DirectX SDK (2006 April or later). 52 | 53 | 1. Download the Platform SDK from 54 | http://www.microsoft.com/msdownload/platformsdk/sdkupdate/ 55 | and DirectX SDK from msdn.microsoft.com/directx/ 56 | (They are huge, but you can download it by parts). 57 | If it doesn't work for you, consider HighGUI that can capture video via VFW or MIL 58 | 59 | 2. Install Platform SDK together with DirectShow SDK. 60 | Install DirectX (with or without sample code). 61 | 62 | 3. Build baseclasses. 63 | See \samples\multimedia\directshow\readme.txt. 64 | 65 | 4. Copy the built libraries (called strmbase.lib and strmbasd.lib 66 | in Release and Debug versions, respectively) to 67 | \lib. 68 | 69 | 5. In Developer Studio add the following paths: 70 | \include 71 | \include 72 | \samples\multimedia\directshow\baseclasses 73 | to the includes' search path 74 | (at Tools->Options->Directories->Include files in case of Visual Studio 6.0, 75 | at Tools->Options->Projects and Solutions->VC++ Directories->Include files in case 76 | of Visual Studio 2005) 77 | Add 78 | \lib 79 | \lib 80 | to the libraries' search path (in the same dialog, ...->"Library files" page) 81 | 82 | NOTE: PUT THE ADDED LINES ON THE VERY TOP OF THE LISTS, OTHERWISE YOU MAY STILL GET 83 | COMPILER OR LINKER ERRORS. This is necessary, because Visual Studio 84 | may include older versions of the same headers and libraries. 85 | 86 | 6. Now you can build OpenCV DirectShow filters. 87 | 88 | \***********************************************************************************/ 89 | 90 | #endif 91 | 92 | #endif 93 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/ml.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // Intel License Agreement 11 | // 12 | // Copyright (C) 2000, Intel Corporation, all rights reserved. 13 | // Third party copyrights are property of their respective owners. 14 | // 15 | // Redistribution and use in source and binary forms, with or without modification, 16 | // are permitted provided that the following conditions are met: 17 | // 18 | // * Redistribution's of source code must retain the above copyright notice, 19 | // this list of conditions and the following disclaimer. 20 | // 21 | // * Redistribution's in binary form must reproduce the above copyright notice, 22 | // this list of conditions and the following disclaimer in the documentation 23 | // and/or other materials provided with the distribution. 24 | // 25 | // * The name of Intel Corporation may not be used to endorse or promote products 26 | // derived from this software without specific prior written permission. 27 | // 28 | // This software is provided by the copyright holders and contributors "as is" and 29 | // any express or implied warranties, including, but not limited to, the implied 30 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 31 | // In no event shall the Intel Corporation or contributors be liable for any direct, 32 | // indirect, incidental, special, exemplary, or consequential damages 33 | // (including, but not limited to, procurement of substitute goods or services; 34 | // loss of use, data, or profits; or business interruption) however caused 35 | // and on any theory of liability, whether in contract, strict liability, 36 | // or tort (including negligence or otherwise) arising in any way out of 37 | // the use of this software, even if advised of the possibility of such damage. 38 | // 39 | //M*/ 40 | 41 | #include "opencv2/ml/ml.hpp" 42 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/nonfree/nonfree.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2012, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_NONFREE_HPP__ 44 | #define __OPENCV_NONFREE_HPP__ 45 | 46 | #include "opencv2/nonfree/features2d.hpp" 47 | 48 | namespace cv 49 | { 50 | 51 | CV_EXPORTS_W bool initModule_nonfree(); 52 | 53 | } 54 | 55 | #endif 56 | 57 | /* End of file. */ 58 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/objdetect.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #include "opencv2/objdetect/objdetect.hpp" 44 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/opencv.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2010, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_ALL_HPP__ 44 | #define __OPENCV_ALL_HPP__ 45 | 46 | #include "opencv2/opencv_modules.hpp" 47 | 48 | #include "opencv2/core/core_c.h" 49 | #include "opencv2/core/core.hpp" 50 | #ifdef HAVE_OPENCV_FLANN 51 | #include "opencv2/flann/miniflann.hpp" 52 | #endif 53 | #ifdef HAVE_OPENCV_IMGPROC 54 | #include "opencv2/imgproc/imgproc_c.h" 55 | #include "opencv2/imgproc/imgproc.hpp" 56 | #endif 57 | #ifdef HAVE_OPENCV_PHOTO 58 | #include "opencv2/photo/photo.hpp" 59 | #endif 60 | #ifdef HAVE_OPENCV_VIDEO 61 | #include "opencv2/video/video.hpp" 62 | #endif 63 | #ifdef HAVE_OPENCV_FEATURES2D 64 | #include "opencv2/features2d/features2d.hpp" 65 | #endif 66 | #ifdef HAVE_OPENCV_OBJDETECT 67 | #include "opencv2/objdetect/objdetect.hpp" 68 | #endif 69 | #ifdef HAVE_OPENCV_CALIB3D 70 | #include "opencv2/calib3d/calib3d.hpp" 71 | #endif 72 | #ifdef HAVE_OPENCV_ML 73 | #include "opencv2/ml/ml.hpp" 74 | #endif 75 | #ifdef HAVE_OPENCV_HIGHGUI 76 | #include "opencv2/highgui/highgui_c.h" 77 | #include "opencv2/highgui/highgui.hpp" 78 | #endif 79 | #ifdef HAVE_OPENCV_CONTRIB 80 | #include "opencv2/contrib/contrib.hpp" 81 | #endif 82 | 83 | #endif 84 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/opencv_modules.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * ** File generated automatically, do not modify ** 3 | * 4 | * This file defines the list of modules available in current build configuration 5 | * 6 | * 7 | */ 8 | 9 | #define HAVE_OPENCV_CALIB3D 10 | #define HAVE_OPENCV_CONTRIB 11 | #define HAVE_OPENCV_CORE 12 | #define HAVE_OPENCV_FEATURES2D 13 | #define HAVE_OPENCV_FLANN 14 | #define HAVE_OPENCV_GPU 15 | #define HAVE_OPENCV_HIGHGUI 16 | #define HAVE_OPENCV_IMGPROC 17 | #define HAVE_OPENCV_LEGACY 18 | #define HAVE_OPENCV_ML 19 | #define HAVE_OPENCV_NONFREE 20 | #define HAVE_OPENCV_OBJDETECT 21 | #define HAVE_OPENCV_OCL 22 | #define HAVE_OPENCV_PHOTO 23 | #define HAVE_OPENCV_STITCHING 24 | #define HAVE_OPENCV_SUPERRES 25 | #define HAVE_OPENCV_TS 26 | #define HAVE_OPENCV_VIDEO 27 | #define HAVE_OPENCV_VIDEOSTAB 28 | 29 | 30 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/photo.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2008-2012, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #include "opencv2/photo/photo.hpp" 44 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/photo/photo.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2008-2012, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_PHOTO_HPP__ 44 | #define __OPENCV_PHOTO_HPP__ 45 | 46 | #include "opencv2/core/core.hpp" 47 | #include "opencv2/imgproc/imgproc.hpp" 48 | 49 | #include "opencv2/photo/photo_c.h" 50 | 51 | #ifdef __cplusplus 52 | 53 | /*! \namespace cv 54 | Namespace where all the C++ OpenCV functionality resides 55 | */ 56 | namespace cv 57 | { 58 | 59 | //! the inpainting algorithm 60 | enum 61 | { 62 | INPAINT_NS=CV_INPAINT_NS, // Navier-Stokes algorithm 63 | INPAINT_TELEA=CV_INPAINT_TELEA // A. Telea algorithm 64 | }; 65 | 66 | //! restores the damaged image areas using one of the available intpainting algorithms 67 | CV_EXPORTS_W void inpaint( InputArray src, InputArray inpaintMask, 68 | OutputArray dst, double inpaintRadius, int flags ); 69 | 70 | 71 | CV_EXPORTS_W void fastNlMeansDenoising( InputArray src, OutputArray dst, float h = 3, 72 | int templateWindowSize = 7, int searchWindowSize = 21); 73 | 74 | CV_EXPORTS_W void fastNlMeansDenoisingColored( InputArray src, OutputArray dst, 75 | float h = 3, float hColor = 3, 76 | int templateWindowSize = 7, int searchWindowSize = 21); 77 | 78 | CV_EXPORTS_W void fastNlMeansDenoisingMulti( InputArrayOfArrays srcImgs, OutputArray dst, 79 | int imgToDenoiseIndex, int temporalWindowSize, 80 | float h = 3, int templateWindowSize = 7, int searchWindowSize = 21); 81 | 82 | CV_EXPORTS_W void fastNlMeansDenoisingColoredMulti( InputArrayOfArrays srcImgs, OutputArray dst, 83 | int imgToDenoiseIndex, int temporalWindowSize, 84 | float h = 3, float hColor = 3, 85 | int templateWindowSize = 7, int searchWindowSize = 21); 86 | 87 | } 88 | 89 | #endif //__cplusplus 90 | 91 | #endif 92 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/photo/photo_c.h: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2008-2012, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_PHOTO_C_H__ 44 | #define __OPENCV_PHOTO_C_H__ 45 | 46 | #include "opencv2/core/core_c.h" 47 | 48 | #ifdef __cplusplus 49 | extern "C" { 50 | #endif 51 | 52 | /* Inpainting algorithms */ 53 | enum 54 | { 55 | CV_INPAINT_NS =0, 56 | CV_INPAINT_TELEA =1 57 | }; 58 | 59 | 60 | /* Inpaints the selected region in the image */ 61 | CVAPI(void) cvInpaint( const CvArr* src, const CvArr* inpaint_mask, 62 | CvArr* dst, double inpaintRange, int flags ); 63 | 64 | 65 | #ifdef __cplusplus 66 | } //extern "C" 67 | #endif 68 | 69 | #endif //__OPENCV_PHOTO_C_H__ 70 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/stitching.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #include "opencv2/stitching/stitcher.hpp" 44 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/stitching/detail/autocalib.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_STITCHING_AUTOCALIB_HPP__ 44 | #define __OPENCV_STITCHING_AUTOCALIB_HPP__ 45 | 46 | #include "opencv2/core/core.hpp" 47 | #include "matchers.hpp" 48 | 49 | namespace cv { 50 | namespace detail { 51 | 52 | // See "Construction of Panoramic Image Mosaics with Global and Local Alignment" 53 | // by Heung-Yeung Shum and Richard Szeliski. 54 | void CV_EXPORTS focalsFromHomography(const Mat &H, double &f0, double &f1, bool &f0_ok, bool &f1_ok); 55 | 56 | void CV_EXPORTS estimateFocal(const std::vector &features, 57 | const std::vector &pairwise_matches, 58 | std::vector &focals); 59 | 60 | bool CV_EXPORTS calibrateRotatingCamera(const std::vector &Hs, Mat &K); 61 | 62 | } // namespace detail 63 | } // namespace cv 64 | 65 | #endif // __OPENCV_STITCHING_AUTOCALIB_HPP__ 66 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/stitching/detail/camera.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_STITCHING_CAMERA_HPP__ 44 | #define __OPENCV_STITCHING_CAMERA_HPP__ 45 | 46 | #include "opencv2/core/core.hpp" 47 | 48 | namespace cv { 49 | namespace detail { 50 | 51 | struct CV_EXPORTS CameraParams 52 | { 53 | CameraParams(); 54 | CameraParams(const CameraParams& other); 55 | const CameraParams& operator =(const CameraParams& other); 56 | Mat K() const; 57 | 58 | double focal; // Focal length 59 | double aspect; // Aspect ratio 60 | double ppx; // Principal point X 61 | double ppy; // Principal point Y 62 | Mat R; // Rotation 63 | Mat t; // Translation 64 | }; 65 | 66 | } // namespace detail 67 | } // namespace cv 68 | 69 | #endif // #ifndef __OPENCV_STITCHING_CAMERA_HPP__ 70 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/stitching/detail/util_inl.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_STITCHING_UTIL_INL_HPP__ 44 | #define __OPENCV_STITCHING_UTIL_INL_HPP__ 45 | 46 | #include 47 | #include "opencv2/core/core.hpp" 48 | #include "util.hpp" // Make your IDE see declarations 49 | 50 | namespace cv { 51 | namespace detail { 52 | 53 | template 54 | B Graph::forEach(B body) const 55 | { 56 | for (int i = 0; i < numVertices(); ++i) 57 | { 58 | std::list::const_iterator edge = edges_[i].begin(); 59 | for (; edge != edges_[i].end(); ++edge) 60 | body(*edge); 61 | } 62 | return body; 63 | } 64 | 65 | 66 | template 67 | B Graph::walkBreadthFirst(int from, B body) const 68 | { 69 | std::vector was(numVertices(), false); 70 | std::queue vertices; 71 | 72 | was[from] = true; 73 | vertices.push(from); 74 | 75 | while (!vertices.empty()) 76 | { 77 | int vertex = vertices.front(); 78 | vertices.pop(); 79 | 80 | std::list::const_iterator edge = edges_[vertex].begin(); 81 | for (; edge != edges_[vertex].end(); ++edge) 82 | { 83 | if (!was[edge->to]) 84 | { 85 | body(*edge); 86 | was[edge->to] = true; 87 | vertices.push(edge->to); 88 | } 89 | } 90 | } 91 | 92 | return body; 93 | } 94 | 95 | 96 | ////////////////////////////////////////////////////////////////////////////// 97 | // Some auxiliary math functions 98 | 99 | static inline 100 | float normL2(const Point3f& a) 101 | { 102 | return a.x * a.x + a.y * a.y + a.z * a.z; 103 | } 104 | 105 | 106 | static inline 107 | float normL2(const Point3f& a, const Point3f& b) 108 | { 109 | return normL2(a - b); 110 | } 111 | 112 | 113 | static inline 114 | double normL2sq(const Mat &r) 115 | { 116 | return r.dot(r); 117 | } 118 | 119 | 120 | static inline int sqr(int x) { return x * x; } 121 | static inline float sqr(float x) { return x * x; } 122 | static inline double sqr(double x) { return x * x; } 123 | 124 | } // namespace detail 125 | } // namespace cv 126 | 127 | #endif // __OPENCV_STITCHING_UTIL_INL_HPP__ 128 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/superres.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #include "opencv2/superres/superres.hpp" 44 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/superres/optical_flow.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_SUPERRES_OPTICAL_FLOW_HPP__ 44 | #define __OPENCV_SUPERRES_OPTICAL_FLOW_HPP__ 45 | 46 | #include "opencv2/core/core.hpp" 47 | 48 | namespace cv 49 | { 50 | namespace superres 51 | { 52 | class CV_EXPORTS DenseOpticalFlowExt : public cv::Algorithm 53 | { 54 | public: 55 | virtual void calc(InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2 = noArray()) = 0; 56 | virtual void collectGarbage() = 0; 57 | }; 58 | 59 | CV_EXPORTS Ptr createOptFlow_Farneback(); 60 | CV_EXPORTS Ptr createOptFlow_Farneback_GPU(); 61 | CV_EXPORTS Ptr createOptFlow_Farneback_OCL(); 62 | 63 | CV_EXPORTS Ptr createOptFlow_Simple(); 64 | 65 | CV_EXPORTS Ptr createOptFlow_DualTVL1(); 66 | CV_EXPORTS Ptr createOptFlow_DualTVL1_GPU(); 67 | CV_EXPORTS Ptr createOptFlow_DualTVL1_OCL(); 68 | 69 | CV_EXPORTS Ptr createOptFlow_Brox_GPU(); 70 | 71 | CV_EXPORTS Ptr createOptFlow_PyrLK_GPU(); 72 | CV_EXPORTS Ptr createOptFlow_PyrLK_OCL(); 73 | } 74 | } 75 | 76 | #endif // __OPENCV_SUPERRES_OPTICAL_FLOW_HPP__ 77 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/superres/superres.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_SUPERRES_HPP__ 44 | #define __OPENCV_SUPERRES_HPP__ 45 | 46 | #include "opencv2/core/core.hpp" 47 | 48 | namespace cv 49 | { 50 | namespace superres 51 | { 52 | CV_EXPORTS bool initModule_superres(); 53 | 54 | class CV_EXPORTS FrameSource 55 | { 56 | public: 57 | virtual ~FrameSource(); 58 | 59 | virtual void nextFrame(OutputArray frame) = 0; 60 | virtual void reset() = 0; 61 | }; 62 | 63 | CV_EXPORTS Ptr createFrameSource_Empty(); 64 | 65 | CV_EXPORTS Ptr createFrameSource_Video(const std::string& fileName); 66 | CV_EXPORTS Ptr createFrameSource_Video_GPU(const std::string& fileName); 67 | 68 | CV_EXPORTS Ptr createFrameSource_Camera(int deviceId = 0); 69 | 70 | class CV_EXPORTS SuperResolution : public cv::Algorithm, public FrameSource 71 | { 72 | public: 73 | void setInput(const Ptr& frameSource); 74 | 75 | void nextFrame(OutputArray frame); 76 | void reset(); 77 | 78 | virtual void collectGarbage(); 79 | 80 | protected: 81 | SuperResolution(); 82 | 83 | virtual void initImpl(Ptr& frameSource) = 0; 84 | virtual void processImpl(Ptr& frameSource, OutputArray output) = 0; 85 | 86 | private: 87 | Ptr frameSource_; 88 | bool firstCall_; 89 | }; 90 | 91 | // S. Farsiu , D. Robinson, M. Elad, P. Milanfar. Fast and robust multiframe super resolution. 92 | // Dennis Mitzel, Thomas Pock, Thomas Schoenemann, Daniel Cremers. Video Super Resolution using Duality Based TV-L1 Optical Flow. 93 | CV_EXPORTS Ptr createSuperResolution_BTVL1(); 94 | CV_EXPORTS Ptr createSuperResolution_BTVL1_GPU(); 95 | CV_EXPORTS Ptr createSuperResolution_BTVL1_OCL(); 96 | } 97 | } 98 | 99 | #endif // __OPENCV_SUPERRES_HPP__ 100 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/ts.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #include "opencv2/ts/ts.hpp" 44 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/video.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #include "opencv2/video/video.hpp" 44 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/video/video.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_VIDEO_HPP__ 44 | #define __OPENCV_VIDEO_HPP__ 45 | 46 | #include "opencv2/video/tracking.hpp" 47 | #include "opencv2/video/background_segm.hpp" 48 | 49 | #ifdef __cplusplus 50 | namespace cv 51 | { 52 | 53 | CV_EXPORTS bool initModule_video(void); 54 | 55 | } 56 | #endif 57 | 58 | #endif //__OPENCV_VIDEO_HPP__ 59 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/videostab.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #include "opencv2/videostab/videostab.hpp" 44 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/videostab/deblurring.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_VIDEOSTAB_DEBLURRING_HPP__ 44 | #define __OPENCV_VIDEOSTAB_DEBLURRING_HPP__ 45 | 46 | #include 47 | #include "opencv2/core/core.hpp" 48 | 49 | namespace cv 50 | { 51 | namespace videostab 52 | { 53 | 54 | CV_EXPORTS float calcBlurriness(const Mat &frame); 55 | 56 | class CV_EXPORTS DeblurerBase 57 | { 58 | public: 59 | DeblurerBase() : radius_(0), frames_(0), motions_(0) {} 60 | 61 | virtual ~DeblurerBase() {} 62 | 63 | virtual void setRadius(int val) { radius_ = val; } 64 | virtual int radius() const { return radius_; } 65 | 66 | virtual void setFrames(const std::vector &val) { frames_ = &val; } 67 | virtual const std::vector& frames() const { return *frames_; } 68 | 69 | virtual void setMotions(const std::vector &val) { motions_ = &val; } 70 | virtual const std::vector& motions() const { return *motions_; } 71 | 72 | virtual void setBlurrinessRates(const std::vector &val) { blurrinessRates_ = &val; } 73 | virtual const std::vector& blurrinessRates() const { return *blurrinessRates_; } 74 | 75 | virtual void update() {} 76 | 77 | virtual void deblur(int idx, Mat &frame) = 0; 78 | 79 | protected: 80 | int radius_; 81 | const std::vector *frames_; 82 | const std::vector *motions_; 83 | const std::vector *blurrinessRates_; 84 | }; 85 | 86 | class CV_EXPORTS NullDeblurer : public DeblurerBase 87 | { 88 | public: 89 | virtual void deblur(int /*idx*/, Mat &/*frame*/) {} 90 | }; 91 | 92 | class CV_EXPORTS WeightingDeblurer : public DeblurerBase 93 | { 94 | public: 95 | WeightingDeblurer(); 96 | 97 | void setSensitivity(float val) { sensitivity_ = val; } 98 | float sensitivity() const { return sensitivity_; } 99 | 100 | virtual void deblur(int idx, Mat &frame); 101 | 102 | private: 103 | float sensitivity_; 104 | Mat_ bSum_, gSum_, rSum_, wSum_; 105 | }; 106 | 107 | } // namespace videostab 108 | } // namespace cv 109 | 110 | #endif 111 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/videostab/fast_marching.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_VIDEOSTAB_FAST_MARCHING_HPP__ 44 | #define __OPENCV_VIDEOSTAB_FAST_MARCHING_HPP__ 45 | 46 | #include 47 | #include 48 | #include 49 | #include "opencv2/core/core.hpp" 50 | 51 | namespace cv 52 | { 53 | namespace videostab 54 | { 55 | 56 | // See http://iwi.eldoc.ub.rug.nl/FILES/root/2004/JGraphToolsTelea/2004JGraphToolsTelea.pdf 57 | class CV_EXPORTS FastMarchingMethod 58 | { 59 | public: 60 | FastMarchingMethod() : inf_(1e6f) {} 61 | 62 | template 63 | Inpaint run(const Mat &mask, Inpaint inpaint); 64 | 65 | Mat distanceMap() const { return dist_; } 66 | 67 | private: 68 | enum { INSIDE = 0, BAND = 1, KNOWN = 255 }; 69 | 70 | struct DXY 71 | { 72 | float dist; 73 | int x, y; 74 | 75 | DXY() : dist(0), x(0), y(0) {} 76 | DXY(float _dist, int _x, int _y) : dist(_dist), x(_x), y(_y) {} 77 | bool operator <(const DXY &dxy) const { return dist < dxy.dist; } 78 | }; 79 | 80 | float solve(int x1, int y1, int x2, int y2) const; 81 | int& indexOf(const DXY &dxy) { return index_(dxy.y, dxy.x); } 82 | 83 | void heapUp(int idx); 84 | void heapDown(int idx); 85 | void heapAdd(const DXY &dxy); 86 | void heapRemoveMin(); 87 | 88 | float inf_; 89 | 90 | cv::Mat_ flag_; // flag map 91 | cv::Mat_ dist_; // distance map 92 | 93 | cv::Mat_ index_; // index of point in the narrow band 94 | std::vector narrowBand_; // narrow band heap 95 | int size_; // narrow band size 96 | }; 97 | 98 | } // namespace videostab 99 | } // namespace cv 100 | 101 | #include "fast_marching_inl.hpp" 102 | 103 | #endif 104 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/videostab/frame_source.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_VIDEOSTAB_FRAME_SOURCE_HPP__ 44 | #define __OPENCV_VIDEOSTAB_FRAME_SOURCE_HPP__ 45 | 46 | #include 47 | #include 48 | #include "opencv2/core/core.hpp" 49 | #include "opencv2/highgui/highgui.hpp" 50 | 51 | namespace cv 52 | { 53 | namespace videostab 54 | { 55 | 56 | class CV_EXPORTS IFrameSource 57 | { 58 | public: 59 | virtual ~IFrameSource() {} 60 | virtual void reset() = 0; 61 | virtual Mat nextFrame() = 0; 62 | }; 63 | 64 | class CV_EXPORTS NullFrameSource : public IFrameSource 65 | { 66 | public: 67 | virtual void reset() {} 68 | virtual Mat nextFrame() { return Mat(); } 69 | }; 70 | 71 | class CV_EXPORTS VideoFileSource : public IFrameSource 72 | { 73 | public: 74 | VideoFileSource(const std::string &path, bool volatileFrame = false); 75 | 76 | virtual void reset(); 77 | virtual Mat nextFrame(); 78 | 79 | int frameCount() { return static_cast(reader_.get(CV_CAP_PROP_FRAME_COUNT)); } 80 | double fps() { return reader_.get(CV_CAP_PROP_FPS); } 81 | 82 | private: 83 | std::string path_; 84 | bool volatileFrame_; 85 | VideoCapture reader_; 86 | }; 87 | 88 | } // namespace videostab 89 | } // namespace cv 90 | 91 | #endif 92 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/videostab/log.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_VIDEOSTAB_LOG_HPP__ 44 | #define __OPENCV_VIDEOSTAB_LOG_HPP__ 45 | 46 | #include "opencv2/core/core.hpp" 47 | 48 | namespace cv 49 | { 50 | namespace videostab 51 | { 52 | 53 | class CV_EXPORTS ILog 54 | { 55 | public: 56 | virtual ~ILog() {} 57 | virtual void print(const char *format, ...) = 0; 58 | }; 59 | 60 | class CV_EXPORTS NullLog : public ILog 61 | { 62 | public: 63 | virtual void print(const char * /*format*/, ...) {} 64 | }; 65 | 66 | class CV_EXPORTS LogToStdout : public ILog 67 | { 68 | public: 69 | virtual void print(const char *format, ...); 70 | }; 71 | 72 | } // namespace videostab 73 | } // namespace cv 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/videostab/motion_stabilizing.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_VIDEOSTAB_MOTION_STABILIZING_HPP__ 44 | #define __OPENCV_VIDEOSTAB_MOTION_STABILIZING_HPP__ 45 | 46 | #include 47 | #include "opencv2/core/core.hpp" 48 | 49 | namespace cv 50 | { 51 | namespace videostab 52 | { 53 | 54 | class CV_EXPORTS IMotionStabilizer 55 | { 56 | public: 57 | virtual void stabilize(const Mat *motions, int size, Mat *stabilizationMotions) const = 0; 58 | 59 | #ifdef OPENCV_CAN_BREAK_BINARY_COMPATIBILITY 60 | virtual ~IMotionStabilizer() {} 61 | #endif 62 | }; 63 | 64 | class CV_EXPORTS MotionFilterBase : public IMotionStabilizer 65 | { 66 | public: 67 | MotionFilterBase() : radius_(0) {} 68 | virtual ~MotionFilterBase() {} 69 | 70 | virtual void setRadius(int val) { radius_ = val; } 71 | virtual int radius() const { return radius_; } 72 | 73 | virtual void update() {} 74 | 75 | virtual Mat stabilize(int index, const Mat *motions, int size) const = 0; 76 | virtual void stabilize(const Mat *motions, int size, Mat *stabilizationMotions) const; 77 | 78 | protected: 79 | int radius_; 80 | }; 81 | 82 | class CV_EXPORTS GaussianMotionFilter : public MotionFilterBase 83 | { 84 | public: 85 | GaussianMotionFilter() : stdev_(-1.f) {} 86 | 87 | void setStdev(float val) { stdev_ = val; } 88 | float stdev() const { return stdev_; } 89 | 90 | virtual void update(); 91 | 92 | virtual Mat stabilize(int index, const Mat *motions, int size) const; 93 | 94 | private: 95 | float stdev_; 96 | std::vector weight_; 97 | }; 98 | 99 | CV_EXPORTS Mat ensureInclusionConstraint(const Mat &M, Size size, float trimRatio); 100 | 101 | CV_EXPORTS float estimateOptimalTrimRatio(const Mat &M, Size size); 102 | 103 | } // namespace videostab 104 | } // namespace 105 | 106 | #endif 107 | -------------------------------------------------------------------------------- /3rdparty/opencv/include/opencv2/videostab/videostab.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_VIDEOSTAB_HPP__ 44 | #define __OPENCV_VIDEOSTAB_HPP__ 45 | 46 | #include "opencv2/videostab/stabilizer.hpp" 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /3rdparty/opencv/lib/opencv_core2413.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GRAYKEY/mobilefacenet_ncnn/996c20b4156886dce318e84dbb5430de0c727788/3rdparty/opencv/lib/opencv_core2413.lib -------------------------------------------------------------------------------- /3rdparty/opencv/lib/opencv_highgui2413.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GRAYKEY/mobilefacenet_ncnn/996c20b4156886dce318e84dbb5430de0c727788/3rdparty/opencv/lib/opencv_highgui2413.lib -------------------------------------------------------------------------------- /3rdparty/opencv/lib/opencv_imgproc2413.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GRAYKEY/mobilefacenet_ncnn/996c20b4156886dce318e84dbb5430de0c727788/3rdparty/opencv/lib/opencv_imgproc2413.lib -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GRAYKEY/mobilefacenet_ncnn/996c20b4156886dce318e84dbb5430de0c727788/CMakeLists.txt -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # mobilefacenet_ncnn 2 | A simple example implementing mobilefacenet for face recognition on ncnn. 3 | 4 | --- 5 | # introduction 6 | [MobileFaceNets: Efficient CNNs for Accurate Real-time Face Verification on Mobile Devices](https://arxiv.org/abs/1804.07573) is an art-of-the-state deep learning method for face recognition. It's designed for the mobile devices.
7 | [ncnn](https://github.com/Tencent/ncnn) is a high-performance neural network inference computing framework optimized for mobile platforms。
8 | This repo is a simple example implementing mobilefacenet on ncnn. 9 | 10 | --- 11 | # environment 12 | - vs 2015 13 | - cmake 14 | - ncnn 15 | - opencv2.4.13 16 | 17 | It is tested on windows10. the needed libraries are in 3rparty. You can replace them with yours. 18 | 19 | --- 20 | # how to use 21 | If you are familiar with how to build, compile and link, you just need the source code files in the src folder, model in the models folder, ncnn and opencv. You can skip all steps run it easy. 22 | 23 | 1.clone this repo. 24 | 25 | 2.If you want to use your all library, modify the CMakeLists.txt according to your environment.
26 | Or just use the library in 3rparty and not modify it. 27 | 28 | 3.run the build.bat in tools folder.it will generate vs2015 folder. 29 | 30 | 4.(if you modify in step 2 and make sure your environment right, skip this step)
31 | if you didn't change CMakeLists.txt and use my 3rparty library, copy the .dll in 3rparty/opencv/bin to vs2015 folder. 32 | 33 | 5.open the mobilefacenet_ncnn.sln in vs2015 folder. choose mobilefacenet_ncnn as the startup project. choose release x64 and compile. 34 | 35 | --- 36 | This model used is just 98.6% on lfw. You can replace it with your excellent models. 37 | 38 | Enjoy it! 39 | 40 | --- 41 | # 中文 42 | mobilefacenent在ncnn上的实现。 43 | 44 | --- 45 | # 运行步骤 46 | 47 | 如果你熟悉如何生成、编译、链接,只需要src文件夹的源码和models文件夹的模型和ncnn、opencv库。相信你可以很容易用自己的方法运行起来。
48 | 49 | 下面步骤是对于新手而言,如何在vs2015上运行。 50 | 51 | 1、下载该仓库(废话……) 52 | 53 | 2、想用自己的库,根据自己电脑环境修改CMakeLists.txt配置。不修改就直接用我3rparty里的。 54 | 55 | 3、运行tools文件夹下的build.bat生成vs2015文件夹。 56 | 57 | 4、如果第2步没修改,那么把3rparty/opencv/bin里的.dll动态链接都复制到生成的vs2015文件夹。 58 | 59 | 5、打开vs2015文件夹里面的mobilefacenet_ncnn.sln的解决方案,在解决方案资源管理器中将mobilefacenet_ncnn设为启动项目,编译release x64。 60 | 61 | 没什么错就能运行了 62 | 63 | --- 64 | 用的模型比较烂。可以替换成自己的模型。 65 | 66 | 注意用的模型是mxnet还是caffe转过来的。mxnet一般网络里减过均值并归一化过。ncnn Mat数据不需要再处理。caffe转的模型,输入数据就需要自己去减均值并归一化了。 67 | 68 | 这个工程主要就是踩踩坑。有些地方实现效率有点低。 69 | 70 | -------------------------------------------------------------------------------- /models/mobilefacenet.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GRAYKEY/mobilefacenet_ncnn/996c20b4156886dce318e84dbb5430de0c727788/models/mobilefacenet.bin -------------------------------------------------------------------------------- /pic/Aaron_Peirsol_0003.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GRAYKEY/mobilefacenet_ncnn/996c20b4156886dce318e84dbb5430de0c727788/pic/Aaron_Peirsol_0003.jpg -------------------------------------------------------------------------------- /pic/Aaron_Peirsol_0004.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GRAYKEY/mobilefacenet_ncnn/996c20b4156886dce318e84dbb5430de0c727788/pic/Aaron_Peirsol_0004.jpg -------------------------------------------------------------------------------- /pic/Aaron_Tippin_0001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GRAYKEY/mobilefacenet_ncnn/996c20b4156886dce318e84dbb5430de0c727788/pic/Aaron_Tippin_0001.jpg -------------------------------------------------------------------------------- /src/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | //#include 4 | #include "net.h" 5 | #include "mobilefacenet.h" 6 | 7 | 8 | 9 | int main() 10 | { 11 | char *model_path = "../models"; 12 | Recognize recognize(model_path); 13 | 14 | cv::Mat img1 = cv::imread("../pic/Aaron_Tippin_0001.jpg", CV_LOAD_IMAGE_COLOR); 15 | cv::Mat img2 = cv::imread("../pic/Aaron_Peirsol_0004.jpg", CV_LOAD_IMAGE_COLOR); 16 | std::vector feature1; 17 | std::vector feature2; 18 | 19 | clock_t start_time = clock(); 20 | recognize.start(img1, feature1); 21 | recognize.start(img2, feature2); 22 | double similar = calculSimilar(feature1, feature2); 23 | clock_t finish_time = clock(); 24 | double total_time = (double)(finish_time - start_time) / CLOCKS_PER_SEC; 25 | 26 | std::cout << "time" << total_time * 1000 << "ms" << std::endl; 27 | std::cout << "similarity is : " << similar << std::endl; 28 | cv::imshow("left", img1); 29 | cv::imshow("right", img2); 30 | cv::waitKey(0); 31 | 32 | return 0; 33 | } -------------------------------------------------------------------------------- /src/mobilefacenet.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | created by L. 2018.05.16 3 | */ 4 | 5 | #include "mobilefacenet.h" 6 | 7 | 8 | 9 | Recognize::Recognize(const std::string &model_path) { 10 | std::string param_files = model_path + "/mobilefacenet.param"; 11 | std::string bin_files = model_path + "/mobilefacenet.bin"; 12 | Recognet.load_param(param_files.c_str()); 13 | Recognet.load_model(bin_files.c_str()); 14 | } 15 | 16 | Recognize::~Recognize() { 17 | Recognet.clear(); 18 | } 19 | 20 | void Recognize::RecogNet(ncnn::Mat& img_) { 21 | ncnn::Extractor ex = Recognet.create_extractor(); 22 | //ex.set_num_threads(2); 23 | ex.set_light_mode(true); 24 | ex.input("data", img_); 25 | ncnn::Mat out; 26 | ex.extract("fc1", out); 27 | feature_out.resize(128); 28 | for (int j = 0; j < 128; j++) 29 | { 30 | feature_out[j] = out[j]; 31 | } 32 | } 33 | 34 | void Recognize::start(const cv::Mat& img, std::vector&feature) { 35 | ncnn::Mat ncnn_img = ncnn::Mat::from_pixels_resize(img.data, ncnn::Mat::PIXEL_BGR2RGB, img.cols, img.rows, 112, 112); 36 | RecogNet(ncnn_img); 37 | feature = feature_out; 38 | } 39 | 40 | double calculSimilar(std::vector& v1, std::vector& v2) 41 | { 42 | assert(v1.size() == v2.size()); 43 | double ret = 0.0, mod1 = 0.0, mod2 = 0.0; 44 | for (std::vector::size_type i = 0; i != v1.size(); ++i) 45 | { 46 | ret += v1[i] * v2[i]; 47 | mod1 += v1[i] * v1[i]; 48 | mod2 += v2[i] * v2[i]; 49 | } 50 | return (ret / sqrt(mod1) / sqrt(mod2) + 1) / 2.0; 51 | } 52 | -------------------------------------------------------------------------------- /src/mobilefacenet.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef MOBILEFACENET_H_ 3 | #define MOBILEFACENET_H_ 4 | #include 5 | #include "net.h" 6 | #include "opencv2/opencv.hpp" 7 | 8 | 9 | class Recognize { 10 | public: 11 | Recognize(const std::string &model_path); 12 | ~Recognize(); 13 | void start(const cv::Mat& img, std::vector&feature); 14 | private: 15 | void RecogNet(ncnn::Mat& img_); 16 | ncnn::Net Recognet; 17 | ncnn::Mat ncnn_img; 18 | std::vector feature_out; 19 | }; 20 | 21 | double calculSimilar(std::vector& v1, std::vector& v2); 22 | 23 | 24 | #endif // !MOBILEFACENET_H_ -------------------------------------------------------------------------------- /tools/build.bat: -------------------------------------------------------------------------------- 1 | cd .. 2 | mkdir vs2015 3 | cd vs2015 4 | cmake .. -G"Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=Release 5 | pause --------------------------------------------------------------------------------