void fast_rgb_to_luv(const boost::gil::rgb8c_view_t &rgb_view,
                     const boost::gil::dev3n8_planar_view_t &luv_view)
{

    using namespace boost::gil;

    if(rgb_view.dimensions() != luv_view.dimensions())
    {
        throw std::invalid_argument("rgb_to_luv expects views of the same dimensions");
    }

#pragma omp parallel for
    for(size_t row=0; row < static_cast<size_t>(rgb_view.height()); row +=1)
    {
        rgb8c_view_t::x_iterator rgb_row_it = rgb_view.row_begin(row);
        dev3n8_planar_view_t::x_iterator luv_row_it = luv_view.row_begin(row);

        for(size_t col=0; col < static_cast<size_t>(rgb_view.width());
            col +=1, ++rgb_row_it, ++luv_row_it)
        {
            (*luv_row_it) = rgb_to_luv(*rgb_row_it);

        } // end of "for each column"
    } // end of "for each row"

    return;
}
void ObjectsDetectionLibGui::set_right_input(boost::gil::rgb8c_view_t &view)
{
    input_right_view = view;

    if(view.dimensions() != screen_right_view.dimensions())
    {
        printf("ObjectsDetectionLibGui was initialized with (%zi, %zi), but received an image of size (%zi, %zi)\n",
               screen_left_view.width(), screen_right_view.height(),
               view.width(), view.height());
        throw std::invalid_argument("ObjectsDetectionLibGui does not support changes in the input image size");
    }
    return;
}