Into

Modules

Documentation

classPiiImageUnwarpOperation

#include <PiiImageUnwarpOperation.h>

An operation that straightens cylindrically warped images.

Inherits PiiDefaultOperation

Description

See PiiImage::unwarpCylinder().

Inputs

imagea distorted input image. Any image type.
radiusthe radius of the cylinder (double). Optional.
distancethe distance between camera aperture and cylinder center (double). Optional.
centerthe location of the optical center in the image (double). Optional.

Outputs

imageunwarped version of the input. Same type as input.
radiusthe radius of the cylinder, in units used by cameraDistance.
distancethe distance between camera aperture and cylinder center.
start anglethe start angle of the visible sector, in radians. The start angle approaches zero as the distance or focal length grows. If the camera is not perfectly aligned with the cylinder (camera center is not a image center), start angle may be different from end angle.
sectorthe angle of the visible sector, in radians. This value is affected by the focalLength.
scalethe physical size of a pixel in the unwarped image. Pixel scale is represented as a 1-by-2 PiiMatrix<double>. Horizontal size (first matrix element) is expressed in rad/px, and vertical size (second matrix element) in units determined by cameraDistance.

Properties

double

The distance between camera aperture and cylinder center.

double

The location of the optical center in the image.

double

The focal length of the camera in pixels.

double

The maximum angle of the unwarped sector, in degrees.

double

Physical radius of the cylinder.

Constructors and destructor

Public member functions

double
double
( )
virtual void
(
  • bool reset
)

Checks the operation for execution.

double
double
double
( )
void
(
  • double cameraDistance
)
void
(
  • double center
)
void
(
  • double focalLength
)
void
(
  • double maxSectorAngle
)
void
(
  • double radius
)

Protected member functions

virtual void

Executes one round of processing.

Property details

  • double cameraDistance

    [read, write]

    The distance between camera aperture and cylinder center.

    Default is 1. Set this value to 0 to make the operation to automatically calculate distance.

  • double center

    [read, write]

    The location of the optical center in the image.

    The default is NaN, which positions the optical center to the center of the input image.

  • double focalLength

    [read, write]

    The focal length of the camera in pixels.

    Default is 1e100.

  • double maxSectorAngle

    [read, write]

    The maximum angle of the unwarped sector, in degrees.

    See PiiImage::unwarpCylinder() for details. The default value is 0 (no limit).

  • double radius

    [read, write]

    Physical radius of the cylinder.

    Default is 0, which causes the radius to be calculated automatically.

Function details

  • PiiImageUnwarpOperation

    ()
  • double cameraDistance

    ()
  • double center

    ()
  • virtual void check

    (
    • bool reset
    )
    [virtual]

    Checks the operation for execution.

    This function creates a suitable flow controller by calling createFlowController(). It then sets the flow controller to the active processor and sets the processor as the input controller for all inputs.

    If you change socket groupings in your overridden implementation, please call PiiDefaultOperation::check() after that. Otherwise, your new groupings will not be in effect.

    Reimplemented from PiiDefaultOperation.

  • double focalLength

    ()
  • double maxSectorAngle

    ()
  • double radius

    ()
  • void setCameraDistance

    (
    • double cameraDistance
    )
  • void setCenter

    (
    • double center
    )
  • void setFocalLength

    (
    • double focalLength
    )
  • void setMaxSectorAngle

    (
    • double maxSectorAngle
    )
  • void setRadius

    (
    • double radius
    )
  • virtual void process

    ()
    [protected, virtual]

    Executes one round of processing.

    This function is invoked by the processor if the necessary preconditions for a new processing round are met. This function does all the necessary calculations to create output objects and sends them to output sockets.

    Calls to process(), syncEvent(), and setProperty() are synchronized and cannot occur simultaneously. PiiDefaultOperation ensures this by locking processLock() for reading before calling process().

    Note: With time-consuming operations, one should occasionally check that the operation hasn't been interrupted, i.e. that state() returns Running.

    Exceptions
    PiiExecutionException

    whenever an unrecoverable error occurs during a processing round, the operation is interrupted, or finishes execution due to end of input data.

    Reimplemented from PiiDefaultOperation.

Notes (0)

Add a note

Not a single note added yet. Be the first, add yours.