How to flip matrix in place? [closed]
I would like to reduce the 3 matrixes to just 2 matrixes by converting and flipping in one command, or flipping in place. Is there any way how to increase efficiency of the code?
cv::Mat dImg; // assume its initalized with TYPE_16UC1
cv::Mat dImg_grey;
cv::Mat dImg_grey_flip;
dImg.convertTo(dImg_grey, CV_8UC1, 255. / (2500 - 0), 0);// to grayscale cv::Mat, (max - min)
cv::flip(dImg_grey, dImg_grey_flip, 1);// cannot flip in place
Is it somehow possible to stuff the flip into the convert.
imho, you're worried in the wrong place, both operations are comparably cheap.
(and no, you can't flip in-place, and you can't combine them into a single operation.)