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 <cstdio>
31#include <string>
32#include <vector>
33
34#include <Math/Math3d.h>
35
36
37class CByteImage;
38class CCalibration;
39class CRFCSignatureFeatureEntry;
40
42{
43public:
44 static void FindPossibleObjectLocations(const CObjectHypothesis* pHypothesis,
45 const CByteImage* pHSVImage,
46 const std::vector<CHypothesisPoint*>& aScenePoints,
47 const CCalibration* calibration,
48 std::vector<Vec3d>& aPossibleLocations,
49 const int desiredNumberOfLocations = 0);
50
51 static void
52 FindSimilarRegionsWithHueAndSaturationHistogram(const CByteImage* pHSVImage,
53 const std::vector<float>& aHueHistogram,
54 const std::vector<float>& aSaturationHistogram,
55 CByteImage* pProbabilityImage);
56
57 static void SaveObjectDescriptorRGBD(const CObjectHypothesis* pHypothesis,
58 const std::string sObjectName,
59 const int nDescriptorNumber = 0);
60 static bool LoadObjectDescriptorRGBD(const std::string sObjectName,
61 const int nDescriptorNumber,
62 CObjectHypothesis*& pHypothesis);
63
64 static void SaveObjectDescriptorPCD(const CObjectHypothesis* pHypothesis,
65 const std::string sObjectName,
66 const int nDescriptorNumber = 0);
67
68 static void FindObjectRGBD(const CObjectHypothesis* pHypothesis,
69 const CByteImage* pHSVImage,
70 const std::vector<CHypothesisPoint*>& aScenePoints,
71 const CCalibration* calibration,
72 const Vec3d upwardsVector,
73 Vec3d& vPosition,
74 Mat3d& mOrientation,
75 float& distance,
76 float& fProbability,
77 CByteImage* pResultImage = NULL);
78
79 static void FindAllObjectsRGBD(const CByteImage* pHSVImage,
80 const CByteImage* pRGBImage,
81 const std::vector<CHypothesisPoint*>& aScenePoints,
82 const CCalibration* calibration,
83 const Vec3d upwardsVector,
84 std::vector<std::string>& aNames,
85 std::vector<Vec3d>& aPositions,
86 std::vector<Mat3d>& aOrientations,
87 std::vector<float>& aProbabilities);
88
89 static void
90 FindObjectWithManyDescriptorsRGBD(const CByteImage* pHSVImage,
91 const CByteImage* pRGBImage,
92 const std::vector<CHypothesisPoint*>& aScenePoints,
93 const CCalibration* calibration,
94 const Vec3d upwardsVector,
95 const std::string objectName,
96 const int numDescriptors);
97
98
99 static void SaveObjectDescriptorRFCH(const CByteImage* pRGBImage,
100 const CByteImage* pObjectMask,
101 const std::string sObjectName,
102 const int nDescriptorNumber = 0);
103 static void LoadObjectDescriptorRFCH(const std::string sObjectName,
104 const int nDescriptorNumber,
105 CRFCSignatureFeatureEntry*& pFeatureDescriptor);
106
107 static void FindObjectRFCH(CRFCSignatureFeatureEntry* pFeatureDescriptor,
108 CByteImage* pRGBImage,
109 const std::vector<CHypothesisPoint*>& aScenePoints,
110 const CCalibration* calibration,
111 Vec3d& vPosition,
112 Mat3d& mOrientation,
113 float& fProbability,
114 CByteImage* pResultImage = NULL);
115 static void FindAllObjectsRFCH(const CByteImage* pRGBImage,
116 const CCalibration* calibration,
117 const std::vector<CHypothesisPoint*>& aScenePoints,
118 std::vector<std::string>& aNames,
119 std::vector<Vec3d>& aPositions,
120 std::vector<Mat3d>& aOrientations,
121 std::vector<float>& aProbabilities);
122};
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)
static void SaveObjectDescriptorPCD(const CObjectHypothesis *pHypothesis, const std::string sObjectName, const int nDescriptorNumber=0)
static bool LoadObjectDescriptorRGBD(const std::string sObjectName, const int nDescriptorNumber, CObjectHypothesis *&pHypothesis)
static void FindSimilarRegionsWithHueAndSaturationHistogram(const CByteImage *pHSVImage, const std::vector< float > &aHueHistogram, const std::vector< float > &aSaturationHistogram, CByteImage *pProbabilityImage)
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)
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)
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)
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)
static void SaveObjectDescriptorRGBD(const CObjectHypothesis *pHypothesis, const std::string sObjectName, const int nDescriptorNumber=0)
static void SaveObjectDescriptorRFCH(const CByteImage *pRGBImage, const CByteImage *pObjectMask, const std::string sObjectName, const int nDescriptorNumber=0)
static void LoadObjectDescriptorRFCH(const std::string sObjectName, const int nDescriptorNumber, CRFCSignatureFeatureEntry *&pFeatureDescriptor)
static void FindObjectRFCH(CRFCSignatureFeatureEntry *pFeatureDescriptor, CByteImage *pRGBImage, const std::vector< CHypothesisPoint * > &aScenePoints, const CCalibration *calibration, Vec3d &vPosition, Mat3d &mOrientation, float &fProbability, CByteImage *pResultImage=NULL)
double distance(const Point &a, const Point &b)
Definition point.hpp:95