src/Perturb.cpp
/**
 * \brief Get the value of the matrix at (x,y), clamping the points if they are outside the image.
 */
\brief Get the value of the matrix at (x,y), clamping the points if they are outside the image.
\ brief Get the value of the matrix at ( x y ) clamping the points if they are outside the image .
float Perturb::getValue(const cv::Mat& img, const float point_x, const float point_y)
{
  float x = clamp(point_x, 0, static_cast<float>(img.cols - 2));
  float y = clamp(point_y, 0, static_cast<float>(img.rows - 2));
  return img.at<float>(static_cast<int>(y), static_cast<int>(x));
}
float Perturb :: getValue ( const cv :: Mat & img , const float point_x , const float point_y ) { float x = clamp ( point_x , 0 , static_cast < float > ( img . cols - 2 ) ) ; float y = clamp ( point_y , 0 , static_cast < float > ( img . rows - 2 ) ) ; return img . at < float > ( static_cast < int > ( y ) , static_cast < int > ( x ) ) ; }
\brief Get the value of the matrix at (x,y), clamping the points if they are outside the image.
\ brief Get the value of the matrix at ( x y ) clamping the points if they are outside the image .