Identifying the range of a color in HSV using openCV

前端 未结 4 2004
陌清茗
陌清茗 2021-02-03 13:59

I am working on identifying the color yellow using openCV in python. I have come to this step where I have to define the lower and upper range of the color yellow in HSV.

<
4条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-03 14:38

    if i want to do it ,first find rgb numbers for yellow (i use 'Edit colors 'in paint) then change them to HSV whith this method:

     u = np.uint8([[[0,236,236]]])
     # define range of blue color in HSV
     lower_yellow = np.array(cv2.cvtColor(l,cv2.COLOR_BGR2HSV))
     upper_yellow = np.array( cv2.cvtColor(u,cv2.COLOR_BGR2HSV))```
    
    

提交回复
热议问题