简体   繁体   中英

How to detect a zebra crossing at the picture?

Good morning, I've just started with Computer Vision . I am trying build a zebra crossing detection. I did as much as at picture. What should I do next?

import cv2

test_image = cv2.imread('dataset/crossway4.jpg')
gray_image = cv2.cvtColor(test_image, cv2.COLOR_BGR2GRAY)

# Extract white color pixels 
white_mask = cv2.inRange(gray_image, 200, 255)
gaussian_blur = cv2.GaussianBlur(white_mask, (5, 5), cv2.BORDER_DEFAULT)

cv2.imshow('Zebra Crossing Detection', gaussian_blur)

cv2.waitKey(0)
cv2.destroyAllWindows()

在此处输入图片说明

Firstly try to get only ROI part from complete image then you can use template matching to check for similar crossing ( https://docs.opencv.org/master/d4/dc6/tutorial_py_template_matching.html ). enter image description here You have to make a small data-set directory of possible template from which it will match. this could be time consuming processing so you can also opt machine-learning(object detection tensorflow,YOLO) as a alternative method for the same.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM