Giter VIP home page Giter VIP logo

vehicle-headlight-tracker's People

Contributors

lewjiayi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

pratham1025

vehicle-headlight-tracker's Issues

ValueError: too many values to unpack (expected 2)

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)

Multiple issues on latest version of OpenCV

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.