lewjiayi / vehicle-headlight-tracker Goto Github PK
View Code? Open in Web Editor NEWA simple night time vehicle tracking algorithm via headlight
License: MIT License
A simple night time vehicle tracking algorithm via headlight
License: MIT License
Could you please help with this error?
Traceback (most recent call last):
File "C:\Users\user\Downloads\Vehicle-Headlight-Tracker-master\Vehicle-Headlight-Tracker-master\detct.py", line 85, in
contours, hierarchy = cv2.findContours(t, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
ValueError: too many values to unpack (expected 2)
Firstly I'd like to say, fascinating work by the looks of everything. I've been attempting to manipulate the code to work but it's not quite working.
Error 1: If running the code raw without any edits, the first error will appear on line 165: low = np.min(np.max(cnt, axis=1), axis=0), it will raise a NumPy AxisError; that axis 1 is out of bounds for array of dimension 0.
--> Changing the if statement right above it from "if len(contours) > 0:" to "if contours.ndim > 1:" will then create error 2.
Error 2: This error will occur on line 107 (line may vary depending on how much you modified the code at this point): contours = np.delete(contours, badBlob), it will raise a Value Error, indicating that "The requested array has an inhomogeneous shape after 1 dimensions".
--> Changing the deletion statement to contours = [contour for i, contour in enumerate(contours) if i not in badBlob] will then raise error 3.
Error 3: This error will occur during the program's first contour encounter, and will argue that the "isUpdated" boolean is not defined.
--> Simple fix, just write "isUpdated = False" on the line before the while loop.
Doing all of these adjustments will make the code run without error interruption, but will also fail to do its original job. As I saw from your example photos, I do not doubt at all the ability of the code to work properly, I would just like to know where you believe I went wrong in error handling and fixing.
Thank you so much!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.