-
-
Notifications
You must be signed in to change notification settings - Fork 56.2k
Pitfalls of OdometryFrame
's dependence on UMat
#22800
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
@JoeHowse Thanks for your considerations!
Since we want to support both Mats and UMats as input data, maybe a compromise solution would be to keep a pair of Mat and UMat instead of just UMats? They would store the same data, a mechanism that was intended by |
I have added a specific case in the issue description, above.
This sounds reasonable, yes.
Provided that one of these may be unused (i.e. empty), this sounds reasonable. |
The issue you've described is related to the As for Mat-UMat pair, I'll discuss this solution with other OpenCV team if they know some better solution. |
For the |
Uh oh!
There was an error while loading. Please reload this page.
System Information
OpenCV Python version: 5.0.0-pre (commit d976272)
Detailed description
Internally,
OdometryFrame
relies onUMat
in all cases (regardless of whether the user originally provided frame data inUMat
format or not). The use ofUMat
here was introduced in #22598, replacing an earlier templated solution.Generally, OpenCV functions do not (and should not) have the side effect of converting
Mat
parameters toUMat
. On many systems,Mat
operations perform better thanUMat
operations. Moreover,Mat
operations have fewer compatibility pitfalls (as they never attempt to use OpenCL features). For example, it is difficult to find any case on ARM Linux whereUMat
is a compatible and performant choice.[Edit]
Here is a specific example of a compatibility problem that I encountered. On one of my Linux systems, when I run
cv::OdometryFrame::compute
, the program outputs the following OpenCL compilation error and then the whole system locks up:This is a case where the system in general has poor OpenCL support. Nonetheless, most OpenCV functions work (with
Mat
input) and this particular function does not.[/Edit]
I would suggest revising the
OdometryFrame
implementation to avoidMat
-->UMat
conversion. Alternatively, I would suggest documenting this class's dependence onUMat
because users may need to consider the performance/compatibility pitfalls.Steps to reproduce
The issue (internal use of
UMat
in all cases) is apparent from code review, as well as testing.Issue submission checklist
The text was updated successfully, but these errors were encountered: