34#include <VisionX/interface/components/ObjectLocalizerInterfaces.h>
35#include <VisionX/interface/units/ObjectRecognitionUnit.h>
40#include <MemoryX/interface/components/PriorKnowledgeInterface.h>
45#include <boost/ptr_container/ptr_vector.hpp>
49#include <Calibration/StereoCalibration.h>
50#include <Structs/ObjectDefinitions.h>
55class CTexturedRecognition;
66 static Eigen::Vector3i
67 extractColorValue(std::string propertyValue)
69 int number = (int)strtol(&propertyValue.c_str()[1], NULL, 16);
72 int g = number >> 8 & 0xFF;
73 int b = number & 0xFF;
75 return Eigen::Vector3i(r, g, b);
86 "PriorKnowledgeProxyName",
"PriorKnowledge",
"name of prior memory proxy");
88 "DataBaseObjectCollectionName",
89 "memdb.Prior_Objects",
90 "name of collection from database to use for object classes");
92 "ImageProviderName",
"ImageProvider",
"name of the image provider to use");
94 "AgentName",
"Name of the agent for which the sensor values are provided");
96 "StereoCalibrationInterface",
97 "Topic name of the stereo calibration provider");
100 "2D localization noise of object recognition. Used in "
101 "order to calculate the 3D world localization noise.");
104 "Enable the calculation of resultimages which are then "
105 "provided using an ImageProvider");
108 "Use a color mask for the result images if set. Otherwise "
109 "the camera images are used");
114 extractColorValue(
"#FFFFFF"),
115 "image color that should be used as alpha channel")
120 "Name of the topic the DebugObserver listens on");
130 virtual public ObjectLocalizerImageInterface
208 memoryx::ObjectLocalizationResultList
210 const Ice::Current&
c = Ice::emptyCurrent)
override;
226 virtual memoryx::ObjectLocalizationResultList
320 bool imagesAreUndistorted,
321 const std::string& referenceFrame,
322 const Ice::Current&
c = Ice::emptyCurrent)
override
325 this->imagesAreUndistorted = imagesAreUndistorted;
337 return resultImagesEnabled;
370 return imagesAreUndistorted;
376 return useResultImageMask;
393 return stereoCalibration.get();
398 void initObjectClasses();
400 void setupImages(
int width,
int height);
403 Eigen::Vector3i colorMask;
404 bool useResultImageMask;
405 bool resultImagesEnabled;
408 ImageProviderInterfacePrx imageProviderPrx;
409 memoryx::PriorKnowledgeInterfacePrx priorKnowledgePrx;
410 memoryx::PersistentObjectClassSegmentBasePrx classesSegmentPrx;
411 memoryx::CommonStorageInterfacePrx databasePrx;
417 std::unique_ptr<CStereoCalibration> stereoCalibration;
418 bool imagesAreUndistorted;
419 ImageFormatInfo imageFormat;
438 Eigen::Vector2d imageNoiseLeft;
439 Eigen::Vector2d imageNoiseRight;
445 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
PropertyDefinition< PropertyType > & defineOptionalProperty(const std::string &name, PropertyType defaultValue, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
PropertyDefinition< PropertyType > & defineRequiredProperty(const std::string &name, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
std::function< PropertyType(std::string)> PropertyFactoryFunction
The MultivariateNormalDistribution class.
ImageProcessorPropertyDefinitions(std::string prefix)
The ImageProcessor class provides an interface for access to ImageProviders via Ice and shared memory...
void onDisconnectComponent() override
ObjectLocalizerProcessorPropertyDefinitions(std::string prefix)
virtual bool initRecognizer()=0
ObjectLocalizerProcessor interface: The initRecognizer method needs to be implemented by any ObjectLo...
virtual memoryx::ObjectLocalizationResultList localizeObjectClasses(const std::vector< std::string > &objectClassNames, CByteImage **cameraImages, armarx::MetaInfoSizeBasePtr imageMetaInfo, CByteImage **resultImages)=0
ObjectLocalizerProcessor interface: The localizeObjectClass method needs to be implemented by any Obj...
std::string priorKnowledgeProxyName
CByteImage * cameraImages[2]
void onConnectImageProcessor() override
Called from framework.
ImageFormatInfo getImageFormat() const
Retrieve format of input images.
Eigen::Vector3i getColorMask() const
std::string getReferenceFrameName() const
Retrieve whether result images are enabled.
void onDisconnectComponent() override
Called from framework.
void onExitImageProcessor() override
Called from framework.
std::string imageProviderName
virtual void onExitObjectLocalizerProcessor()
ObjectLocalizerProcessor interface: subclass hook.
ObjectLocalizerProcessor()
virtual void onConnectObjectLocalizerProcessor()
ObjectLocalizerProcessor interface: subclass hook.
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void process() override
The process method is inherited from ImageProcessor.
bool getImagesAreUndistorted() const
Retrieve whether images are undistorted.
virtual void onDisconnectObjectLocalizerProcessor()
ObjectLocalizerProcessor interface: subclass hook.
std::string referenceFrameName
memoryx::ObjectLocalizationResultList localizeObjectClasses(const memoryx::ObjectClassNameList &objectClassNames, const Ice::Current &c=Ice::emptyCurrent) override
The process method is inherited from the ObjectLocalizationProcessorInterface and is called by the Wo...
bool getResultImagesEnabled() const
Retrieve whether result images are enabled.
void onInitImageProcessor() override
Called from framework.
boost::ptr_vector< boost::nullable< CByteImage > > resultImagesData
virtual void onInitObjectLocalizerProcessor()
ObjectLocalizerProcessor interface: subclass hook.
friend class ObjectLocalizerProcessorJob
virtual bool addObjectClass(const memoryx::EntityPtr &objectClassEntity, const memoryx::GridFileManagerPtr &fileManager)=0
ObjectLocalizerProcessor interface: The addObjectClass method needs to be implemented by any ObjectLo...
CByteImage cameraImagesData[2]
void reportStereoCalibrationChanged(const StereoCalibration &stereoCalibration, bool imagesAreUndistorted, const std::string &referenceFrame, const Ice::Current &c=Ice::emptyCurrent) override
memoryx::MultivariateNormalDistributionPtr calculateLocalizationUncertainty(Vec2d left_point, Vec2d right_point)
Calculate 3D uncertainty from two 2d points in left and right camera.
armarx::MetaInfoSizeBasePtr imageMetaInfo
CStereoCalibration * getStereoCalibration() const
Retrieve stereo calibration corresponding to image provider.
bool isResultImageMaskEnabled() const
CByteImage ** resultImages
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
IceInternal::Handle< MultivariateNormalDistribution > MultivariateNormalDistributionPtr
IceInternal::Handle< Entity > EntityPtr
Typedef of EntityPtr as IceInternal::Handle<Entity> for convenience.
std::shared_ptr< GridFileManager > GridFileManagerPtr