为了实现利用霍夫变换求得页面的格子线和边界的定位,需要识别出这些格子线和边界,但是现在的情况下,识别情况不是很好。暂且把代码罗列如下,以便后续修改完善。
参考代码:
#!/usr/bin/env python
'''
Usage:
------
ipcam.py
Keys:
-----
ESC - exit
'''
# Python 2/3 compatibility
from __future__ import print_function
import sys
PY3 = sys.version_info[0] == 3
if PY3:
xrange = range
import cv2
import urllib
import numpy as np
import math
def check_hough_line(dst, cdst, isHoughLinesP = True):
'''dst: cdst:
'''
if isHoughLinesP: # HoughLinesP
lines = cv2.HoughLinesP(dst, 1, math.pi/180.0, 40, np.array([]), 50, 10)
if lines == None:
return
a,b,c = lines.shape
for i in range(a)