Firebase MLKit Text Recognition with Live Camera in iOS - ios

I am trying to build an iOS application that uses Firebase MLKit to recognize text from live camera frame.
I found an Android sample here.
https://medium.com/digital-curry/firebase-mlkit-textdetection-in-android-using-firebase-ml-vision-apis-with-live-camera-72ef47ad4ebd
Does anyone know good sample in iOS?

Text Detection From Firebase MLKit:
You can find demo code for Image to Text conversion using Firebase MLKit in iOS.
https://github.com/sayaleepote/TextDetect
For live recognization, you can create a custom camera and take a picture in the background periodically and detect a text from an image.
Custom Camera View for Capture Images:
For custom camera view, you can use below sample code.
Link: https://github.com/AlexLittlejohn/ALCameraViewController
Note: You can achieve this feature using iOS native MLKit + Vision framework
Refer This link for iOS native framework.
https://stackoverflow.com/questions/50918310
Let me know if you have any query.
Thanks.

Related

create dynamic camera overlay that changes with scences

Hi I am new to IOS developing. I've been searching for a while, just can not find a good example.
I like to create an app dynamically detect paper,
The app should be able to generate dynamic camera overlay by analysing current camera scenes.
like Adobe Scan.
I can program the sampling and detection algorithm myself,
but really not good on the IOS interface and technique.
I am using objective-C as programming language.
I like to know:
1, how to change the camera overlay in real time?
2, how should i put a ticker that repeatedly check camera scenes?
3, how can I access and modify a picture from iOS objective C?
Please give me some ideas or show me some examples.

read text from camera using vision framework ios

I want to programmatically read numbers on a page using mobile's camera instead from image, just like barcode scanning. I know that we can read or scan barcode but is there any way to read numbers using same strategy.

Is there any way to capture video or image from Unity (which use Vuforia) iOS application?

I have an Augmented Reality functionality made using Unity + Vuforia plugin which I integrated into the iOS application. The app uses the camera as background and when you navigate camera to some marker 3D object will appear on it.
My task is to add buttons which will start and stop capture video (or image) from the camera. The output should be a video with camera scene + 3D object.
I made some investigation, but the only solution I found is to convert the view of AVCaptureVideoPreviewLayer on which camera preview is showing to a video (or image). But from my opinion, this solution is inefficient and not flexible.
Is there any way to get a current instance of the AVCaptureSession from Unity (or maybe Vuforia plugin)? Or maybe there is another way to solve my problem?
Any pieces of advice or guides will be very helpful.
I don't think you should use AVCaptureSession to get the preview and even do the capture operation in Cocoa-Touch instead you should capture the image in Unity and pass the data to Cocoa-Touch native API.
Here is the link how to capture the screenshot in Unity.

Virtual reality content capture in iOS and Swift

I am looking into VR using Native swift, found some interesting ways to port google cardboard SDK but want to reach out and see if anyone has experience in this, specifically capturing panoramic images using an iPhone and converting them into VR content.

Unity3D on iOS, inspecting the device camera image in Obj-C

I have a Unity/iOS app that captures the user's photo and displays it in the 3D environment. Now I'd like to leverage CIFaceFeature to find eye positions, which requires accessing the native (Objective-C) layer. My flow looks like:
Unity -> WebCamTexture (encode and send image to native -- this is SLOW)
Obj-C -> CIFaceFeature (find eye coords)
Unity -> Display eye positions
I've got a working prototype, but it's slow because I'm capturing the image in Unity (WebCamTexture) and then sending it to Obj-C to do the FaceFeature detection. It seems like there should be a way to simply ask my Obj-C class to "inspect the active camera". This would have to be much, much faster than encoding and passing an image.
So my question, in a nutshell:
Can I query in Obj-C 'is there a camera currently capturing?'
If so, how do I 'snapshot' the image from that currently running session?
Thanks!
You can access the Camera's preview capture stream by changing CameraCapture.mm in unity.
I suggest that you have a look at some existing plugin called Camera Capture for an example of how additional camera I/O functionality can be added to the capture session / "capture pipeline".
To set you off in the right direction. have a look at the function initCapture in CameraCapture.mm :
- (bool)initCapture:(AVCaptureDevice*)device width:(int)w height:(int)h fps:(float)fps
Here you will be able to add to the capture session.
And then you should have a look at the code sample provided by Apple on Facial Recognition :
https://developer.apple.com/library/ios/samplecode/SquareCam/Introduction/Intro.html
Cheers
Unity 3D allows execution of native code. In the scripting reference, look for native plugins. In this way you can display a native iOS view (with the camera view, possibly hidden depending on your requirements) and run Objective C code. Then return the results of eye detection to Unity if you need it in a 3D view.

Resources