importPanorama()
Scientific results for this function.
H05 examines bearing and altitude errors at withheld synthetic landmarks. H05 study and results.
H07 verified lookup inside the photographed sector, including across north. Seasonal and event searches requiring a complete skyline reject partial photographs. H07 results.
Choose controls according to what you know:
The picker samples the overview. Choose Zoom and click two corners to display the selected region at native pixel detail, then choose Add control point. Full-turn plots cut the calibrated view at north. In scripted controls use NA_real_ for each unknown angle. Levelling adjusts the near-horizon band. If an altitude shift takes image rows beyond the poles, only whole rows within the physical altitude range are kept. A one-point adjustment records the calibrated bounds and uses the original PNG. Keep it with the saved object. A tilt adjustment writes a levelled PNG in the working directory. Use a panorama with nominally linear angular axes and transparent sky above terrain in every column. A partial panorama supports altitude lookup within its photographed sector. Stellarium export requires a full turn.
Retaining panorama calibration and provenance.
Implementation arguments, return value and documented modes
| Argument | Formal default | Behaviour in this interface |
|---|---|---|
file |
— | PNG with sky removed to transparency. Keep this file alongside saved horizon objects. |
loc |
— | WGS84 latitude, longitude and optional elevation in metres. |
az.lim |
c(0, 360) |
True bearings of the left and right edges, increasing clockwise. A sector may cross north, e.g. c(330,30). |
alt.lim |
c(-90, 90) |
Altitudes of the bottom and top edges in degrees. Set these explicitly for a cropped panorama. |
name |
tools::file_path_sans_ext(basename(file)) |
Site name. |
calibrate |
FALSE |
Open the interactive graphics picker. Choose Zoom and click two corners to enlarge a region. Add a control by clicking a landmark and entering its true azimuth, altitude or both. Finish to apply the fit. |
points |
NULL |
Optional data frame with numeric x, y, az and alt. Pixel coordinates start at the upper-left image edge. Use NA for an unknown angle. |
alpha.threshold |
0.5 |
Minimum opacity counted as terrain, from above zero to one. |
alt.unc |
0.5 |
Assumed skyline altitude uncertainty in degrees. |
Return value
A skyscapeR.horizon object with a numerical profile, external PNG reference, angular bounds and control points. Use saveRDS() to save the object. Copy the displayed panorama PNG with the RDS and use relinkHor to reconnect a moved horizon or list.
Extraction method and limitations
Sky detection uses the PNG alpha channel. In each image column the first pixel
whose opacity reaches alpha.threshold defines the terrain edge. The
function does not segment an ordinary opaque photograph by sky colour. Remove
the sky to transparency beforehand and retain sky above terrain in every column.
Trees, buildings and mask errors become part of the extracted skyline.
Calibration uses linear angular axes, origin shifts and, where supported by
the controls, fitted scale or sinusoidal near-horizon tilt corrections.
This is not a general camera/lens model or a full spherical photogrammetric
adjustment. Wide-angle distortion, stitched-image parallax and inaccurate
control measurements are not removed automatically. The supplied
alt.unc is an assumed error, not an uncertainty estimated from the fit.
Inspect independent field controls after calibration.
A partial panorama only supplies the photographed sector; it is unsuitable for
functions requiring a closed full horizon. Supplying only latitude and longitude
leaves observer elevation unknown. Add a finite measured elevation before
using functions, such as sketchSky, that require it.
Implementation. R/importPanorama.R. Full function help · Terrain horizons and panoramas outline · Photographic calibration and interchange · Importing site horizons · Partial profile coverage