Skip to content

Instantly share code, notes, and snippets.

@bigsnarfdude
Last active August 1, 2016 18:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bigsnarfdude/38c2a214fbc6369d5b697df63c93171c to your computer and use it in GitHub Desktop.
Save bigsnarfdude/38c2a214fbc6369d5b697df63c93171c to your computer and use it in GitHub Desktop.
[self-driving-car] greyscale
# label pixel0 pixel1 pixel2 pixel3 pixel4 pixel5 pixel6 pixel7 pixel8
# 1 0 0 0 0 0 0 0 0 0
# 0 0 0 0 0 0 0 0 0 0
from skimage import color
from skimage import io
img = color.rgb2gray(io.imread('001.jpg'))
img
x1 = 0
x2 = 240
y1 = 0
y2 = 240
cropped = img[x1:x2,y1:y2]
io.imsave("/Users/benchemployee/Desktop/kaggle/selfDriving/cropped.jpg", cropped)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment