In [1]:
import cv2
import numpy as np
img = cv2.imread("data/soccerball.jpeg")
print(type(img), img.shape)
In [2]:
blue = img[100, 100, 0]
In [3]:
print(blue)
In [4]:
img.item(10, 10, 2)
Out[4]:
In [5]:
img.itemset((10,10,2), 100)
In [6]:
img.item(10,10,2)
Out[6]:
In [7]:
img.dtype
Out[7]:
In [8]:
b,g,r = cv2.split(img)
In [10]:
img2 = cv2.merge((b,g,r))
In [14]:
from matplotlib import pyplot as plt
%matplotlib inline
In [18]:
plt.imshow(img2)
Out[18]:
In [ ]: