Realization method of python opencv reading a picture and returning b g and r values of a pixel point of the picture

  • 2021-07-09 08:51:55
  • OfStack

As shown below:


#coding=utf-8
# Read a picture   Object of a pixel in the picture b , g , r Value 
import cv2
import numpy as np
 
img=cv2.imread('./o.jpg')
px=img[10,10]
print px
blue=img[10,10,0]
print blue
green=img[10,10,1]
print blue
red=img[10,10,2]
print blue

Related articles: