I'd like to know how to convert UMat image onto Mat and back-and-forth. I do calculation on input image which I read/write
UMat img,gray;
imread("lena.jpg", 1).copyTo(img);
cvtColor(img, gray, COLOR_BGR2GRAY);
imwrite("lena_gray.jpg", gray);
I have OpenCV 3.4.1. and after imwrite() call I got
Segmentation fault (core dumped)
There is a bug #11176 of segmentation fault if UMat saves by imwrite()
So I'm thinking to convert to Mat and after then to save.
How to convert UMat to Mat back-and-forth?