Last active
December 12, 2015 02:58
-
-
Save sgss/4702862 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <typename I, typename O, typename Iterator> | |
inline void transform_image( | |
const cv::Mat_<I>& input, | |
cv::Mat_<O> *output, | |
Iterator iterator) { | |
if (input.size != output->size) { | |
DR_LOGE("Dimensions of input and output images must be identical."); | |
DR_LOGD("Skipping the rest."); | |
return; | |
} | |
const int rows = input.rows; | |
const int cols = input.cols; | |
for (int y = 0; y < rows; ++y) { | |
const I *in_row = input[y]; | |
O *out_row = (*output)[y]; | |
for (int x = 0; x < cols; ++x) { | |
iterator(in_row[x], &out_row[x]); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment