PCL
pcl::Crop Class Reference

Image cropping/expansion algorithm More...

#include <Crop.h>

+ Inheritance diagram for pcl::Crop:

Public Types

using crop_mode = CropMode::value_type
 

Public Member Functions

 Crop (const Crop &)=default
 
template<typename T >
 Crop (const GenericRectangle< T > &r)
 
 Crop (double left=0, double top=0, double right=0, double bottom=0)
 
const DVectorFillValues () const
 
void GetNewSizes (int &width, int &height) const override
 
bool IsAbsolute () const
 
bool IsRelative () const
 
DRect Margins () const
 
crop_mode Mode () const
 
Cropoperator= (const Crop &)=default
 
void SetFillValues (const DVector &fillValues)
 
template<typename T >
void SetMargins (const GenericRectangle< T > &r)
 
void SetMargins (int left, int top, int right, int bottom)
 
void SetMode (crop_mode mode)
 
- Public Member Functions inherited from pcl::GeometricTransformation
 GeometricTransformation ()=default
 
 GeometricTransformation (const GeometricTransformation &)=default
 
 GeometricTransformation (GeometricTransformation &&)=default
 
 ~GeometricTransformation () override
 
GeometricTransformationoperator= (const GeometricTransformation &)=default
 
GeometricTransformationoperator= (GeometricTransformation &&)=default
 
- Public Member Functions inherited from pcl::ImageTransformation
 ImageTransformation ()=default
 
 ImageTransformation (const ImageTransformation &)=default
 
virtual ~ImageTransformation ()
 
template<class P >
GenericImage< P > & operator>> (GenericImage< P > &image) const
 
ImageVariantoperator>> (ImageVariant &image) const
 
- Public Member Functions inherited from pcl::ImageResolution
 ImageResolution ()=default
 
 ImageResolution (const ImageResolution &)=default
 
void GetResolution (double &x, double &y)
 
double HorizontalResolution () const
 
bool IsMetricResolution () const
 
ImageResolutionoperator= (const ImageResolution &)=default
 
double Resolution () const
 
void SetMetricResolution (bool m)
 
void SetResolution (double r)
 
void SetResolution (double x, double y)
 
double VerticalResolution () const
 

Protected Member Functions

void Apply (pcl::ComplexImage &) const override
 
void Apply (pcl::DComplexImage &) const override
 
void Apply (pcl::DImage &) const override
 
void Apply (pcl::Image &) const override
 
void Apply (pcl::UInt16Image &) const override
 
void Apply (pcl::UInt32Image &) const override
 
void Apply (pcl::UInt8Image &) const override
 

Additional Inherited Members

- Static Public Member Functions inherited from pcl::GeometricTransformation
template<class P >
static void ApplyGammaExponentCorrection (typename P::sample *samples, size_type length, double gamma, AbstractImage::ThreadData &threadData, int maxProcessors=PCL_MAX_PROCESSORS)
 
template<class P >
static void ApplyInverseGammaExponentCorrection (typename P::sample *samples, size_type length, double gamma, AbstractImage::ThreadData &threadData, int maxProcessors=PCL_MAX_PROCESSORS)
 
template<class P >
static void ApplyInverseSRGBGammaCorrection (typename P::sample *samples, size_type length, AbstractImage::ThreadData &threadData, int maxProcessors=PCL_MAX_PROCESSORS)
 
template<class P >
static void ApplySRGBGammaCorrection (typename P::sample *samples, size_type length, AbstractImage::ThreadData &threadData, int maxProcessors=PCL_MAX_PROCESSORS)
 

Detailed Description

Crop is a noninterpolating geometric transformation class that allows cropping an image or expanding it by specifying separate cropping margins for each side. When a cropping margin is negative the image is cropped, and when it is positive, the image is expanded.

Definition at line 101 of file Crop.h.

Member Typedef Documentation

◆ crop_mode

using pcl::Crop::crop_mode = CropMode::value_type

Represents a cropping mode.

Definition at line 109 of file Crop.h.

Constructor & Destructor Documentation

◆ Crop() [1/3]

pcl::Crop::Crop ( double  left = 0,
double  top = 0,
double  right = 0,
double  bottom = 0 
)
inline

Constructs a Crop object with the specified cropping margins for the left, top, right and bottom sides.

Definition at line 115 of file Crop.h.

◆ Crop() [2/3]

template<typename T >
pcl::Crop::Crop ( const GenericRectangle< T > &  r)
inline

Constructs a Crop object whose cropping margins are defined by the components of a rectangle r.

Definition at line 126 of file Crop.h.

◆ Crop() [3/3]

pcl::Crop::Crop ( const Crop )
default

Copy constructor.

Member Function Documentation

◆ Apply() [1/7]

void pcl::Crop::Apply ( pcl::ComplexImage image) const
overrideprotectedvirtual

Applies this transformation to a 32-bit complex image.

Reimplemented from pcl::ImageTransformation.

◆ Apply() [2/7]

void pcl::Crop::Apply ( pcl::DComplexImage image) const
overrideprotectedvirtual

Applies this transformation to a 64-bit complex image.

Reimplemented from pcl::ImageTransformation.

◆ Apply() [3/7]

void pcl::Crop::Apply ( pcl::DImage image) const
overrideprotectedvirtual

Applies this transformation to a 64-bit floating point image.

Reimplemented from pcl::ImageTransformation.

◆ Apply() [4/7]

void pcl::Crop::Apply ( pcl::Image image) const
overrideprotectedvirtual

Applies this transformation to a 32-bit floating point image.

Reimplemented from pcl::ImageTransformation.

◆ Apply() [5/7]

void pcl::Crop::Apply ( pcl::UInt16Image image) const
overrideprotectedvirtual

Applies this transformation to a 16-bit unsigned integer image.

Reimplemented from pcl::ImageTransformation.

◆ Apply() [6/7]

void pcl::Crop::Apply ( pcl::UInt32Image image) const
overrideprotectedvirtual

Applies this transformation to a 32-bit unsigned integer image.

Reimplemented from pcl::ImageTransformation.

◆ Apply() [7/7]

void pcl::Crop::Apply ( pcl::UInt8Image image) const
overrideprotectedvirtual

Applies this transformation to an 8-bit unsigned integer image.

Reimplemented from pcl::ImageTransformation.

◆ FillValues()

const DVector& pcl::Crop::FillValues ( ) const
inline

Returns the current vector of per-channel filling values for uncovered image regions.

See the documentation for SetFillValues() for more information.

Definition at line 212 of file Crop.h.

◆ GetNewSizes()

void pcl::Crop::GetNewSizes ( int &  width,
int &  height 
) const
overridevirtual

Predicts transformed image dimensions.

Parameters
[in,out]widthReference to a variable whose value is a horizontal dimension in pixels (width). On output, it will receive the predicted horizontal dimension after the transformation.
[in,out]heightReference to a variable whose value is a vertical dimension in pixels (height). On output, it will receive the predicted vertical dimension after the transformation.
Note
This is a pure virtual member function that must be reimplemented in every derived class.

Implements pcl::GeometricTransformation.

◆ IsAbsolute()

bool pcl::Crop::IsAbsolute ( ) const
inline

Returns true iff this Crop object interprets its cropping margins as absolute increments. Returns false if cropping margins are interpreted relative to current image dimensions.

Definition at line 193 of file Crop.h.

◆ IsRelative()

bool pcl::Crop::IsRelative ( ) const
inline

Returns true iff this Crop object interprets its cropping margins relative to current image dimensions. Returns false if cropping margins are interpreted as absolute increments.

Definition at line 183 of file Crop.h.

◆ Margins()

DRect pcl::Crop::Margins ( ) const
inline

Returns a rectangle whose components correspond to the current cropping margins of this Crop object.

Definition at line 146 of file Crop.h.

◆ Mode()

crop_mode pcl::Crop::Mode ( ) const
inline

Returns the current cropping mode of this Crop object.

Definition at line 173 of file Crop.h.

◆ operator=()

Crop& pcl::Crop::operator= ( const Crop )
default

Copy assignment operator. Returns a reference to this object.

◆ SetFillValues()

void pcl::Crop::SetFillValues ( const DVector fillValues)
inline

Sets a vector of per-channel filling values for uncovered image regions.

Uncovered regions result when a Crop instance extends an image due to positive cropping margins.

By default, there are no filling values defined (and hence the returned vector is empty by default). When the Crop instance is executed and a filling value is not defined for a channel of the target image, uncovered regions are filled with the minimum sample value in the native range of the image (usually zero).

Definition at line 229 of file Crop.h.

◆ SetMargins() [1/2]

template<typename T >
void pcl::Crop::SetMargins ( const GenericRectangle< T > &  r)
inline

Sets the cropping margins equal to the components of a specified rectangle r.

Definition at line 156 of file Crop.h.

◆ SetMargins() [2/2]

void pcl::Crop::SetMargins ( int  left,
int  top,
int  right,
int  bottom 
)
inline

Sets the specified left, top, right and bottom cropping margins.

Definition at line 165 of file Crop.h.

◆ SetMode()

void pcl::Crop::SetMode ( crop_mode  mode)
inline

Sets the cropping mode for this Crop object.

Definition at line 201 of file Crop.h.


The documentation for this class was generated from the following file: