Skip to content

Instantly share code, notes, and snippets.

@domluna
Last active June 13, 2016 17:00
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 domluna/61570cc152b3541c0609d8c7c764629d to your computer and use it in GitHub Desktop.
Save domluna/61570cc152b3541c0609d8c7c764629d to your computer and use it in GitHub Desktop.
example of rgb2gray + resizing images
from __future__ import absolute_import
from __future__ import print_function
from __future__ import absolute_import
import warnings
from skimage.color import rgb2gray
from skimage.transform import resize
from skimage import img_as_ubyte
def rgb2gray_resize(img, new_height, new_width):
with warnings.catch_warnings():
warnings.simplefilter('ignore')
return img_as_ubyte(resize(rgb2gray(observation), (new_height, new_width)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment