class cv::detail::SphericalWarper

Overview

Warper that maps an image onto the unit sphere located at the origin. More…

#include <warpers.hpp>

class SphericalWarper: public cv::detail::RotationWarperBase
{
public:
    // construction

    SphericalWarper(float scale);

    // methods

    virtual
    Rect
    buildMaps(
        Size src_size,
        InputArray K,
        InputArray R,
        OutputArray xmap,
        OutputArray ymap
        );

    virtual
    Point
    warp(
        InputArray src,
        InputArray K,
        InputArray R,
        int interp_mode,
        int border_mode,
        OutputArray dst
        );

protected:
    // methods

    virtual
    void
    detectResultRoi(
        Size src_size,
        Point& dst_tl,
        Point& dst_br
        );
};

// direct descendants

class SphericalWarperGpu;

Inherited Members

public:
    // methods

    virtual
    Rect
    buildMaps(
        Size src_size,
        InputArray K,
        InputArray R,
        OutputArray xmap,
        OutputArray ymap
        ) = 0;

    virtual
    float
    getScale() const;

    virtual
    void
    setScale(float);

    virtual
    Point
    warp(
        InputArray src,
        InputArray K,
        InputArray R,
        int interp_mode,
        int border_mode,
        OutputArray dst
        ) = 0;

    virtual
    void
    warpBackward(
        InputArray src,
        InputArray K,
        InputArray R,
        int interp_mode,
        int border_mode,
        Size dst_size,
        OutputArray dst
        ) = 0;

    virtual
    Point2f
    warpPoint(
        const Point2f& pt,
        InputArray K,
        InputArray R
        ) = 0;

    virtual
    Rect
    warpRoi(
        Size src_size,
        InputArray K,
        InputArray R
        ) = 0;

    virtual
    Rect
    buildMaps(
        Size src_size,
        InputArray K,
        InputArray R,
        OutputArray xmap,
        OutputArray ymap
        );

    virtual
    float
    getScale() const;

    virtual
    void
    setScale(float val);

    virtual
    Point
    warp(
        InputArray src,
        InputArray K,
        InputArray R,
        int interp_mode,
        int border_mode,
        OutputArray dst
        );

    virtual
    void
    warpBackward(
        InputArray src,
        InputArray K,
        InputArray R,
        int interp_mode,
        int border_mode,
        Size dst_size,
        OutputArray dst
        );

    virtual
    Point2f
    warpPoint(
        const Point2f& pt,
        InputArray K,
        InputArray R
        );

    virtual
    Rect
    warpRoi(
        Size src_size,
        InputArray K,
        InputArray R
        );

protected:
    // fields

    P projector_;

    // methods

    virtual
    void
    detectResultRoi(
        Size src_size,
        Point& dst_tl,
        Point& dst_br
        );

    void
    detectResultRoiByBorder(
        Size src_size,
        Point& dst_tl,
        Point& dst_br
        );

Detailed Documentation

Warper that maps an image onto the unit sphere located at the origin.

Projects image onto unit sphere with origin at (0, 0, 0) and radius scale, measured in pixels. A 360° panorama would therefore have a resulting width of 2 * scale * PI pixels. Poles are located at (0, -1, 0) and (0, 1, 0) points.

Construction

SphericalWarper(float scale)

Construct an instance of the spherical warper class.

Parameters:

scale Radius of the projected sphere, in pixels. An image spanning the whole sphere will have a width of 2 * scale * PI pixels.

Methods

virtual
Rect
buildMaps(
    Size src_size,
    InputArray K,
    InputArray R,
    OutputArray xmap,
    OutputArray ymap
    )

Builds the projection maps according to the given camera data.

Parameters:

src_size Source image size
K Camera intrinsic parameters
R Camera rotation matrix
xmap Projection map for the x axis
ymap Projection map for the y axis

Returns:

Projected image minimum bounding box

virtual
Point
warp(
    InputArray src,
    InputArray K,
    InputArray R,
    int interp_mode,
    int border_mode,
    OutputArray dst
    )

Projects the image.

Parameters:

src Source image
K Camera intrinsic parameters
R Camera rotation matrix
interp_mode Interpolation mode
border_mode Border extrapolation mode
dst Projected image

Returns:

Project image top-left corner