Ocean
Ocean::CV::Synthesis::Constraint Class Referenceabstract

This class is the base class for all constraints. More...

Inheritance diagram for Ocean::CV::Synthesis::Constraint:

Public Member Functions

virtual ~Constraint ()=default
 Destructs this constraint. More...
 
 Constraint (const Scalar impact)
 Creates an empty constraint. More...
 
Scalar impact () const
 Returns the impact factor of this constraint. More...
 
virtual Scalar cost (const Vector2 &inside, const Vector2 &outside) const =0
 Returns the cost for a given for two given points. More...
 
virtual Scalar weight (const Vector2 &point) const =0
 Returns the weight of this constraint according to a given point. More...
 

Protected Member Functions

 Constraint ()=default
 Creates an empty constraint. More...
 
virtual std::unique_ptr< Constraintcopy (const Scalar scale=Scalar(1)) const =0
 Creates a copy of this constraint by an optional scale parameter. More...
 

Protected Attributes

Scalar impact_ = Scalar(0)
 Impact factor of this constraint. More...
 

Friends

class Constraints
 

Detailed Description

This class is the base class for all constraints.

Constraints can be used to improve the image quality of a synthesized image.
Constraints cover e.g., geometrical structures, patterns or other kinds of visual information not entirely converted by a patch-based synthesis.

Constructor & Destructor Documentation

◆ ~Constraint()

virtual Ocean::CV::Synthesis::Constraint::~Constraint ( )
virtualdefault

Destructs this constraint.

◆ Constraint() [1/2]

Ocean::CV::Synthesis::Constraint::Constraint ( const Scalar  impact)
inlineexplicit

Creates an empty constraint.

Parameters
impactThe impact factor, with range [0, infinity)

◆ Constraint() [2/2]

Ocean::CV::Synthesis::Constraint::Constraint ( )
protecteddefault

Creates an empty constraint.

Member Function Documentation

◆ copy()

virtual std::unique_ptr<Constraint> Ocean::CV::Synthesis::Constraint::copy ( const Scalar  scale = Scalar(1)) const
protectedpure virtual

Creates a copy of this constraint by an optional scale parameter.

A scale of 0.5 provide a constraint for an image with bisected dimensions.
The resulting object has to be released by the caller.

Parameters
scaleThe scale to be used

Implemented in Ocean::CV::Synthesis::FiniteLineConstraint, and Ocean::CV::Synthesis::LineConstraint.

◆ cost()

virtual Scalar Ocean::CV::Synthesis::Constraint::cost ( const Vector2 inside,
const Vector2 outside 
) const
pure virtual

Returns the cost for a given for two given points.

Parameters
insideThe inside point (point inside the mask to determine the cost for - according to the second point)
outsideThe outside point (point outside the mask)
Returns
Constraint cost

Implemented in Ocean::CV::Synthesis::FiniteLineConstraint, and Ocean::CV::Synthesis::LineConstraint.

◆ impact()

Scalar Ocean::CV::Synthesis::Constraint::impact ( ) const
inline

Returns the impact factor of this constraint.

Returns
Constraint impact factor

◆ weight()

virtual Scalar Ocean::CV::Synthesis::Constraint::weight ( const Vector2 point) const
pure virtual

Returns the weight of this constraint according to a given point.

Parameters
pointThe point to determine the weight for
Returns
Resulting weight

Implemented in Ocean::CV::Synthesis::FiniteLineConstraint, Ocean::CV::Synthesis::LineConstraint, and Ocean::CV::Synthesis::StructureConstraint.

Friends And Related Function Documentation

◆ Constraints

friend class Constraints
friend

Field Documentation

◆ impact_

Scalar Ocean::CV::Synthesis::Constraint::impact_ = Scalar(0)
protected

Impact factor of this constraint.


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