|
Boost Users : |
Subject: Re: [Boost-users] [boost::gil] Type conversion in Generic Image Library
From: Nathan Crookston (nathan.crookston_at_[hidden])
Date: 2013-08-01 16:27:11
Hi Néstor,
Nestor Morales Hernández wrote:
>
>
> // I get the input images
> AbstractStereoMatcher::input_image_view_t
> input_left_view(video_input_p->get_left_image()),
> input_right_view(video_input_p->get_right_image());
>
> AbstractVideoInput::input_image_t
>
> rectified_left_view(input_left_view._dynamic_cast<AbstractVideoInput::input_image_t>()),
>
> rectified_right_view(input_right_view._dynamic_cast<AbstractVideoInput::input_image_t>());
>
> homography_rectifier_p->run(input_left_view, 0,
> boost::gil::view(rectified_left_view));
>
> Note that AbstractStereoMatcher::input_image_view_t and
AbstractVideoInput::input_image_t are different types. The former is an
any_image_view of const data, while the latter is an rgb8_image_t.
> // The ouput of the compiler is the following:
> /home/nestor/Dropbox/KULeuven/projects/doppia/src/applications/stixel_world_improved/StixelWorldApplication.cpp:296:102:
> required from here
> /home/nestor/Dropbox/KULeuven/projects/doppia/libs/boost/gil/image_view.hpp:101:143:
> error: const class
> boost::gil::any_image_view<boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<const
> boost::gil::pixel<unsigned char,
> boost::gil::layout<boost::mpl::vector3<boost::gil::red_t,
> boost::gil::green_t, boost::gil::blue_t> > >*> > >,
> boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<const
> boost::gil::pixel<unsigned char,
> boost::gil::layout<boost::mpl::vector1<boost::gil::gray_color_t> > >*> > >,
> boost::mpl::vector0<mpl_::na>, 0>, 0> > has no member named pixels
> make[2]: *** [CMakeFiles/stixel_world.dir/StixelWorldApplication.cpp.o]
> Error 1
>
You can edit the message down to this:
StixelWorldApplication.cpp:296
error: const class boost::gil::any_image_view</*unintelligible template
gobbledygook*/> has no member named pixels
Which is true. It looks like you're passing input_left_view, of
any_image_view type, into run, which expects rgb8c_view_t. Perhaps you
need to use rectified_left_view (which isn't really a view) in conjunction
with gil::view() (which will retrieve a view from the image).
> I hope somebody can help me with that. As I said, I'm new on using Boost
> Generic Image Library and it is driving me crazy.
>
I can sympathize -- it's pretty easy to do basic things with GIL, and GIL
allows you to do very complex things elegantly, but there can be a steep
learning curve in between.
HTH,
Nate
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net