Open a20185 opened 7 years ago
Moreover , in case to the loop in the same function
while (len(lines) < 4):
...
will also be better be improved by adding the loop condition of restricting the threshold_intersect
variable to more than zero to handle the abnormal situations.
First of all , thanks for sharing your code for the A4-correlation.
However , when I try to generate some outputs using your code , it will raise python
TypeError
, saying thatAfter finding and locating the problems , I found that the reason of this problem is because of the python interface
cv2.HoughLines(edges, rho, theta, threshold)
method provided by the standard OpenCV Library will return None if none of the Hough edges was found in the given image by the certainthreshold
value. Therefore , in the following method insrc/perspective.py
, L152~L226:Should provide Exception Handler to check for TypeError by using try...except block to wrap the following code:
or simply using if-else to handle the exceptions like:
will works fine.