python: 'cv2.' -> 'cv.' via 'import cv2 as cv'
This commit is contained in:
@@ -7,7 +7,7 @@ This example illustrates how to use Hough Transform to find lines
|
||||
# Python 2/3 compatibility
|
||||
from __future__ import print_function
|
||||
|
||||
import cv2
|
||||
import cv2 as cv
|
||||
import numpy as np
|
||||
import sys
|
||||
import math
|
||||
@@ -16,9 +16,9 @@ from tests_common import NewOpenCVTests
|
||||
|
||||
def linesDiff(line1, line2):
|
||||
|
||||
norm1 = cv2.norm(line1 - line2, cv2.NORM_L2)
|
||||
norm1 = cv.norm(line1 - line2, cv.NORM_L2)
|
||||
line3 = line1[2:4] + line1[0:2]
|
||||
norm2 = cv2.norm(line3 - line2, cv2.NORM_L2)
|
||||
norm2 = cv.norm(line3 - line2, cv.NORM_L2)
|
||||
|
||||
return min(norm1, norm2)
|
||||
|
||||
@@ -29,9 +29,9 @@ class houghlines_test(NewOpenCVTests):
|
||||
fn = "/samples/data/pic1.png"
|
||||
|
||||
src = self.get_sample(fn)
|
||||
dst = cv2.Canny(src, 50, 200)
|
||||
dst = cv.Canny(src, 50, 200)
|
||||
|
||||
lines = cv2.HoughLinesP(dst, 1, math.pi/180.0, 40, np.array([]), 50, 10)[:,0,:]
|
||||
lines = cv.HoughLinesP(dst, 1, math.pi/180.0, 40, np.array([]), 50, 10)[:,0,:]
|
||||
|
||||
eps = 5
|
||||
testLines = [
|
||||
|
||||
Reference in New Issue
Block a user