STIRA  0.1
Public Member Functions | List of all members
stira::histogram::RunLengthHistogram Class Reference

histogram to keep track which values are found over which run lengths Reference: http://www.nlpr.ia.ac.cn/2008papers/gjhy/gh87.pdf http://www.roborealm.com/help/ShapeHistogram.php More...

#include <RunLengthHistogram.h>

Public Member Functions

 RunLengthHistogram (int maxWidth, int maxLengthHistogram)
 constructor More...
 
 RunLengthHistogram (const RunLengthHistogram &runLengthHistogram)
 Copy constructor.
 
RunLengthHistogramClone ()
 Copy constructor.
 
int GetMaxValue () const
 
int GetMaxLengthInHistogram () const
 
std::vector< std::vector< CurveSegment > > GetWidthLengthHistogram () const
 
std::vector< std::vector< double > > GetHistogram2D () const
 
std::vector< CurveSegmentGetCurrentWidthVector () const
 
std::vector< common::Point< int > > GetSegmentStartPointVector () const
 
bool Analyse (std::vector< int > vYarnWidths, int startIndex=0)
 analyse run lengths of yarn widths More...
 
std::vector< CurveSegmentGetSegmentsWithWidth (int width)
 Gets all segments with a specified width. More...
 
std::vector< CurveSegmentGetSegmentsWithGivenWidthOfGivenLength (int width, int length)
 Gets all segments with a specified width of a given length. More...
 
std::vector< CurveSegmentGetLongestSegmentsWithGivenWidth (int width, unsigned int nrSegments)
 Gets a number of the longest segments with specified width. More...
 
int CountSegmentsWithGivenWidthOfGivenLength (int width, int length)
 Counts all segments with a specified width of a given length. More...
 
double ComputeEntropy ()
 Gets longest segment with specified width. More...
 
void WriteSegments (std::string fileName, int index)
 Writes current run length segments to a file on disk. More...
 
void WriteHistogram (std::string fileName, int index)
 Writes current run length histogram to a file on disk. More...
 

Detailed Description

histogram to keep track which values are found over which run lengths Reference: http://www.nlpr.ia.ac.cn/2008papers/gjhy/gh87.pdf http://www.roborealm.com/help/ShapeHistogram.php

Constructor & Destructor Documentation

stira::histogram::RunLengthHistogram::RunLengthHistogram ( int  maxWidth,
int  maxLengthHistogram 
)

constructor

Parameters
maxValuemaximal possible value in histogram
maxLengthmaximal possible segment length

Member Function Documentation

bool stira::histogram::RunLengthHistogram::Analyse ( std::vector< int >  vYarnWidths,
int  startIndex = 0 
)

analyse run lengths of yarn widths

Parameters
vYarnWidthsvector of yarn width per point along the yarn
startIndexindex from where to start
double stira::histogram::RunLengthHistogram::ComputeEntropy ( )

Gets longest segment with specified width.

Parameters
widthspecified width to find longest segments
int stira::histogram::RunLengthHistogram::CountSegmentsWithGivenWidthOfGivenLength ( int  width,
int  length 
)

Counts all segments with a specified width of a given length.

Parameters
widthspecified width to find all segments of
std::vector< CurveSegment > stira::histogram::RunLengthHistogram::GetLongestSegmentsWithGivenWidth ( int  width,
unsigned int  nrSegments 
)

Gets a number of the longest segments with specified width.

Parameters
widthspecified width to find longest segments
std::vector< CurveSegment > stira::histogram::RunLengthHistogram::GetSegmentsWithGivenWidthOfGivenLength ( int  width,
int  length 
)

Gets all segments with a specified width of a given length.

Parameters
widthspecified width to find all segments of
lengthwidth specified lengthwidth to find all segments of
std::vector< CurveSegment > stira::histogram::RunLengthHistogram::GetSegmentsWithWidth ( int  width)

Gets all segments with a specified width.

Parameters
widthspecified width to find all segments of
void stira::histogram::RunLengthHistogram::WriteHistogram ( std::string  fileName,
int  index 
)

Writes current run length histogram to a file on disk.

Parameters
fileNamethe name of the file to write to
void stira::histogram::RunLengthHistogram::WriteSegments ( std::string  fileName,
int  index 
)

Writes current run length segments to a file on disk.

Parameters
fileNamethe name of the file to write to

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