Images¶
This notebook shows usage for the Image type. This type is useful for loading single image files, reading the embedded metadata, and performing radiometric calibrations.
In [1]:
from micasense.image import Image
import os
import glob
%matplotlib inline
imagePath = os.path.join(".", "data", "ALTUM")
imageName = glob.glob(os.path.join(imagePath, "IMG_0021_1.tif"))[0]
img = Image(imageName)
img.plot_all();
Image Histogram¶
In [2]:
import matplotlib.pyplot as plt
import cv2
nbins = 1024
vmin = 0
vmax = 2**16
bins = range(vmin, vmax, int(vmax / nbins))
hist = cv2.calcHist([img.raw().ravel()], [0], None, [nbins], [vmin, vmax])
plt.plot(bins, hist)
plt.xlim(img.raw().min(), img.raw().max())
plt.ylim(0, hist.max())
plt.xlabel("Pixel Value")
plt.ylabel("Frequency")
plt.show()
Copyright (c) 2017-2019 MicaSense, Inc. For licensing information see the project git repository