Instrument Neutral Distributed Interface INDI 2.2.5
FrameTracker Class Reference

The FrameTracker class measures where a bright extended target (planet, Moon or Sun disk) sits in a video frame, and reports its averaged offset from a lock point. More...

#include <frametracker.h>

Classes

struct  Image
struct  Measurement
struct  Report

Public Member Functions

void reset ()
 Drop the lock point and the current averaging window.
void setLock (double x, double y)
 Lock to an explicit position. Restarts the averaging window.
bool hasLock () const
double lockX () const
double lockY () const
double lockArea () const
bool addMeasurement (const Measurement &measurement, double time, double window, Report &report)
 addMeasurement Add a measurement to the averaging window.

Static Public Member Functions

static Measurement measure (const Image &image, double referenceArea=0)
 measure Find the target in a single frame.

Detailed Description

The FrameTracker class measures where a bright extended target (planet, Moon or Sun disk) sits in a video frame, and reports its averaged offset from a lock point.

The measurement bins the frame down to at most 256 pixels on its long side, separates the target from the sky with Otsu's threshold, keeps the largest connected blob and returns its brightness-weighted centroid. Each measurement carries a quality value between 0 and 1.

Measurements are averaged over a time window to filter out seeing. The first valid measurement after reset() becomes the lock point unless one is set explicitly with setLock().

The class does no I/O and holds no locks; StreamManager feeds it from its frame thread.

Definition at line 43 of file frametracker.h.

Member Function Documentation

◆ addMeasurement()

bool INDI::FrameTracker::addMeasurement ( const Measurement & measurement,
double time,
double window,
Report & report )

addMeasurement Add a measurement to the averaging window.

Parameters
measurementresult of measure(), in the same coordinates as the lock point.
timetime of the frame, in seconds.
windowlength of the averaging window, in seconds.
reportfilled when the window completes.
Returns
true when a window completed and report was filled.
Note
Until a lock point exists, valid measurements acquire one and invalid ones are dropped.

Definition at line 281 of file frametracker.cpp.

◆ hasLock()

bool INDI::FrameTracker::hasLock ( ) const
inline

Definition at line 103 of file frametracker.h.

◆ lockArea()

double INDI::FrameTracker::lockArea ( ) const
inline

Definition at line 115 of file frametracker.h.

◆ lockX()

double INDI::FrameTracker::lockX ( ) const
inline

Definition at line 107 of file frametracker.h.

◆ lockY()

double INDI::FrameTracker::lockY ( ) const
inline

Definition at line 111 of file frametracker.h.

◆ measure()

FrameTracker::Measurement INDI::FrameTracker::measure ( const Image & image,
double referenceArea = 0 )
static

measure Find the target in a single frame.

Parameters
imageframe to measure.
referenceAreablob area at lock time, used to lower the quality when the blob size changes a lot (clouds, another object). Pass 0 to skip this check.

Definition at line 94 of file frametracker.cpp.

◆ reset()

Drop the lock point and the current averaging window.

Definition at line 258 of file frametracker.cpp.

◆ setLock()

void INDI::FrameTracker::setLock ( double x,
double y )

Lock to an explicit position. Restarts the averaging window.

Definition at line 265 of file frametracker.cpp.


The documentation for this class was generated from the following files: