OpenCV操作(一)

cv::threshold()

 threshold(InputArray src, OutputArray dst,double thresh, double maxVal, int thresholdType)

参数

src - 输入矩阵对矩阵src中的每个元素应用固定阈值分割

dst - 输出矩阵

thresh - 阈值

maxVal - 设置的最大值

thresholdType - 阈值类型

阈值类型

THRESH_BINARY:过门限的值设置为maxVal,其它值置零

THRESH_BINARY_INV:过门限的值置零,其它值设置为maxVal

THRESH_TRUNC:过门限的值设置为门限值,其它值置不变

THRESH_TOZERO:过门限的值不变,其它值置零

THRESH_TOZERO_INV:过门限的值置零,其它值不变

cv::minMaxLoc(InputArray src, double* minVal, double* maxVal=0, Point* minLoc=0, Point* maxLoc=0, InputArray mask=noArray())

在给定的矩阵中寻找最大和最小值(包括它们的位置).

Parameters:
  • src – input single-channel array.
  • minVal – pointer to the returned minimum value; NULL is used if not required.
  • maxVal – pointer to the returned maximum value; NULL is used if not required.
  • minLoc – pointer to the returned minimum location (in 2D case); NULL is used if not required.
  • maxLoc – pointer to the returned maximum location (in 2D case); NULL is used if not required.
  • mask – optional mask used to select a sub-array.

猜你喜欢

转载自blog.csdn.net/sinat_37011812/article/details/82228402
今日推荐