Ask Your Question
5

Is there any reason not to use UMat?

asked 2015-07-14 04:11:54 -0600

blDraX gravatar image

I'm currently writing a piece of software that uses various different modules of OpenCV (some examples are edge detection via Canny, filtering operators, optical flow and I have some own algorithms that work on the opencv matrices).

My question is, with the introduction of UMat in OpenCV3, is there any reason to still use Mat? Currently I'm still using Mat everythere (having only recently moved to 3.0), but trying out Farnebacks optical flow method, I realized it's much faster using the GPU speedup of UMat. But I love uniformity so at best I'll want to use ONLY UMat or ONLY Mat in my entire software. So I'm now thinking about using UMat everywhere so that I won't have to convert between the two of them.

Is this a good idea? Are there drawbacks of using UMat everywhere? I read of some cases where using the GPU actually led to a loss of speed. Do these problems still exist in the gold release?

edit retag flag offensive close merge delete

Comments

1

I understand your question. When you 've got big code usinng Mat change to UMat it's a big work. May be you can find some answers to your question here and here

LBerger gravatar imageLBerger ( 2015-07-14 04:27:23 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-07-26 03:19:41 -0600

Anna Lucia gravatar image

The data member in UMat is hidden and there is no constructor with user data. And some functions can not be carried on OpenCL. So some Mat should be remained.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-07-14 04:11:54 -0600

Seen: 3,446 times

Last updated: Jul 26 '15