(C) PLOS One [1]. This unaltered content originally appeared in journals.plosone.org.
Licensed under Creative Commons Attribution (CC BY) license.
url:https://journals.plos.org/plosone/s/licenses-and-copyright

------------



ORION software tool for the geometrical calibration of all-sky cameras

['Juan Carlos Antuña-Sánchez', 'Group Of Atmospheric Optics', 'Universidad De Valladolid', 'Goa-Uva', 'Valladolid', 'Roberto Román', 'Juan Luis Bosch', 'Departamento De Química Y Física', 'Universidad De Almería', 'Almería']

Date: 2022-04

This paper presents the software application ORION (All-sky camera geOmetry calibRation from star positIONs). This software has been developed with the aim of providing geometrical calibration to all-sky cameras, i.e. assess which sky coordinates (zenith and azimuth angles) correspond to each camera pixel. It is useful to locate bodies over the celestial vault, like stars and planets, in the camera images. The user needs to feed ORION with a set of cloud-free sky images captured at night-time for obtaining the calibration matrices. ORION searches the position of various stars in the sky images. This search can be automatic or manual. The sky coordinates of the stars and the corresponding pixel positions in the camera images are used together to determine the calibration matrices. The calibration is based on three parameters: the pixel position of the sky zenith in the image; the shift angle of the azimuth viewed by the camera with respect to the real North; and the relationship between the sky zenith angle and the pixel radial distance regards to the sky zenith in the image. In addition, ORION includes other features to facilitate its use, such as the check of the accuracy of the calibration. An example of ORION application is shown, obtaining the calibration matrices for a set of images and studying the accuracy of the calibration to predict a star position. Accuracy is about 9.0 arcmin for the analyzed example using a camera with average resolution of 5.4 arcmin/pixel (about 1.7 pixels).

Funding: This research was funded by the Ministerio de Ciencia, Innovación y Universidades (grant no. RTI2018-097864-B-I00) and by Junta de Castilla y León (grant no. VA227P20). The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.

Copyright: © 2022 Antuña-Sánchez et al. This is an open access article distributed under the terms of the Creative Commons Attribution License , which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.

This paper introduces the ORION application and it is structured as follows: Section 2 introduces the instrumentation, the workflow and the theoretical principles behind ORION while section 3 presents an example of the use of ORION. Finally, the main conclusions are summarized in Section 4.

We have developed the software application named ORION (all-sky camera geOmetry calibRation from star positIONs), with the main objective of providing an open and free tool for the geometrical calibration of all-sky cameras that is accurate, simple and user-friendly. The use of stars instead of the Sun for the geometric calibration is chosen because the Sun size in camera images is usually larger (causing problems to identify its center in the image) and, in addition, by using multiple stars we are able to cover more sky angles. ORION is written in Python 3 language and Qt5 for graphical interface [ 39 ], and it is capable of geometrically calibrating an all-sky camera by identifying star positions in the celestial vault. The source code and example data are hosted at Zenodo ( https://doi.org/10.5281/zenodo.5595851 ). The Windows build of the application is hosted on the GOA-UVa (Atmospheric Optics Group, University of Valladolid) website ( http://goa.uva.es/orion-app/ ).

The knowledge of the sky coordinates that correspond to each pixel of an all-sky camera is crucial in several applications; for example to extract sky radiance at specific sky angles [ 25 , 28 ], to forecast solar irradiance [ 29 , 30 ], to calculate aurora and cloud base altitudes by stereographic methods [ 31 , 32 ], or simply to locate bodies over the celestial vault. This can be achieved by the geometrical calibration of the all-sky cameras, which consists of obtaining two matrices of the same size than the camera images, containing the values of both the azimuth and zenith angles viewed by each pixel. Several calibration methods have been described in the literature. The intrinsic calibration is used for determining the internal parameters of the camera. Images of a chessboard are recorded for this purpose, for instance, the OcamCalib toolbox [ 33 , 34 ] employs images of the corners of the chessboard that are identified to detect any distortion in the camera optics. Extrinsic camera calibrations consist of determining the camera orientation and require the identifying the position of the Sun [ 30 , 32 , 35 , 36 ] or any star [ 28 , 37 , 38 ] in several images and the correlation of these positions with the Sun or star coordinates.

This kind of instruments is generally used to observe and quantify clouds and cloud cover [ 2 – 10 ] or as a proxy of the sky conditions. However, all-sky cameras present high versatility and they can also be used for different purposes, among others: to derive other more complex cloud properties as cloud base height by stereoscopic methods [ 11 , 12 ]; to detect and observe aurora, celestial bodies or bolides [ 13 – 15 ]; to estimate the sky radiance [ 16 – 18 ]; to study the cloud effects over solar radiation [ 19 , 20 ]; to study the polarization of the sky light [ 21 , 22 ]; to detect and retrieve atmospheric aerosol properties [ 23 – 25 ]; and to obtain synergy in combination with other instruments like radiometers, ceilometers or photometers [ 26 – 28 ].

All-sky cameras are ground-based instruments capable of capturing images of the full sky. There are many varieties: with electronic sensors (CMOS or CCD) or film (especially in the past, see [ 1 ] and references therein); with monochromatic sensors or with filters, typically RGB Bayer filters but also narrower; looking to a mirror oriented to the sky or looking directly to the sky with a fish-eye lens; static cameras or moving cameras, usually installed on a sun-tracker with a shadow ball to block the direct sun light; operating at daytime, night-time or both; and others. Some of the best features of the current all-sky cameras are: they allow the possibility of changing exposure time, sensor gain and other parameters to adapt the camera to the sky scenario; they are able to obtain a snapshot of the full sky radiance, covering every sky position and in various spectral ranges; the capture time is short; and they are inexpensive as compared to other instruments. Conversely, obtaining an accurate radiometric calibration of the images is difficult, the spectral filters are generally wide for some applications, and there are also issues with the presence of hot pixels, pixel saturation, lens aberrations, and image vignetting, among others.

2 Instrumentation, data and method

2.1 All-sky camera In order to show how ORION works, sky images from an all-sky camera have been used. This camera is installed at the scientific platform of the GOA-UVa located on the rooftop of the Faculty of Sciences at Valladolid, Spain (41.664° N, 4.706° W, 705 m a.s.l.). More information about the GOA-UVa platform and the climate conditions of Valladolid can be found in [18, 40–42]. The all-sky camera model used here is OMEA-3C from Alcor System manufacturer. It is formed by a SONY IMX178 RGB CMOS sensor with a fisheye lens, both encapsulated in a weatherproof case with a BK7 glass dome on top. The housing includes a heating system to avoid water condensation on the dome. This camera captures images with size of 3,096 X 2,080 pixels, a pixel scale of 5.4 arcmin/pixel and 14-bit resolution. This all-sky camera is configured to capture a multi-exposure set of raw sky images every 2 minutes at night-time and every 5 minutes at daytime. These raw images are stored and then converted into 8-bits true color or gray-scale images. The 8-bits night-time images are used to carry out the geometrical calibration. A set of these sky images captured on August 23rd, 2020 from 20:20 UTC to 23:58 UTC (110 images) is used for the example shown in Section 3.1.

2.2 Identification of stars The data that are needed for the geometrical calibration are the position (x and y pixel coordinates) of the center of a star and the sky coordinates of the chosen star (azimuth and zenith angles). Several images obtained at different times are used in the geometrical calibration to cover a wider range of pixel positions and angles. The ORION user must put this set of images in a folder and introduce the folder path in ORION. ORION reads the date and time of each image directly from the image filename. For that, the user must prepare the image set with the following naming convention: “text_YearMonthDay_HourMinute” (example: C006_20200817_0300.jpg). ORION includes an additional utility that allows changing the filename format of the images. The flowchart for obtaining the data required for calibration is described in Fig 1. Two different ways of doing this have been implemented in ORION: manual and automatic mode. In automatic mode, you can select if the initial calibration matrix is Custom or Default. ORION uses these initial matrices to find the position of the pixel closest to the chosen star; for this calculation the Harvesine distance function [43] is used. Each analyzed image is first converted into gray scale. PPT PowerPoint slide

PNG larger image

TIFF original image Download: Fig 1. Flowchart for star selection modes. The rhombuses represent decisions made by the user. https://doi.org/10.1371/journal.pone.0265959.g001 The size of the ROI (Region of Interest) depends on the selected mode. The manual mode allows the user to choose the dimensions of the ROI. For each sky image, ORION opens an additional window where the user must select the ROI as a rectangular pixel box. To do this, ORION uses the selectROI function that is a native part of the OpenCV library [44]. To find out where to manually select the ROI, or to check whether ORION correctly identifies star positions in either Manual or Automatic mode, we recommend using Stellarium (https://stellarium.org), which is a free open source planetarium that displays a realistic hemispheric sky similar to what is captured by a fisheye lens [45]. The automatic mode skips the selection of the ROI on an image-by-image, simplifying the process. The size of the ROI box depends on the image resolution as well as the chosen option (Custom or Default). In the “Find the star position” step, the sky coordinates for the selected star are obtained. To calculate azimuth and zenith values of a chosen star, the position of the observer (all-sky camera) is required, which is determined by the latitude, longitude, and elevation above sea level of the all-sky camera. ORION obtains the star coordinates for each image from “PyEphem” library [46], using as input the mentioned all-sky camera coordinates and the date and time when the image was captured. If the zenith angle of a star is above 83°in an image, ORION does not consider this star for calibration in this image since it is close to the horizon, where star identification is more difficult due, in this particular case, to city lights. After obtaining the coordinates of the stars, ORION only needs to identify the position of the center of the chosen star in each sky image. In manual mode ORION assumes that the center of the chosen star is located in the brightest pixel of the ROI (chosen manually) and it stores the x and y position of that pixel. In automatic mode, ORION uses the initial matrices (previously selected) to select the position of the ROI and then, to find automatically the brightest pixel inside. If the accuracy of the initial calibration matrices is admissible, the actual image of the star in the sky image must be close to the predicted pixel (ROI is centered in this pixel), although not necessarily in the same pixel. The Custom matrices option uses the calibration matrices that were obtained in a previous calibration, for example, using the manual mode. In this case, the ROI used to find the position of the stars is a square box whose side dimension is the height (or width if larger) of the sky image divided by 100. This arbitrary value was chosen after performing several tests and seeing empirically that it worked well for different images. The Default option is similar to the Custom one, but the calibration matrices are generated from two input parameters instead of the matrices obtained from a previous calibration. These input parameters are: 1) the azimuth shift from North, which indicates the angle between the North of the image (assumed as the top center of the image) and the real geographical North observed in the image; and 2) the extreme zenith, which is the sky zenith angle viewed by the pixel located in the top row and center column in the image. With this information, and assuming that the center of the entire sky (zenith) corresponds to the center of the image, a calibration azimuth and zenith matrices can be calculated. Fig 2 shows a couple of examples of the matrices generated by this method in a 2,000x2,000 pixel image. The first case (Fig 2a and 2b) presents no shift from North, being the azimuth angle from 0°to 360°counterclockwise, and a high range of zenith angles; while the second case (Fig 2c and 2d) presents a well defined shift from North of -50°and a lower variation in zenith angles due to the lower value of the extreme zenith angle. Finally, the ROI used to find the stars in Default option is a square box similar to that in Custom mode, but dividing by 50 instead of 100 (i.e. larger box), since the Default method is less accurate. This mode is useful to perform a quick calibration as an input to the automatic star detection mode. PPT PowerPoint slide

PNG larger image

TIFF original image Download: Fig 2. Defaults matrices for azimuth and zenith. a) Shift from north 0°. b) Extreme zenith 100°. c) Shift from north -50°. d) Extreme zenith 80°. https://doi.org/10.1371/journal.pone.0265959.g002 The user must decide if the position of the brightest pixel is correct. If yes, the azimuth, zenith and the pixel position (x, y) will be stored and ORION will go to the next image. This process is repeated until the list of selected images is complete. This data is stored in an .npy file for use in calibration. More files can be generated for other stars.

[END]

[1] Url: https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0265959

(C) Plos One. "Accelerating the publication of peer-reviewed science."
Licensed under Creative Commons Attribution (CC BY 4.0)
URL: https://creativecommons.org/licenses/by/4.0/


via Magical.Fish Gopher News Feeds:
gopher://magical.fish/1/feeds/news/plosone/