Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
  1. for "binary flags" like 0,1,2,4,8,16, etc | and + are equivalent operations
  2. cv2.threshold returns the binary image and also the threshold value (useful, if you use OTSU). have a look:


>>> help(cv2.threshold)
Help on built-in function threshold:

threshold(...)
    threshold(src, thresh, maxval, type[, dst]) -> retval, dst

in your case above it means: keep only the image, and discard the threshold value.

  1. for "binary flags" (pow 2) like 0,1,2,4,8,16, etc | and + are equivalent operations
  2. cv2.threshold returns the binary image and also the threshold value (useful, if you use OTSU). have a look:


>>> help(cv2.threshold)
Help on built-in function threshold:

threshold(...)
    threshold(src, thresh, maxval, type[, dst]) -> retval, dst

in your case above it means: keep only the image, and discard the threshold value.