From 3989f516b22365d515a0adb813ee518e70f0e693 Mon Sep 17 00:00:00 2001 From: mimhoff Date: Wed, 12 Jul 2023 23:28:10 +1000 Subject: [PATCH 1/2] fix (some) build errors for new software versions --- actuators/quickset/ptcr/protocol.cpp | 2 +- batteries/ocean/serial_io.cpp | 2 +- batteries/ocean/stdio_query.cpp | 6 +- batteries/ocean/stdio_query.h | 2 +- graphics/applications/csv_plot/stream.cpp | 2 +- .../applications/label_points/MainWindow.cpp | 24 +-- .../applications/view_points/main_window.cpp | 8 +- imaging/applications/cv-calc.cpp | 10 +- imaging/applications/cv-cat.cpp | 2 +- imaging/applications/image-accumulate.cpp | 4 +- .../applications/image-pinhole-calibrate.cpp | 18 +- imaging/camera/pinhole.cpp | 5 +- imaging/cv_mat/bursty_pipeline.h | 10 +- imaging/cv_mat/detail/accumulated.cpp | 4 +- imaging/cv_mat/detail/bitwise.cpp | 1 - imaging/cv_mat/detail/ratio.h | 2 +- imaging/cv_mat/detail/utils.cpp | 4 +- imaging/cv_mat/filters.cpp | 157 +++++++++--------- imaging/cv_mat/pipeline.cpp | 15 +- imaging/cv_mat/pipeline.h | 2 +- imaging/examples/regionprops-demo.cpp | 2 +- imaging/frequency_domain.cpp | 4 +- imaging/region_properties.cpp | 6 +- imaging/vegetation/filters.cpp | 6 +- .../test/gaussian_process_test.cpp | 4 +- .../points-foreground-partitions.cpp | 13 +- point_cloud/applications/points-join.cpp | 2 +- point_cloud/applications/points-rays.cpp | 4 +- .../applications/points-to-partitions.cpp | 13 +- .../basler/applications/basler-cat.cpp | 2 +- .../applications/flycapture-callback.cpp | 16 +- .../applications/flycapture-multicam.cpp | 4 +- sensors/cameras/flycapture/attributes.cpp | 2 +- sensors/cameras/flycapture/flycapture.cpp | 2 +- sensors/cameras/flycapture/helpers.cpp | 2 +- .../gige/applications/gige-callback.cpp | 16 +- .../cameras/vimba/applications/vimba-cat.cpp | 4 +- sensors/cameras/vimba/camera.cpp | 12 +- tbb/bursty_reader.h | 11 +- 39 files changed, 201 insertions(+), 204 deletions(-) diff --git a/actuators/quickset/ptcr/protocol.cpp b/actuators/quickset/ptcr/protocol.cpp index d6e1b24a0..fa0fb8861 100644 --- a/actuators/quickset/ptcr/protocol.cpp +++ b/actuators/quickset/ptcr/protocol.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/batteries/ocean/serial_io.cpp b/batteries/ocean/serial_io.cpp index 492acbb07..1dfb6dc58 100755 --- a/batteries/ocean/serial_io.cpp +++ b/batteries/ocean/serial_io.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include using namespace std; diff --git a/batteries/ocean/stdio_query.cpp b/batteries/ocean/stdio_query.cpp index e0dc322b6..a1d654e06 100644 --- a/batteries/ocean/stdio_query.cpp +++ b/batteries/ocean/stdio_query.cpp @@ -103,7 +103,7 @@ void stdio_query::async_receive(const boost::asio::mutable_buffer& buffer, boost received_length_ = 0; input_.async_read_some(boost::asio::buffer(buffer), - boost::bind(&stdio_query::handle_receive, _1, _2, &error_code_, &received_length_)); + boost::bind(&stdio_query::handle_receive, boost::placeholders::_1, _2, &error_code_, &received_length_)); } @@ -118,10 +118,10 @@ std::size_t stdio_query::receive(const boost::asio::mutable_buffer& buffer, std::size_t length = 0; input_.async_read_some(boost::asio::buffer(buffer), - boost::bind(&stdio_query::handle_receive, _1, _2, &ec, &length)); + boost::bind(&stdio_query::handle_receive, boost::placeholders::_1, _2, &ec, &length)); // boost::asio::async_read( input_, boost::asio::buffer(buffer), // boost::asio::transfer_at_least(1), - // boost::bind(&stdio_query::handle_receive, _1, _2, &ec, &length)); + // boost::bind(&stdio_query::handle_receive, boost::placeholders::_1, _2, &ec, &length)); // Block until the asynchronous operation has completed. do io_service_.run_one(); while (ec == boost::asio::error::would_block); diff --git a/batteries/ocean/stdio_query.h b/batteries/ocean/stdio_query.h index 37f00786b..e954b9bd5 100644 --- a/batteries/ocean/stdio_query.h +++ b/batteries/ocean/stdio_query.h @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/graphics/applications/csv_plot/stream.cpp b/graphics/applications/csv_plot/stream.cpp index 9e60a0169..a89eca13b 100644 --- a/graphics/applications/csv_plot/stream.cpp +++ b/graphics/applications/csv_plot/stream.cpp @@ -29,7 +29,7 @@ /// @author Vsevolod Vlaskine -#include +#include #include "stream.h" #include "traits.h" diff --git a/graphics/applications/label_points/MainWindow.cpp b/graphics/applications/label_points/MainWindow.cpp index 8d984fa38..0df70838c 100644 --- a/graphics/applications/label_points/MainWindow.cpp +++ b/graphics/applications/label_points/MainWindow.cpp @@ -31,7 +31,7 @@ #include #include #ifndef Q_MOC_RUN -#include +#include #include #include #endif @@ -63,12 +63,12 @@ MainWindow::MainWindow( const std::string& title, Viewer* viewer ) Actions::Action* saveAsAction = new Actions::Action( "SaveAs...", boost::bind( &MainWindow::saveAs, this ) ); Actions::Action* reloadAction = new Actions::Action( "Reload", boost::bind( &Viewer::reload, viewer ) ); - Actions::ToggleAction* navigateSceneAction = new Actions::ToggleAction( QIcon::fromTheme("edit-select", Icons::pointer() ) , "navigate scene", boost::bind( &Tools::Navigate::toggle, boost::ref( viewer->navigate ), _1 ), "Ctrl+Q" ); - Actions::ToggleAction* selectPointsAction = new Actions::ToggleAction( QIcon::fromTheme("zoom-select", Icons::select()), "select points", boost::bind( &Tools::SelectClip::toggle, boost::ref( viewer->selectClip ), _1 ), "Ctrl+W" ); - Actions::ToggleAction* selectPartitionAction = new Actions::ToggleAction( QIcon::fromTheme("tools-wizard", Icons::fuzzy()), "select partition", boost::bind( &Tools::SelectPartition::toggle, boost::ref( viewer->selectPartition ), _1 ), "Ctrl+E" ); - Actions::ToggleAction* selectIdAction = new Actions::ToggleAction( QIcon::fromTheme("tools-wizard", Icons::fuzzy()), "select id", boost::bind( &Tools::SelectPartition::toggle, boost::ref( viewer->selectId ), _1 ), "Ctrl+R" ); - Actions::ToggleAction* pipetteAction = new Actions::ToggleAction( QIcon::fromTheme("color-picker", Icons::pipette()), "pick id", boost::bind( &Tools::PickId::toggle, boost::ref( viewer->pickId ), _1 ), "Ctrl+T" ); - Actions::ToggleAction* bucketAction = new Actions::ToggleAction( QIcon::fromTheme("fill-color", Icons::bucket()), "set id", boost::bind( &Tools::Fill::toggle, boost::ref( viewer->fill ), _1 ), "Ctrl+Y" ); + Actions::ToggleAction* navigateSceneAction = new Actions::ToggleAction( QIcon::fromTheme("edit-select", Icons::pointer() ) , "navigate scene", boost::bind( &Tools::Navigate::toggle, boost::ref( viewer->navigate ), boost::placeholders::_1 ), "Ctrl+Q" ); + Actions::ToggleAction* selectPointsAction = new Actions::ToggleAction( QIcon::fromTheme("zoom-select", Icons::select()), "select points", boost::bind( &Tools::SelectClip::toggle, boost::ref( viewer->selectClip ), boost::placeholders::_1 ), "Ctrl+W" ); + Actions::ToggleAction* selectPartitionAction = new Actions::ToggleAction( QIcon::fromTheme("tools-wizard", Icons::fuzzy()), "select partition", boost::bind( &Tools::SelectPartition::toggle, boost::ref( viewer->selectPartition ), boost::placeholders::_1 ), "Ctrl+E" ); + Actions::ToggleAction* selectIdAction = new Actions::ToggleAction( QIcon::fromTheme("tools-wizard", Icons::fuzzy()), "select id", boost::bind( &Tools::SelectPartition::toggle, boost::ref( viewer->selectId ), boost::placeholders::_1 ), "Ctrl+R" ); + Actions::ToggleAction* pipetteAction = new Actions::ToggleAction( QIcon::fromTheme("color-picker", Icons::pipette()), "pick id", boost::bind( &Tools::PickId::toggle, boost::ref( viewer->pickId ), boost::placeholders::_1 ), "Ctrl+T" ); + Actions::ToggleAction* bucketAction = new Actions::ToggleAction( QIcon::fromTheme("fill-color", Icons::bucket()), "set id", boost::bind( &Tools::Fill::toggle, boost::ref( viewer->fill ), boost::placeholders::_1 ), "Ctrl+Y" ); selectPointsAction->setToolTip( "select points, click and drag
" "hold Ctrl to add to current selection
" @@ -139,7 +139,7 @@ MainWindow::MainWindow( const std::string& title, Viewer* viewer ) resize( 640, 480 ); m_viewMenu = menuBar()->addMenu( "View" ); - Actions::ToggleAction* action = new Actions::ToggleAction( "File Panel", boost::bind( &MainWindow::toggleFileFrame, this, _1 ) ); + Actions::ToggleAction* action = new Actions::ToggleAction( "File Panel", boost::bind( &MainWindow::toggleFileFrame, this, boost::placeholders::_1 ) ); action->setChecked( m_fileFrameVisible ); m_viewMenu->addAction( action ); connect( viewer, SIGNAL( initialized() ), this, SLOT( viewerInitialized() ) ); @@ -256,11 +256,11 @@ void MainWindow::updateFileFrame() } if( !sameFields ) { filename += ": \"" + m_viewer.datasets()[i]->options().fields + "\""; } m_fileLayout->addWidget( new QLabel( filename.c_str() ), i + 1, 0, Qt::AlignLeft | Qt::AlignTop ); - CheckBox* viewBox = new CheckBox( boost::bind( &Viewer::show, boost::ref( m_viewer ), i, _1 ) ); + CheckBox* viewBox = new CheckBox( boost::bind( &Viewer::show, boost::ref( m_viewer ), i, boost::placeholders::_1 ) ); viewBox->setCheckState( Qt::Checked ); viewBox->setToolTip( ( std::string( "check to make " ) + filename + " visible" ).c_str() ); m_fileLayout->addWidget( viewBox, i + 1, 1, Qt::AlignRight | Qt::AlignTop ); - CheckBox* writeBox = new CheckBox( boost::bind( &Viewer::setWritable, boost::ref( m_viewer ), i, _1 ) ); + CheckBox* writeBox = new CheckBox( boost::bind( &Viewer::setWritable, boost::ref( m_viewer ), i, boost::placeholders::_1 ) ); writeBox->setToolTip( ( std::string( "check to make " ) + filename + " writable" ).c_str() ); if( i == 0 ) { writeBox->setCheckState( Qt::Checked ); } m_fileLayout->addWidget( writeBox, i + 1, 2, Qt::AlignRight | Qt::AlignTop ); @@ -273,10 +273,10 @@ void MainWindow::updateFileFrame() for( FileGroupMap::const_iterator it = m_fileGroups.begin(); it != m_fileGroups.end(); ++it, ++i ) { m_fileLayout->addWidget( new QLabel( ( "\"" + it->first + "\"" ).c_str() ), i, 0, Qt::AlignLeft | Qt::AlignTop ); - CheckBox* viewBox = new CheckBox( boost::bind( &MainWindow::showFileGroup, this, it->first, _1 ) ); + CheckBox* viewBox = new CheckBox( boost::bind( &MainWindow::showFileGroup, this, it->first, boost::placeholders::_1 ) ); viewBox->setToolTip( ( std::string( "check to make files with fields \"" ) + it->first + "\" visible" ).c_str() ); m_fileLayout->addWidget( viewBox, i, 1, Qt::AlignRight | Qt::AlignTop ); - CheckBox* writeBox = new CheckBox( boost::bind( &MainWindow::setWritableFileGroup, this, it->first, _1 ) ); + CheckBox* writeBox = new CheckBox( boost::bind( &MainWindow::setWritableFileGroup, this, it->first, boost::placeholders::_1 ) ); writeBox->setToolTip( ( std::string( "check to make files with fields \"" ) + it->first + "\" writable" ).c_str() ); m_fileLayout->addWidget( writeBox, i, 2, Qt::AlignRight | Qt::AlignTop ); m_fileLayout->setRowStretch( i, i + 1 == m_viewer.datasets().size() + fields.size() ? 1 : 0 ); diff --git a/graphics/applications/view_points/main_window.cpp b/graphics/applications/view_points/main_window.cpp index 23daf418d..d96343914 100644 --- a/graphics/applications/view_points/main_window.cpp +++ b/graphics/applications/view_points/main_window.cpp @@ -96,7 +96,7 @@ MainWindow::MainWindow( const std::string& title, const std::shared_ptraddMenu( "View" ); - ToggleAction* action = new ToggleAction( "File Panel", boost::bind( &MainWindow::toggleFileFrame, this, _1 ) ); + ToggleAction* action = new ToggleAction( "File Panel", boost::bind( &MainWindow::toggleFileFrame, this, boost::placeholders::_1 ) ); action->setChecked( m_fileFrameVisible ); m_viewMenu->addAction( action ); updateFileFrame(); @@ -158,7 +158,7 @@ void MainWindow::updateFileFrame() // quick and dirty } if( !sameFields ) { title += ": \"" + controller->readers[i]->options.fields + "\""; } m_fileLayout->addWidget( new QLabel( title.c_str() ), i + 1, 0, Qt::AlignLeft | Qt::AlignTop ); - CheckBox* viewBox = new CheckBox( boost::bind( &Reader::show, boost::ref( *controller->readers[i] ), _1 ) ); + CheckBox* viewBox = new CheckBox( boost::bind( &Reader::show, boost::ref( *controller->readers[i] ), boost::placeholders::_1 ) ); viewBox->setCheckState( controller->readers[i]->show() ? Qt::Checked : Qt::Unchecked ); connect( viewBox, SIGNAL( toggled( bool ) ), this, SLOT( update_view() ) ); // redraw when box is toggled viewBox->setToolTip( ( std::string( "check to make " ) + title + " visible" ).c_str() ); @@ -176,7 +176,7 @@ void MainWindow::updateFileFrame() // quick and dirty for( FileGroupMap::const_iterator it = m_userGroups.begin(); it != m_userGroups.end(); ++it, ++i ) { m_fileLayout->addWidget( new QLabel( ( "\"" + it->first + "\"" ).c_str() ), i, 0, Qt::AlignLeft | Qt::AlignTop ); - CheckBox* viewBox = new CheckBox( boost::bind( &MainWindow::showFileGroup, this, it->first, _1 ) ); + CheckBox* viewBox = new CheckBox( boost::bind( &MainWindow::showFileGroup, this, it->first, boost::placeholders::_1 ) ); //viewBox->setCheckState( Qt::Checked ); viewBox->setToolTip( ( std::string( "check to make files within group \"" ) + it->first + "\" visible" ).c_str() ); m_fileLayout->addWidget( viewBox, i, 1, Qt::AlignRight | Qt::AlignTop ); @@ -186,7 +186,7 @@ void MainWindow::updateFileFrame() // quick and dirty for( FileGroupMap::const_iterator it = m_fieldsGroups.begin(); it != m_fieldsGroups.end(); ++it, ++i ) { m_fileLayout->addWidget( new QLabel( ( "\"" + it->first + "\"" ).c_str() ), i, 0, Qt::AlignLeft | Qt::AlignTop ); - CheckBox* viewBox = new CheckBox( boost::bind( &MainWindow::showFileGroup, this, it->first, _1 ) ); + CheckBox* viewBox = new CheckBox( boost::bind( &MainWindow::showFileGroup, this, it->first, boost::placeholders::_1 ) ); //viewBox->setCheckState( Qt::Checked ); viewBox->setToolTip( ( std::string( "check to make files with fields \"" ) + it->first + "\" visible" ).c_str() ); m_fileLayout->addWidget( viewBox, i, 1, Qt::AlignRight | Qt::AlignTop ); diff --git a/imaging/applications/cv-calc.cpp b/imaging/applications/cv-calc.cpp index 5fa25e5db..8b729197b 100644 --- a/imaging/applications/cv-calc.cpp +++ b/imaging/applications/cv-calc.cpp @@ -610,8 +610,8 @@ class shapes bool draw( cv::Mat m ) const { if( max.x == 0 && min.x == 0 && max.y == 0 && max.y == 0 ) { return false; } - if( properties.normalized ) { cv::rectangle( m, cv::Point2i( min.x * m.cols, min.y * m.rows ), cv::Point2i( max.x * m.cols, max.y * m.rows ), properties.color, properties.weight ); } // CV_AA ); - else { cv::rectangle( m, min, max, properties.color, properties.weight ); } // CV_AA ); + if( properties.normalized ) { cv::rectangle( m, cv::Point2i( min.x * m.cols, min.y * m.rows ), cv::Point2i( max.x * m.cols, max.y * m.rows ), properties.color, properties.weight ); } // cv::LINE_AA ); + else { cv::rectangle( m, min, max, properties.color, properties.weight ); } // cv::LINE_AA ); return true; } }; @@ -624,8 +624,8 @@ class shapes bool draw( cv::Mat m ) const { if( !comma::math::less( 0, radius ) ) { return false; } - if( properties.normalized ) { cv::circle( m, cv::Point2i( centre.x * m.cols, centre.y * m.rows ), radius * m.cols, properties.color, properties.weight, CV_AA ); } - else { cv::circle( m, centre, radius, properties.color, properties.weight, CV_AA ); } + if( properties.normalized ) { cv::circle( m, cv::Point2i( centre.x * m.cols, centre.y * m.rows ), radius * m.cols, properties.color, properties.weight, cv::LINE_AA ); } + else { cv::circle( m, centre, radius, properties.color, properties.weight, cv::LINE_AA ); } return true; } }; @@ -638,7 +638,7 @@ class shapes bool draw( cv::Mat m ) const { if( text.empty() ) { return false; } - cv::putText( m, text, properties.normalized ? cv::Point2f( position.x * m.cols, position.y * m.rows ) : position, cv::FONT_HERSHEY_SIMPLEX, 1.0, properties.color, properties.weight, CV_AA ); + cv::putText( m, text, properties.normalized ? cv::Point2f( position.x * m.cols, position.y * m.rows ) : position, cv::FONT_HERSHEY_SIMPLEX, 1.0, properties.color, properties.weight, cv::LINE_AA ); return true; } }; diff --git a/imaging/applications/cv-cat.cpp b/imaging/applications/cv-cat.cpp index df7ab1c22..063ab9974 100644 --- a/imaging/applications/cv-cat.cpp +++ b/imaging/applications/cv-cat.cpp @@ -316,7 +316,7 @@ int main( int argc, char** argv ) reader.reset( new bursty_reader< pair >( boost::bind( &read, boost::ref( input ), boost::ref( rate ) ), discard, capacity ) ); } const unsigned int default_delay = vm.count( "file" ) == 0 ? 1 : 200; // HACK to make view work on single files - pipeline_with_header pipeline( output, filters_with_header::make( filters, boost::bind( &get_timestamp_from_header, _1, input.header_binary() ), default_delay ), *reader, number_of_threads ); + pipeline_with_header pipeline( output, filters_with_header::make( filters, boost::bind( &get_timestamp_from_header, boost::placeholders::_1, input.header_binary() ), default_delay ), *reader, number_of_threads ); pipeline.run(); if( vm.count( "stay" ) ) { while( !is_shutdown ) { boost::this_thread::sleep( boost::posix_time::seconds( 1 ) ); } } return 0; diff --git a/imaging/applications/image-accumulate.cpp b/imaging/applications/image-accumulate.cpp index 7b47961b0..fc92d6867 100644 --- a/imaging/applications/image-accumulate.cpp +++ b/imaging/applications/image-accumulate.cpp @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include #include @@ -350,7 +350,7 @@ static void output_once_( const boost::posix_time::ptime& t ) static void output_() { - static const boost::posix_time::time_duration period = boost::posix_time::milliseconds( 1000.0 / *fps ); + static const boost::posix_time::time_duration period = boost::posix_time::milliseconds( (long) ( 1000.0 / *fps ) ); static const boost::posix_time::time_duration timeout = boost::posix_time::milliseconds( 10 ); boost::posix_time::ptime time_to_output = boost::posix_time::microsec_clock::universal_time() + period; while( !is_shutdown && !done && std::cout.good() ) diff --git a/imaging/applications/image-pinhole-calibrate.cpp b/imaging/applications/image-pinhole-calibrate.cpp index 48ca43cdd..69019949e 100644 --- a/imaging/applications/image-pinhole-calibrate.cpp +++ b/imaging/applications/image-pinhole-calibrate.cpp @@ -175,7 +175,7 @@ static double reprojection_error( const std::vector< std::vector< cv::Point3f > for( unsigned int i = 0; i < object_points.size(); ++i ) { cv::projectPoints( cv::Mat( object_points[i] ), rvecs[i], tvecs[i], camera_matrix, distortion_coefficients, image_points_2 ); - double err = cv::norm( cv::Mat( image_points[i] ), cv::Mat( image_points_2 ), CV_L2 ); + double err = cv::norm( cv::Mat( image_points[i] ), cv::Mat( image_points_2 ), cv::NORM_L2 ); unsigned int n = object_points[i].size(); per_view_errors[i] = std::sqrt( err * err / n ); total_error += err * err; @@ -196,7 +196,7 @@ static bool calibrate( const std::vector< cv::Point3f >& pattern_corners { std::vector< float > reprojection_errors; std::vector< std::vector< cv::Point3f > > object_points( image_points.size(), pattern_corners ); - cv::calibrateCamera( object_points, image_points, image_size, camera_matrix, distortion_coefficients, rvecs, tvecs, flags | CV_CALIB_FIX_K4 | CV_CALIB_FIX_K5 ); + cv::calibrateCamera( object_points, image_points, image_size, camera_matrix, distortion_coefficients, rvecs, tvecs, flags | cv::CALIB_FIX_K4 | cv::CALIB_FIX_K5 ); bool ok = cv::checkRange( camera_matrix ) && cv::checkRange( distortion_coefficients ); total_average_error = reprojection_error( object_points, image_points, rvecs, tvecs, camera_matrix, distortion_coefficients, reprojection_errors ); return ok; @@ -284,9 +284,9 @@ int main( int ac, char** av ) if( pattern == patterns::invalid ) { std::cerr << "image-pinhole-calibration: expected calibration pattern, got: \"" << pattern_string << "\"" << std::endl; } float square_size = options.value< float >( "--pattern-square-size,--square-size", 1 ); int flags = 0; - if( options.exists( "--no-principal-point" ) ) { flags |= CV_CALIB_FIX_PRINCIPAL_POINT; } - if( options.exists( "--no-tangential-distortion" ) ) { flags |= CV_CALIB_ZERO_TANGENT_DIST; } - if( options.exists( "--no-aspect-ratio" ) ) { flags |= CV_CALIB_FIX_ASPECT_RATIO; } + if( options.exists( "--no-principal-point" ) ) { flags |= cv::CALIB_FIX_PRINCIPAL_POINT; } + if( options.exists( "--no-tangential-distortion" ) ) { flags |= cv::CALIB_ZERO_TANGENT_DIST; } + if( options.exists( "--no-aspect-ratio" ) ) { flags |= cv::CALIB_FIX_ASPECT_RATIO; } bool view = options.exists( "--view" ); bool verbose = options.exists( "--verbose,-v" ); std::vector< std::vector< cv::Point2f > > image_points; @@ -307,7 +307,7 @@ int main( int ac, char** av ) //if( view ) { images.push_back( pair.second.clone() ); } image_size = pair.second.size(); std::vector< cv::Point2f > points; - bool found = pattern == patterns::chessboard ? cv::findChessboardCorners( pair.second, pattern_size, points, CV_CALIB_CB_ADAPTIVE_THRESH | CV_CALIB_CB_FAST_CHECK | CV_CALIB_CB_NORMALIZE_IMAGE ) + bool found = pattern == patterns::chessboard ? cv::findChessboardCorners( pair.second, pattern_size, points, cv::CALIB_CB_ADAPTIVE_THRESH | cv::CALIB_CB_FAST_CHECK | cv::CALIB_CB_NORMALIZE_IMAGE ) : pattern == patterns::circles_grid ? findCirclesGrid( view, pattern_size, points ) : pattern == patterns::asymmetric_circles_grid ? findCirclesGrid( view, pattern_size, points, cv::CALIB_CB_ASYMMETRIC_GRID ) : false; @@ -324,7 +324,7 @@ int main( int ac, char** av ) { cv::Mat grey; cv::cvtColor( pair.second, grey, cv::COLOR_BGR2GRAY ); - cv::cornerSubPix( grey, points, cv::Size( 11, 11 ), cv::Size( -1, -1 ), cv::TermCriteria( CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1 ) ); + cv::cornerSubPix( grey, points, cv::Size( 11, 11 ), cv::Size( -1, -1 ), cv::TermCriteria( cv::TermCriteria::MAX_ITER + cv::TermCriteria::EPS, 30, 0.1 ) ); } image_points.push_back( points ); timestamps.push_back( pair.first ); @@ -368,7 +368,7 @@ int main( int ac, char** av ) else { // set flag to use values from config - if (options.exists("--config")) { flags |= CV_CALIB_USE_INTRINSIC_GUESS; } + if (options.exists("--config")) { flags |= cv::CALIB_USE_INTRINSIC_GUESS; } if( !calibrate( pattern_corners, *image_size, image_points, flags, camera_matrix, distortion_coefficients, rvecs, tvecs, output.total_average_error ) ) { std::cerr << "image-pinhole-calibrate: calibration failed" << std::endl; return 1; } } for( unsigned int i = 0; i < images.size(); ++i ) @@ -381,7 +381,7 @@ int main( int ac, char** av ) if( verbose ) { std::cerr << "image-pinhole-calibrate: outputting..." << std::endl; } output.pinhole.image_size = Eigen::Vector2i( image_size->width, image_size->height ); output.pinhole.principal_point = Eigen::Vector2d( camera_matrix.at< double >( 0, 2 ), camera_matrix.at< double >( 1, 2 ) ); - if( flags & CV_CALIB_FIX_ASPECT_RATIO ) + if( flags & cv::CALIB_FIX_ASPECT_RATIO ) { output.pinhole.focal_length = camera_matrix.at< double >( 0, 0 ); } diff --git a/imaging/camera/pinhole.cpp b/imaging/camera/pinhole.cpp index d45772820..bdc9f93e9 100644 --- a/imaging/camera/pinhole.cpp +++ b/imaging/camera/pinhole.cpp @@ -30,8 +30,9 @@ #include #include #include -#include -#include +#include +#include +#include #include #include #include diff --git a/imaging/cv_mat/bursty_pipeline.h b/imaging/cv_mat/bursty_pipeline.h index 55c1fbd28..8de0af9f0 100644 --- a/imaging/cv_mat/bursty_pipeline.h +++ b/imaging/cv_mat/bursty_pipeline.h @@ -29,8 +29,8 @@ #pragma once -#include -#include +#include +#include #include "../../tbb/bursty_reader.h" namespace snark { namespace tbb { @@ -45,7 +45,7 @@ class bursty_pipeline /// @param number_of_threads maximum number of threads, 0 means auto bursty_pipeline( unsigned int number_of_threads = 0 ); - void run( bursty_reader< T >& reader, const ::tbb::filter_t< T, void >& filter ); + void run( bursty_reader< T >& reader, const ::tbb::filter< T, void >& filter ); private: unsigned int number_of_threads_; @@ -53,10 +53,10 @@ class bursty_pipeline template< typename T > -inline bursty_pipeline< T >::bursty_pipeline( unsigned int number_of_threads ) : number_of_threads_( number_of_threads > 0 ? number_of_threads : ::tbb::task_scheduler_init::default_num_threads() ) {} +inline bursty_pipeline< T >::bursty_pipeline( unsigned int number_of_threads ) : number_of_threads_( number_of_threads > 0 ? number_of_threads : ::tbb::this_task_arena::max_concurrency() ) {} template< typename T > -inline void bursty_pipeline< T >::run( bursty_reader< T >& reader, const ::tbb::filter_t< T, void >& filter ) +inline void bursty_pipeline< T >::run( bursty_reader< T >& reader, const ::tbb::filter< T, void >& filter ) { ::tbb::parallel_pipeline( number_of_threads_, reader.filter() & filter ); } diff --git a/imaging/cv_mat/detail/accumulated.cpp b/imaging/cv_mat/detail/accumulated.cpp index 58fc81d3d..7e58a05f6 100644 --- a/imaging/cv_mat/detail/accumulated.cpp +++ b/imaging/cv_mat/detail/accumulated.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include "../depth_traits.h" @@ -71,7 +71,7 @@ template< typename H, int DepthIn > static void divide_by_rows( const cv::Mat& m, cv::Mat& result, const apply_function& fn, comma::uint64 count ) { tbb::parallel_for( tbb::blocked_range< std::size_t >( 0, m.rows ), - boost::bind( &iterate_pixels< DepthIn >, _1, m, boost::ref( result ), boost::ref(fn), count ) ); + boost::bind( &iterate_pixels< DepthIn >, boost::placeholders::_1, m, boost::ref( result ), boost::ref(fn), count ) ); } template< typename H > diff --git a/imaging/cv_mat/detail/bitwise.cpp b/imaging/cv_mat/detail/bitwise.cpp index a49354e3a..7a1dc9893 100644 --- a/imaging/cv_mat/detail/bitwise.cpp +++ b/imaging/cv_mat/detail/bitwise.cpp @@ -29,7 +29,6 @@ #include "bitwise.h" -#include #include #include #include diff --git a/imaging/cv_mat/detail/ratio.h b/imaging/cv_mat/detail/ratio.h index 021ce4bca..e04f17fa2 100644 --- a/imaging/cv_mat/detail/ratio.h +++ b/imaging/cv_mat/detail/ratio.h @@ -38,7 +38,7 @@ #include #include #include -#include +#include namespace snark{ namespace cv_mat { diff --git a/imaging/cv_mat/detail/utils.cpp b/imaging/cv_mat/detail/utils.cpp index b4fae8d9b..14948a81a 100644 --- a/imaging/cv_mat/detail/utils.cpp +++ b/imaging/cv_mat/detail/utils.cpp @@ -110,7 +110,7 @@ boost::unordered_map< std::string, unsigned int > fill_cvt_color_types_() { boost::unordered_map types; //note RGB is exactly the same as BGR - types[ "CV_BGR2GRAY" ] = types[ "BGR,GRAY" ] = types[ "CV_RGB2GRAY" ] = types[ "RGB,GRAY" ] = CV_BGR2GRAY; + types[ "CV_BGR2GRAY" ] = types[ "BGR,GRAY" ] = types[ "cv::COLOR_RGB2GRAY" ] = types[ "RGB,GRAY" ] = CV_BGR2GRAY; types[ "CV_GRAY2BGR" ] = types[ "GRAY,BGR" ] = types[ "CV_GRAY2RGB" ] = types[ "GRAY,RGB" ] = CV_GRAY2BGR; types[ "CV_BGR2XYZ" ] = types[ "BGR,XYZ" ] = types[ "CV_RGB2XYZ" ] = types[ "RGB,XYZ" ] = CV_BGR2XYZ; types[ "CV_XYZ2BGR" ] = types[ "XYZ,BGR" ] = types[ "CV_XYZ2RGB" ] = types[ "XYZ,RGB" ] = CV_XYZ2BGR; @@ -171,7 +171,7 @@ std::string make_filename( const boost::posix_time::ptime& t, const std::string& std::vector< int > imwrite_params( const std::string& type, const int quality ) { std::vector< int > params; - if ( type == "jpg" ) { params.push_back( CV_IMWRITE_JPEG_QUALITY ); } + if ( type == "jpg" ) { params.push_back( cv::IMWRITE_JPEG_QUALITY ); } else { COMMA_THROW( comma::exception, "quality only supported for jpg images, not for \"" << type << "\" yet" ); } params.push_back( quality ); return params; diff --git a/imaging/cv_mat/filters.cpp b/imaging/cv_mat/filters.cpp index 0b6831839..572381407 100644 --- a/imaging/cv_mat/filters.cpp +++ b/imaging/cv_mat/filters.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #if CV_MAJOR_VERSION <= 2 @@ -795,12 +796,12 @@ static typename impl::filters< H >::value_type blur_impl_( typename impl::filter struct threshold_t { - enum types { binary = CV_THRESH_BINARY - , binary_inv = CV_THRESH_BINARY_INV - , trunc = CV_THRESH_TRUNC - //, trunc_inv = CV_THRESH_TRUNC | CV_THRESH_BINARY_INV // == CV_THRESH_TOZERO - , tozero = CV_THRESH_TOZERO - , tozero_inv = CV_THRESH_TOZERO_INV }; + enum types { binary = cv::THRESH_BINARY + , binary_inv = cv::THRESH_BINARY_INV + , trunc = cv::THRESH_TRUNC + //, trunc_inv = cv::THRESH_TRUNC | cv::THRESH_BINARY_INV // == cv::THRESH_TOZERO + , tozero = cv::THRESH_TOZERO + , tozero_inv = cv::THRESH_TOZERO_INV }; static types from_string( const std::string& s ) { @@ -818,7 +819,7 @@ static typename impl::filters< H >::value_type threshold_impl_( typename impl::f { typename impl::filters< H >::value_type n; n.first = m.first; - cv::threshold( m.second, n.second, threshold, max_value, otsu ? type | CV_THRESH_OTSU : type ); + cv::threshold( m.second, n.second, threshold, max_value, otsu ? type | cv::THRESH_OTSU : type ); return n; } @@ -897,7 +898,7 @@ static typename impl::filters< H >::value_type kmeans_impl_( typename impl::filt cv::Mat classes; cv::Mat centers; int attempts = 5; - cv::kmeans(pixels, k, classes, cv::TermCriteria( CV_TERMCRIT_ITER + CV_TERMCRIT_EPS, 100, 0.01 ), attempts, cv::KMEANS_PP_CENTERS, centers); + cv::kmeans(pixels, k, classes, cv::TermCriteria( cv::TermCriteria::MAX_ITER + cv::TermCriteria::EPS, 100, 0.01 ), attempts, cv::KMEANS_PP_CENTERS, centers); cv::Mat out = cv::Mat::zeros(m.second.rows, m.second.cols, m.second.type()); out = out.reshape(1, m.second.rows*m.second.cols); for (int p = 0; p < out.rows ; p++) { centers.row(classes.at(p)).copyTo(out.row(p)); } @@ -1226,8 +1227,8 @@ struct timestamp_impl_ { value_type operator()( value_type m ) { - cv::rectangle( m.second, cv::Point( 5, 5 ), cv::Point( 228, 25 ), cv::Scalar( 0xffff, 0xffff, 0xffff ), CV_FILLED, CV_AA ); - cv::putText( m.second, boost::posix_time::to_iso_string( get_timestamp_(m.first) ), cv::Point( 10, 20 ), cv::FONT_HERSHEY_SIMPLEX, 0.5, cv::Scalar( 0, 0, 0 ), 1, CV_AA ); + cv::rectangle( m.second, cv::Point( 5, 5 ), cv::Point( 228, 25 ), cv::Scalar( 0xffff, 0xffff, 0xffff ), cv::FILLED, cv::LINE_AA ); + cv::putText( m.second, boost::posix_time::to_iso_string( get_timestamp_(m.first) ), cv::Point( 10, 20 ), cv::FONT_HERSHEY_SIMPLEX, 0.5, cv::Scalar( 0, 0, 0 ), 1, cv::LINE_AA ); return m; } }; @@ -1290,8 +1291,8 @@ struct count_impl_ value_type operator()( value_type m ) { - cv::rectangle( m.second, cv::Point( 5, 5 ), cv::Point( 80, 25 ), cv::Scalar( 0xffff, 0xffff, 0xffff ), CV_FILLED, CV_AA ); - cv::putText( m.second, boost::lexical_cast< std::string >( count++ ), cv::Point( 10, 20 ), cv::FONT_HERSHEY_SIMPLEX, 0.5, cv::Scalar( 0, 0, 0 ), 1, CV_AA ); + cv::rectangle( m.second, cv::Point( 5, 5 ), cv::Point( 80, 25 ), cv::Scalar( 0xffff, 0xffff, 0xffff ), cv::FILLED, cv::LINE_AA ); + cv::putText( m.second, boost::lexical_cast< std::string >( count++ ), cv::Point( 10, 20 ), cv::FONT_HERSHEY_SIMPLEX, 0.5, cv::Scalar( 0, 0, 0 ), 1, cv::LINE_AA ); return m; } }; @@ -1402,9 +1403,9 @@ struct filter_table_t //scale cv::Mat result(mat.rows,mat.cols,use_double?CV_64FC(mat.channels()):CV_32FC(mat.channels())); if(use_double) - tbb::parallel_for(tbb::blocked_range(0,mat.rows, partition_size), boost::bind(scale_, _1, mat, s, boost::ref(result))); + tbb::parallel_for(tbb::blocked_range(0,mat.rows, partition_size), boost::bind(scale_, boost::placeholders::_1, mat, s, boost::ref(result))); else - tbb::parallel_for(tbb::blocked_range(0,mat.rows, partition_size), boost::bind(scale_, _1, mat, s, boost::ref(result))); + tbb::parallel_for(tbb::blocked_range(0,mat.rows, partition_size), boost::bind(scale_, boost::placeholders::_1, mat, s, boost::ref(result))); return result; } cv::Mat normalize_sum(const cv::Mat& mat) @@ -1413,9 +1414,9 @@ struct filter_table_t cv::Mat result(mat.rows,mat.cols, use_double?CV_64FC(mat.channels()):CV_32FC(mat.channels())); int partition_size=mat.rows/number_of_partitions; if(use_double) - tbb::parallel_for(tbb::blocked_range(0,mat.rows, partition_size), boost::bind(normalize_sum_, _1, mat, boost::ref(result))); + tbb::parallel_for(tbb::blocked_range(0,mat.rows, partition_size), boost::bind(normalize_sum_, boost::placeholders::_1, mat, boost::ref(result))); else - tbb::parallel_for(tbb::blocked_range(0,mat.rows, partition_size), boost::bind(normalize_sum_, _1, mat, boost::ref(result))); + tbb::parallel_for(tbb::blocked_range(0,mat.rows, partition_size), boost::bind(normalize_sum_, boost::placeholders::_1, mat, boost::ref(result))); return result; } static cv::Scalar max_(const tbb::blocked_range& r, const cv::Mat& v, cv::Scalar s) @@ -1516,7 +1517,7 @@ static float colour_scale_factor( int const depth ) template < typename H > static typename impl::filters< H >::value_type text_impl_( typename impl::filters< H >::value_type m, const std::string& s, const cv::Point& origin, const cv::Scalar& colour ) { - cv::putText( m.second, s, origin, cv::FONT_HERSHEY_SIMPLEX, 1.0, cv::Scalar( colour * colour_scale_factor( m.second.depth() ) ), 1, CV_AA ); + cv::putText( m.second, s, origin, cv::FONT_HERSHEY_SIMPLEX, 1.0, cv::Scalar( colour * colour_scale_factor( m.second.depth() ) ), 1, cv::LINE_AA ); return m; } @@ -1755,7 +1756,7 @@ static typename impl::filters< H >::value_type convert( typename impl::filters< n.second += cv::Scalar::all( 1 ); cv::log( n.second, n.second ); // todo: optional } - if( normalize ) { cv::normalize( n.second, n.second, 0, 1, CV_MINMAX ); } + if( normalize ) { cv::normalize( n.second, n.second, 0, 1, cv::NORM_MINMAX ); } return n; } @@ -1800,7 +1801,7 @@ static typename impl::filters< H >::value_type convert( typename impl::filters< q2.copyTo( q1 ); tmp.copyTo( q2 ); - if( normalize ) { cv::normalize( n.second, n.second, 0, 1, CV_MINMAX ); } + if( normalize ) { cv::normalize( n.second, n.second, 0, 1, cv::NORM_MINMAX ); } return n; } @@ -1871,7 +1872,7 @@ static typename impl::filters< H >::value_type per_element_ratio( const typename { int otype = CV_MAKETYPE( DepthOut, coefficients.size() ); cv::Mat result( m.second.size(), otype ); - tbb::parallel_for( tbb::blocked_range< std::size_t >( 0, m.second.rows ), boost::bind( &ratio< DepthIn, DepthOut >, _1, m.second, coefficients, boost::ref( result ) ) ); + tbb::parallel_for( tbb::blocked_range< std::size_t >( 0, m.second.rows ), boost::bind( &ratio< DepthIn, DepthOut >, boost::placeholders::_1, m.second, coefficients, boost::ref( result ) ) ); return typename impl::filters< H >::value_type( m.first, result ); } @@ -2161,19 +2162,19 @@ static std::pair< functor_type, bool > make_filter_functor( const std::vector< s const auto& s = comma::split(e[1], ','); try { - if( s.front() == "average" ) { return std::make_pair( boost::bind< value_type_t >( accumulated::average< H >(), _1 ), false ); } + if( s.front() == "average" ) { return std::make_pair( boost::bind< value_type_t >( accumulated::average< H >(), boost::placeholders::_1 ), false ); } if( s.front() == "moving-average" ) { if( s.size() < 2 ){ COMMA_THROW(comma::exception, "accumulated: error please provide window size for " << s.front() ); } - return std::make_pair( boost::bind< value_type_t >( accumulated::moving_average< H >( boost::lexical_cast< comma::uint32 >(s[1]) ), _1 ), false ); + return std::make_pair( boost::bind< value_type_t >( accumulated::moving_average< H >( boost::lexical_cast< comma::uint32 >(s[1]) ), boost::placeholders::_1 ), false ); } if( s.front() == "ema" ) { if( s.size() < 2 ){ COMMA_THROW(comma::exception, "accumulated: error please provide alpha value for " << s.front() ); } - return std::make_pair( boost::bind< value_type_t >( accumulated::ema< H >( boost::lexical_cast< float >(s[1]), s.size() < 3 ? 1 : boost::lexical_cast< comma::uint32 >(s[2]) ), _1 ), false ); + return std::make_pair( boost::bind< value_type_t >( accumulated::ema< H >( boost::lexical_cast< float >(s[1]), s.size() < 3 ? 1 : boost::lexical_cast< comma::uint32 >(s[2]) ), boost::placeholders::_1 ), false ); } - if( s.front() == "min" ) { return std::make_pair( boost::bind< value_type_t >( accumulated::min< H >(), _1 ), false ); } - if( s.front() == "max" ) { return std::make_pair( boost::bind< value_type_t >( accumulated::max< H >(), _1 ), false ); } + if( s.front() == "min" ) { return std::make_pair( boost::bind< value_type_t >( accumulated::min< H >(), boost::placeholders::_1 ), false ); } + if( s.front() == "max" ) { return std::make_pair( boost::bind< value_type_t >( accumulated::max< H >(), boost::placeholders::_1 ), false ); } COMMA_THROW(comma::exception, "accumulated: unrecognised operation: " << s.front()); } catch( boost::bad_lexical_cast& bc ) @@ -2190,7 +2191,7 @@ static std::pair< functor_type, bool > make_filter_functor( const std::vector< s double threshold1 = boost::lexical_cast< double >( s[0] ); double threshold2 = boost::lexical_cast< double >( s[1] ); int kernel_size = s.size() > 2 ? boost::lexical_cast< int >( s[2] ) : 3; - return std::make_pair( boost::bind< value_type_t >( canny_impl_< H >(), _1, threshold1, threshold2, kernel_size ), true ); + return std::make_pair( boost::bind< value_type_t >( canny_impl_< H >(), boost::placeholders::_1, threshold1, threshold2, kernel_size ), true ); } if( e[0] == "clahe" ) { @@ -2210,7 +2211,7 @@ static std::pair< functor_type, bool > make_filter_functor( const std::vector< s if( e[0] == "convert-color" || e[0] == "convert_color" ) { if( e.size() == 1 ) { COMMA_THROW( comma::exception, "convert-color: please specify conversion" ); } - return std::make_pair(boost::bind< value_type_t >( cvt_color_impl_< H >(), _1, impl::cvt_color_type_from_string( e[1] ) ), true ); + return std::make_pair(boost::bind< value_type_t >( cvt_color_impl_< H >(), boost::placeholders::_1, impl::cvt_color_type_from_string( e[1] ) ), true ); } if( e[0] == "count" ) { return std::make_pair(count_impl_< H >(), false ); } if( e[0] == "crop" ) @@ -2234,7 +2235,7 @@ static std::pair< functor_type, bool > make_filter_functor( const std::vector< s default: COMMA_THROW( comma::exception, "expected crop=[x,y,]width,height, got \"" << comma::join( e, '=' ) << "\"" ); } - return std::make_pair(boost::bind< value_type_t >( crop_impl_< H >, _1, x, y, w, h ), true ); + return std::make_pair(boost::bind< value_type_t >( crop_impl_< H >, boost::placeholders::_1, x, y, w, h ), true ); } if( e[0] == "crop-cols" || e[0] == "crop-rows" ) { @@ -2250,8 +2251,8 @@ static std::pair< functor_type, bool > make_filter_functor( const std::vector< s unsigned int w = boost::lexical_cast< unsigned int >( inputs[s+1] ); stripes.push_back( std::make_pair( x, w ) ); } - if ( e[0] == "crop-cols" ) { return std::make_pair(boost::bind< value_type_t >( crop_cols_impl_< H >(), _1, stripes ), true ); } - else { return std::make_pair(boost::bind< value_type_t >( crop_rows_impl_< H >(), _1, stripes ), true ); } + if ( e[0] == "crop-cols" ) { return std::make_pair(boost::bind< value_type_t >( crop_cols_impl_< H >(), boost::placeholders::_1, stripes ), true ); } + else { return std::make_pair(boost::bind< value_type_t >( crop_rows_impl_< H >(), boost::placeholders::_1, stripes ), true ); } } if( e[0] == "bands-to-cols" || e[0] == "bands-to-rows" ) { @@ -2315,7 +2316,7 @@ static std::pair< functor_type, bool > make_filter_functor( const std::vector< s ++s; } if ( bands.empty() ) { COMMA_THROW( comma::exception, op_name << ": specify at least one band" ); } - return std::make_pair( boost::bind< value_type_t >( bands_to_cols_impl_< H >(), _1, bands_to_cols, bands, cv_reduce_method, cv_reduce_dtype ), true ); + return std::make_pair( boost::bind< value_type_t >( bands_to_cols_impl_< H >(), boost::placeholders::_1, bands_to_cols, bands, cv_reduce_method, cv_reduce_dtype ), true ); } if( e[0] == "crop-tile" ) { @@ -2346,7 +2347,7 @@ static std::pair< functor_type, bool > make_filter_functor( const std::vector< s if( tile.first >= *count_x ) { COMMA_THROW( comma::exception, "crop-tile: expected tile column index less than " << *count_x << "; got: " << tile.first ); } if( tile.second >= *count_y ) { COMMA_THROW( comma::exception, "crop-tile: expected tile row index less than " << *count_y << "; got: " << tile.second ); } } - return std::make_pair( boost::bind< value_type_t >( crop_tile_impl_< H >(), _1, *count_x, *count_y, tiles, vertical ), true ); + return std::make_pair( boost::bind< value_type_t >( crop_tile_impl_< H >(), boost::placeholders::_1, *count_x, *count_y, tiles, vertical ), true ); } if( e[0] == "tile" ) { @@ -2363,7 +2364,7 @@ static std::pair< functor_type, bool > make_filter_functor( const std::vector< s } if( !width ) { COMMA_THROW( comma::exception, "untile: expected tile count along x; got: \"" << e[1] << "\"" ); } if( !height ) { COMMA_THROW( comma::exception, "untile: expected tile count along x and y; got: \"" << e[1] << "\"" ); } - return std::make_pair( boost::bind< value_type_t >( tile_impl_< H >(), _1, *width, *height, vertical ), true ); + return std::make_pair( boost::bind< value_type_t >( tile_impl_< H >(), boost::placeholders::_1, *width, *height, vertical ), true ); } if( e[0] == "untile" ) { @@ -2380,7 +2381,7 @@ static std::pair< functor_type, bool > make_filter_functor( const std::vector< s } if( !count_x ) { COMMA_THROW( comma::exception, "untile: expected tile count along x; got: \"" << e[1] << "\"" ); } if( !count_y ) { COMMA_THROW( comma::exception, "untile: expected tile count along x and y; got: \"" << e[1] << "\"" ); } - return std::make_pair( boost::bind< value_type_t >( untile_impl_< H >(), _1, *count_x, *count_y, vertical ), true ); + return std::make_pair( boost::bind< value_type_t >( untile_impl_< H >(), boost::placeholders::_1, *count_x, *count_y, vertical ), true ); } if( e[0] == "cols-to-channels" || e[0] == "rows-to-channels" ) { @@ -2427,33 +2428,33 @@ static std::pair< functor_type, bool > make_filter_functor( const std::vector< s } if ( values.empty() ) { COMMA_THROW( comma::exception, op_name << ": specify at least one " << op_what << " to store as channel" ); } if ( values.size() > 4 ) { COMMA_THROW( comma::exception, op_name << ": can have at most 4 output channels" ); } - return std::make_pair( boost::bind< value_type_t >( cols_to_channels_impl_< H >(), _1, cols_to_channels, values, padding, repeat ), true ); + return std::make_pair( boost::bind< value_type_t >( cols_to_channels_impl_< H >(), boost::placeholders::_1, cols_to_channels, values, padding, repeat ), true ); } if( e[0] == "channels-to-cols" || e[0] == "channels-to-rows" ) { const bool channels_to_cols = e[0] == "channels-to-cols"; - return std::make_pair( boost::bind< value_type_t >( channels_to_cols_impl_ < H >(), _1, channels_to_cols ), true ); + return std::make_pair( boost::bind< value_type_t >( channels_to_cols_impl_ < H >(), boost::placeholders::_1, channels_to_cols ), true ); } if( e[0] == "cross" ) // todo: quick and dirty, implement using traits { boost::array< int, 9 > p = {{ 0, 0, 0, 0, 0, 1, 8, 0 }}; const std::vector< std::string > v = comma::split( e[1], ',' ); for( unsigned int i = 0; i < v.size(); ++i ) { if( !v[i].empty() ) { p[i] = boost::lexical_cast< int >( v[i] ); } } - return std::make_pair( boost::bind< value_type_t >( cross_impl_< H >, _1, drawing::cross( cv::Point( p[0], p[1] ), cv::Scalar( p[4], p[3], p[2] ), p[5], p[6], p[7] ) ), true ); + return std::make_pair( boost::bind< value_type_t >( cross_impl_< H >, boost::placeholders::_1, drawing::cross( cv::Point( p[0], p[1] ), cv::Scalar( p[4], p[3], p[2] ), p[5], p[6], p[7] ) ), true ); } if( e[0] == "circle" ) // todo: quick and dirty, implement using traits { boost::array< int, 9 > p = {{ 0, 0, 0, 0, 0, 0, 1, 8, 0 }}; const std::vector< std::string > v = comma::split( e[1], ',' ); for( unsigned int i = 0; i < v.size(); ++i ) { if( !v[i].empty() ) { p[i] = boost::lexical_cast< int >( v[i] ); } } - return std::make_pair( boost::bind< value_type_t >( circle_impl_< H >, _1, drawing::circle( cv::Point( p[0], p[1] ), p[2], cv::Scalar( p[5], p[4], p[3] ), p[6], p[7], p[8] ) ), true ); + return std::make_pair( boost::bind< value_type_t >( circle_impl_< H >, boost::placeholders::_1, drawing::circle( cv::Point( p[0], p[1] ), p[2], cv::Scalar( p[5], p[4], p[3] ), p[6], p[7], p[8] ) ), true ); } if( e[0] == "rectangle" || e[0] == "box" ) // todo: quick and dirty, implement using traits { boost::array< int, 10 > p = {{ 0, 0, 0, 0, 0, 0, 0, 1, 8, 0 }}; const std::vector< std::string > v = comma::split( e[1], ',' ); for( unsigned int i = 0; i < v.size(); ++i ) { if( !v[i].empty() ) { p[i] = boost::lexical_cast< int >( v[i] ); } } - return std::make_pair( boost::bind< value_type_t >( rectangle_impl_< H >, _1, drawing::rectangle( cv::Point( p[0], p[1] ), cv::Point( p[2], p[3] ), cv::Scalar( p[6], p[5], p[4] ), p[7], p[8], p[9] ) ), true ); + return std::make_pair( boost::bind< value_type_t >( rectangle_impl_< H >, boost::placeholders::_1, drawing::rectangle( cv::Point( p[0], p[1] ), cv::Point( p[2], p[3] ), cv::Scalar( p[6], p[5], p[4] ), p[7], p[8], p[9] ) ), true ); } if( e[0] == "file" ) { @@ -2491,7 +2492,7 @@ static std::pair< functor_type, bool > make_filter_functor( const std::vector< s quality = boost::lexical_cast< int >( s[i] ); } } - return std::make_pair( boost::bind< value_type_t >( impl::file< H >( get_timestamp, s[0], no_header, quality, do_index, filenames ), _1 ), false ); + return std::make_pair( boost::bind< value_type_t >( impl::file< H >( get_timestamp, s[0], no_header, quality, do_index, filenames ), boost::placeholders::_1 ), false ); } if( e[0] == "save" ) { @@ -2506,10 +2507,10 @@ static std::pair< functor_type, bool > make_filter_functor( const std::vector< s else if( s[i] == "no-header" ) { no_header = true; } else { quality = boost::lexical_cast< int >( s[i] ); } } - return std::make_pair( boost::bind< value_type_t >( save_impl_< H >( s[0], no_header, quality, do_index ), _1 ), false ); + return std::make_pair( boost::bind< value_type_t >( save_impl_< H >( s[0], no_header, quality, do_index ), boost::placeholders::_1 ), false ); } - if( e[0] == "gamma" ) { return std::make_pair( boost::bind< value_type_t >( gamma_impl_< H >, _1, boost::lexical_cast< double >( e[1] ) ), true ); } - if( e[0] == "pow" || e[0] == "power" ) { return std::make_pair( boost::bind< value_type_t >( pow_impl_< H >, _1, boost::lexical_cast< double >( e[1] ) ), true ); } + if( e[0] == "gamma" ) { return std::make_pair( boost::bind< value_type_t >( gamma_impl_< H >, boost::placeholders::_1, boost::lexical_cast< double >( e[1] ) ), true ); } + if( e[0] == "pow" || e[0] == "power" ) { return std::make_pair( boost::bind< value_type_t >( pow_impl_< H >, boost::placeholders::_1, boost::lexical_cast< double >( e[1] ) ), true ); } if( e[0] == "remove-mean") { std::vector< std::string > s = comma::split( e[1], ',' ); @@ -2517,7 +2518,7 @@ static std::pair< functor_type, bool > make_filter_functor( const std::vector< s unsigned int neighbourhood_size = boost::lexical_cast< unsigned int >( s[0] ); cv::Size kernel_size(neighbourhood_size, neighbourhood_size); double ratio = boost::lexical_cast< double >( s[1] ); - return std::make_pair( boost::bind< value_type_t >( remove_mean_impl_< H >, _1, kernel_size, ratio ), true ); + return std::make_pair( boost::bind< value_type_t >( remove_mean_impl_< H >, boost::placeholders::_1, kernel_size, ratio ), true ); } if( e[0] == "fft" ) { @@ -2540,11 +2541,11 @@ static std::pair< functor_type, bool > make_filter_functor( const std::vector< s else if( w[i] == "log" || w[i] == "log-scale" ) { log_scale = true; } } } - return std::make_pair( boost::bind< value_type_t >( fft_impl_< H >, _1, direct, complex, magnitude, log_scale, normalize ), true ); + return std::make_pair( boost::bind< value_type_t >( fft_impl_< H >, boost::placeholders::_1, direct, complex, magnitude, log_scale, normalize ), true ); } - if( e[0] == "flip" ) { return std::make_pair( boost::bind< value_type_t >( flip_impl_< H >, _1, 0 ), true ); } - if( e[0] == "flop" ) { return std::make_pair( boost::bind< value_type_t >( flip_impl_< H >, _1, 1 ), true ); } - if( e[0] == "magnitude" ) { return std::make_pair( boost::bind< value_type_t >( magnitude_impl_< H >, _1 ), true ); } + if( e[0] == "flip" ) { return std::make_pair( boost::bind< value_type_t >( flip_impl_< H >, boost::placeholders::_1, 0 ), true ); } + if( e[0] == "flop" ) { return std::make_pair( boost::bind< value_type_t >( flip_impl_< H >, boost::placeholders::_1, 1 ), true ); } + if( e[0] == "magnitude" ) { return std::make_pair( boost::bind< value_type_t >( magnitude_impl_< H >, boost::placeholders::_1 ), true ); } if( e[0] == "text" ) { if( e.size() <= 1 ) { COMMA_THROW( comma::exception, "text: expected text value" ); } @@ -2562,7 +2563,7 @@ static std::pair< functor_type, bool > make_filter_functor( const std::vector< s else if( w[3] == "yellow" ) { s = cv::Scalar( 0, 0xffff, 0xffff ); } else { COMMA_THROW( comma::exception, "expected colour of text, e.g. 'red', in \"" << comma::join( e, '=' ) << "\", got '" << w[3] << "'" ); } } - return std::make_pair( boost::bind< value_type_t >( text_impl_< H >, _1, w[0], p, s ), true ); + return std::make_pair( boost::bind< value_type_t >( text_impl_< H >, boost::placeholders::_1, w[0], p, s ), true ); } if( e[0] == "convert-to" || e[0] == "convert_to" ) { @@ -2582,7 +2583,7 @@ static std::pair< functor_type, bool > make_filter_functor( const std::vector< s } } if ( w.size() > 2 ) { offset = boost::lexical_cast< double >( w[2] ); } - return std::make_pair( boost::bind< value_type_t >( convert_to_impl_< H >, _1, it->second, scale, offset ), true ); + return std::make_pair( boost::bind< value_type_t >( convert_to_impl_< H >, boost::placeholders::_1, it->second, scale, offset ), true ); } if( e[0] == "resize" ) { @@ -2619,7 +2620,7 @@ static std::pair< functor_type, bool > make_filter_functor( const std::vector< s default: COMMA_THROW( comma::exception, "expected resize=,, got: \"" << e[1] << "\"" ); } - return std::make_pair( boost::bind< value_type_t >( resize_impl_< H >, _1, width, height, w, h, interpolation ), true ); + return std::make_pair( boost::bind< value_type_t >( resize_impl_< H >, boost::placeholders::_1, width, height, w, h, interpolation ), true ); } else if( e[0] == "timestamp" ) { return std::make_pair(timestamp_impl_< H >( get_timestamp ), true); } else if( e[0] == "transpose" ) { return std::make_pair(transpose_impl_< H >, true); } @@ -2629,12 +2630,12 @@ static std::pair< functor_type, bool > make_filter_functor( const std::vector< s unsigned int default_number_of_channels = 3; unsigned int nchannels = e.size() == 1 ? default_number_of_channels : boost::lexical_cast< unsigned int >( e[1] ); if ( nchannels == 0 ) { COMMA_THROW( comma::exception, "expected positive number of channels in merge filter, got " << nchannels ); } - return std::make_pair( boost::bind< value_type_t >( merge_impl_< H >, _1, nchannels ), true ); + return std::make_pair( boost::bind< value_type_t >( merge_impl_< H >, boost::placeholders::_1, nchannels ), true ); } else if( e[0] == "clone-channels" ) { if( e.size() < 2 ) { COMMA_THROW( comma::exception, "clone-channels: please specify number of channels" ); } - return std::make_pair( boost::bind< value_type_t >( clone_channels_impl_< H >, _1, boost::lexical_cast< unsigned int >( e[1] ) ), true ); + return std::make_pair( boost::bind< value_type_t >( clone_channels_impl_< H >, boost::placeholders::_1, boost::lexical_cast< unsigned int >( e[1] ) ), true ); } if( e[0] == "undistort" ) { return std::make_pair( undistort_impl_< H >( e[1] ), true ); } if( e[0] == "invert" ) @@ -2657,7 +2658,7 @@ static std::pair< functor_type, bool > make_filter_functor( const std::vector< s } if( w[0] == "max" ) { return std::make_pair( normalize_max_impl_< H >, true ); } else if( w[0] == "sum" ) { return std::make_pair( normalize_sum_impl_< H >, true ); } - else if( w[0] == "all" ) { return std::make_pair( boost::bind( normalize_cv_impl_< H >, _1, norm_type ), true ); } + else if( w[0] == "all" ) { return std::make_pair( boost::bind( normalize_cv_impl_< H >, boost::placeholders::_1, norm_type ), true ); } COMMA_THROW( comma::exception, "expected all, max, or sum option for normalize, got: \"" << w[0] << "\"" ); } if( e[0]=="equalize-histogram" ) { return std::make_pair( equalize_histogram_impl_< H >, true ); } @@ -2666,7 +2667,7 @@ static std::pair< functor_type, bool > make_filter_functor( const std::vector< s const std::vector< std::string >& s = comma::split( e[1], ',' ); double scale = boost::lexical_cast< double >( s[0] ); double offset = s.size() == 1 ? 0.0 : boost::lexical_cast< double >( s[1] ); - return std::make_pair( boost::bind< value_type_t >( brightness_impl_< H >, _1, scale, offset ), true ); + return std::make_pair( boost::bind< value_type_t >( brightness_impl_< H >, boost::placeholders::_1, scale, offset ), true ); } if( e[0] == "color-map" ) { @@ -2685,7 +2686,7 @@ static std::pair< functor_type, bool > make_filter_functor( const std::vector< s else if( e[1] == "pink" ) { type = cv::COLORMAP_PINK; } else if( e[1] == "hot" ) { type = cv::COLORMAP_HOT; } else { COMMA_THROW( comma::exception, "expected colour-map type; got: \"" << e[1] << "\"" ); } - return std::make_pair( boost::bind< value_type_t >( colour_map_impl_< H >, _1, type ), true ); + return std::make_pair( boost::bind< value_type_t >( colour_map_impl_< H >, boost::placeholders::_1, type ), true ); } if( e[0] == "blur" ) { @@ -2725,7 +2726,7 @@ static std::pair< functor_type, bool > make_filter_functor( const std::vector< s params.sigma_colour = boost::lexical_cast< double >( s[3] ); // max sigma color } else { COMMA_THROW( comma::exception, "invalid blur type" ); } - return std::make_pair( boost::bind< value_type_t >( blur_impl_< H >, _1, params ), true ); + return std::make_pair( boost::bind< value_type_t >( blur_impl_< H >, boost::placeholders::_1, params ), true ); } if( e[0] == "load" ) { @@ -2752,7 +2753,7 @@ static std::pair< functor_type, bool > make_filter_functor( const std::vector< s if( s.size() < 2 || s.size() % 2 != 0 ) { COMMA_THROW( comma::exception, "inrange: expected , got: \"" << comma::join( e, '=' ) << "\"" ); } cv::Scalar lower = impl::scalar_from_strings( &s[0], s.size() / 2 ); cv::Scalar upper = impl::scalar_from_strings( &s[ s.size() / 2 ], s.size() / 2 ); - return std::make_pair( boost::bind< value_type_t >( inrange_impl_< H >, _1, lower, upper ), true ); + return std::make_pair( boost::bind< value_type_t >( inrange_impl_< H >, boost::placeholders::_1, lower, upper ), true ); } if( e[0] == "threshold" ) { @@ -2762,13 +2763,13 @@ static std::pair< functor_type, bool > make_filter_functor( const std::vector< s double threshold = otsu ? 0 : boost::lexical_cast< double >( s[0] ); double maxval = s.size() < 2 ? 255 : boost::lexical_cast< double >( s[1] ); threshold_t::types type = threshold_t::from_string( s.size() < 3 ? "" : s[2] ); - return std::make_pair( boost::bind< value_type_t >( threshold_impl_< H >, _1, threshold, maxval, type, otsu ), true ); + return std::make_pair( boost::bind< value_type_t >( threshold_impl_< H >, boost::placeholders::_1, threshold, maxval, type, otsu ), true ); } if ( e[0] == "kmeans" ) { if( e.size() < 2 ) { COMMA_THROW( comma::exception, "expected kmeans=" ); } int k = boost::lexical_cast(e[1]); - return std::make_pair( boost::bind< value_type_t >(kmeans_impl_< H >, _1, k), true ); + return std::make_pair( boost::bind< value_type_t >(kmeans_impl_< H >, boost::placeholders::_1, k), true ); } if( e[0] == "linear-combination" || e[0] == "ratio" || e[0] == "shuffle" ) { @@ -2805,16 +2806,16 @@ static std::pair< functor_type, bool > make_filter_functor( const std::vector< s coefficients.back().reserve( ratios::channel::NUM_CHANNELS ); for( size_t j = 0; j < r.numerator.terms.size(); ++j ) { coefficients.back().push_back( std::make_pair( r.numerator.terms[j].value, r.denominator.terms[j].value ) ); } } - return std::make_pair( boost::bind< value_type_t >( ratio_impl_< H >, _1, coefficients, e[0] ), true ); + return std::make_pair( boost::bind< value_type_t >( ratio_impl_< H >, boost::placeholders::_1, coefficients, e[0] ), true ); } if( snark::cv_mat::morphology::operations().find( e[0] ) != snark::cv_mat::morphology::operations().end() ) { snark::cv_mat::morphology::parameters parameters( e ); - return std::make_pair( boost::bind< value_type_t >( morphology::morphology< H >, _1, snark::cv_mat::morphology::operations().at( e[0] ), parameters.kernel_, parameters.iterations_ ), true ); + return std::make_pair( boost::bind< value_type_t >( morphology::morphology< H >, boost::placeholders::_1, snark::cv_mat::morphology::operations().at( e[0] ), parameters.kernel_, parameters.iterations_ ), true ); } if( e[0] == "skeleton" || e[0] == "thinning" ) { - return std::make_pair( boost::bind< value_type_t >( morphology::skeleton< H >(snark::cv_mat::morphology::parameters( e )), _1 ), true ); + return std::make_pair( boost::bind< value_type_t >( morphology::skeleton< H >(snark::cv_mat::morphology::parameters( e )), boost::placeholders::_1 ), true ); } if( e[0] == "overlay" ) { @@ -2842,7 +2843,7 @@ static std::pair< functor_type, bool > make_filter_functor( const std::vector< s if( w.size() > 1 ) { n = w[1]; } if(w.size()>2) { suffix=w[2]; } } - return std::make_pair( boost::bind< value_type_t >( view_impl_< H >( get_timestamp, n, delay, suffix ), _1 ), false ); + return std::make_pair( boost::bind< value_type_t >( view_impl_< H >( get_timestamp, n, delay, suffix ), boost::placeholders::_1 ), false ); } boost::function< value_type_t( value_type_t ) > functor = imaging::vegetation::impl::filters< H >::make_functor( e ); if( functor ) { return std::make_pair( functor, true ); } @@ -2863,7 +2864,7 @@ static std::pair< functor_type, bool > make_filter_functor( const std::vector< s { auto b = make_filter< O, H >::make_filter_functor( comma::split( w[k], equal_sign_ ), get_timestamp_, 1 ); if( b.second == false ) { parallel = false; } // If any filter must be serial, then turn parallel off - functor = boost::bind( b.first , boost::bind( functor, _1 ) ); + functor = boost::bind( b.first , boost::bind( functor, boost::placeholders::_1 ) ); } return std::make_pair( functor, parallel ); } @@ -2912,7 +2913,7 @@ template <> struct time_traits< boost::posix_time::ptime > template < typename H > std::vector< typename impl::filters< H >::filter_type > impl::filters< H >::make( const std::string& how, unsigned int default_delay ) { - return impl::filters< H >::make( how, boost::bind( &time_traits< H >::pass_time, _1 ), default_delay ); + return impl::filters< H >::make( how, boost::bind( &time_traits< H >::pass_time, boost::placeholders::_1 ), default_delay ); } template < typename H > @@ -2940,7 +2941,7 @@ std::vector< typename impl::filters< H >::filter_type > impl::filters< H >::make maker_t m( get_timestamp, '|', ':' ); composer_t c( m ); auto g = boost::apply_visitor( snark::cv_mat::bitwise::visitor< input_type, input_type, composer_t >( c ), result ); - f.push_back( filter_type( boost::bind< value_type_t >( mask_impl_< H >( g.first ), _1 ), g.second ) ); + f.push_back( filter_type( boost::bind< value_type_t >( mask_impl_< H >( g.first ), boost::placeholders::_1 ), g.second ) ); } else if( e[0] == "tee" ) { @@ -2950,7 +2951,7 @@ std::vector< typename impl::filters< H >::filter_type > impl::filters< H >::make maker_t m( get_timestamp, '|', ':' ); composer_t c( m ); auto g = boost::apply_visitor( snark::cv_mat::bitwise::visitor< input_type, input_type, composer_t >( c ), result ); - f.push_back( filter_type( boost::bind< value_type_t >( tee_impl_< H >( g.first ), _1 ), g.second ) ); + f.push_back( filter_type( boost::bind< value_type_t >( tee_impl_< H >( g.first ), boost::placeholders::_1 ), g.second ) ); } else if( e[0] == "multiply" || e[0] == "divide" || e[0] == "add" || e[0] == "subtract" || e[0] == "absdiff" ) { @@ -2961,7 +2962,7 @@ std::vector< typename impl::filters< H >::filter_type > impl::filters< H >::make composer_t c( m ); auto operand_filters = boost::apply_visitor( snark::cv_mat::bitwise::visitor< input_type, input_type, composer_t >( c ), result ); auto op = arithmetic< H >::str_to_operation(e[0]); - f.push_back( filter_type( boost::bind< value_type_t >( arithmetic< H >( op ), _1, operand_filters.first ), operand_filters.second ) ); + f.push_back( filter_type( boost::bind< value_type_t >( arithmetic< H >( op ), boost::placeholders::_1, operand_filters.first ), operand_filters.second ) ); } else if( e[0] == "bitwise" ) { @@ -2971,13 +2972,13 @@ std::vector< typename impl::filters< H >::filter_type > impl::filters< H >::make maker_t m( get_timestamp, '|', ':' ); composer_t c( m ); auto operand_filters = boost::apply_visitor( snark::cv_mat::bitwise::visitor< input_type, input_type, composer_t >( c ), result ); - f.push_back( filter_type( boost::bind< value_type_t >( bitwise_impl_< H >( operand_filters.first ), _1 ), operand_filters.second ) ); + f.push_back( filter_type( boost::bind< value_type_t >( bitwise_impl_< H >( operand_filters.first ), boost::placeholders::_1 ), operand_filters.second ) ); } else if( e[0] == "bayer" ) // kept for backwards-compatibility, use convert-color=BayerBG,BGR etc.. { if( modified ) { COMMA_THROW( comma::exception, "cannot covert from bayer after transforms: " << name ); } unsigned int which = boost::lexical_cast< unsigned int >( e[1] ) + 45u; // HACK, bayer as unsigned int, but I don't find enum { BG2RGB, GB2BGR ... } more usefull - f.push_back( filter_type( boost::bind< value_type_t >( cvt_color_impl_< H >(), _1, which ) ) ); + f.push_back( filter_type( boost::bind< value_type_t >( cvt_color_impl_< H >(), boost::placeholders::_1, which ) ) ); } else if( e[0] == "pack" ) { @@ -3005,7 +3006,7 @@ std::vector< typename impl::filters< H >::filter_type > impl::filters< H >::make { if( modified ) { COMMA_THROW( comma::exception, "cannot covert from 12 bit packed after transforms: " << name ); } if(e.size()!=1) { COMMA_THROW( comma::exception, "unexpected arguement: "<( unpack12_impl_< H >, _1 ) ) ); + f.push_back( filter_type( boost::bind< value_type_t >( unpack12_impl_< H >, boost::placeholders::_1 ) ) ); } else if( e[0] == "log" ) // todo: rotate log by size: expose to user { @@ -3074,7 +3075,7 @@ std::vector< typename impl::filters< H >::filter_type > impl::filters< H >::make std::vector< std::string > s = comma::split( e[1], ',' ); boost::optional < int > quality; if (s.size()> 1) { quality = boost::lexical_cast(s[1]); } - f.push_back( filter_type( boost::bind< value_type_t >( encode_impl_< H >( get_timestamp ), _1, s[0], quality ), false ) ); + f.push_back( filter_type( boost::bind< value_type_t >( encode_impl_< H >( get_timestamp ), boost::placeholders::_1, s[0], quality ), false ) ); } else if( e[0] == "grab" ) { @@ -3082,7 +3083,7 @@ std::vector< typename impl::filters< H >::filter_type > impl::filters< H >::make std::vector< std::string > s = comma::split( e[1], ',' ); boost::optional < int > quality; if (s.size() == 1) { quality = boost::lexical_cast(s[1]); } - f.push_back( filter_type( boost::bind< value_type_t >( grab_impl_< H >(get_timestamp), _1, s[0], quality ) ) ); + f.push_back( filter_type( boost::bind< value_type_t >( grab_impl_< H >(get_timestamp), boost::placeholders::_1, s[0], quality ) ) ); } // else if( e[0] == "file" ) // { @@ -3097,7 +3098,7 @@ std::vector< typename impl::filters< H >::filter_type > impl::filters< H >::make // else if( s[i] == "no-header" ) { no_header = true; } // else { quality = boost::lexical_cast< int >( s[i] ); } // } -// f.push_back( filter_type( boost::bind< value_type_t >( impl::file< H >( get_timestamp, no_header ), _1, s[0], quality, do_index ), false ) ); +// f.push_back( filter_type( boost::bind< value_type_t >( impl::file< H >( get_timestamp, no_header ), boost::placeholders::_1, s[0], quality, do_index ), false ) ); // } else if( e[0] == "simple-blob" ) { @@ -3127,7 +3128,7 @@ std::vector< typename impl::filters< H >::filter_type > impl::filters< H >::make if( t.size() > 1 ) { path = s[1]; } } } - f.push_back( filter_type( boost::bind< value_type_t >( simple_blob_impl_< H >(get_timestamp), _1, cv_read_< cv::SimpleBlobDetector::Params >( config, path ), is_binary ), false ) ); + f.push_back( filter_type( boost::bind< value_type_t >( simple_blob_impl_< H >(get_timestamp), boost::placeholders::_1, cv_read_< cv::SimpleBlobDetector::Params >( config, path ), is_binary ), false ) ); f.push_back( filter_type( NULL ) ); // quick and dirty #else // #if CV_MAJOR_VERSION <= 2 COMMA_THROW( comma::exception, "simple-blob: opencv 3 support: todo" ); @@ -3147,7 +3148,7 @@ std::vector< typename impl::filters< H >::filter_type > impl::filters< H >::make if( next_filter != "null" && next_filter != "encode" && next_filter != "file") { COMMA_THROW( comma::exception, "cannot have a filter after head unless next filter is null or encode or file" ); } } unsigned int n = e.size() < 2 ? 1 : boost::lexical_cast< unsigned int >( e[1] ); - f.push_back( filter_type( boost::bind< value_type_t >( head_impl_< H >, _1, n ), false ) ); + f.push_back( filter_type( boost::bind< value_type_t >( head_impl_< H >, boost::placeholders::_1, n ), false ) ); } else if( e[0] == "rotate90" ) { diff --git a/imaging/cv_mat/pipeline.cpp b/imaging/cv_mat/pipeline.cpp index 88cce0088..0ab1f2acf 100644 --- a/imaging/cv_mat/pipeline.cpp +++ b/imaging/cv_mat/pipeline.cpp @@ -27,8 +27,7 @@ // OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN // IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include -#include +#include #include #include "pipeline.h" @@ -112,24 +111,24 @@ void pipeline< H >::setup_pipeline_() { if( m_filters.empty() ) { - m_filter = ::tbb::filter_t< pair, void >( ::tbb::filter::serial_in_order, boost::bind( &pipeline< H >::write_, this, _1 ) ); + m_filter = ::tbb::filter< pair, void >( ::tbb::filter_mode::serial_in_order, boost::bind( &pipeline< H >::write_, this, boost::placeholders::_1 ) ); } else { - ::tbb::filter_t< pair, pair > all_filters; + ::tbb::filter< pair, pair > all_filters; bool has_null = false; for( std::size_t i = 0; i < m_filters.size(); ++i ) { - ::tbb::filter::mode mode = ::tbb::filter::serial_in_order; + ::tbb::filter_mode mode = ::tbb::filter_mode::serial_in_order; if( m_filters[i].parallel ) { - mode = ::tbb::filter::parallel; + mode = ::tbb::filter_mode::parallel; } if( !m_filters[i].filter_function ) { has_null = true; break; } - ::tbb::filter_t< pair, pair > filter( mode, boost::bind( m_filters[i].filter_function, _1 ) ); + ::tbb::filter< pair, pair > filter( mode, boost::bind( m_filters[i].filter_function, boost::placeholders::_1 ) ); all_filters = i == 0 ? filter : ( all_filters & filter ); } - m_filter = all_filters & ::tbb::filter_t< pair, void >( ::tbb::filter::serial_in_order, boost::bind( has_null ? &pipeline< H >::null_ : &pipeline< H >::write_, this, _1 ) ); + m_filter = all_filters & ::tbb::filter< pair, void >( ::tbb::filter_mode::serial_in_order, boost::bind( has_null ? &pipeline< H >::null_ : &pipeline< H >::write_, this, boost::placeholders::_1 ) ); } } diff --git a/imaging/cv_mat/pipeline.h b/imaging/cv_mat/pipeline.h index e8a344e0b..384b57416 100644 --- a/imaging/cv_mat/pipeline.h +++ b/imaging/cv_mat/pipeline.h @@ -91,7 +91,7 @@ class pipeline void setup_pipeline_(); cv_mat::serialization& m_output; - ::tbb::filter_t< pair, void > m_filter; + ::tbb::filter< pair, void > m_filter; std::vector< filter_type > m_filters; tbb::bursty_reader< pair >& m_reader; tbb::bursty_pipeline< pair > m_pipeline; diff --git a/imaging/examples/regionprops-demo.cpp b/imaging/examples/regionprops-demo.cpp index 9d5885d3d..c501456c5 100644 --- a/imaging/examples/regionprops-demo.cpp +++ b/imaging/examples/regionprops-demo.cpp @@ -44,7 +44,7 @@ int main( int ac, char** av ) } cv::Mat image = cv::imread( av[1], 1 ); cv::Mat binary; - cv::threshold( image, binary, 128, 255, CV_THRESH_BINARY_INV ); + cv::threshold( image, binary, 128, 255, cv::THRESH_BINARY_INV ); snark::imaging::region_properties properties( binary ); properties.show( image ); cv::imshow( "image", image ); diff --git a/imaging/frequency_domain.cpp b/imaging/frequency_domain.cpp index b261845f0..3d170c107 100644 --- a/imaging/frequency_domain.cpp +++ b/imaging/frequency_domain.cpp @@ -78,7 +78,7 @@ cv::Mat frequency_domain::filter( const cv::Mat& image, const cv::Mat& mask ) cv::multiply( abs, paddedMaskF, abs ); } cv::Mat result; - cv::normalize( abs, abs, 0, maxValue, CV_MINMAX ); // scale to get the same max value as the original TODO better scaling ? + cv::normalize( abs, abs, 0, maxValue, cv::NORM_MINMAX ); // scale to get the same max value as the original TODO better scaling ? abs.convertTo( result, CV_8U ); return result; } @@ -101,7 +101,7 @@ cv::Mat frequency_domain::magnitude() const shift( magnitudeImage ); // transform the matrix with float values into a viewable image form (float between values 0 and 1). - cv::normalize( magnitudeImage, magnitudeImage, 0, 1, CV_MINMAX ); + cv::normalize( magnitudeImage, magnitudeImage, 0, 1, cv::NORM_MINMAX ); return magnitudeImage; } diff --git a/imaging/region_properties.cpp b/imaging/region_properties.cpp index 8db4773ac..eff0f7091 100644 --- a/imaging/region_properties.cpp +++ b/imaging/region_properties.cpp @@ -73,7 +73,7 @@ region_properties::region_properties ( const cv::Mat& image, double minArea ): cv::Mat binary; if( image.channels() == 3 ) { - cv::cvtColor( image, binary, CV_RGB2GRAY ); + cv::cvtColor( image, binary, cv::COLOR_RGB2GRAY ); } else if( image.channels() == 1 ) { @@ -86,12 +86,12 @@ region_properties::region_properties ( const cv::Mat& image, double minArea ): // cv::Mat closed; // cv::morphologyEx( binary, closed, cv::MORPH_CLOSE, cv::Mat::ones( 3, 3, CV_8U) ); std::vector< std::vector > contours; - cv::findContours( binary, contours, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE ); + cv::findContours( binary, contours, cv::RETR_EXTERNAL, cv::CHAIN_APPROX_SIMPLE ); for( unsigned int i = 0; i < contours.size(); i++ ) { binary = cv::Scalar(0); - cv::drawContours( binary, contours, i, cv::Scalar(0xFF), CV_FILLED ); + cv::drawContours( binary, contours, i, cv::Scalar(0xFF), cv::FILLED ); cv::Rect rect = cv::boundingRect( cv::Mat( contours[i]) ); cv::Moments moments = cv::moments( binary( rect ), true ); double x = moments.m10/moments.m00; diff --git a/imaging/vegetation/filters.cpp b/imaging/vegetation/filters.cpp index bd546aea8..9bbeb8f71 100644 --- a/imaging/vegetation/filters.cpp +++ b/imaging/vegetation/filters.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include @@ -137,14 +137,14 @@ static typename impl::filters< H >::value_type exponential_combination_impl_( co template < typename H > boost::function< typename impl::filters< H >::value_type( typename impl::filters< H >::value_type ) > impl::filters< H >::make_functor( const std::vector< std::string >& e ) { - if( e[0] == "ndvi" ) { return boost::bind< value_type >( ndvi_impl_< H >, _1 ); } + if( e[0] == "ndvi" ) { return boost::bind< value_type >( ndvi_impl_< H >, boost::placeholders::_1 ); } if( e[0]=="exponential-combination" ) { const std::vector< std::string >& s = comma::split( e[1], ',' ); if( s[0].empty() ) { COMMA_THROW( comma::exception, "exponential-combination: expected powers got: \"" << e[1] << "\"" ); } std::vector< double > power( s.size() ); for( unsigned int j = 0; j < s.size(); ++j ) { power[j] = boost::lexical_cast< double >( s[j] ); } - return boost::bind< value_type >( exponential_combination_impl_< H >, _1, power ); + return boost::bind< value_type >( exponential_combination_impl_< H >, boost::placeholders::_1, power ); } return NULL; } diff --git a/math/gaussian_process/test/gaussian_process_test.cpp b/math/gaussian_process/test/gaussian_process_test.cpp index 2d1385961..e82d72fcf 100644 --- a/math/gaussian_process/test/gaussian_process_test.cpp +++ b/math/gaussian_process/test/gaussian_process_test.cpp @@ -29,7 +29,7 @@ #include -#include +#include #include #include "../covariance.h" #include "../gaussian_process.h" @@ -47,7 +47,7 @@ static void test_gaussian_process( const Eigen::MatrixXd& inputDomains snark::squared_exponential_covariance covariance( 1.0, 3.0, 0.1 ); snark::gaussian_process gp( inputDomains , inputTargets - , boost::bind( &snark::squared_exponential_covariance::covariance, boost::ref( covariance ), _1, _2 ) + , boost::bind( &snark::squared_exponential_covariance::covariance, boost::ref( covariance ), boost::placeholders::_1, _2 ) , covariance.self_covariance() ); Eigen::VectorXd outputMeans; Eigen::VectorXd outputVariances; diff --git a/point_cloud/applications/points-foreground-partitions.cpp b/point_cloud/applications/points-foreground-partitions.cpp index da8c0c8ac..46fda4f8f 100644 --- a/point_cloud/applications/points-foreground-partitions.cpp +++ b/point_cloud/applications/points-foreground-partitions.cpp @@ -41,8 +41,7 @@ #include #include #include -#include -#include +#include #include #include #include @@ -348,22 +347,22 @@ int main( int ac, char** av ) verbose = options.exists( "--verbose,-v" ); discard = options.exists( "--discard,-d" ); output_all = options.exists( "--output-all" ); - ::tbb::filter_t< block_t*, block_t* > partition_filter( ::tbb::filter::serial_in_order, &partition_ ); - ::tbb::filter_t< block_t*, void > write_filter( ::tbb::filter::serial_in_order, &write_block_ ); + ::tbb::filter< block_t*, block_t* > partition_filter( ::tbb::filter_mode::serial_in_order, &partition_ ); + ::tbb::filter< block_t*, void > write_filter( ::tbb::filter_mode::serial_in_order, &write_block_ ); #ifdef PROFILE ProfilerStart( "points-foreground-partitions.prof" ); { #endif if( discard ) { bursty_reader.reset( new snark::tbb::bursty_reader< block_t* >( &read_block_bursty_ ) ); - ::tbb::filter_t< void, void > filters = bursty_reader->filter() & partition_filter & write_filter; + ::tbb::filter< void, void > filters = bursty_reader->filter() & partition_filter & write_filter; ::tbb::parallel_pipeline( 3, filters ); // while( bursty_reader->wait() ) { ::tbb::parallel_pipeline( 3, filters ); } bursty_reader->join(); } else { - ::tbb::filter_t< void, block_t* > read_filter( ::tbb::filter::serial_in_order, &read_block_ ); - ::tbb::filter_t< void, void > filters = read_filter & partition_filter & write_filter; + ::tbb::filter< void, block_t* > read_filter( ::tbb::filter_mode::serial_in_order, &read_block_ ); + ::tbb::filter< void, void > filters = read_filter & partition_filter & write_filter; ::tbb::parallel_pipeline( 3, filters ); } #ifdef PROFILE diff --git a/point_cloud/applications/points-join.cpp b/point_cloud/applications/points-join.cpp index 665b8cd30..baf5561b4 100644 --- a/point_cloud/applications/points-join.cpp +++ b/point_cloud/applications/points-join.cpp @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/point_cloud/applications/points-rays.cpp b/point_cloud/applications/points-rays.cpp index 771b8e059..36774fae2 100644 --- a/point_cloud/applications/points-rays.cpp +++ b/point_cloud/applications/points-rays.cpp @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include #include @@ -225,7 +225,7 @@ int main( int argc, char** argv ) if( records.empty() ) { break; } if( verbose ) { std::cerr << "points-rays: block " << records[0].first.block << ": loaded " << records.size() << " points in a grid of size " << grid.size() << " voxels" << std::endl; } if( verbose ) { std::cerr << "points-rays: block " << records[0].first.block << ": tracing..." << std::endl; } - tbb::parallel_for( tbb::blocked_range< std::size_t >( 0, records.size(), records.size() / 4 ), boost::bind( &trace_points, _1, boost::ref( records ), boost::cref( grid ), threshold ) ); + tbb::parallel_for( tbb::blocked_range< std::size_t >( 0, records.size(), records.size() / 4 ), boost::bind( &trace_points, boost::placeholders::_1, boost::ref( records ), boost::cref( grid ), threshold ) ); if( verbose ) { std::cerr << "points-rays: block " << records[0].first.block << ": outputting..." << std::endl; } for( std::size_t i = 0; i < records.size(); ++i ) { diff --git a/point_cloud/applications/points-to-partitions.cpp b/point_cloud/applications/points-to-partitions.cpp index d88625991..70b362eb9 100644 --- a/point_cloud/applications/points-to-partitions.cpp +++ b/point_cloud/applications/points-to-partitions.cpp @@ -41,8 +41,7 @@ #include #include #include -#include -#include +#include #include #include #include @@ -287,22 +286,22 @@ int main( int ac, char** av ) discard = options.exists( "--discard,-d" ); min_id = options.value( "--min-id", 0 ); output_all = options.exists( "--output-all" ); - ::tbb::filter_t< block_t*, block_t* > partition_filter( ::tbb::filter::serial_in_order, &partition_ ); - ::tbb::filter_t< block_t*, void > write_filter( ::tbb::filter::serial_in_order, &write_block_ ); + ::tbb::filter< block_t*, block_t* > partition_filter( ::tbb::filter_mode::serial_in_order, &partition_ ); + ::tbb::filter< block_t*, void > write_filter( ::tbb::filter_mode::serial_in_order, &write_block_ ); #ifdef PROFILE ProfilerStart( "points-to-partitions.prof" ); { #endif if( discard ) { bursty_reader.reset( new snark::tbb::bursty_reader< block_t* >( &read_block_bursty_ ) ); - ::tbb::filter_t< void, void > filters = bursty_reader->filter() & partition_filter & write_filter; + ::tbb::filter< void, void > filters = bursty_reader->filter() & partition_filter & write_filter; ::tbb::parallel_pipeline( 3, filters ); // while( bursty_reader->wait() ) { ::tbb::parallel_pipeline( 3, filters ); } bursty_reader->join(); } else { - ::tbb::filter_t< void, block_t* > read_filter( ::tbb::filter::serial_in_order, &read_block_ ); - ::tbb::filter_t< void, void > filters = read_filter & partition_filter & write_filter; + ::tbb::filter< void, block_t* > read_filter( ::tbb::filter_mode::serial_in_order, &read_block_ ); + ::tbb::filter< void, void > filters = read_filter & partition_filter & write_filter; ::tbb::parallel_pipeline( 3, filters ); } #ifdef PROFILE diff --git a/sensors/cameras/basler/applications/basler-cat.cpp b/sensors/cameras/basler/applications/basler-cat.cpp index 8306f7355..a0ae13446 100644 --- a/sensors/cameras/basler/applications/basler-cat.cpp +++ b/sensors/cameras/basler/applications/basler-cat.cpp @@ -1297,7 +1297,7 @@ static bool run_chunk_pipeline( Pylon::CBaslerGigECamera& camera , boost::ref( camera ) , boost::ref( grabber )) , max_queue_size, max_queue_capacity )); - tbb::filter_t< chunk_pair_t, void > writer( tbb::filter::serial_in_order, boost::bind( &write, _1 )); + tbb::filter< chunk_pair_t, void > writer( tbb::filter_mode::serial_in_order, boost::bind( &write, boost::placeholders::_1 )); snark::tbb::bursty_pipeline< chunk_pair_t > pipeline; camera.AcquisitionStart(); comma::verbose << "running in chunk mode..." << std::endl; diff --git a/sensors/cameras/flycapture/applications/flycapture-callback.cpp b/sensors/cameras/flycapture/applications/flycapture-callback.cpp index 1b4af8230..6f8f0f4ff 100644 --- a/sensors/cameras/flycapture/applications/flycapture-callback.cpp +++ b/sensors/cameras/flycapture/applications/flycapture-callback.cpp @@ -27,10 +27,10 @@ // OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN // IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include +#include #include #include -#include +#include #include #include #include @@ -227,21 +227,21 @@ int main( int argc, char** argv ) } callback.reset( new snark::camera::flycapture::callback( camera, on_frame_ ) ); tbb::task_scheduler_init init; - tbb::filter_t< void, Pair > read( tbb::filter::serial_in_order, boost::bind( read_, _1 ) ); - tbb::filter_t< Pair, void > write( tbb::filter::serial_in_order, boost::bind( write_, boost::ref( *serialization), _1 ) ); - tbb::filter_t< void, Pair > imageFilters = read; + tbb::filter< void, Pair > read( tbb::filter_mode::serial_in_order, boost::bind( read_, boost::placeholders::_1 ) ); + tbb::filter< Pair, void > write( tbb::filter_mode::serial_in_order, boost::bind( write_, boost::ref( *serialization), boost::placeholders::_1 ) ); + tbb::filter< void, Pair > imageFilters = read; if( !filters.empty() ) { std::vector< snark::cv_mat::filter > cvMatFilters = snark::cv_mat::filters::make( filters ); for( std::size_t i = 0; i < cvMatFilters.size(); ++i ) { - tbb::filter::mode mode = tbb::filter::serial_in_order; + tbb::filter_mode mode = tbb::filter_mode::serial_in_order; if( cvMatFilters[i].parallel ) { - mode = tbb::filter::parallel; + mode = tbb::filter_mode::parallel; } - tbb::filter_t< Pair, Pair > filter( mode, boost::bind( cvMatFilters[i].filter_function, _1 ) ); + tbb::filter< Pair, Pair > filter( mode, boost::bind( cvMatFilters[i].filter_function, boost::placeholders::_1 ) ); imageFilters = imageFilters & filter; } } diff --git a/sensors/cameras/flycapture/applications/flycapture-multicam.cpp b/sensors/cameras/flycapture/applications/flycapture-multicam.cpp index e79343922..bd9d9ef21 100644 --- a/sensors/cameras/flycapture/applications/flycapture-multicam.cpp +++ b/sensors/cameras/flycapture/applications/flycapture-multicam.cpp @@ -27,10 +27,10 @@ // OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN // IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include +#include #include #include -#include +#include #include #include #include diff --git a/sensors/cameras/flycapture/attributes.cpp b/sensors/cameras/flycapture/attributes.cpp index 93cf5a7cb..1318e8aa6 100644 --- a/sensors/cameras/flycapture/attributes.cpp +++ b/sensors/cameras/flycapture/attributes.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include "flycapture.h" diff --git a/sensors/cameras/flycapture/flycapture.cpp b/sensors/cameras/flycapture/flycapture.cpp index 69a1b2b94..b05fdf19e 100644 --- a/sensors/cameras/flycapture/flycapture.cpp +++ b/sensors/cameras/flycapture/flycapture.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sensors/cameras/flycapture/helpers.cpp b/sensors/cameras/flycapture/helpers.cpp index 9c5db9d55..62ebbbd78 100644 --- a/sensors/cameras/flycapture/helpers.cpp +++ b/sensors/cameras/flycapture/helpers.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include "flycapture.h" diff --git a/sensors/cameras/gige/applications/gige-callback.cpp b/sensors/cameras/gige/applications/gige-callback.cpp index a1254fccb..5281dcd0d 100644 --- a/sensors/cameras/gige/applications/gige-callback.cpp +++ b/sensors/cameras/gige/applications/gige-callback.cpp @@ -27,10 +27,10 @@ // OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN // IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include +#include #include #include -#include +#include #include #include #include @@ -233,21 +233,21 @@ int main( int argc, char** argv ) } callback.reset( new snark::camera::gige::callback( gige, on_frame_ ) ); tbb::task_scheduler_init init; - tbb::filter_t< void, Pair > read( tbb::filter::serial_in_order, boost::bind( read_, _1 ) ); - tbb::filter_t< Pair, void > write( tbb::filter::serial_in_order, boost::bind( write_, boost::ref( *serialization), _1 ) ); - tbb::filter_t< void, Pair > imageFilters = read; + tbb::filter< void, Pair > read( tbb::filter_mode::serial_in_order, boost::bind( read_, boost::placeholders::_1 ) ); + tbb::filter< Pair, void > write( tbb::filter_mode::serial_in_order, boost::bind( write_, boost::ref( *serialization), boost::placeholders::_1 ) ); + tbb::filter< void, Pair > imageFilters = read; if( !filters.empty() ) { std::vector< snark::cv_mat::filter > cvMatFilters = snark::cv_mat::filters::make( filters ); for( std::size_t i = 0; i < cvMatFilters.size(); ++i ) { - tbb::filter::mode mode = tbb::filter::serial_in_order; + tbb::filter_mode mode = tbb::filter_mode::serial_in_order; if( cvMatFilters[i].parallel ) { - mode = tbb::filter::parallel; + mode = tbb::filter_mode::parallel; } - tbb::filter_t< Pair, Pair > filter( mode, boost::bind( cvMatFilters[i].filter_function, _1 ) ); + tbb::filter< Pair, Pair > filter( mode, boost::bind( cvMatFilters[i].filter_function, boost::placeholders::_1 ) ); imageFilters = imageFilters & filter; } } diff --git a/sensors/cameras/vimba/applications/vimba-cat.cpp b/sensors/cameras/vimba/applications/vimba-cat.cpp index 7152375e0..8063f9f7b 100644 --- a/sensors/cameras/vimba/applications/vimba-cat.cpp +++ b/sensors/cameras/vimba/applications/vimba-cat.cpp @@ -27,7 +27,7 @@ // OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN // IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include +#include #include #include #include @@ -384,7 +384,7 @@ int main( int argc, char** argv ) int exit_code = 0; while( acquiring ) { - camera.start_acquisition( boost::bind( &output_frame, _1, boost::ref( serialization ), boost::ref( camera ) ), num_frames ); + camera.start_acquisition( boost::bind( &output_frame, boost::placeholders::_1, boost::ref( serialization ), boost::ref( camera ) ), num_frames ); comma::signal_flag is_shutdown; long frames_delivered = 0; do { diff --git a/sensors/cameras/vimba/camera.cpp b/sensors/cameras/vimba/camera.cpp index cda026371..2af297dcb 100644 --- a/sensors/cameras/vimba/camera.cpp +++ b/sensors/cameras/vimba/camera.cpp @@ -28,7 +28,7 @@ // IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include -#include +#include #include #include @@ -63,11 +63,11 @@ camera::name_values camera::info() const { name_values name_value_pairs; - add_name_value( "id", boost::bind( &AVT::VmbAPI::Camera::GetID, boost::cref( *camera_ ), _1 ), name_value_pairs ); - add_name_value( "name", boost::bind( &AVT::VmbAPI::Camera::GetName, boost::cref( *camera_ ), _1 ), name_value_pairs ); - add_name_value( "model", boost::bind( &AVT::VmbAPI::Camera::GetModel, boost::cref( *camera_ ), _1 ), name_value_pairs ); - add_name_value( "serial_number", boost::bind( &AVT::VmbAPI::Camera::GetSerialNumber, boost::cref( *camera_ ), _1 ), name_value_pairs ); - add_name_value( "interface_id", boost::bind( &AVT::VmbAPI::Camera::GetInterfaceID, boost::cref( *camera_ ), _1 ), name_value_pairs ); + add_name_value( "id", boost::bind( &AVT::VmbAPI::Camera::GetID, boost::cref( *camera_ ), boost::placeholders::_1 ), name_value_pairs ); + add_name_value( "name", boost::bind( &AVT::VmbAPI::Camera::GetName, boost::cref( *camera_ ), boost::placeholders::_1 ), name_value_pairs ); + add_name_value( "model", boost::bind( &AVT::VmbAPI::Camera::GetModel, boost::cref( *camera_ ), boost::placeholders::_1 ), name_value_pairs ); + add_name_value( "serial_number", boost::bind( &AVT::VmbAPI::Camera::GetSerialNumber, boost::cref( *camera_ ), boost::placeholders::_1 ), name_value_pairs ); + add_name_value( "interface_id", boost::bind( &AVT::VmbAPI::Camera::GetInterfaceID, boost::cref( *camera_ ), boost::placeholders::_1 ), name_value_pairs ); return name_value_pairs; } diff --git a/tbb/bursty_reader.h b/tbb/bursty_reader.h index 36bbcd1a8..7dd89a40b 100644 --- a/tbb/bursty_reader.h +++ b/tbb/bursty_reader.h @@ -29,13 +29,12 @@ #pragma once -#include +#include #include #include #include #include -#include -#include +#include namespace snark { namespace tbb { @@ -65,7 +64,7 @@ class bursty_reader void join(); - ::tbb::filter_t< void, T >& filter() { return filter_; } + ::tbb::filter< void, T >& filter() { return filter_; } private: T read_( ::tbb::flow_control& flow ); @@ -75,7 +74,7 @@ class bursty_reader unsigned int size_; bool running_; boost::function0< T > produce_; - ::tbb::filter_t< void, T > filter_; + ::tbb::filter< void, T > filter_; boost::scoped_ptr< boost::thread > thread_; }; @@ -84,7 +83,7 @@ bursty_reader< T >::bursty_reader( boost::function0< T > produce, unsigned int s : size_( size ) , running_( true ) , produce_( produce ) - , filter_( ::tbb::filter::serial_in_order, boost::bind( &bursty_reader< T >::read_, this, _1 ) ) + , filter_( ::tbb::filter_mode::serial_in_order, boost::bind( &bursty_reader< T >::read_, this, boost::placeholders::_1 ) ) { if( capacity > 0 ) { queue_.set_capacity( capacity ); } thread_.reset( new boost::thread( boost::bind( &bursty_reader< T >::produce_loop_, this ) ) ); From e8f9bf9fedc6dd154ab5edfe8759b9f82459396a Mon Sep 17 00:00:00 2001 From: mimhoff Date: Thu, 13 Jul 2023 10:56:46 +1000 Subject: [PATCH 2/2] dependencies.commits: updated --- dependencies.commits | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.commits b/dependencies.commits index 2ee16befd..90de1fecf 100644 --- a/dependencies.commits +++ b/dependencies.commits @@ -1 +1 @@ -comma,8b6ae0214296a6bf4eafd52ac5dcf18192f80849 +comma,dbfeb541ad19c00c46cbae9c7d43b44dbd27c90b