What is the equivalent of opencv for matlab fliplr ()?

My decision:

cv::Mat FlipLR(const cv::Mat& inImg) { //create flipped image from Left to right cv::Mat outImg(inImg.size(), inImg.type()); cv::Mat_<double> FlipMatrix(2, 3); FlipMatrix << -1, 0, inImg.cols - 1, 0, 1, 0; cv::warpAffine( inImg, outImg, FlipMatrix, outImg.size(), cv::INTER_NEAREST ); return outImg; } 

Is there a more efficient way to do this?

+7
c ++ opencv matlab
source share
2 answers

Yes, cv :: flip () .

Although a simple document search would give you this.

+8
source share

fliplr:

 cv::flip(imImg, outImg, 1); 

flipud:

 cv::flip(imImg, outImg, 0); 
+1
source share

All Articles