lane_detection_module.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:diy_driverless_car_ROS 作者: wilselby 项目源码 文件源码
def binary_thresh( img,  boundaries,  filter):

     if filter == 'RGB':
         frame_to_thresh = img.copy()
     else:
         frame_to_thresh = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)

     for (lower,  upper) in boundaries:

         # create numpy arrays from the boundaries
         lower = np.array(lower,  dtype = "uint8")
         upper = np.array(upper,  dtype = "uint8")

         # find the colors within the specified boundaries and apply the mask
         mask = cv2.inRange(frame_to_thresh,  lower,  upper)
         output = cv2.bitwise_and(frame_to_thresh, frame_to_thresh,  mask = mask)   #Returns an RGB image

     return mask
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号