Marek
Marek

Reputation: 892

Obtaining opencv UMat shape in python

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

Answers (1)

ShellAddicted
ShellAddicted

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

Related Questions