Panels¶

This notebook shows usage for the Panel class. This type is useful for detecting MicaSense calibration panels and extracting information about the lambertian panel surface.

In [1]:
%load_ext autoreload
%autoreload 2
In [2]:
import os
import glob
from micasense.image import Image
from micasense.panel import Panel

%matplotlib inline

imagePath = os.path.join(".", "data", "ALTUM")
imageName = glob.glob(os.path.join(imagePath, "IMG_0000_4.tif"))[0]

img = Image(imageName)
panel = Panel(img)

if not panel.panel_detected():
    raise IOError("Panel Not Detected!")

print("Detected panel serial: {}".format(panel.serial))
mean, std, num, sat_count = panel.raw()
print("Extracted Panel Statistics:")
print("Mean: {}".format(mean))
print("Standard Deviation: {}".format(std))
print("Panel Pixel Count: {}".format(num))
print("Saturated Pixel Count: {}".format(sat_count))

panel.plot();
Detected panel serial: RP06-2051037-OB
Extracted Panel Statistics:
Mean: 31759.2813400335
Standard Deviation: 387.988424049216
Panel Pixel Count: 14925
Saturated Pixel Count: 0
No description has been provided for this image
In [3]:
# imagePath = os.path.join('.','data','ALTUM1SET','000')
# imageName = glob.glob(os.path.join(imagePath,'IMG_0000_1.tif'))[0]

imagePath = os.path.join(".", "data", "ALTUM")
imageName = glob.glob(os.path.join(imagePath, "IMG_0000_4.tif"))[0]

img = Image(imageName)
if img.auto_calibration_image:
    print("Found automatic calibration image")
panel = Panel(img)

if not panel.panel_detected():
    raise IOError("Panel Not Detected!")

print("Detected panel serial: {}".format(panel.serial))
mean, std, num, sat_count = panel.raw()
print("Extracted Panel Statistics:")
print("Mean: {}".format(mean))
print("Standard Deviation: {}".format(std))
print("Panel Pixel Count: {}".format(num))
print("Saturated Pixel Count: {}".format(sat_count))

panel.plot();
Found automatic calibration image
Detected panel serial: RP06-2051037-OB
Extracted Panel Statistics:
Mean: 31759.2813400335
Standard Deviation: 387.988424049216
Panel Pixel Count: 14925
Saturated Pixel Count: 0
No description has been provided for this image

Copyright (c) 2017-2018 MicaSense, Inc. For licensing information see the project git repository