Last active
December 19, 2017 00:25
-
-
Save BlogBlocks/6b336a5d6b7aa58574e9de11e19b2428 to your computer and use it in GitHub Desktop.
finding an image mean
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
""" | |
Get numpy mean of an image, np meanimage mean as a float image mean as a decimal | |
float is the mean displayed in a value between 0 and 1 | |
""" | |
from skimage import io | |
import numpy as np | |
image = io.imread('http://i.stack.imgur.com/Y8UeF.jpg') | |
print(np.mean(image)) | |
#You might want to convert all images to float to get a value betwenn 0 and 1: | |
from skimage import io, img_as_float | |
import numpy as np | |
image = io.imread('publish/20170819160925.jpg') | |
image = img_as_float(image) | |
print(np.mean(image)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment