MSERCalculation.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5  *
6  * ArmarX is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * ArmarX is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * @package
19  * @author
20  * @date
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 #pragma once
25 
26 #include "ObjectHypothesis.h"
28 
29 class CStereoCalibration;
30 class CByteImage;
31 
33 {
34 public:
35  CMSERCalculation(void);
36  ~CMSERCalculation(void);
37 
38  static void FindMSERs2D(const CByteImage* pRGBImage, const CByteImage* pHSVImage, std::vector<CMSERDescriptor*>& aMSERDescriptors);
39  static void FindMSERs3D(const CByteImage* pByteImageLeft, const CByteImage* pByteImageRight, CStereoCalibration* pStereoCalibration,
40  const float fToleranceFactor, std::vector<CMSERDescriptor3D*>& aRegions3D);
41  static void StereoMatchMSERs(const std::vector<CMSERDescriptor*>& aMSERDescriptorsLeft, const std::vector<CMSERDescriptor*>& aMSERDescriptorsRight,
42  CStereoCalibration* pStereoCalibration, const float fToleranceFactor, std::vector<CMSERDescriptor3D*>& aRegions3D);
43 
44  static CMSERDescriptor* CreateMSERDescriptor(std::vector<Vec2d>* aPoints2D, const CByteImage* pHSVImage);
45  static CMSERDescriptor3D* CreateMSERDescriptor3D(CMSERDescriptor* pMSERLeft, CMSERDescriptor* pMSERRight, CStereoCalibration* pStereoCalibration);
46 
47  static float HistogramDistanceL2(CMSERDescriptor* pDescriptor1, CMSERDescriptor* pDescriptor2);
48  static float HistogramDistanceChi2(CMSERDescriptor* pDescriptor1, CMSERDescriptor* pDescriptor2);
49 
50  static void SortQuadrangleCorners(Vec2d* pCorners, Vec2d& vUp, Vec2d& vLow, Vec2d& vLeft, Vec2d& vRight);
51  static void CreateWeightedHueHistogramWithinQuadrangle(Vec2d vUp, Vec2d vLow, Vec2d vLeft, Vec2d vRight, const CByteImage* pHSVImage,
52  float* pHistogram, const int nHistogramSize, int& nSaturationSum);
53 
54  static void GetMeanAndCovariance2D(std::vector<Vec2d>& aPoints2D, Vec2d& vMean, Mat2d& mCovariance);
55  static void GetEigenvaluesAndEigenvectors2D(Mat2d mMatrix2D, float& fLambda1, float& fLambda2, Vec2d& vE1, Vec2d& vE2);
56 
57  static void CreateHSVHistograms(CMSERDescriptor* pDescriptor, const CByteImage* pHSVImage);
58 };
CMSERDescriptor
Definition: ObjectHypothesis.h:35
CMSERCalculation::CreateWeightedHueHistogramWithinQuadrangle
static void CreateWeightedHueHistogramWithinQuadrangle(Vec2d vUp, Vec2d vLow, Vec2d vLeft, Vec2d vRight, const CByteImage *pHSVImage, float *pHistogram, const int nHistogramSize, int &nSaturationSum)
Definition: MSERCalculation.cpp:700
ObjectHypothesis.h
CMSERCalculation::GetMeanAndCovariance2D
static void GetMeanAndCovariance2D(std::vector< Vec2d > &aPoints2D, Vec2d &vMean, Mat2d &mCovariance)
Definition: MSERCalculation.cpp:328
GfxTL::Vec2d
VectorXD< 2, double > Vec2d
Definition: VectorXD.h:694
CMSERCalculation::CreateMSERDescriptor
static CMSERDescriptor * CreateMSERDescriptor(std::vector< Vec2d > *aPoints2D, const CByteImage *pHSVImage)
Definition: MSERCalculation.cpp:388
CMSERCalculation
Definition: MSERCalculation.h:32
CMSERCalculation::FindMSERs3D
static void FindMSERs3D(const CByteImage *pByteImageLeft, const CByteImage *pByteImageRight, CStereoCalibration *pStereoCalibration, const float fToleranceFactor, std::vector< CMSERDescriptor3D * > &aRegions3D)
Definition: MSERCalculation.cpp:253
CMSERCalculation::SortQuadrangleCorners
static void SortQuadrangleCorners(Vec2d *pCorners, Vec2d &vUp, Vec2d &vLow, Vec2d &vLeft, Vec2d &vRight)
Definition: MSERCalculation.cpp:640
CMSERDescriptor3D
Definition: ObjectHypothesis.h:97
CMSERCalculation::CreateHSVHistograms
static void CreateHSVHistograms(CMSERDescriptor *pDescriptor, const CByteImage *pHSVImage)
Definition: MSERCalculation.cpp:484
CMSERCalculation::CreateMSERDescriptor3D
static CMSERDescriptor3D * CreateMSERDescriptor3D(CMSERDescriptor *pMSERLeft, CMSERDescriptor *pMSERRight, CStereoCalibration *pStereoCalibration)
Definition: MSERCalculation.cpp:420
CMSERCalculation::HistogramDistanceL2
static float HistogramDistanceL2(CMSERDescriptor *pDescriptor1, CMSERDescriptor *pDescriptor2)
Definition: MSERCalculation.cpp:589
CMSERCalculation::CMSERCalculation
CMSERCalculation(void)
Definition: MSERCalculation.cpp:45
CMSERCalculation::HistogramDistanceChi2
static float HistogramDistanceChi2(CMSERDescriptor *pDescriptor1, CMSERDescriptor *pDescriptor2)
Definition: MSERCalculation.cpp:616
CMSERCalculation::StereoMatchMSERs
static void StereoMatchMSERs(const std::vector< CMSERDescriptor * > &aMSERDescriptorsLeft, const std::vector< CMSERDescriptor * > &aMSERDescriptorsRight, CStereoCalibration *pStereoCalibration, const float fToleranceFactor, std::vector< CMSERDescriptor3D * > &aRegions3D)
Definition: MSERCalculation.cpp:193
CMSERCalculation::GetEigenvaluesAndEigenvectors2D
static void GetEigenvaluesAndEigenvectors2D(Mat2d mMatrix2D, float &fLambda1, float &fLambda2, Vec2d &vE1, Vec2d &vE2)
Definition: MSERCalculation.cpp:367
CMSERCalculation::~CMSERCalculation
~CMSERCalculation(void)
Definition: MSERCalculation.cpp:51
CMSERCalculation::FindMSERs2D
static void FindMSERs2D(const CByteImage *pRGBImage, const CByteImage *pHSVImage, std::vector< CMSERDescriptor * > &aMSERDescriptors)
Definition: MSERCalculation.cpp:58
Logging.h