Skip to content

Instantly share code, notes, and snippets.

@agneym
Created April 12, 2016 12:27
Show Gist options
  • Save agneym/1ce047872de1da503bd6d5e3077d3bdf to your computer and use it in GitHub Desktop.
Save agneym/1ce047872de1da503bd6d5e3077d3bdf to your computer and use it in GitHub Desktop.
To represent opencv image as normalised float
import cv2
import numpy as np
from skimage import img_as_float
#Read image from given direcotory
image = cv2.imread('C:\Python27\images\pic.jpg')
#Print pixel at (100,100)
print image[100,100]
#................ image converted to float.............
float_var = img_as_float(image)
#Print floating point image coordinates
print float_var[100,100]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment