Cv2.inRange
Thresholding Operations
Synopsis
Checks if array elements lie between the elements of two other arrays.
The function checks the range as follows:
- For every element of a single-channel input array:
- \(\texttt{dst} (I)= \texttt{lowerb} (I)_0 \leq \texttt{src} (I)_0 \leq \texttt{upperb} (I)_0\)
- For two-channel arrays:
- \(\texttt{dst} (I)= \texttt{lowerb} (I)_0 \leq \texttt{src} (I)_0 \leq \texttt{upperb} (I)_0 \land \texttt{lowerb} (I)_1 \leq \texttt{src} (I)_1 \leq \texttt{upperb} (I)_1\)
and so forth.
That is, dst (I) is set to 255 (all 1 -bits) if src (I) is within the specified 1D, 2D, 3D, ... box and 0 otherwise.
When the lower and/or upper boundary parameters are scalars, the indexes (I) at lowerb and upperb in the above formulas should be omitted.
Parameters
-
src- first input array. -
lowerb- inclusive lower boundary array or a scalar. -
upperb- inclusive upper boundary array or a scalar. -
dst- output array of the same size as src and CV_8U type.
See also
Favorite site
- OpenCV: Thresholding Operations using inRange
- 라즈베리파이 OpenCV 파이썬 컬러 필터링 : 네이버 블로그
- (파이썬 OpenCV) 특정 색상 영역 추출 - cv2.inRange
- (w6d4) 특정 색상 영역 추출과 Edge detection
- (10) OpenCV python - 색상 범위 추출 - inRange
이 문서를 가리키는 문서