I am implementing a barcode scanner using MLKIT in my application (Kotlin). I need the barcode to be processed only when it is visible in a transparent rectangle in the center of the screen. as we see in the picture below.
PIC 1
Right now my App detects every barcode visible in the camera view as shown below. Is it possible to limit the detection area so the detection only reads from a rectangle in the middle of the screen?
Besides I would like to create a custom PreviewView for a barcode with cameraX, as shown in PIC 1. Thank you.
PIC 2
ML Kit doesn't support specifying interested area currently, so you have to either crop the preview image or filter out barcode results that not in the specified area. Similar question How do I make the camera focus only inside the rectangle and read the text inside the rectangle only in a flutter?
Related
I'm not sure where to start with this one, I have an image with a repeatable grid pattern and I am trying to detect and create a digital representation of that grid over the camera view.
If I have my rear camera preview hovering over this image, I would like it to detect gridlines and then overlay a digital redline of the grids. Similar to the face/barcode detection but a grid detector.
Any help in the right direction would be greatly appreciated.
I want to super-impose an outline of a face when the camera launches in android. Kind of like an empty avatar or a silhouette. I'm NOT looking for face detection. I just the want the user to have the ability to align the outline to the person's face when taking the picture, so that all pictures are taken at the same distance. I already have the camera launching. I'm thinking of putting the facial outline as my main layout and have the camera launching as the background of that layout. Any ideas?
Here you go
there is a section detailing how to do this.
http://developer.android.com/guide/topics/media/camera.html#custom-camera
I'm writing an android app using OpenCV for my masters that will be something like a game. The main goal is to a detect a car in selected area. The "prize" will be triggered randomly while detecting cars. When the user will hit the proper car I want to display a 3D object overlay on the screen and attach it to the middle of the car and keep it there so when the user will change the angle of his view on the car, the object will also be seen from diffrent angle.
at the moment I have EVERYTHING beside attaching the object. I've created detection, I'm drawing the 3D overlay, I've created functions that allow me to rotate the camera etc. BUT I do not have any clue how can I attach the overlay to the specific point. Cause I don't have this I have no point to recalculate the renderer to change the overlay perspective.
Please, I really need some help, even a small idea will be fine:
How can I attach the overlay to the specific in real world
(Sorry, I couldn't comment. Need at least 50 points to do that ... :P )
I assume your image of the car is coming from a camera feed and you are drawing 3d car in opengl. If so, then you can try this:
You set the pixel format of the opengl layer as RGBA_8888, so that you can set the background of the opengl camera as a transparent color.
You take a relative layout as layout of your activity.
first you add the opencv camera layout to it as full height and width.
then you add opengl layer as full height and width.
you get the position of the real car from opencv layer as pixel value or something you did.
then scale it to your opengl parameters so that you can draw it on the right spot.
it worked for me. hope it works for you too.
I have an application that scans qr code. I want to place a square in the middle of camera view so the users have a guide on where they will place the qr code. Can you tell me how to do it? Thank you.
I am using a standard Android camera/surface area. I am not using the full screen, and have implemented the preview surface area with a height of 200dp. However, when I save the photo, it is saved as if the preview/surface area is the full screen.
Is there a way for me to save to a jpeg exactly what is displayed on the preview/surface area?
Some context for the question, I am using the camera to capture the text of a street sign, so I only need a very small image.
In my OCR applications I capture preview, and then extract subimages for further processing based on position of ROI ( determined by some surface overlay ).
See android demo code ( demos/ ) :
http://sourceforge.net/projects/javaocr/
I'm not aware of interface allowing ti capture only subimage