Creating a Reporter for IplImage

Hi,

I am trying to make a FrameReporting component (inheriting from OCL::ReportingComponent) to display (using cvShow) my images.

In my component I have just added dedicated marshallers.

I now need help to define my marshallers.

In the serialize function, I loop over the properties of the input property bag and try to recompose my Image object from from its properties. I have previously defined a ImageTypeInfo (inheriting RTT::TemplateTypeInfo). But I don't know how to call my composition functions from my marshaller!

My code looks like:


void FrameMarshaller::serialize(const PropertyBag &v) {
std::vector props = v.getProperties();
for (PropertyBag::iterator i = props.begin(); i != props.end(); i++) {
/// I don't know what to do here!!
imageTypeInfo->composeTypeImpl(bag, image);
cvShowImage(wName, image);
}
}

Charles.

Ruben Smits's picture

Creating a Reporter for IplImage

On Fri, Jul 24, 2009 at 4:25 PM,
charles [dot] lesire [..] ...<charles [dot] lesire [..] ...> wrote:
> Hi,
>
> I am trying to make a FrameReporting component (inheriting from OCL::ReportingComponent) to display (using cvShow) my images.

We already have something like this, two years ago a masters student
created this. It however never made it into ocl-trunk.

Checkout the DisplayImageComponent at:

svn.mech.kuleuven.be/repos/orocos/branches/ocl-pma/vision

I don't know if this is what you are looking for but it inherits from
the OCL::ReportingComponent and can display images from multiple
sources in a separte thread.
It has been a while since i checked that code. If it doesn't work
out-of-the-box it should at least give you a serious hint.

Ruben

> In my component I have just added dedicated marshallers.
>
> I now need help to define my marshallers.
>
> In the serialize function, I loop over the properties of the input property bag and try to recompose my Image object from from its properties. I have previously defined a ImageTypeInfo (inheriting RTT::TemplateTypeInfo). But I don't know how to call my composition functions from my marshaller!
>
> My code looks like:
>
> &#10;&gt; void FrameMarshaller::serialize(const PropertyBag &amp;v) {&#10;&gt;  std::vector&lt;PropertyBase*&gt; props = v.getProperties();&#10;&gt;  for (PropertyBag::iterator i = props.begin(); i != props.end(); i++) {&#10;&gt;    /// I don&#039;t know what to do here!!&#10;&gt;    imageTypeInfo-&gt;composeTypeImpl(bag, image);&#10;&gt;    cvShowImage(wName, image);&#10;&gt;  }&#10;&gt; }&#10;&gt;
>
> Charles.
> --
> Orocos-Users mailing list
> Orocos-Users [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>