ObjectRecognition.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 
27 #include "ObjectHypothesis.h"
28 
29 // IVT
30 #include <Math/Math3d.h>
31 
32 #include <cstdio>
33 #include <string>
34 #include <vector>
35 
36 
37 class CByteImage;
38 class CCalibration;
39 class CRFCSignatureFeatureEntry;
40 
41 
43 {
44 public:
45  static void FindPossibleObjectLocations(const CObjectHypothesis* pHypothesis, const CByteImage* pHSVImage, const std::vector<CHypothesisPoint*>& aScenePoints,
46  const CCalibration* calibration, std::vector<Vec3d>& aPossibleLocations, const int desiredNumberOfLocations = 0);
47 
48  static void FindSimilarRegionsWithHueAndSaturationHistogram(const CByteImage* pHSVImage, const std::vector<float>& aHueHistogram,
49  const std::vector<float>& aSaturationHistogram, CByteImage* pProbabilityImage);
50 
51  static void SaveObjectDescriptorRGBD(const CObjectHypothesis* pHypothesis, const std::string sObjectName, const int nDescriptorNumber = 0);
52  static bool LoadObjectDescriptorRGBD(const std::string sObjectName, const int nDescriptorNumber, CObjectHypothesis*& pHypothesis);
53 
54  static void SaveObjectDescriptorPCD(const CObjectHypothesis* pHypothesis, const std::string sObjectName, const int nDescriptorNumber = 0);
55 
56  static void FindObjectRGBD(const CObjectHypothesis* pHypothesis, const CByteImage* pHSVImage, const std::vector<CHypothesisPoint*>& aScenePoints,
57  const CCalibration* calibration, const Vec3d upwardsVector, Vec3d& vPosition, Mat3d& mOrientation, float& distance,
58  float& fProbability, CByteImage* pResultImage = NULL);
59 
60  static void FindAllObjectsRGBD(const CByteImage* pHSVImage, const CByteImage* pRGBImage, const std::vector<CHypothesisPoint*>& aScenePoints,
61  const CCalibration* calibration, const Vec3d upwardsVector, std::vector<std::string>& aNames, std::vector<Vec3d>& aPositions,
62  std::vector<Mat3d>& aOrientations, std::vector<float>& aProbabilities);
63 
64  static void FindObjectWithManyDescriptorsRGBD(const CByteImage* pHSVImage, const CByteImage* pRGBImage, const std::vector<CHypothesisPoint*>& aScenePoints,
65  const CCalibration* calibration, const Vec3d upwardsVector, const std::string objectName, const int numDescriptors);
66 
67 
68  static void SaveObjectDescriptorRFCH(const CByteImage* pRGBImage, const CByteImage* pObjectMask, const std::string sObjectName, const int nDescriptorNumber = 0);
69  static void LoadObjectDescriptorRFCH(const std::string sObjectName, const int nDescriptorNumber, CRFCSignatureFeatureEntry*& pFeatureDescriptor);
70 
71  static void FindObjectRFCH(CRFCSignatureFeatureEntry* pFeatureDescriptor, CByteImage* pRGBImage, const std::vector<CHypothesisPoint*>& aScenePoints,
72  const CCalibration* calibration, Vec3d& vPosition, Mat3d& mOrientation, float& fProbability, CByteImage* pResultImage = NULL);
73  static void FindAllObjectsRFCH(const CByteImage* pRGBImage, const CCalibration* calibration, const std::vector<CHypothesisPoint*>& aScenePoints,
74  std::vector<std::string>& aNames, std::vector<Vec3d>& aPositions, std::vector<Mat3d>& aOrientations, std::vector<float>& aProbabilities);
75 
76 
77 };
78 
CObjectRecognition::SaveObjectDescriptorPCD
static void SaveObjectDescriptorPCD(const CObjectHypothesis *pHypothesis, const std::string sObjectName, const int nDescriptorNumber=0)
Definition: ObjectRecognition.cpp:56
CObjectRecognition::FindObjectRGBD
static void FindObjectRGBD(const CObjectHypothesis *pHypothesis, const CByteImage *pHSVImage, const std::vector< CHypothesisPoint * > &aScenePoints, const CCalibration *calibration, const Vec3d upwardsVector, Vec3d &vPosition, Mat3d &mOrientation, float &distance, float &fProbability, CByteImage *pResultImage=NULL)
Definition: ObjectRecognition.cpp:490
ObjectHypothesis.h
CObjectRecognition::FindAllObjectsRFCH
static void FindAllObjectsRFCH(const CByteImage *pRGBImage, const CCalibration *calibration, const std::vector< CHypothesisPoint * > &aScenePoints, std::vector< std::string > &aNames, std::vector< Vec3d > &aPositions, std::vector< Mat3d > &aOrientations, std::vector< float > &aProbabilities)
Definition: ObjectRecognition.cpp:903
CObjectRecognition::LoadObjectDescriptorRFCH
static void LoadObjectDescriptorRFCH(const std::string sObjectName, const int nDescriptorNumber, CRFCSignatureFeatureEntry *&pFeatureDescriptor)
Definition: ObjectRecognition.cpp:750
CObjectRecognition::FindPossibleObjectLocations
static void FindPossibleObjectLocations(const CObjectHypothesis *pHypothesis, const CByteImage *pHSVImage, const std::vector< CHypothesisPoint * > &aScenePoints, const CCalibration *calibration, std::vector< Vec3d > &aPossibleLocations, const int desiredNumberOfLocations=0)
Definition: ObjectRecognition.cpp:223
CObjectRecognition::SaveObjectDescriptorRFCH
static void SaveObjectDescriptorRFCH(const CByteImage *pRGBImage, const CByteImage *pObjectMask, const std::string sObjectName, const int nDescriptorNumber=0)
Definition: ObjectRecognition.cpp:686
CObjectRecognition::FindObjectRFCH
static void FindObjectRFCH(CRFCSignatureFeatureEntry *pFeatureDescriptor, CByteImage *pRGBImage, const std::vector< CHypothesisPoint * > &aScenePoints, const CCalibration *calibration, Vec3d &vPosition, Mat3d &mOrientation, float &fProbability, CByteImage *pResultImage=NULL)
Definition: ObjectRecognition.cpp:776
CObjectRecognition::FindAllObjectsRGBD
static void FindAllObjectsRGBD(const CByteImage *pHSVImage, const CByteImage *pRGBImage, const std::vector< CHypothesisPoint * > &aScenePoints, const CCalibration *calibration, const Vec3d upwardsVector, std::vector< std::string > &aNames, std::vector< Vec3d > &aPositions, std::vector< Mat3d > &aOrientations, std::vector< float > &aProbabilities)
Definition: ObjectRecognition.cpp:571
GfxTL::Vec3d
VectorXD< 3, double > Vec3d
Definition: VectorXD.h:695
CObjectHypothesis
Definition: ObjectHypothesis.h:249
CObjectRecognition::LoadObjectDescriptorRGBD
static bool LoadObjectDescriptorRGBD(const std::string sObjectName, const int nDescriptorNumber, CObjectHypothesis *&pHypothesis)
Definition: ObjectRecognition.cpp:163
CObjectRecognition
Definition: ObjectRecognition.h:42
CObjectRecognition::FindSimilarRegionsWithHueAndSaturationHistogram
static void FindSimilarRegionsWithHueAndSaturationHistogram(const CByteImage *pHSVImage, const std::vector< float > &aHueHistogram, const std::vector< float > &aSaturationHistogram, CByteImage *pProbabilityImage)
Definition: ObjectRecognition.cpp:405
distance
double distance(const Point &a, const Point &b)
Definition: point.hpp:88
CObjectRecognition::FindObjectWithManyDescriptorsRGBD
static void FindObjectWithManyDescriptorsRGBD(const CByteImage *pHSVImage, const CByteImage *pRGBImage, const std::vector< CHypothesisPoint * > &aScenePoints, const CCalibration *calibration, const Vec3d upwardsVector, const std::string objectName, const int numDescriptors)
Definition: ObjectRecognition.cpp:645
CObjectRecognition::SaveObjectDescriptorRGBD
static void SaveObjectDescriptorRGBD(const CObjectHypothesis *pHypothesis, const std::string sObjectName, const int nDescriptorNumber=0)
Definition: ObjectRecognition.cpp:105