MCPcopy Create free account
hub / github.com/PyImageSearch/imutils / check_opencv_version

Function check_opencv_version

imutils/convenience.py:218–236  ·  view source on GitHub ↗
(major, lib=None)

Source from the content-addressed store, hash-verified

216 return int(lib.__version__.split(".")[0])
217
218def check_opencv_version(major, lib=None):
219 # this function may be removed in a future release as we now
220 # use the get_opencv_major_function to obtain the current OpenCV
221 # version and then perform the actual version check *within* the
222 # respective function
223 import warnings
224 message = """
225 The check_opencv_version function is deprecated and may be
226 removed in a future release. Use at your own risk.
227 """
228 warnings.warn(message, DeprecationWarning, stacklevel=2)
229
230 # if the supplied library is None, import OpenCV
231 if lib is None:
232 import cv2 as lib
233
234 # return whether or not the current OpenCV version matches the
235 # major version number
236 return lib.__version__.startswith(major)
237
238def build_montages(image_list, image_shape, montage_shape):
239 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…