Apply EffectFactory Effects on CameraPreview - android

I am trying to make an Android application that lets the user take a picture with lomo effect. The thing is, I want to make the camera preview the image WITH the effect automatically, not take a picture then apply the effect.
I learned how to use CameraPreview on this link. I also found out about EfectFactory class here, which has the effect I want. The problem is, I don't know how to apply efectfactory class on a CameraPreview.
I googled this but didn't find the answer I was looking for.
For the code, I am using the same as how my first link provided.
Can anyone help me on this problem?
Thanks in advance

You can do below thing:
1) Get bitmap from captured image in GLS Surface view
and then
2) Apply effects using Effect Factory class.
More detail use this link.

Related

Sample Android Code for moving an image behind a selection box

I am looking for a sample code/app that can take a picture with the camera and then have the ability to crop it, specifically using the method of moving/zooming the image behind a selector box like the current google photos editor does.
bonus points if you can find something for xamarin :)
i found this, but i am looking for a more complete example.

Add to Camera preview a frame showing position in Android

I need to add to user interface in Android application using Camera API a frame showing ID card position with specific dimension on the screen, when the user is taking a picture.
like this:
Any suggestion?
Thank you.
You will have to make your own camera and process each frame to find and highlight edges.
It's not an easy task :)
https://www.tensorflow.org/ or OpenCV might be of interest to you.
I think you cant use android API (Android.Camera) for doing that. You can use the OpenCV to do anything in your application.

Android Camera Activity like Instagram

Which are the best ways to create a Camera Custom activity, using FRONT FACE CAMERA or BACK FACE, and choosing the best sizes of SurfaceView and Camera for each device?
I would want to create an activity like Instagram has, squared and with custom layouts above and below.
If there's any sample that's like this, please It would be very useful.
see https://thenewcircle.com/s/post/39/using__the_camera_api (small) or https://github.com/commonsguy/cwac-camera (with lots of enhancements)
you can try my simple library https://github.com/mistreckless/PortraitCameraSupport
but instagram developers did that by another way. They capture the entire screen image then programmatically cut the square preview you see

Access Android Camera Frames with no Preview

I want to do image processing on frames from Android Camera in real time with OpenCv, but all the OpenCv Android examples provide a preview of the image being captured. I really don't need previews of the frames , is there any way to get the frames without actually showing the preview ?
A quick/naive way would be to make onCameraFrame method returning null and set your CameraBridgeViewBase visibility to SurfaceView.INVISIBLE or SurfaceView.GONE.
I still would like to know if it worked for you, but meanwhile I found the solution that worked for me. As I feel grateful for the guy who wrote it, I'm sharing this (scroll down to answers section) with anyone who will have same problem in future.
In case the link vanished, here's his/her pro-tip:
You can set your preview (in this case a CameraBridgeViewBase)
transparent by setting the alpha value of the view, with 0 being
completely invisible.
mOpenCvCameraView.setAlpha(0);
This should make your preview "disappear".
I wonder how your solution works, because as you can read in the docs:
This method is invoked when delivery of the frame needs to be done.
The returned values - is a modified frame which needs to be displayed
on the screen.
Indeed, in my case it doesn't work but I desperately need such a functionality.

Capture a certain part on a full screen camera

Lets say this picture below is a full screen custom camera, how could I capture a square photo from the inside of that red square?
I chose this approach on custom camera to avoid THIS kind of problem which results to a squashed preview for square camera. After the process the output should be like this :
I just want to try the solution that Instagram used to prevent that squashed-image-from-square-camera issue, I read it from the accepted answer of #xramos from THIS LINK also.
Here's what he said :
Please help me fellow prgrammers :) Thank you and have a good day :D

Categories

Resources