Reputation: 892
I'm working on a project involving calculations on GPU in openCV.
Is there a direct way to obtain shape (number of cols and rows) of UMat array without converting it first to numpy object in Python?
Upvotes: 6
Views: 2976
Reputation: 159
Actually there's not an easy way to do that :-(
You can:
A)Store shape before upload image to GPU (like you do, best way)
B)Download the image from GPU and get its shape
using something like this (BAD WAY, but Works):
shape = yourUMat.get().shape
Upvotes: 3