|
Instrument Neutral Distributed Interface INDI 2.2.5
|
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. | |
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.
| bool INDI::FrameTracker::addMeasurement | ( | const Measurement & | measurement, |
| double | time, | ||
| double | window, | ||
| Report & | report ) |
addMeasurement Add a measurement to the averaging window.
| measurement | result of measure(), in the same coordinates as the lock point. |
| time | time of the frame, in seconds. |
| window | length of the averaging window, in seconds. |
| report | filled when the window completes. |
Definition at line 281 of file frametracker.cpp.
|
inline |
Definition at line 103 of file frametracker.h.
|
inline |
Definition at line 115 of file frametracker.h.
|
inline |
Definition at line 107 of file frametracker.h.
|
inline |
Definition at line 111 of file frametracker.h.
|
static |
measure Find the target in a single frame.
| image | frame to measure. |
| referenceArea | blob 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.
| void INDI::FrameTracker::reset | ( | ) |
Drop the lock point and the current averaging window.
Definition at line 258 of file frametracker.cpp.
| 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.