Recognize text and draw a rectangle over text on camera preview - android

In Camera preview i want to detect text & draw a rectangle overlay on Paragraph/complete text similar to camScanner.
I have used opencv Library but in this i am able to detect object but not able to draw a border/rectangle over complete visible text. I have also used android-Camera2Basic.(https://github.com/googlearchive/android-Camera2Basic).
.

Related

Draw a rectangleBox on CameraX preview and capture only that area

I want to open the camera with a rectangle border over it. And capture only the rectangle area image. The rectangle border can resize as per the user's choice.
Tried with many SO link but still no answer.
Below is the SO link that I want to achieve.
Display a rectangular bounding box (overlay) on custom Camera2 API so only the image inside the box is captured

Display camera preview in a circle

I want to display a camera preview in a circular shape using the camera2 api. I want to display the preview in a circular shape, but I dont't want the image to be captured in a circular shape.
The captured image would be a face( later want to implement face detection and auto capture). I did have a look at few questions already asked, but none of them are with the new camera2 api's and most of them talk about having an overlay image cropped with a transparent circle. But this will not work in a case where I need to auto detect a face(as the face may appear out side the cropped circular image).
Is there any way I can implement this ? I did try an example with TextureView and set it to a LinearLayout with fixed width and height, but the preview appeared a bit squeezed and in a square shape.
I don't see why face detection matters here - if you enable the camera API's face detector, it'll run on the full image no matter what you do in drawing it inside a circle.
You can either use a circle overlay on top of a correctly-shaped TextureView or SurfaceView, or do your own OpenGL rendering of a circle with the camera preview as a EGL texture.
The latter you'll probably want a GLSurfaceView for the OpenGL drawing context, and a SurfaceTexture to send camera data to and expose it as a EGL texture.
JPEGs captured will still be full-FOV, and the camera API will know nothing about your circular preview drawing, so face detection and everything else will work on the full field of view.

Android Camera2 - Draw circle focus area

I'm trying to develop a custom application that uses Camera 2 API and I would like to add the feature "tap to focus". In other words, when I tap on the screen to focus, it shows a circle of the focus area.
How can I draw the circle focus area?
I followed the Google Camera2Basic example.
Thank you.
May be enough is draw circle of tap area, not focus area? In this case You can save X and Y pos of tap and use it as center of circle. And You can use any tutorial for drawing over camera preview, like that.

Android How to set the imageview in front of drawingview

I am using drawing view to draw on touch of user , So I need to put the image in front of it. There are some letters written in the middle of image , which is in translucent , while the other places are covered with color. So on touch the user would only see the letter filling with paint as the letter is transparent and translucent.
Edited
is the picture, I want to fill the only white space with color on user touch. Right now I am painting on a white canvas and , truly I have copied the code of touch to draw from android api demo folder. So please Tell me How to fill that white blank space only .
I came up with idea and that is to draw canvas as the source code of api demo is doing , and just put the imageveiw in front of this canvas hence user would only see the white area is filling with color. Any idea that How can I perform this ?
So My major problem is how to put that image view in front canvas in android. ?

Get outline of Alphabet as Path in Android

I want to crop an image in alphabet(A-Z,0-9) in Andorid any idea ?
Here is an example of what I am looking for Cut out image in shape of text
but he uses java's awt api(I am looking for Android) also it is too slow.
After some googling and reading android docs found that we can specified drawing area for canvas using canvas.clipPath(path) then I can draw a rectangular image on canvas and image will only be visible that is drawn in clipped area,hopefully :)
So now I can crop image in small rectangle and draw rectangle on Text path is it possible to get Outline of an Alphabet for given font ?
On Android you should be able to do that very easily by using a BitmapShader.
Instantiate your BitmapShader.
Instantiate a Paint, and call setShader(bitmapShader).
Draw text with Canvas.drawText("Cat", x,y, paint).

Categories

Resources