Kstars

fitsgradientdetector.h
1/*
2 SPDX-FileCopyrightText: 2004 Jasem Mutlaq
3 SPDX-FileCopyrightText: 2020 Eric Dejouhanet <eric.dejouhanet@gmail.com>
4
5 SPDX-License-Identifier: GPL-2.0-or-later
6
7 Some code fragments were adapted from Peter Kirchgessner's FITS plugin
8 SPDX-FileCopyrightText: Peter Kirchgessner <http://members.aol.com/pkirchg>
9*/
10
11#ifndef FITSGRADIENTDETECTOR_H
12#define FITSGRADIENTDETECTOR_H
13
14#include "fitsstardetector.h"
15
16class FITSGradientDetector: public FITSStarDetector
17{
19
20 public:
21 explicit FITSGradientDetector(FITSData * data): FITSStarDetector(data) {};
22
23 public:
24 /** @brief Find sources in the parent FITS data file.
25 * @see FITSStarDetector::findSources().
26 */
27 QFuture<bool> findSources(QRect const &boundary = QRect()) override;
28
29 protected:
30 /** @internal Find sources in the parent FITS data file, dependent of the pixel depth.
31 * @see FITSGradientDetector::findSources.
32 */
33 template <typename T>
34 bool findSources(const QRect &boundary);
35
36 /** @internal Implementation of the Canny Edge detection (CannyEdgeDetector).
37 * @copyright 2015 Gonzalo Exequiel Pedone (https://github.com/hipersayanX/CannyDetector).
38 * @param data is the FITS data to run the detection onto.
39 * @param gradient is the vector storing the amount of change in pixel sequences.
40 * @param direction is the vector storing the four directions (horizontal, vertical and two diagonals) the changes stored in 'gradient' are detected in.
41 */
42 template <typename T>
43 void sobel(FITSData const * data, QVector<float> &gradient, QVector<float> &direction) const;
44
45 /** @internal Identify gradient connections.
46 * @param width, height are the dimensions of the frame to work on.
47 * @param gradient is the vector holding the amount of change in pixel sequences.
48 * @param ids is the vector storing which gradient was identified for each pixel.
49 */
50 int partition(int width, int height, QVector<float> &gradient, QVector<int> &ids) const;
51
52 /** @internal Trace gradient neighbors.
53 * @param width, height are the dimensions of the frame to work on.
54 * @param image is the image to work on, actually gradients extracted using the sobel algorithm.
55 * @param ids is the vector storing which gradient was identified for each pixel.
56 * @param x, y locate the pixel to trace from.
57 */
58 void trace(int width, int height, int id, QVector<float> &image, QVector<int> &ids, int x, int y) const;
59};
60
61#endif // FITSGRADIENTDETECTOR_H
Q_OBJECTQ_OBJECT
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:38:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.