Skip to content

[Finding_Lanes] Fix path resolution, missing frame validation, Hough lines crash, and update README #467

Description

@Prayas340

Description

This issue addresses several bugs and improvement areas in the Finding_Lanes project:

  1. Path Resolution Issue: Hardcoded relative paths (Finding_Lanes/video.mp4 in lanes.py and Finding_Lanes/picture.jpg in sub.py) cause FileNotFoundError or video load failure when running the scripts from within the Finding_Lanes directory as instructed in README.md.
  2. Missing Frame Validation: lanes.py does not check ret or frame is None from cap.read(), causing an unhandled OpenCV exception (cv2.cvtColor on empty image) when reaching EOF or frame read failure.
  3. Empty Hough Lines Crash: average_lines_intercept() raises a TypeError when HoughLinesP returns None, or crashes when left/right fit arrays are empty (e.g. no left or right lane line detected).
  4. Incomplete README: README.md contains placeholder text under the description section (A short description about the script must be mentioned here.).

Proposed Fixes

  • Use os.path relative to __file__ for dynamic asset path resolution in lanes.py and sub.py.
  • Add frame validation check (if not ret or frame is None: break) in lanes.py.
  • Add null and empty array checks in average_lines_intercept() and make_coordinate() to gracefully handle undetected lane lines.
  • Complete the README.md description section with project details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions