quickbirdeng / yuvtomat Goto Github PK
View Code? Open in Web Editor NEWHigh-performance library for converting YUV_420_888 Android Camera images to OpenCV RGB Mats
High-performance library for converting YUV_420_888 Android Camera images to OpenCV RGB Mats
The toMat throws this:
java.lang.UnsatisfiedLinkError: No implementation found for long org.opencv.core.Mat.n_Mat(int, int, int, java.nio.ByteBuffer) (tried Java_org_opencv_core_Mat_n_1Mat and Java_org_opencv_core_Mat_n_1Mat__IIILjava_nio_ByteBuffer_2).
The Image given to the function is an ArImage from google's ARCore.
Any ideas why it happens and how to fix it?
Thank you!
The problem happens when set the resolution to 2160x1080.
Thanks for this awesome project (and of course the OpenCV package for gradle)! This really saved me so much trouble. I can convert my images to Mats, but when I try to use the clipping, then for
val yuv = YuvImage(image).clip(left=20, top=20, right=40, bottom=40)
I get a compile error saying
Expression 'YuvImage' of type 'YuvImage.Factory' cannot be invoked as a function. The function 'invoke()' is not found
My versions:
ext.kotlin_version = '1.3.50'
implementation "com.quickbirdstudios:yuvtomat:1.1.0"
implementation 'com.quickbirdstudios:opencv:4.1.0'
Do you have an idea what happens there?
Yuv format is not supported: Yuv(resource=androidx.camera.core.SettableImageProxy@f251aa8, width=864, height=480, y=Plane(buffer=java.nio.DirectByteBuffer[pos=0 lim=430048 cap=430048], pixelStride=1, rowStride=896), u=Plane(buffer=java.nio.DirectByteBuffer[pos=0 lim=215007 cap=215007], pixelStride=2, rowStride=896), v=Plane(buffer=java.nio.DirectByteBuffer[pos=0 lim=215007 cap=215007], pixelStride=2, rowStride=896))
Hello, can you suggest what is the possible cause for this error?
I noticed strange values width = 864 but rowStride = 896, may be this is the reason.
Sony Xperia XZ3 Black (H9436)
CameraX api has ImageProxy class which you obtain from ImageAnalyzer. It has the same api as usual Image. So adding support is just duplicating several constructors. And I would create pull request, but…
The difficult part, I think, this feature should be in separate package. If someone don't use CameraX in his/her project won't have to download it.
Hi,
Can you add "Yuv.bgr" method ?
Because Opencv in android is BGR.
Thank's
private void saveQuickBird(Image newImage, int rotation)
{
final Image image = newImage;
Mat rgbMat = Yuv.rgb(image);// getting a rgb mat!
Mat bgrMat = new Mat();
Imgproc.cvtColor(rgbMat, bgrMat, Imgproc.COLOR_RGB2BGR);// Without this line the image is weird.
// Do some work..
// Now Save !
org.opencv.imgcodecs.Imgcodecs.imwrite(_path, bgrRotated);
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.