ICF 3.1.1.10
Technical documentation of ICF Libraries
CBlobFeature.h
Go to the documentation of this file.
1/********************************************************************************
2** This file is part of the ICF Framework. Copyright (C) Witold Gantzke & Kirill Lepskiy
3** ICF Framework may be used under the terms of the LGPL License v. 2.1 by the Free Software Foundation.
4********************************************************************************/
5
6#pragma once
7
8
9// ICF includes
10#include <i2d/CPolygon.h>
11#include <iipr/CObjectFeature.h>
12
13
14namespace iipr
15{
16
17
22{
23public:
25
27
29 double area,
30 double perimeter,
31 const i2d::CVector2d& position,
32 double angle = 0.0,
33 const i2d::CVector2d& scale = i2d::CVector2d(1.0, 1.0),
34 const i2d::CPolygon& contour = i2d::CPolygon());
35
36 double GetCircularity() const;
37 double GetCompactness() const;
38 double GetPerimeter() const;
39 double GetArea() const;
40 const i2d::CPolygon& GetContour() const;
41
42 // reimplemented (iser::ISerializable)
43 bool Serialize(iser::IArchive& archive) override;
44
45 // reimplemented (istd::IChangeable)
46 bool CopyFrom(const IChangeable& object, CompatibilityMode mode = CM_WITHOUT_REFS) override;
47 std::unique_ptr<istd::IChangeable> CloneMe(CompatibilityMode mode = CM_WITHOUT_REFS) const override;
48
49private:
50 double m_area;
51 double m_perimeter;
52 i2d::CPolygon m_contour;
53};
54
55
56} // namespace iipr
57
58
Definition of the data model for a polygon.
Definition CPolygon.h:24
Definition of position or mathematical vector on 2D plane.
Definition CVector2d.h:29
Implementation of the blob-based feature.
double GetArea() const
double GetPerimeter() const
CBlobFeature(double area, double perimeter, const i2d::CVector2d &position, double angle=0.0, const i2d::CVector2d &scale=i2d::CVector2d(1.0, 1.0), const i2d::CPolygon &contour=i2d::CPolygon())
double GetCircularity() const
double GetCompactness() const
iipr::CObjectFeature BaseClass
bool Serialize(iser::IArchive &archive) override
Load or store state of this object as a archive stream.
const i2d::CPolygon & GetContour() const
bool CopyFrom(const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS) override
std::unique_ptr< istd::IChangeable > CloneMe(CompatibilityMode mode=CM_WITHOUT_REFS) const override
Make a copy of this object.
Implementation of a general image object feature.
Represent input/output persistence archive.
Definition IArchive.h:34
CompatibilityMode
Control how relationship betweeen objects are interpreted.
@ CM_WITHOUT_REFS
External references are simple ignored.
Contains the image processing classes.

© Witold Gantzke and Kirill Lepskiy