Reproduce the new scanning feature in iOS 11 Notes - ios

Does anyone know how to reproduce the new Notes new scanning feature in iOS 11??
Is AVFoundation used for the camera?
How is the camera detecting the shape of the paper/document/card?
How do they place the overlay over in real time?
How does the camera know when to take the photo?
What's that animated overlay and how can we achieve this?

Does anyone know how to reproduce this?
Not exactly :P
Is AVFoundation used for the camera? Yes
How is the camera detecting the shape of the paper/document/card?
They are using the Vision Framework to do rectangle detection.
It's stated in this WWDC session by one of the demonstrators
How do they place the overlay over in real time?
You Should check out the above video for this as he talks about doing something similar in one of the demos
How does the camera know when to take the photo?
I'm not familiar with this app but it's surely triggered in the capture session, no?
Whats that animated overlay and how can we achieve this?
Not sure about this but I'd imagine it's some kind of CALayer with animation
Is Tesseract framework used for the image afterwards?
Isn't Tesseract OCR for text?
If you're looking for handwriting recognition, you might want to look for a MNIST model

Use Appleā€™s rectangle detection SDK, which provides an easy-to-use API that can identify rectangles in still images or video sequences in near-realtime. The algorithm works very well in simple scenes with a single prominent rectangle in a clean background, but is less accurate in more complicated scenes, such as capturing small receipts or business cards in cluttered backgrounds, which are essential use-cases for our scanning feature.
An image processor that identifies notable features (such as faces and barcodes) in a still image or video.
https://developer.apple.com/documentation/coreimage/cidetector

Related

I want to detect motion/movement in the live camera. How can i do it?

I'm creating motion detect app for ios. when camera on live any object passes the camera like person , animal. than i want detect motion feature. how's it possible?
I suggest you get familiar with the AVFoundation framework to understand how to get live video frames using the camera of an iOS device. A good starting point is Apple's famous sample AVCam, which should get you familiar with all the camera concepts.
As the next step, figure out how to do the movement detection. The simplest algorithm for that would be the background subtraction. The idea is to subtract two consecutive frames one from another. The areas without movement just cancel each other and become black, while the areas with movements show some nonzero values.
Here's an example of background subtraction in the OpenCV framework.
If in the end, you decide to use OpenCV (which is a classic Computer Vision framework which I definitely recommend), then you'll need to integrate OpenCV into your iOS app. You can see a short tutorial here.
I tried to show you some pointers which could get you going. The problem (how you presented it) is definitely not an easy one, so good luck!

iOS AVFoundation - is it possible to add text/image into the video via position/motion tracking?

I am aware of how to add text / image overlay into a video on iOS with AVFoundation.
Is there some way to do this using position/motion tracking of certain objects / areas in the video?
What exactly is this type of video editing feature called?
Let's say I have a video of a car moving from left to right. I want to place an image of another car at the position of the original car so that as the car in the video is moving from left to right, my image follows on top of that car. I would also want this to be properly skewed as the car moves from left to right.
Another example would be a video of a monitor. And me placing an image on the screen of that monitor.
Please let me know if I need to explain further.
Other than iOS is there some other library which is able to do this? Like ffmpeg?
What you're broadly looking for is Object Recognition, which is a fairly complex topic in it's own right and part of the field of Computer Vision.
AVFoundation includes support for Face Detection and does a fairly reasonable job of it https://developer.apple.com/reference/avfoundation/avmetadatafaceobject but that's about it.
To do what you're trying to do, I'd start with OpenCV (which includes support for iOS) and investigate from there http://opencv.org/
You're not going to find a literal "find me a car" API, what you will find is lots of different algorithms which are implemented that allow you to train them and detect the objects they are trained for. One potential algorithm is using Haar Cascades. There's more detail on working with those and training your own classifier here https://github.com/andrewssobral/vehicle_detection_haarcascades

Motion Sensing by Camera in iOS

I am working on an app in iOS that will occur an event if camera detects some changes in image or we can say motion in image. Here I am not asking about face recognition or a particular colored image motion, And I got all result for OpenCV when I searched, And I also found that we can achieve this by using gyroscope and accelerometer both , but how??
I am beginner in iOS.So my question is , Is there any framework or any easy way to detect motion or motion sensing by camera.And How to achieve?
For Example if I move my hand before camera then it will show some message or alert.
And plz give me some useful and easy to understand links about this.
Thanx
If all you want is some kind of crude motion detection, my open source GPUImage framework has a GPUImageMotionDetector within it.
This admittedly simple motion detector does frame-to-frame comparisons, based on a low-pass filter, and can identify the number of pixels that have changed between frames and the centroid of the changed area. It operates on live video and I know some people who've used it for motion activation of functions in their iOS applications.
Because it relies on pixel differences and not optical flow or feature matching, it can be prone to false positives and can't track discrete objects as they move in a frame. However, if all you need is basic motion sensing, this is pretty easy to drop into your application. Look at the FilterShowcase example to see how it works in practice.
I don't exactly understand what you mean here:
Here I am not asking about face recognition or a particular colored
image motion, because I got all result for OpenCV when I searched
But I would suggest to go for opencv as you can use opencv in IOS. Here is a good link which helps you to setup opencv in ios.
There are lot of opencv motion detection codes online and here is one among them, which you can make use of.
You need to convert the UIImage ( image type in IOS ) to cv::Mat or IplImage and pass it to the opencv algorithms. You can convert using this link or this.

Facedetection in iOS

I'm currently working on a project, where I need to detect a face and then take a photo with the camera. (after the camera focused everything correctly).
Is something like this possbile in iOS?
Are there any good tutorials on this?
i would suggest to use opencv for this as it has proven algorithm and fast enough to work on image as well as video
https://github.com/aptogo/FaceTracker
https://github.com/mjp/FaceRecognition
This solution will work for android too using opencv port to android.
Use GPUImage for face detection.
Face detection example is also available in GPUImage.
see last point in FilterShowCase example project of GPUImage for face detection.
iOS 10 and Swift 3
You can check apple example you can detect face
https://developer.apple.com/library/content/samplecode/AVCamBarcode/Introduction/Intro.html
you can select the face metedata to make camera track the face and show yellow box on the face its have good performace than this example
https://github.com/wayn/SquareCam-Swift

Detect custom image marker in real time using OpenCV on iOS

I would like some hints, maybe more, on detecting a custom image marker in a real-time video feed. I'm using OpenCV, iPhone and the camera feed.
By custom image marker I'm referring to a predefined image, but it can be any kind of image (not a specific designed marker). For example, it can be a picture of some skyscrapers.
I've already worked with ARTags and understand how they are detected, but how would I detect this custom image and especially find out its position & orientation?
What makes a good custom image to be detected successfully?
Thanks
The most popular markers used in AR are
AR markers (a simple form of QR codes) - those detected by AR tookit & others
QR codes. There are plenty of examples on how to create/detect/read QR.
Dot grids. Similar with the chess grids used in calibration. It seems their detection can be more robust than the classical chess grid. OpenCV has codes related to dot grid detection in the calibration part. Also, the OpenCV codebase offers a good starting point to extract 3D position and orientation.
Chess grids. Similar to dot grids. They were the standard calibration pattern, and some people used them for marker detection of a long time. But they lost their position to dot grids recently, when some people discovered that dots can be detected with better accuracy.
Note:
Grids are symmetrical. I bet you already know that. But that means you will not be able to
recover full orientation data from them. You will get the plane where the grid lies, but nothing more.
Final note:
Code and examples for the first two are easily found on the Internet. They are considered the best by many people. If you decide to use the grid patterns, you have to enjoy some math and image processing work :) And it will take more.
This answer is valid no more since Vuforia is now a paid engine.
I think you should give Vuforia a try. It's a AR engine that can use any image you want as a marker. What makes a good marker for Vuforia is high frequency images.
http://www.qualcomm.com/solutions/augmented-reality
Vuforia is a free to use engine.

Resources