Ok, I tried to change typedefs to make things more clear, but I guess I
have had a mess. I will try to explain it again:
I am trying to use the class CpuPreprocessor publicly available here:
https://bitbucket.org/rodrigob/doppia/src/8b784ff23eeab329d02ebe2eb1bc4775e2...
To do so, I create a shared pointer pointing to an object of the class:
shared_ptr<CpuPreprocessor> homography_rectifier_p;
homography_rectifier_p.reset(new
CpuPreprocessor(video_input_p->get_left_image().dimensions(),
video_input_p->get_stereo_calibration(),
options));
Then, I try to execute the `run` method of the class CpuPreprocessor, which
has the prototype:
void run(const AbstractPreprocessor::input_image_view_t& input, const int
camera_index,
const AbstractPreprocessor::output_image_view_t &output);
// 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());
// And then I try to put them as input of the run function, doing the same
process followed in
https://bitbucket.org/rodrigob/doppia/src/8b784ff23eeab329d02ebe2eb1bc4775e2...
AbstractVideoInput::input_image_t
rectified_left_view(input_left_view._dynamic_castAbstractVideoInput::input_image_t()),
rectified_right_view(input_right_view._dynamic_castAbstractVideoInput::input_image_t());
homography_rectifier_p->run(input_left_view, 0,
boost::gil::view(rectified_left_view));
// 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
Hi Néstor,
Nestor Morales Hernández wrote:
I currently have an image of the type ` boost::gil::rgb8c_view_t`. I need to pass it to a function (from a code I don't mantain) with this prototype:
void function(const boost::gil::rgb8c_view_t& input, const int index, const boost::gil::rgb8c_view_t::view_t &output)
I have created an output image by using the following syntax:
boost::gil::rgb8c_view_t::view_t output(input._dynamic_castboost::gil::rgb8c_view_t::view_t());
At this point, the compiler accepts the image output as input for the function. However, I need the image back to the `boost::gil::rgb8c_view_t` type. The question is:
- Is it a correct way to allocate the image output? - How do I transform it back to the type boost::gil::rgb8c_view_t?
I'm having trouble parsing your syntax here. It looks like input is not really an rgb8c_view_t, rather its an any_image type. If it were the gil-specified typedef, there wouldn't be a _dynamic_cast member. Likewise output appears to be the same, with a nested view_t typedef.
Are you saying that function is the prototype over which you have no control? It seems odd that it would have an output view which has immutable pixels (due to the 'c' in rgb8c) and which could not itself be swapped out for a different view (due to the fact that it's a view passed by const reference).
I'm hoping there's been some mistake in copying pieces of your code into this email, otherwise there's only bad solutions to what you describe.
HTH, Nate
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Néstor Morales Hernández Departamento ISAATC, Universidad de La Laguna e-mail: nestor@isaatc.ull.es Phone: (+34) 922 318 287