Go to the documentation of this file.
34 #include <Image/ByteImage.h>
40 #include <Ice/Current.h>
41 #include <IceUtil/Time.h>
48 #include <VisionX/interface/core/ImageProviderInterface.h>
49 #include <VisionX/interface/components/YoloComponentInterface.h>
50 #include <VisionX/interface/components/YoloObjectListener.h>
58 virtual public ComponentInterface,
68 bool m_image_received;
70 std::mutex m_input_image_mutex;
72 std::string m_image_provider_id;
77 ::CByteImage** m_input_image_buf;
83 visionx::ImageProviderInterfacePrx m_image_provider;
84 unsigned int m_image_provider_channel;
93 darknet::network m_network;
95 std::vector<std::string> m_darknet_classes;
129 virtual void process()
override;
143 const std::vector<darknet::detection>& detections,
144 const std::vector<std::string>& classes
156 const ::CByteImage* inputImage,
157 const std::vector<DetectedObject>& detectedObjects,
158 ::CByteImage* outputImage
164 virtual void restoreDefaults(
const Ice::Current& = Ice::Current{})
override;
170 virtual double getThresh(
const Ice::Current&)
override;
176 virtual void setThresh(
double thresh,
const Ice::Current&)
override;
184 virtual float getFpsCap(
const Ice::Current&)
override;
190 virtual void setHierThresh(
double hier_thresh,
const Ice::Current&)
override;
196 virtual double getNms(
const Ice::Current&)
override;
202 virtual void setNms(
double nms,
const Ice::Current&)
override;
204 virtual void setFpsCap(
float fps_cap,
const Ice::Current& = Ice::Current{})
override;
210 virtual std::vector<std::string>
getClasses(
const Ice::Current&)
override;
220 virtual void bootstrap_darknet();
225 virtual void run_object_detection_task();
virtual void setThresh(double thresh, const Ice::Current &) override
Sets the new thresh parameter.
virtual void process() override
virtual void onExitImageProcessor() override
virtual std::string getDefaultName() const override
virtual void onConnectImageProcessor() override
virtual ~Component() override
The ImageProcessor class provides an interface for access to ImageProviders via Ice and shared memory...
virtual armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
static void renderOutput(const ::CByteImage *inputImage, const std::vector< DetectedObject > &detectedObjects, ::CByteImage *outputImage)
Renders the objects detectedObjects, belonging to one of a class defined in classes onto the outputIm...
static std::vector< DetectedObject > convertOutput(const std::vector< darknet::detection > &detections, const std::vector< std::string > &classes)
Converts Darknet types to VisionX types.
virtual void setFpsCap(float fps_cap, const Ice::Current &=Ice::Current{}) override
virtual void setNms(double nms, const Ice::Current &) override
Sets the new nms parameter.
virtual void onDisconnectImageProcessor() override
static const std::string default_name
virtual void restoreDefaults(const Ice::Current &=Ice::Current{}) override
Restores the default parameter values.
std::unique_ptr< CByteImage > CByteImageUPtr
virtual void setHierThresh(double hier_thresh, const Ice::Current &) override
Sets the new hierThresh parameter.
virtual double getHierThresh(const Ice::Current &) override
Returns the currently set hierThresh parameter.
armarx::core::time::DateTime Time
virtual double getThresh(const Ice::Current &) override
Returns the currently set thresh parameter.
Base Class for all Logging classes.
virtual void onInitImageProcessor() override
virtual float getFpsCap(const Ice::Current &) override
virtual double getNms(const Ice::Current &) override
Returns the currently set nms parameter.
virtual std::vector< std::string > getClasses(const Ice::Current &) override
Returns the list of all known classes.