Skip to content

Hezihao/cv_scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cv_scripts

Functionalities implemented with OpenCV.

Lane Detector

Intro:

The following steps are included in this simple demo:

  1. undistort the raw image data from camera
  2. transfer into grayscale image, and apply Canny filter on it
  3. apply color filter on it(cause the lane line is of yellow) in order to extract line
  4. combine both and binarize it
  5. get to the bird-eye view image with warping
  6. apply sliding window onto the bird-eye view and detect centers of lines in it
  7. interpolation inbetween those nodes with 2nd(3rd) order curves
  8. map it back to normal view and overlap it with original(undistorted image)

Examples:

  1. Output of detection on warped image:

  2. Overlapped with original data:

Optical Flow

Intro:

Following steps are envolved in calculation of optical flow:

  1. Feature extraction: Harris corners & SIFT feature are covered by now.
    SIFT provides a more rich feature detection and hopefully a better optical flow.

  2. Calculation of optical flow with:
    points, status, error = cv2.calcOpticalFlowPyrLK(frame_1, frame_2, feature_points, (...next_points...), **lk_params)
    see documentation of function at https://docs.opencv.org/2.4/modules/video/doc/motion_analysis_and_object_tracking.html this function is based on Lukas-Kanade method, which results as a sparse set(compared to Farneback method), and there are three assumptions:

    • constant intensity
    • continuious/small motion
    • spatial continuity
  3. Visualization of features/traces with:
    cv2.circle(Img, (point_x, point_y), radius, (color_b, color_g, color_r), width)
    cv2.line(Img, (pa_x, pa_y), (pb_x, pb_y), (color_b, color_g, color_r), width)

Examples

  1. Original data:

  2. Detected features:
    Harris


    SIFT

  3. Calculated optical flow:
    Harris


    SIFT

  4. Overall traces
    Harris


    SIFT

About

Functionalities implemented with OpenCV.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages