Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Utils missing from org.bytedeco.opencv #760

Closed
nofurylion opened this issue Jul 13, 2019 · 1 comment
Closed

Android Utils missing from org.bytedeco.opencv #760

nofurylion opened this issue Jul 13, 2019 · 1 comment
Labels

Comments

@nofurylion
Copy link

Hi,
Build target : Android 21+
Language : Kotlin
My gradle :

implementation group: 'org.bytedeco', name: 'opencv', version: '4.1.0-1.5.1'
implementation group: 'org.bytedeco', name: 'opencv', version: '4.1.0-1.5.1', classifier: "android-arm"

When using Utils.bitmapToMat(param1, param2), the only available Utils are from package org.opencv.android. I cant find Utils from package org.bytedeco.opencv.android .

This lead to error since param2 will require org.opencv.core.Mat instead of org.bytedeco.opencv.opencv_core.Mat

I've tried rough casting it like param2 as org.opencv.core.Mat but it lead to error "unable to cast".

Are there any alternative way to convert bitmap to mat easily?
and also why package org.opencv.* still exist in the library? Is that how wrappers work?
Screenshot_2019-07-13_17-53-25

Originally posted by @nofurylion in #549 (comment)

@nofurylion nofurylion changed the title Android Utils missing from org.bytedeco.opencv.android Android Utils missing from org.bytedeco.opencv Jul 13, 2019
@saudet
Copy link
Member

saudet commented Jul 13, 2019

We can convert between Mat objects of the two APIs with OpenCVFrameConverter.ToMat and OpenCVFrameConverter.ToOrgOpenCvCoreMat. See this unit test for an example:
https://github.com/bytedeco/javacv/blob/master/platform/src/test/java/org/bytedeco/javacv/FrameConverterTest.java#L211

@saudet saudet closed this as completed Jul 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants