(major, lib=None)
| 216 | return int(lib.__version__.split(".")[0]) |
| 217 | |
| 218 | def 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 | |
| 238 | def build_montages(image_list, image_shape, montage_shape): |
| 239 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…