Ok, I finally found the problem and thought I would share the solution for anyone else driven nuts by this. The issue is that in the HoughLinesP function, there is an extra parameter, “lines” which is redundant because the output of the function is the same:
cv2.HoughLinesP(image, rho, theta, threshold[, lines[, minLineLength[, maxLineGap]]])
This is causing issues with the parameters as they are read in the wrong order. To avoid confusion with the order of the parameters, the simplest solution is to specify them inside the function like so:
lines = cv2.HoughLinesP(E,rho = 1,theta = 1*np.pi/180,threshold = 100,minLineLength = 100,maxLineGap = 50)
This totally fixed my problem and I hope it will help others.
Related Posts:
- Cannot find module cv2 when using OpenCV
- Cannot find module cv2 when using OpenCV
- How to resize an image with OpenCV2.0 and Python2.6
- ImportError: numpy.core.multiarray failed to import
- import opencv vs import cv2
- Cannot find module cv2 when using OpenCV
- ImportError: DLL load failed: %1 is not a valid Win32 application. But the DLL’s are there
- ImportError: numpy.core.multiarray failed to import
- ImportError: DLL load failed: %1 is not a valid Win32 application. But the DLL’s are there
- Permission denied error by installing matplotlib
- How do I install Python OpenCV through Conda?
- How can I upgrade NumPy?
- Difference in output with waitKey(0) and waitKey(1)
- ImportError: libSM.so.6: cannot open shared object file: No such file or directory
- explain arguments meaning in res = cv2.bitwise_and(img,img,mask = mask)
- OpenCV NoneType object has no attribute shape
- What does bitwise_and operator exactly do in openCV?
- SystemError: new style getargs format but argument is not a tuple?
- ImportError: No module named ‘cv2’ Python3
- Cannot import cv2 in python in OSX
- ImportError: No module named cv2
- OpenCV NoneType object has no attribute shape
- Installing opencv on Windows 10 with python 3.6 and anaconda 3.6
- How to crop an image in OpenCV using Python
- SystemError: new style getargs format but argument is not a tuple?
- cmake error ‘the source does not appear to contain CMakeLists.txt’
- inverting image in Python with OpenCV
- How does cv2.boundingRect() function of OpenCV work?
- Python OpenCV2 (cv2) wrapper to get image size?
- ValueError: total size of new array must be unchanged
- What’s the canonical way to check for type in Python?
- IndexError: tuple index out of range —– Python
- What is the pythonic way to calculate dot product?
- Is there a ‘foreach’ function in Python 3?
- How to condense if/else into one line in Python?
- Depth-first search (DFS) code in python
- How to use Python to execute a cURL command?
- What does %s mean in a python format string?
- bash: pip: command not found
- How do I concatenate two lists in Python?
- Convert a tensor to numpy array in Tensorflow?
- How to run Conda?
- How do I check whether a file exists without exceptions?
- How can I get dictionary key as variable directly in Python (not by searching from value)?
- pygame.error: video system not initialized
- Python – Reading and writing csv files with utf-8 encoding
- Python’s equivalent of && (logical-and) in an if-statement
- Replace values in list using Python
- Trouble updating to Anaconda Navigator 1.10.0 (MacOS)
- Binary numbers in Python
- Django: ImproperlyConfigured: The SECRET_KEY setting must not be empty
- Remove all occurrences of a value from a list?
- os.path.dirname(__file__) returns empty
- keyerror 1 in my code
- ‘NoneType’ object has no attribute ‘group’
- How to fix ‘ValueError: list.remove(x): x not in list’ error in Python
- Group by index + column in pandas
- Why am I getting a FileNotFoundError?
- What is the difference between ‘/’ and ‘//’ when used for division?
- How do I format a string using a dictionary in python-3.x?
- How to extend a class in python?
- Converting XML to JSON using Python?
- Django – no such table exception
- How to import a module given the full path?
- Why does “pip install” inside Python raise a SyntaxError?
- Removing numbers from string
- importing external “.txt” file in python
- How can I remove Nan from list Python/NumPy
- Writing string to a file on a new line every time
- examining items in a python Queue
- What’s the difference between scikit-learn and tensorflow? Is it possible to use them together?
- How to initialize weights in PyTorch?
- Can’t find module cPickle using Python 3.5 and Anaconda
- How can I check if two segments intersect?
- “Can’t convert ‘float’ object to str implicitly”
- Why I get ‘list’ object has no attribute ‘items’?
- tar: Unrecognized archive format error when trying to unpack flower_photos.tgz, TF tutorials on OSX
- Repeating a function in Python
- How can I convert a .py to .exe for Python?
- LinAlgError: Last 2 dimensions of the array must be square
- Nonlinear regression with python – what’s a simple method to fit this data better?
- ImportError: No module named mysql.connector using Python2
- Python read in string from file and split it into values
- range() for floats
- import pandas_datareader gives ImportError: cannot import name ‘is_list_like’
- How does tuple comparison work in Python?
- AttributeError: ‘float’ object has no attribute ‘split’4
- How to add pandas data to an existing csv file?
- AttributeError: ‘tuple’ object has no attribute
- In Python, how do I determine if an object is iterable?
- Explaining Python’s ‘__enter__’ and ‘__exit__’
- numpy.float64 object is not iterable…but I’m NOT trying to
- Converting a list to a set changes element order
- Create a list with initial capacity in Python
- Accessing dict_keys element by index in Python3
- How to update Pandas from Anaconda and is it possible to use eclipse with this last
- Does python support character type?
- Styling multi-line conditions in ‘if’ statements?
- What is related_name used for?
- Symbol not found: __PyCodecInfo_GetIncrementalDecoder