Go to the documentation of this file.
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>
55 class CTexturedRecognition;
66 static Eigen::Vector3i
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);
85 defineOptionalProperty<std::string>(
86 "PriorKnowledgeProxyName",
"PriorKnowledge",
"name of prior memory proxy");
87 defineOptionalProperty<std::string>(
88 "DataBaseObjectCollectionName",
89 "memdb.Prior_Objects",
90 "name of collection from database to use for object classes");
91 defineOptionalProperty<std::string>(
92 "ImageProviderName",
"ImageProvider",
"name of the image provider to use");
93 defineRequiredProperty<std::string>(
94 "AgentName",
"Name of the agent for which the sensor values are provided");
95 defineOptionalProperty<std::string>(
"CalibrationUpdateTopicName",
96 "StereoCalibrationInterface",
97 "Topic name of the stereo calibration provider");
98 defineOptionalProperty<float>(
"2DLocalizationNoise",
100 "2D localization noise of object recognition. Used in "
101 "order to calculate the 3D world localization noise.");
102 defineOptionalProperty<bool>(
"EnableResultImages",
104 "Enable the calculation of resultimages which are then "
105 "provided using an ImageProvider");
106 defineOptionalProperty<bool>(
"useResultImageMask",
108 "Use a color mask for the result images if set. Otherwise "
109 "the camera images are used");
112 defineOptionalProperty<Eigen::Vector3i>(
114 extractColorValue(
"#FFFFFF"),
115 "image color that should be used as alpha channel")
118 defineOptionalProperty<std::string>(
"DebugObserverName",
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
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...
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
VectorXD< 2, double > Vec2d
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.