Camera
AstroGraph uses the ImageCaptureCore
api to directly control plugged-in cameras. Upon connection, the app will open a session and
send
PTP commands to the
camera.
The PTP code in AstroGraph is a fork of Indigo, with changes specific for
iPadOS.
Bahtinov Focus Analyzer
Bahtinov diffraction lines are analyzed using OpenCV's Probabilistic
hough line detector. These lines are examined to determine the center and side lines. Focus
is
then calculated based off the intersection of the side lines and how for that intersection is
from
the center line. Anything less than 1 pixel is considered "in focus" as far as the UI will tell
you,
though this was arbitrarily chosen.
Automatic Alignment
AstroGraph implements a parallelized version of FOCUS for
automatically aligning images. Stars in each image are detected using OpenCV's
SimpleBlobDetector
class. Afterwards, stars are matched up to a target image. An affine transform for each image is
calculated using the rigid algorithm. Finally,
images
are stacked together on the GPU using metal to average each image.