How to apply props/ mask(like snapchat) on face using real camera in swift? - camera

I am working on a snapchat like app where user will be able to apply filters on his face or multiple faces. Minimum iOs support is iOS 12 , device support : iPhone 6 & above. Please let me know how to implement this.

Related

ImageView for all iPhones in Common Sizes [duplicate]

This question already has answers here:
Images for iphone 5 retina display
(5 answers)
Closed 9 years ago.
So typically on storyboard, you assign an imageview with the image you want (foo.png) and then the phones automatically upsize to the retina version if one is on the iPhone 4 or 4s (foo#2x.png).
The question is, how do you get an image to display properly on a 4'' iPhone 5? It is all out of whack when I try it in the simulator and Apple has yet to address this situation with a simple solution as they did with the Retina display of the iPhone 4's. Any help? Thanks!
iPhone 5 support can be added very simply by adding a default#2x-568.png file to your project. Beyond that, it is only a case of making certain the app scales to a new size correctly. Make sure your views accomodate to the new size either programatically, or by setting springs and struts correctly in your UI archives (XIBs or Storyboards as appropriate). You shouldn't need any new images (*). If you already
support retina devices, then you only need to add the new splash screen as above.
(*) If you do for whatever reason, I'd recommend reading this answer:
ios6 UIImageView - Loading -568h image
Apple doesn't provide a good way of using different images on the iPhone 5, because you aren't supposed to use any!

AVCaptureSessionPresetHigh resolution on iPad?

I need to know what the AVCaptureSessionPresetHigh resolution is for the newest iPad, and for all various devices for that matter. Apple's documentation has a chart that explains what the various resolutions are for the different presets, but only for the iPhone 3, 3GS, and 4. That chart is here: http://developer.apple.com/library/mac/#documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/04_MediaCapture.html
Is there somewhere else where this is recorded for the rest of the devices? I haven't been able to find it anywhere.
I've tested the AVCaptureSessionPresetHigh and with iPad 4 it returns me the resolution of 1280x720!
Cheers
I tested with iPad 3 (Retina) and it returns 1280x720.
BTW, the AVCaptureSessionPresetHigh is the default for AVCaptureSession.

Thumbnail MKMapView without Google Logo

I am in the process of developing a thumbnail MKMapView to show a singular point on the map. However, as the thumbnail is only 70x61px, the google logo takes up a large proportion of the map.
Please can you tell me a way of using the MKMapView so that the google logo is less visible or can't been seen, but avoiding app rejection, or any alternatives to using the MKMapView?
Thanks in advanced.
How it looks at the moment:
Have you looking into the Google Maps Static API? It returns regular jpeg maps rather than interactive ones. You might be able to craft a URL that gets you a small enough image for your thumbnail. I don't know whether that would be ok according to their license or not.
Start developing with the iOS 6 beta. There are significant changes to MapKit that removes Google as the data provider (and thus their logo). The final version of iOS 6 and it's SDK will be released in the next couple of weeks. So you will also be good to go submitting an iOS 6 app soon.

Live Face Recognition iOS adding 3D object

I need to create an iOS 5 application will run on iPad2 (I can use private API because the App will not be released in App Store) will show live stream from front camera, recognize eyes and render a pair of glasses (I have the 3D model) following face movements.
Which is the best approach and the best technology (e.g. OpenGL ES) I can use?
Just use the libraries included in XCode. I have a sample here. It's got everything you need.
It uses the AVFoundation, CoreImage, CoreMedia, and CoreVideo frameworks.

How to programmatically start front camera of iPad?

I would like to start front camera of the iPad when app starts.
How do I do it programmatically?
Please let me know.
First thing you need to do is to detect if your device has got front-facing camera. For that you need to iterate through the video devices.
Try this method of UIImagePickerController:
+ (BOOL)isCameraDeviceAvailable:(UIImagePickerControllerCameraDevice)cameraDevice
This is a class method and UIImagePickerControllerCameraDevice can take two values:
- UIImagePickerControllerCameraDeviceRear
- UIImagePickerControllerCameraDeviceFront
Example code:
if( [UIImagePickerController isCameraDeviceAvailable: UIImagePickerControllerCameraDeviceFront ])
{
// do something
}
Note that this is available for iOS 4.0 and later.
Also I am not sure if there is any API's to start the front-facing camera up front. The camera always seems to start in the same mode that the user left it the last time it was used. Maybe by design Apple did not expose any API's to change this. Maybe Apple wanted the users to make a call on this.
Nevertheless you can atleast detect the availability of Fron Camera & provide your feature.
If I understand your question correctly, all you have to do is open your Camera to be in Front Mode instead of Rear Mode, so write this inside the method where you call the picker for the first time:
picker.cameraDevice=UIImagePickerControllerCameraDeviceFront;
Hope this answers your question.