Displaying modified live camera preview - android

I've currently made an android app that can display a live preview of the camera, but I'm looking for a way to perform live pixel manipulation (ie, make the image grayscale, sepia-toned, etc.). As of yet I haven't found any code for someone whose done this before.
Any help would be appreciated.

You could use the Camera.Parameters to set the appropriate effect. Read more about it here.
If you want to do the manipulation by yours then use onPreviewFrame of camera. This gives you raw byte[] of YUV format (its by default, you could set it to other formats also. Look here for setting the preview format).
Now you could able to perform any pixel manipulation you want on byte[].
Hope this helps!

I have answered this question here. In short, this tutorial gives you probably the best way, how to achieve this (by using OpenCV, a free Computer Vision library). You can download their example application from their website as well.

Related

Retrieving Pixels from a DNG file within Android

I am currently working on an HDR application that requires the use of Camera2 to be able to customize HDR settings.
I have developed a customized algorithm to retrieve certain data from Raw DNG images and I would like to implement it on Android.
I am unfortunately not an expert in Java/Android, so I taught myself how to code. Using other formats, I have usually worked with bitmaps to retrieve pixel data. ( which was relatively an easy task concerning the existing methods )
Concerning DNG files, I have found no documentation showing me how to retrieve the pixels data. I thought of bufferizing the image, however the DNG file format contains many information other than pixels and I'm afraid I am unable to find an extraction strategy using bufferstream. (I just want to store the pixels inside an array)
Anyone has an idea ? Would highly appreciate some tips.
Best regards
Camera2 does not produce DNGs directly - it produces plain RAW buffers, which you can then save to a DNG via DngCreator.
Are you operating on the initial RAW buffers, or saving DNGs and then loading them back?
In general, DNGs are not full baked images, so quite a bit of code is needed to render them completely - see for example Adobe's DNG SDK.

How do you record AR video processed by OpenCV on Android?

I'm creating an Android app that makes use of OpenCV to implement augmented reality. One of the needed features is that it saves the processed video. I can't seem to find any sample code on real-time saving while using OpenCV.
If the above scenario isn't possible, another option is to save the video first and have it post-processed by OpenCV and saved back as a new file. But I can't find any sample code for this either.
Could someone be kind enough to point me to either direction, or give me an alternative? It's ok if the alternative doesn't use OpenCV.
Typical opencv flow is, you receive frames from camera, convert to RGB format, perform matrix operations then return to activity to display in View. You can actually store the modified frames as images somewhere in sdcard and use jcodec to create your mp4 out of your images. See Android make animated video from list of images.

Android Video from camera

What should I read for creating a basic augmented reality app for android?
I read the android reference articles, and I learnd that I could use the Intent(using the built in app) or construct my own "costumized" app (with camera).
I wanted to know what I should read more about, so that I could create something basic like a shape on the screen
By the way:
Cant I just see the current image given by the camera with out the need of saving it? (all of the articles want me to save the files captured, and as you know augmented reality(in my case) does not need saving the file, but does it "on the fly" , am I correct?
you can see the preview using surfaceview while recording from a mediarecorder.
the preview can be seen using setPreviewDisplayfunction of media recorder. its pretty simple to use.
I highly recommend you have a look at OpenCV. I have not used it with Android, but I know it to be a fairly painless and accessible way to image processing.

Android: Saving constucted image on screen

My users are going to construct and image out of other images in the game, what I then need to take is capture the image they have created and save it.
Im really not sure how to capture the final image, I am using OpenGL ES so the Canvas option is viable
Thanks
I think glReadPixels is probably what you're looking for. Khronos has better documentation of this function.

Android Original / Default Camera Parameters

I have an application where i make use of the Camera API to specify my own settings and do some frame processing.
I need my application to take photos with the same settings the Android original Camera app does, but apparently I have no way to extract the procedures and intents from it. I have taken a look at the original Android Camera app class file, but it was not helpful, since it makes use of native routines for the parameters part...
Is there any way that I can obtain the parameters used by the original camera App? And in which way does it save the images?
I know that i can write to a File stream as suggested in many posts, and i have done so, but how can i actually save the specific information the device puts in the files, such as information on the camera, density, and such ?
Thanks in advance

Categories

Resources