My solution is:
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?
Yes, cv::flip().
Although a simple search through the docs would've given you this.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments