13#include <QtCore/QMultiMap>
56 template <
typename Operation>
62 template <
typename Operation>
73 const double& minValue,
74 ResultsConsumer& resultProcessor)
const;
103 double offset = spaceSize.
GetX() * 0.5;
104 diff.
SetX(std::fmod(diff.
GetX() + offset + spaceSize.
GetX(), spaceSize.
GetX()) - offset);
108 double offset = spaceSize.
GetY() * 0.5;
109 diff.
SetY(std::fmod(diff.
GetY() + offset + spaceSize.
GetY(), spaceSize.
GetY()) - offset);
118template <
typename Operation>
124 for (
int y = 0; y < size.
GetY(); ++y){
127 for (
int x = 0; x < size.
GetX(); ++x){
128 linePtr[x] = operation(linePtr[x]);
135 for (
int x = 0; x < size.
GetX(); ++x){
136 linePtr[x] = operation(linePtr[x]);
143template <
typename Operation>
150 for (
int y = 0; y < commonSize.
GetY(); ++y){
153 const float* spaceLinePtr = (
const float*)space.
GetLinePtr(y);
154 for (
int x = 0; x < commonSize.
GetX(); ++x){
155 linePtr[x] = operation(linePtr[x], spaceLinePtr[x]);
162 const quint32* spaceLinePtr = (
const quint32*)space.
GetLinePtr(y);
163 for (
int x = 0; x < commonSize.
GetX(); ++x){
164 linePtr[x] = operation(linePtr[x], spaceLinePtr[x]);
Definition of position or mathematical vector on 2D plane.
double GetY() const
Get Y position of this vector.
double GetX() const
Get X position of this vector.
void SetY(double y)
Set Y position of this vector.
void SetX(double x)
Set X position of this vector.
Hough space used for 2d Hough transformations.
virtual bool CreateBitmap(PixelFormat pixelFormat, const istd::CIndex2d &size, istd::COptMemory &&data, int linesDifference=0)
Create bitmap with specified size and format using external image data buffer.
CHoughSpace2d(const istd::CIndex2d &size, bool isWrappedX=false, bool isWrappedY=false)
void ApplyOperation(Operation operation)
Apply some operation to each element.
iimg::CGeneralBitmap BaseClass
virtual bool CreateHoughSpace(const istd::TIndex< 2 > &size, const double &initValue=0)
virtual ExtensionMode GetExtensionMode(int dimensionIndex) const
Get extension mode for single dimension.
virtual double GetSpaceDistance2(const imath::TVector< 2 > &position1, const imath::TVector< 2 > &position2) const
virtual void SmoothHoughSpace(const istd::TIndex< 2 > &iterations)
void CombineWithSpace(const CHoughSpace2d &space, Operation operation)
Combine this space with some other space.
void SetDimensionWrapped(int dimensionIndex, bool state)
Set if this space to be wrapped horizontaly or not.
virtual double GetSpaceDistance(const imath::TVector< 2 > &position1, const imath::TVector< 2 > &position2) const
TSimpleSpaceResultConsumer< 2 > StdConsumer
virtual void IncreaseValueAt(const imath::TVector< 2 > &position, double value)
virtual bool IsDimensionWrapped(int dimensionIndex) const
Check if this space is wrapped horizontaly, it means the the left pixel is neighbour of the right one...
virtual bool ExtractToBitmap(iimg::IBitmap &bitmap) const
Extract this Hough space to some gray scale bitmap.
virtual bool AnalyseHoughSpace(const double &minValue, ResultsConsumer &resultProcessor) const
Analyse this Hough space to find set of local maximums.
bool CreateHoughSpace(const istd::CIndex2d &size, bool isWrappedX, bool isWrappedY, bool isFloatSpace)
virtual istd::TIndex< 2 > GetSpaceSize() const
Get size of this Hough space.
virtual bool GetSpacePosition(const imath::TVector< 2 > &position, imath::TVector< 2 > &result) const
virtual bool CreateBitmap(PixelFormat pixelFormat, const istd::CIndex2d &size, int pixelBitsCount=0, int componentsCount=0)
Create bitmap with specified size and format.
Template interface for Hough space.
Consumer of results generated for some multidimensional space (typically Hough space).
Standard device- and platform-independent bitmap definition.
PixelFormat GetPixelFormat() const override
Get the bitmap's pixel format.
const void * GetLinePtr(int positionY) const override
Get pointer to buffer for single line.
istd::CIndex2d GetImageSize() const override
Get size of this raster image.
Definition of single plane bitmap.
PixelFormat
Bitmap pixel format description.
@ PF_GRAY32
32-bit grayscale bitmap.
@ PF_FLOAT32
32-bit floating point coded bitmap (type float).
Implementation of fixed-size mathematical vector with specified type of elements.
Element GetLength2() const
Return euclidian length square.
Index implementation for addressing elements in 2D-space.
Memory block with optional deleting function used during destruction.
Multidimensional index used to addressing fixed-size array.
Contains implementations of interfaces and components of common algorithms with no association to ano...