python: 'cv2.' -> 'cv.' via 'import cv2 as cv'
This commit is contained in:
@@ -7,7 +7,7 @@ MSER detector test
|
||||
from __future__ import print_function
|
||||
|
||||
import numpy as np
|
||||
import cv2
|
||||
import cv2 as cv
|
||||
|
||||
from tests_common import NewOpenCVTests
|
||||
|
||||
@@ -33,7 +33,7 @@ class mser_test(NewOpenCVTests):
|
||||
]
|
||||
thresharr = [ 0, 70, 120, 180, 255 ]
|
||||
kDelta = 5
|
||||
mserExtractor = cv2.MSER_create()
|
||||
mserExtractor = cv.MSER_create()
|
||||
mserExtractor.setDelta(kDelta)
|
||||
np.random.seed(10)
|
||||
|
||||
@@ -53,11 +53,11 @@ class mser_test(NewOpenCVTests):
|
||||
mserExtractor.setMinArea(kMinArea)
|
||||
mserExtractor.setMaxArea(kMaxArea)
|
||||
if invert:
|
||||
cv2.bitwise_not(src, src)
|
||||
cv.bitwise_not(src, src)
|
||||
if binarize:
|
||||
_, src = cv2.threshold(src, thresh, 255, cv2.THRESH_BINARY)
|
||||
_, src = cv.threshold(src, thresh, 255, cv.THRESH_BINARY)
|
||||
if blur:
|
||||
src = cv2.GaussianBlur(src, (5, 5), 1.5, 1.5)
|
||||
src = cv.GaussianBlur(src, (5, 5), 1.5, 1.5)
|
||||
minRegs = 7 if use_big_image else 2
|
||||
maxRegs = 1000 if use_big_image else 20
|
||||
if binarize and (thresh == 0 or thresh == 255):
|
||||
|
||||
Reference in New Issue
Block a user