diff --git a/src/caffe/layers/video_data_layer.cpp b/src/caffe/layers/video_data_layer.cpp index 9015c20219d..6e71ae741f2 100644 --- a/src/caffe/layers/video_data_layer.cpp +++ b/src/caffe/layers/video_data_layer.cpp @@ -50,12 +50,12 @@ void VideoDataLayer::DataLayerSetUp( if (!cap_.open(video_file)) { LOG(FATAL) << "Failed to open video: " << video_file; } - total_frames_ = cap_.get(CV_CAP_PROP_FRAME_COUNT); + total_frames_ = cap_.get(cv::CAP_PROP_FRAME_COUNT); processed_frames_ = 0; // Read image to infer shape. cap_ >> cv_img; // Set index back to the first frame. - cap_.set(CV_CAP_PROP_POS_FRAMES, 0); + cap_.set(cv::CAP_PROP_POS_FRAMES, 0); } else { LOG(FATAL) << "Unknow video type!"; } diff --git a/src/caffe/util/bbox_util.cpp b/src/caffe/util/bbox_util.cpp index a9e7408d9db..5e060e40477 100644 --- a/src/caffe/util/bbox_util.cpp +++ b/src/caffe/util/bbox_util.cpp @@ -2236,7 +2236,7 @@ void VisualizeBBox(const vector& images, const Blob* detections, &baseline); cv::rectangle(image, cv::Point(0, 0), cv::Point(text.width, text.height + baseline), - CV_RGB(255, 255, 255), CV_FILLED); + CV_RGB(255, 255, 255), cv::FILLED); cv::putText(image, buffer, cv::Point(0, text.height + baseline / 2.), fontface, scale, CV_RGB(0, 0, 0), thickness, 8); // Draw bboxes. @@ -2262,7 +2262,7 @@ void VisualizeBBox(const vector& images, const Blob* detections, cv::rectangle( image, bottom_left_pt + cv::Point(0, 0), bottom_left_pt + cv::Point(text.width, -text.height-baseline), - color, CV_FILLED); + color, cv::FILLED); cv::putText(image, buffer, bottom_left_pt - cv::Point(0, baseline), fontface, scale, CV_RGB(0, 0, 0), thickness, 8); } @@ -2271,7 +2271,7 @@ void VisualizeBBox(const vector& images, const Blob* detections, if (!save_file.empty()) { if (!cap_out.isOpened()) { cv::Size size(image.size().width, image.size().height); - cv::VideoWriter outputVideo(save_file, CV_FOURCC('D', 'I', 'V', 'X'), + cv::VideoWriter outputVideo(save_file, cv::VideoWriter::fourcc('D', 'I', 'V', 'X'), 30, size, true); cap_out = outputVideo; } diff --git a/src/caffe/util/io.cpp b/src/caffe/util/io.cpp index e687e16f962..537f1417d52 100644 --- a/src/caffe/util/io.cpp +++ b/src/caffe/util/io.cpp @@ -196,7 +196,7 @@ cv::Mat ReadImageToCVMat(const string& filename, } if (cv_img_origin.data) { if (is_color && cv_img_origin.channels() < 3) { - cv::cvtColor(cv_img_origin, cv_img, CV_GRAY2RGB); + cv::cvtColor(cv_img_origin, cv_img, cv::COLOR_GRAY2RGB); } if (short_side > 0) { if (cv_img_origin.rows > cv_img_origin.cols) { @@ -212,10 +212,10 @@ cv::Mat ReadImageToCVMat(const string& filename, } cv::Size sz(width, height); if (cv_img.data) { - cv::resize(cv_img, cv_img_origin, sz, 0., 0., CV_INTER_LINEAR); + cv::resize(cv_img, cv_img_origin, sz, 0., 0., cv::INTER_LINEAR); return cv_img_origin; } - cv::resize(cv_img_origin, cv_img, sz, 0., 0., CV_INTER_LINEAR); + cv::resize(cv_img_origin, cv_img, sz, 0., 0., cv::INTER_LINEAR); } else { LOG(ERROR) << "Could not decode file " << filename; }