Android Firebase ML Kit PDF417 Camera Performance Issues - java

I am trying to detect a PDF417 barcode on the SA ID Card. The preview frame coming through is the max size for possible previews. In my tests its either 720p on low end devices and 1080p on high end ones.
The issue is that for Firebase to detect the PDF417 barcode it needs to be really close to the camera. I am passing the direct byte array data to the ML Kit right now using the same method that the Firebase ML Example does.
A previous build of mine had much better success in detecting the barcodes when I passed bitmaps to the ML Kit. That system was horribly slow and inefficient, but could detect the PDF417 from quite far away.
Is there any reason for this or am I doing something wrong? How can I get Firebase to detect PDF417 from far enough away to keep the entire card in frame?

Related

Real time emotion detection with OpenCV and Tensorflow in Android Studio

I am trying to build an Android app with Android Studio(Java), that based on a tensorflow model(pretrained in python) is able to classify the emotion of the person standing in front of the device's camera. My app needs to take the frame, apply some opencv operations like facedetection, grayscale, resize, crop, and histogram equlisation, and after that, giving the result to the model, it will predict the emotion. I have an activity that is showing the camera, but i dont know how to do all this frame manipulation and prediction in the background, when on the phone's screen the preview of the camera and the tags of the predictions, are the only things showing.
I managed to do this on PC very easly, running on the max FPS of the webcam, so i think it should be possible on the phone too.
Is there any similar project that i can get inspiration from? or does anyone know a bit of documentation or a way to do something like this ?
I would suggest checking out the Google ML Vision API's, they can easily be integrated into an Android App and are very accurate. There are many API's like the image labeller and facial labeller. Just check them out here:
https://developers.google.com/ml-kit/vision/face-detection/android
Hope I could help!

Compress movies on Android

I have a game where users complete assignment by making a picture that will be send to the backend. Before sending this to the backend the image is resized to limit the amount of data that has to be send. This all works fine.
Now I want to extend this with movie clips. Movie clips are a lot bigger then picture. Especially if you don't compress them. The problem is that I have no clue how to do this.
So the main question is how can change my app that the user records a video and after it compress it to make the file smaller in size. Are there libraries around to do this? Or is there something in Android itself to use?
One approach that works is to use ffmpeg to do the compression.
There are some well used ffmpeg libraries that will allow you include ffmpge via a wrapper and then use standard ffmpeg syntax to perform the compression within your app.
See this one which includes examples:
https://github.com/WritingMinds/ffmpeg-android-java
Note that video compression is power and battery intensive, and takes time so you may want to limit the clip size if you plan to have users use this functional regularly.

Android cropping and decreasing video size

we are going to start an app that captures videos or picks videos from gallery. The videos will be exactly 30 seconds, so users can crop or trim videos like video editor.
At this point, we got 2 main problems. The first one is video size. You know the video size could be huge for uploading :) So we need to decrease video size. The other problem is when iOS device captures and uploads video to server, there are some problems when trying to play that video on android app.
We have used “ffmpeg” library before for an another project but that library has varous problems like slow compression or library .so file’s size. And also have compatibility issues with sdk 24 (nougat)
Anyone has an experience about that? Or any ideas to overcome those problems? Thank u all.
I don't know what problems you have with ffmpeg. But it is definetely the best and the fastest library available for video editing,creating etc. Use ffmpeg4android if size is important for you. The library is about 6 megabytes and it is a wrapper for ffmpeg and has most usable methods of ffmpeg.
Please check Android MediaMuxer Api https://developer.android.com/reference/android/media/MediaMuxer.html
With this you can crop video, change it's frame rate and resolution

Image Recognition BlackBerry?

I'm trying to develop a sort of AR for BlackBerry devices. Trying to achieve the best compatibility for old devices, if it's possible I would like to make it for BlackBerry OS 5 / 6.
Due to lack of hardware performance, I'm not trying to show a real-time solution on screen. Right now I just want to recognize some symbol that the camera see, at the moment the symbol is recognized I want to capture a photo of the current view.
After that, I want to crop part of the captured photo and compare it with a imagery and determine if it matches some image.
I'm quite advanced on researching the alternatives, for the image comparing step, I know there are two common techniques histogram and keypoints. I'm almost decided to use histogram method, but I'm worried about the colors captured by the camera could be a little different from which ones I got in the database (due to light sources, colors, etc.)
Any ideas of which is the best method to achieve what I'm trying to do?
Thanks!

If I want a faster camera preview FPS, will I have to use the NDK?

I'm trying to get the preview frame rate up, but setPreviewFrameRate isn't supported on my phone. The max I can get using setPreviewCallbackWithBuffer and with no extra processing is about 17 fps, which I think most people would agree is kind of crappy. Am I missing something in the Android Java SDK or will I need to learn about the NDK to handle data at a full 30 fps? (I should point out that the camera can capture and save files at this rate -- apparently it just can't preview at this rate).
Are there any disadvantages of using the NDK that I should know about?
I've been in this situation, and reading from the camera was faster in the NDK. However, I rooted the phone and read straight from the framebuffer, and it probably wasn't the same phone you're developing for, so YMMV.

Categories

Resources