Now you don’t have to settle for the slow, lacking WebCamTexture API. The NatCam API provides access to device camera functions like high resolution previews (at high frame rates), exposure, focusing, zooming, flash, torch, photo capture, VR support, OpenCV support, and so much more. We used it in our upcoming project and it works absolutely great.
Blazing fast camera preview (especially on Android).
HD. You can view what your phone sees in HD, or even higher resolutions if you wish to. All at a solid framerate.
Custom resolutions. NatCam allows you to set the camera’s resolution. There are also resolution presets for ease of use.
Photo capture. NatCam allows you to capture high-resolution insta-worthy photos. You also have control over lighting with flash mode access.
Focus. Focus on anything you see. It also features focus modes (like autofocus, tap to focus, or even off).
Exposure. Set custom exposure bias for properly exposing those under- and over-exposed scenes your app will face. It also features exposure modes (like auto exposure and locked exposure).
Zoom. NatCam supports hardware optical zoom.
Torch. Switch on and off the device’s LED torch.
VR support. NatCam is compatible with GearVR and Google Cardboard. Check out a Cardboard VR example here.
Preview Data. NatCam gives you access to the preview data for performing software operations.
OpenCV support. NatCam has built-in support the OpenCVForUnity API. Check out the official examples.
Minimalist package. NatCam is a very small, specialized package. It is specifically designed not to add unnecessary overhead to your project.
Instant support. We respond to support emails usually within minutes.
On my galaxy S3 pictured above, I can play a full HD preview (1080p) from the camera between 24-30FPS. As for Unity’s WebCamTexture API, we all know how slow it is. WebCamTexture will only yield 3-4FPS at such a resolution.
Hey @Lanre any update on this?
Just curious since I retested my own app with Redmi Note 2 and the webcamtexture is performing poorer than my previous phone.
Hello @ikazrima . The package is still pending review; this is probably due to the Christmas and New Year holiday. I would guess that it would be reviewed within the next week. I’m very eager to see how Unity Devs use it.
Oh. I found this. When I came across this thread, I almost cried like a little girl. A week I struggled with Unity camera and began to teach Java to write the wrapper. It would take a lot of time and I had almost given up hope that I would find a solution. But NatCam save my hope! Thank you, Larne.
I would still advise you to get familiar with Android Java in your free time because the sources are included. That way, if you want to add some custom functionality, like scanning a new type of barcode, you can do so easily. I have included a little readme for the sources and will be happy to discuss Java programming with you.
But yes, NatCam is made for extreme convenience. You sure would love it!
Hi guys! I’m sorry that I have been incommunicado for the past few days; My team is about to launch an app so we’re performing last-minute adjustments.
I have bitter-sweet news (more sweet than bitter). I must inform you that Unity still has my package in Pending Review. Because it’s taking so long, I have asked Unity to cancel it. In order to make up for it, I plan to add even more features and release a 100% complete featureset. These new features will include OpenCV support, video capture support, front camera support, zoom, torch, custom camera resolutions, and quite (very) possibly, photo filters. I plan to be done with all this in about 2 weeks. Then I’ll send it back to Unity for review.
I am really really really sorry that all this is taking a while, but it is completely worth the wait. You won’t ever need another device camera solution again. Thanks for your patience!
Hello guys. I’ve been working on OpenCV support for Android NatCam. The biggest hurdle is returning a texture that lives in system memory to OpenCV. The issue with that is that getting the camera preview to Unity requires using GPU processing (to convert from YUV to RGB). That’s what makes NatCam so fast. Now getting that texture data back to system memory is the huge challenge. The only option is to use glReadPixels, which is notoriously slow. It sends framerates from ~30FPS to ~8FPS (rendering a 1920x1080 camera preview). That is totally unacceptable. I don’t want us devs to have to sacrifice quality resolutions for speed. There are two possible compromises that can be made:
For OpenCV, supplying a camera preview with a very low frame rate (~5FPS) while displaying the fluid preview to the user. This is how NatCam performs Barcode Detection on Android. Does OpenCV require a fluid 30FPS stream? I would love to know as I have not worked with OpenCV myself.
…
EDIT: An optimized method has been found. Stay tuned.
5 fps is pretty low for opencv. And also i think it should be close to the real capture fps, because the tracking would delay on the real image.
But the good thing is while using the opencv i currently using a resolution of ~240x180 and getting really good results from a processed image. (get the data array > rescale the image (pyrDown) > converting grayscale > applying histogram) Also all this happens using opencv which takes place on the data array.
So i think rescaling the opencv image on the gpu and using it with opencv would be a great solution.
NatCam should now support OpenCV on Android OpenGLES2 devices with ARM CPU’s (which account for the majority of mainstream Android phones). It currently doesn’t support x86 CPU’s (it will during release, but will be marked ‘Experimental’). I get between 18-22FPS on my Galaxy S3 running a 1920x1080 preview. Pretty decent performance. Now on to OpenGLES3!
EDIT: Also in the works in Android IL2CPP support. Currently working with a few issues. Will all be resolved in the release.
EDIT: NatCam should now work with OpenCV on Android GLES2 devices. On both ARM and x86 CPU’s.
Hello guys. Unfortunately, NatCam v1.0f1 will not include video recording support. This decision was made considering the amount of development time, and also challenges that will arise in video playback.
Wow, I can’t believe my luck, I’m trying to build an image scanning app, and have been working on a native plugin for a few days, and really getting frustrated with the lack of progress. The fact you’re working on one as we speak is pretty damn amazing!!
My needs are simply a performant camera preview, with the ability to take a hi-resolution auto-focused picture when the user taps a button, along with optional flash support. I’m using OpenCV to detect scanned documents, and would only need to run it on the final, captured image, not on the entire image preview.
Any ideas on a timeline for release? Please hurry up and take my money!