Go to the documentation of this file.
34 #include <VisionX/interface/units/ObjectRecognitionUnit.h>
35 #include <VisionX/interface/components/ObjectLocalizerInterfaces.h>
38 #include <MemoryX/interface/components/PriorKnowledgeInterface.h>
43 #include <Structs/ObjectDefinitions.h>
44 #include <Calibration/StereoCalibration.h>
48 #include <boost/ptr_container/ptr_vector.hpp>
54 class CTexturedRecognition;
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 defineOptionalProperty<std::string>(
"PriorKnowledgeProxyName",
"PriorKnowledge",
"name of prior memory proxy");
87 defineOptionalProperty<std::string>(
"DataBaseObjectCollectionName",
"memdb.Prior_Objects",
"name of collection from database to use for object classes");
88 defineOptionalProperty<std::string>(
"ImageProviderName",
"ImageProvider",
"name of the image provider to use");
89 defineRequiredProperty<std::string>(
"AgentName",
"Name of the agent for which the sensor values are provided");
90 defineOptionalProperty<std::string>(
"CalibrationUpdateTopicName",
"StereoCalibrationInterface",
"Topic name of the stereo calibration provider");
91 defineOptionalProperty<float>(
"2DLocalizationNoise", 4.0,
"2D localization noise of object recognition. Used in order to calculate the 3D world localization noise.");
92 defineOptionalProperty<bool>(
"EnableResultImages",
true,
"Enable the calculation of resultimages which are then provided using an ImageProvider");
93 defineOptionalProperty<bool>(
"useResultImageMask",
false,
"Use a color mask for the result images if set. Otherwise the camera images are used");
95 defineOptionalProperty<Eigen::Vector3i>(
"colorMask", extractColorValue(
"#FFFFFF"),
"image color that should be used as alpha channel").setFactory(f);
97 defineOptionalProperty<std::string>(
"DebugObserverName",
"DebugObserver",
"Name of the topic the DebugObserver listens on");
109 virtual public ObjectLocalizerImageInterface
183 memoryx::ObjectLocalizationResultList
localizeObjectClasses(
const memoryx::ObjectClassNameList& objectClassNames,
const Ice::Current&
c = Ice::emptyCurrent)
override;
272 void reportStereoCalibrationChanged(
const StereoCalibration& stereoCalibration,
bool imagesAreUndistorted,
const std::string& referenceFrame,
const Ice::Current&
c = Ice::emptyCurrent)
override
275 this->imagesAreUndistorted = imagesAreUndistorted;
286 return resultImagesEnabled;
316 return imagesAreUndistorted;
321 return useResultImageMask;
336 return stereoCalibration.get();
341 void initObjectClasses();
343 void setupImages(
int width,
int height);
346 Eigen::Vector3i colorMask;
347 bool useResultImageMask;
348 bool resultImagesEnabled;
351 ImageProviderInterfacePrx imageProviderPrx;
352 memoryx::PriorKnowledgeInterfacePrx priorKnowledgePrx;
353 memoryx::PersistentObjectClassSegmentBasePrx classesSegmentPrx;
354 memoryx::CommonStorageInterfacePrx databasePrx;
360 std::unique_ptr<CStereoCalibration> stereoCalibration;
361 bool imagesAreUndistorted;
362 ImageFormatInfo imageFormat;
381 Eigen::Vector2d imageNoiseLeft;
382 Eigen::Vector2d imageNoiseRight;
388 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
virtual void onConnectObjectLocalizerProcessor()
ObjectLocalizerProcessor interface: subclass hook.
CByteImage ** resultImages
void reportStereoCalibrationChanged(const StereoCalibration &stereoCalibration, bool imagesAreUndistorted, const std::string &referenceFrame, const Ice::Current &c=Ice::emptyCurrent) override
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...
std::string referenceFrameName
ImageFormatInfo getImageFormat() const
Retrieve format of input images.
The ImageProcessor class provides an interface for access to ImageProviders via Ice and shared memory...
bool getResultImagesEnabled() const
Retrieve whether result images are enabled.
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
virtual void onDisconnectObjectLocalizerProcessor()
ObjectLocalizerProcessor interface: subclass hook.
virtual bool initRecognizer()=0
ObjectLocalizerProcessor interface: The initRecognizer method needs to be implemented by any ObjectLo...
VectorXD< 2, double > Vec2d
void exit()
Requests exit to the job.
ObjectLocalizerProcessorPropertyDefinitions(std::string prefix)
virtual bool addObjectClass(const memoryx::EntityPtr &objectClassEntity, const memoryx::GridFileManagerPtr &fileManager)=0
ObjectLocalizerProcessor interface: The addObjectClass method needs to be implemented by any ObjectLo...
armarx::MetaInfoSizeBasePtr imageMetaInfo
Eigen::Vector3i extractColorValue(std::string propertyValue)
void process() override
The process method is inherited from ImageProcessor.
bool getImagesAreUndistorted() const
Retrieve whether images are undistorted.
CByteImage * cameraImages[2]
bool isResultImageMaskEnabled() const
void onExitImageProcessor() override
Called from framework.
std::string priorKnowledgeProxyName
void onConnectImageProcessor() override
Called from framework.
std::string imageProviderName
void onDisconnectComponent() override
Called from framework.
virtual void onExitObjectLocalizerProcessor()
ObjectLocalizerProcessor interface: subclass hook.
boost::ptr_vector< boost::nullable< CByteImage > > resultImagesData
IceInternal::Handle< MultivariateNormalDistribution > MultivariateNormalDistributionPtr
virtual void onInitObjectLocalizerProcessor()
ObjectLocalizerProcessor interface: subclass hook.
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
CStereoCalibration * getStereoCalibration() const
Retrieve stereo calibration corresponding to image provider.
ObjectLocalizerProcessorJob encapsules the object localization job.
std::shared_ptr< GridFileManager > GridFileManagerPtr
std::string getReferenceFrameName() const
Retrieve whether result images are enabled.
Eigen::Vector3i getColorMask() const
void onInitImageProcessor() override
Called from framework.
memoryx::MultivariateNormalDistributionPtr calculateLocalizationUncertainty(Vec2d left_point, Vec2d right_point)
Calculate 3D uncertainty from two 2d points in left and right camera.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
CByteImage cameraImagesData[2]
std::function< PropertyType(std::string)> PropertyFactoryFunction
void onDisconnectComponent() override
const armarx::VariantTypeId MultivariateNormalDistribution
ObjectLocalizerProcessor()
ObjectLocalizerProcessor.