namespace cv::detail

namespace detail {

// enums

enum WaveCorrectKind;

// structs

struct CameraParams;
struct CompressedRectilinearPortraitProjector;
struct CompressedRectilinearProjector;
struct CylindricalPortraitProjector;
struct CylindricalProjector;
struct FisheyeProjector;
struct GraphEdge;
struct ImageFeatures;
struct MatchesInfo;
struct MercatorProjector;
struct PaniniPortraitProjector;
struct PaniniProjector;
struct PlanePortraitProjector;
struct PlaneProjector;
struct ProjectorBase;
struct SphericalPortraitProjector;
struct SphericalProjector;
struct StereographicProjector;
struct TransverseMercatorProjector;

// classes

class AKAZEFeaturesFinder;
class AffineBasedEstimator;
class AffineBestOf2NearestMatcher;
class AffineWarper;
class BestOf2NearestMatcher;
class BestOf2NearestRangeMatcher;
class Blender;
class BlocksGainCompensator;
class BundleAdjusterAffine;
class BundleAdjusterAffinePartial;
class BundleAdjusterBase;
class BundleAdjusterRay;
class BundleAdjusterReproj;
class CompressedRectilinearPortraitWarper;
class CompressedRectilinearWarper;
class CylindricalPortraitWarper;
class CylindricalWarper;
class CylindricalWarperGpu;
class DisjointSets;
class DpSeamFinder;
class Estimator;
class ExposureCompensator;
class FeatherBlender;
class FeaturesFinder;
class FeaturesMatcher;
class FisheyeWarper;
class GainCompensator;
class Graph;
class GraphCutSeamFinder;
class GraphCutSeamFinderBase;
class HomographyBasedEstimator;
class MercatorWarper;
class MultiBandBlender;
class NoBundleAdjuster;
class NoExposureCompensator;
class NoSeamFinder;
class OrbFeaturesFinder;
class PairwiseSeamFinder;
class PaniniPortraitWarper;
class PaniniWarper;
class PlanePortraitWarper;
class PlaneWarper;
class PlaneWarperGpu;
class RotationWarper;

template <class P>
class RotationWarperBase;

class SeamFinder;
class SphericalPortraitWarper;
class SphericalWarper;
class SphericalWarperGpu;
class StereographicWarper;
class SurfFeaturesFinder;
class Timelapser;
class TimelapserCrop;
class TransverseMercatorWarper;
class VoronoiSeamFinder;

// global functions

bool
calibrateRotatingCamera(
    const std::vector<Mat>& Hs,
    Mat& K
    );

void
createLaplacePyr(
    InputArray img,
    int num_levels,
    std::vector<UMat>& pyr
    );

void
createLaplacePyrGpu(
    InputArray img,
    int num_levels,
    std::vector<UMat>& pyr
    );

void
createWeightMap(
    InputArray mask,
    float sharpness,
    InputOutputArray weight
    );

void
estimateFocal(
    const std::vector<ImageFeatures>& features,
    const std::vector<MatchesInfo>& pairwise_matches,
    std::vector<double>& focals
    );

void
findMaxSpanningTree(
    int num_images,
    const std::vector<MatchesInfo>& pairwise_matches,
    Graph& span_tree,
    std::vector<int>& centers
    );

void
focalsFromHomography(
    const Mat& H,
    double& f0,
    double& f1,
    bool& f0_ok,
    bool& f1_ok
    );

std::vector<int>
leaveBiggestComponent(
    std::vector<ImageFeatures>& features,
    std::vector<MatchesInfo>& pairwise_matches,
    float conf_threshold
    );

String
matchesGraphAsString(
    std::vector<String>& pathes,
    std::vector<MatchesInfo>& pairwise_matches,
    float conf_threshold
    );

void
normalizeUsingWeightMap(
    InputArray weight,
    InputOutputArray src
    );

bool
overlapRoi(
    Point tl1,
    Point tl2,
    Size sz1,
    Size sz2,
    Rect& roi
    );

void
restoreImageFromLaplacePyr(std::vector<UMat>& pyr);

void
restoreImageFromLaplacePyrGpu(std::vector<UMat>& pyr);

Rect
resultRoi(
    const std::vector<Point>& corners,
    const std::vector<UMat>& images
    );

Rect
resultRoi(
    const std::vector<Point>& corners,
    const std::vector<Size>& sizes
    );

Rect
resultRoiIntersection(
    const std::vector<Point>& corners,
    const std::vector<Size>& sizes
    );

Point
resultTl(const std::vector<Point>& corners);

void
selectRandomSubset(
    int count,
    int size,
    std::vector<int>& subset
    );

int&
stitchingLogLevel();

void
waveCorrect(
    std::vector<Mat>& rmats,
    WaveCorrectKind kind
    );

} // namespace detail