[Opencv-python] cv2.inRange(...) specifies the ROI area

[Opencv-python] cv2.inRange specifies the ROI area

1. Background

When doing image processing, it is often necessary to specify the ROI (region of interest), which can greatly reduce the amount of calculation, and at the same time, it is convenient for the program to process the target.
Cv2 can specify the interface of ROI:

cv2.inRange(src, lowerb, upperb[, dst]) -> dst

The cv2.inRange(...) function itself is to check whether the array element is between the elements of the other two arrays.
If it is between the elements, the element becomes 255, otherwise it is 0;
this feature can be used to specify the ROI, and then you can make Mask or choice

Guess you like

Origin blog.csdn.net/jn10010537/article/details/113086472