Object orientation
Reflections
%pylab inline --no-import-all
Populating the interactive namespace from numpy and matplotlib
# %pylab inline --no-import-all
import scipy
import scipy.misc
import skimage
import skimage.io
import numpy as np
import urllib
# import cStringIO
import matplotlib.pyplot as plt
# scipy.misc.imread(
URL = "http://uc452cam01-kky.fav.zcu.cz/snapshot.jpg"
# URL = "http://plzen.cz/kamera.php?0.8989779513794929"
URL = "http://www.chmi.cz/files/portal/docs/meteo/kam/pribram.jpg"
im = skimage.io.imread(URL)
# im = skimage.io.imread(URL, as_grey=True)
plt.imshow(im)
plt.show()
im.shape
(1200, 1600, 3)
im.shape
(480, 640, 3)
im[50, 10, 0]
195
im[10:15, 10:15, 0]
array([[195, 195, 194, 193, 195], [196, 198, 197, 196, 196], [196, 196, 195, 195, 195], [194, 195, 194, 194, 195], [193, 193, 193, 194, 195]], dtype=uint8)
pole = [1,2,3,4,5,6,7,8,9]
print(pole[::2])
[1, 3, 5, 7, 9]
im = skimage.io.imread(URL)
im[130:140,:, 2] = 0
plt.imshow(im)
<matplotlib.image.AxesImage at 0x1a95f1a7580>
plt.imshow(im[::10, ::10, :])
<matplotlib.image.AxesImage at 0x1a95f78b520>
import skimage.color
img = skimage.color.rgb2gray(im)
print(img.shape)
plt.imshow(img)
plt.colorbar()
(1200, 1600)
<matplotlib.colorbar.Colorbar at 0x1a95ffb6430>