void image_traversal(const ImageView& img, Container& container) { using namespace boost::gil; std::cout << "img height: " << img.height() << std::endl; std::cout << "img width : " << img.width() << std::endl; std::cout << " values:" << num_channels<ImageView>::value << std::endl; long cnt_row = 0; long cnt_col = 0; for (typename ImageView::iterator it=img.begin(); it!=img.end(); ++it ) { for (int c=0; c < num_channels<ImageView>::value; ++c) { long val = (*it)[c]; container[ cnt_row ][ cnt_col ][c] = val; // std::cout << "cntrow: " << cnt_row << " cntcol: " << cnt_col << std::endl; } if ( cnt_col == (img.width()-1) ) { ++cnt_row; cnt_col = 0; } else ++cnt_col; } }