1 | initial version |
please DO NOT WRITE FOR LOOPS like that, ever , with opencv.
j<=input.cols;
is out of bounds, same for rowslog()
only makes sense for float datait should be rewritten as:
Mat input = ...
Mat tmp;
input.convertTo(tmp, CV_32F, 1.0, 1.0);
cv::log(tmp.t(), output);
normalize(output,output,0,255,NORM_MINMAX, CV_8U);
2 | No.2 Revision |
please DO NOT WRITE FOR LOOPS like that, ever , with opencv.
j<=input.cols;
is out of bounds, same for rowslog()
only makes sense for float datait should be rewritten as:
Mat input = ...
Mat tmp;
tmp, output;
input.convertTo(tmp, CV_32F, 1.0, 1.0);
1.0); // to float, also add 1
cv::log(tmp.t(), output);
output); // log on transposed Mat
normalize(output,output,0,255,NORM_MINMAX, CV_8U);
CV_8U); // back to uchar
3 | No.3 Revision |
please DO NOT WRITE FOR LOOPS like that, ever , with opencv.
j<=input.cols;
is out of bounds, same for rowslog()
only makes sense for float datait should be rewritten as:
Mat input = ...
Mat tmp, output;
input.convertTo(tmp, CV_32F, 1.0, 1.0); // to float, also add 1
cv::log(tmp.t(), output); // log on transposed Mat
normalize(output,output,0,255,NORM_MINMAX, CV_8U); // back to uchar