/*
 * Copyright 2017 Jan Dorazil <deu439@gmail.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

#ifndef LBPH_HPP
#define LBPH_HPP

#include <opencv2/opencv.hpp>

using namespace cv;

class lbph
{
  template <typename _Tp> static
  void olbp_(InputArray _src, OutputArray _dst);
  
  template <typename _Tp> static
  void elbp_(InputArray _src, OutputArray _dst, int radius, int neighbors);
  
  template <typename _Tp> static
  void eltp_(
    InputArray _src, OutputArray _dst, int radius, int neighbors, float th
  );
  
  template <typename _Tp>
  static void lbsp_(InputArray _src, OutputArray _dst, float threshold);
  
  template <typename _Tp>
  static void lbsp_(InputArray _src1, InputArray _src2, OutputArray _dst,
                    float threshold);

  template <typename _Tp>
  static void var_(InputArray _src, OutputArray _dst);

  static Mat histc_(const Mat& src, int minVal=0,
                    int maxVal=255, bool normed=false);
  static Mat histc(InputArray _src, int minVal, int maxVal, bool normed);
  
public:
  static void remap(Mat in);
  static void mb_lbp(InputArray _src, OutputArray _dst);
  static void olbp(InputArray src, OutputArray dst);
  static void elbp(InputArray src, OutputArray dst, int radius, int neighbors);
  static void eltp(
    InputArray src, OutputArray dst, int radius, int neighbors, float th
  );
  static void lbsp(InputArray src, OutputArray dst, float threshold);
  static void lbsp(InputArray src1, InputArray src2, OutputArray dst,
                   float threshold);
  static void var(InputArray src, OutputArray dst);
  static Mat spatial_histogram(InputArray _src, int numPatterns,
                               int grid_x, int grid_y, bool /*normed*/);
};

#endif // LBPH_HPP
