HandModelVisualizer.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// hand localisation
31
32// IVT
33#include "Calibration/Calibration.h"
34#include "Calibration/StereoCalibration.h"
35#include "Image/ByteImage.h"
36
37// movemaster
38#include "MoveMasterModel.h"
39
40namespace visionx
41{
43 {
44 public:
45 // constructor
46 CHandModelVisualizer(CStereoCalibration* pCalibration, bool bUseLeftCamera = true);
47
48 // destructor
50
51
52 // update the hand configuration
53 void UpdateHandModel(double* pConfig,
54 bool bUpdateOpenInventorModel = true,
55 bool bDrawCylinderInHand = false);
56
57
58 // draw fingertips into an image
59 void DrawFingertips(CByteImage* pImage);
60
61 // draw simple hand model for PF
62 void DrawHandModelV2(CByteImage* pImage, bool bLeftCameraImage = true);
63
64 // draw hand into an image
65 void DrawHand(CByteImage* pImage);
66
67 // draw segmented image with hand/object/background regions
68 void DrawSegmentedImage(CByteImage* pImage, bool bUseOpenInventorModel = true);
69 void DrawSegmentedImageWithoutOpenInventor(CByteImage* pSegmentedImage);
70
71 // draw a +
72 static void DrawCross(CByteImage* pGreyImage, int x, int y, int nBrightness);
73 static void DrawCross(CByteImage* pColorImage, int x, int y, int r, int g, int b);
74
75
76 static void DrawLineIntoImage(CByteImage* pImage,
77 int x1,
78 int y1,
79 int x2,
80 int y2,
81 int red,
82 int green,
83 int blue);
84
85
86 //void OutputProjectionImage(CByteImage* pImage, bool write_to_file=false);
87 //void OutputProjectionImagePolygon(CByteImage* pImage, bool write_to_file=false);
88 //void PaintPolygon(CByteImage* pImage, Polygon* pol);
89 //void PaintLineSequence(Vec3d linePoints[], int nPoints, CByteImage* pImage);
90
91
92 private:
93 public: //TODO: make private again
96
97 CStereoCalibration* m_pStereoCalibration;
102
103
104 void DrawPolygon(CByteImage* pImage, ConvexPolygonCalculations::Polygon& pPolygon);
105 void DrawPolygonGrayscale(CByteImage* pImage, ConvexPolygonCalculations::Polygon& pPolygon);
106
107 void DrawQuadrangleAlongA3DLine(CByteImage* pImage,
108 Vec3d vStart,
109 Vec3d vEnd,
110 float fWidthAtStart,
111 float fWidthAtEnd);
112
113 void ConfigureMoveMasterModel(double* pConfig, bool bDrawCylinderInHand);
114
115 void ExtractAnglesFromRotationMatrix(const Mat3d& mat, Vec3d& angles);
116 };
117} // namespace visionx
static void DrawCross(CByteImage *pGreyImage, int x, int y, int nBrightness)
static void DrawLineIntoImage(CByteImage *pImage, int x1, int y1, int x2, int y2, int red, int green, int blue)
void DrawSegmentedImageWithoutOpenInventor(CByteImage *pSegmentedImage)
CStereoCalibration * m_pStereoCalibration
void ConfigureMoveMasterModel(double *pConfig, bool bDrawCylinderInHand)
void ExtractAnglesFromRotationMatrix(const Mat3d &mat, Vec3d &angles)
void DrawSegmentedImage(CByteImage *pImage, bool bUseOpenInventorModel=true)
void DrawHandModelV2(CByteImage *pImage, bool bLeftCameraImage=true)
void DrawPolygonGrayscale(CByteImage *pImage, ConvexPolygonCalculations::Polygon &pPolygon)
void DrawPolygon(CByteImage *pImage, ConvexPolygonCalculations::Polygon &pPolygon)
CHandModelVisualizer(CStereoCalibration *pCalibration, bool bUseLeftCamera=true)
void DrawHand(CByteImage *pImage)
void UpdateHandModel(double *pConfig, bool bUpdateOpenInventorModel=true, bool bDrawCylinderInHand=false)
void DrawQuadrangleAlongA3DLine(CByteImage *pImage, Vec3d vStart, Vec3d vEnd, float fWidthAtStart, float fWidthAtEnd)
void DrawFingertips(CByteImage *pImage)
This file offers overloads of toIce() and fromIce() functions for STL container types.
ArmarX headers.