Updated scripts for converting smartphone spherical panoramas into hemispherical images
This repo contains scripts to process smartphone spherical panoramas into upward facing hemispherical images for estimating forest canopy metrics.
This repo is an update to my earlier analysis pipeline from Arietta, A.Z.A. (2021) Estimation of forest canopy structure and understory light using spherical panorama images from smartphone photography. Forestry. DOI: 10.1093/forestry/cpab034 to process smartphone spherical panoramas into upward facing hemispherical images for estimating forest canopy metrics.
Vingette
The easiest way to convert all of your spherical panos to hemispherical projections is to source the function from my github:
source("https://raw.githubusercontent.com/andisa01/Spherical-Pano-UPDATE/main/Spheres_to_Hemis.R")
When you source the script, it will install and load all necessary packages. It also downloads the masking file that we will use to black out the periphery of the images.
The script contains the function convert_spheres_to_hemis()
, which does exactly what is says. You'll need to put all of your raw spherical panos into a subdirectory within your working directory. We can then pass the path to the directory as an argument to the function.
convert_spheres_to_hemis(focal_path = "./raw_panos/")
This function will loop through all of your raw panos, convert them to masked, north-oriented upward-facing hemispherical images and put them all in a folder called "masked_hemispheres" in your working directory. It will also output a csv file called "canopy_output.csv" that contains information about the image.
Please see my blog post for a detailed walk-though of how the function works.
Please take a look at my other blog posts that detail:
Tips for taking better spherical panorama images
Using spherical panoramas form smartphones
Analyzing hemispherical photos