|
GCVL
Multi-platform (Windows, Unix and Mac OS) C++/OpenCL/CUDA library with several Computer Vision algorithms.
|
00001 /* 00002 * 00003 * GPGPU Computer Vision Library (GCVL) 00004 * 00005 * Copyright (c) Luis Omar Alvarez Mures 2015 <omar.alvarez@udc.es> 00006 * Copyright (c) Emilio Padron Gonzalez 2015 <emilioj@gmail.com> 00007 * 00008 * All rights reserved. 00009 * 00010 * This library is free software; you can redistribute it and/or 00011 * modify it under the terms of the GNU General Public 00012 * License as published by the Free Software Foundation; either 00013 * version 3 of the License, or (at your option) any later version. 00014 * 00015 * This library is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 * General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU General Public 00021 * License along with this library. 00022 * 00023 */ 00024 00025 #pragma once 00026 00027 #include "export.h" 00028 #include "gcvlconfig.h" 00029 #include "algorithm.h" 00030 00031 #include <memory> 00032 #include <string> 00033 #include <vector> 00034 #include <opencv2/opencv.hpp> 00035 00036 namespace gcvl { 00037 00038 class GCVL_EXPORT BlockMatching : public Algorithm { 00039 00040 public: 00041 BlockMatching(std::string inputLeft, std::string inputRight, std::unique_ptr<unsigned char[]> &output); 00042 ~BlockMatching(); 00044 00047 inline void setAggDim(const int val) { val % 2 == 0 ? _dim = val + 1 : _dim = val; _radius = _dim / 2; } 00049 00052 inline void setMaxDisp(const int val) { val > 255 ? _maxDisp = 255 : _maxDisp = val; } 00054 00057 inline void setNormalize(const bool val) { _normalize = val; } 00059 00062 inline unsigned int getWidth() { return _width; } 00064 00067 inline unsigned int getHeight() { return _height; } 00068 void prepare(); 00069 void setArgs(); 00070 void launch(); 00071 void postpare(); 00072 00073 private: 00074 //Aggregation dimension (odd value) 00075 int _dim; 00076 //Aggregation dimension / 2 00077 int _radius; 00078 //Maximum disparity 00079 int _maxDisp; 00080 bool _normalize; 00081 unsigned int _width; 00082 unsigned int _height; 00083 cv::Mat _inputLeft; 00084 cv::Mat _inputRight; 00085 unsigned char * _output; 00086 00087 }; 00088 00089 }