Visual Servoing Platform version 3.6.0
Loading...
Searching...
No Matches
vpFeatureTranslation.h
1/****************************************************************************
2 *
3 * ViSP, open source Visual Servoing Platform software.
4 * Copyright (C) 2005 - 2023 by Inria. All rights reserved.
5 *
6 * This software is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 * See the file LICENSE.txt at the root directory of this source
11 * distribution for additional information about the GNU GPL.
12 *
13 * For using ViSP with software that can not be combined with the GNU
14 * GPL, please contact Inria about acquiring a ViSP Professional
15 * Edition License.
16 *
17 * See https://visp.inria.fr for more information.
18 *
19 * This software was developed at:
20 * Inria Rennes - Bretagne Atlantique
21 * Campus Universitaire de Beaulieu
22 * 35042 Rennes Cedex
23 * France
24 *
25 * If you have questions regarding the use of this file, please contact
26 * Inria at visp@inria.fr
27 *
28 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
29 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
30 *
31 * Description:
32 * 3D translation visual feature.
33 *
34*****************************************************************************/
35
36#ifndef vpFeatureTranslation_H
37#define vpFeatureTranslation_H
38
44#include <visp3/core/vpHomogeneousMatrix.h>
45#include <visp3/core/vpMatrix.h>
46#include <visp3/core/vpRGBa.h>
47#include <visp3/core/vpTranslationVector.h>
48#include <visp3/visual_features/vpBasicFeature.h>
49
272class VISP_EXPORT vpFeatureTranslation : public vpBasicFeature
273{
274public:
279 typedef enum {
291 cMo
292 } vpFeatureTranslationRepresentationType;
293
294 // basic contructor
296 // basic constructor specifying the type of translation feature
297 explicit vpFeatureTranslation(vpFeatureTranslationRepresentationType r);
298 // constructor : build from an homogeneous matrix
299 // cdMc is the displacement that the camera has to realize
300 vpFeatureTranslation(vpHomogeneousMatrix &f2Mf1, vpFeatureTranslationRepresentationType r);
303
304 // build from an homogeneous matrix
305 // cdMc is the displacement that the camera has to realize
306 void buildFrom(const vpHomogeneousMatrix &f2Mf1);
307
308 void display(const vpCameraParameters &cam, const vpImage<unsigned char> &I, const vpColor &color = vpColor::green,
309 unsigned int thickness = 1) const;
310 void display(const vpCameraParameters &cam, const vpImage<vpRGBa> &I, const vpColor &color = vpColor::green,
311 unsigned int thickness = 1) const;
312
315
316 // compute the error between two visual features from a subset
317 // a the possible features
318 vpColVector error(const vpBasicFeature &s_star, unsigned int select = FEATURE_ALL);
319
320 vpFeatureTranslationRepresentationType getFeatureTranslationType() const;
321
322 double get_Tx() const;
323 double get_Ty() const;
324 double get_Tz() const;
325
326 // basic construction
327 void init();
328 // compute the interaction matrix from a subset a the possible features
329 vpMatrix interaction(unsigned int select = FEATURE_ALL);
330
331 // print the name of the feature
332 void print(unsigned int select = FEATURE_ALL) const;
333
334 void set_Tx(double t_x);
335 void set_Ty(double t_y);
336 void set_Tz(double t_z);
337
338 void setFeatureTranslationType(const vpFeatureTranslationRepresentationType r);
339
340 // feature selection
341 static unsigned int selectTx();
342 static unsigned int selectTy();
343 static unsigned int selectTz();
344
345private:
348 vpFeatureTranslationRepresentationType translation;
349};
350
351#endif
class that defines what is a visual feature
virtual vpColVector error(const vpBasicFeature &s_star, unsigned int select=FEATURE_ALL)
virtual void init()=0
virtual vpMatrix interaction(unsigned int select=FEATURE_ALL)=0
Compute the interaction matrix from a subset of the possible features.
virtual void print(unsigned int select=FEATURE_ALL) const =0
Print the name of the feature.
virtual void display(const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const =0
virtual vpBasicFeature * duplicate() const =0
Generic class defining intrinsic camera parameters.
Implementation of column vector and the associated operations.
Class to define RGB colors available for display functionalities.
Definition vpColor.h:152
static const vpColor green
Definition vpColor.h:214
Class that defines the translation visual feature .
virtual ~vpFeatureTranslation()
Destructor. Does nothing.
Implementation of an homogeneous matrix and operations on such kind of matrices.
Definition of the vpImage class member functions.
Definition vpImage.h:135
Implementation of a matrix and operations on matrices.
Definition vpMatrix.h:152