Advertisement
dan-masek

Untitled

Sep 25th, 2018
523
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. void filter2(const cv::Mat &image, cv::Mat &out)
  2. {
  3.     CV_Assert(!image.empty() && (image.type() == CV_8UC3));
  4.     out.create(image.rows / 2, image.cols / 2, image.type());
  5.     for (int i = 0; i < out.rows; i++) {
  6.         for (int j = 0; j < out.cols; j++) {
  7.             out.at<cv::Vec3b>(i, j) = image.at<cv::Vec3b>(i * 2, j * 2);
  8.         }
  9.     }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement