Last active
June 13, 2016 17:00
-
-
Save domluna/61570cc152b3541c0609d8c7c764629d to your computer and use it in GitHub Desktop.
example of rgb2gray + resizing images
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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