Skip to content

Latest commit

 

History

History
29 lines (27 loc) · 844 Bytes

onelineCVFunctions_jp.md

File metadata and controls

29 lines (27 loc) · 844 Bytes

onelineCVFunctions.hpp

下記の頻出の変換を1行で書けるようにした関数群

  • convert
  • cvtColor
  • copyMakeBorder
  • split

convert

cv::Mat convert(cv::Mat& src, const int depth, const double alpha = 1.0, const double beta = 0.0);

Usage

convert関数の戻り値をcv::Matに変えただけの関数です. 下記のような型のキャストや,何倍するかなどを指定するのを1行で書きたい場合に使います.

Mat a = convert(b, CV_8U, 5);

下記のように書けることの代用です.

Mat src = a.clone()

convert

cv::Mat cenvertCentering(cv::InputArray src, int depth, double a = 1.0, double b = 127.5);

Usage

convertと同じ用途ですが,convertax+bを行い,こちらは,a(x-b)を行います.