Getting the full camera view - ios

When your taking a photo with a camera, your not getting all the camera view right?
I mean in a portrait photo take
I will have much more hight then a landscape photo:
Where ill have much more width, right?
But the camera is a circle so that means the the image can be actuality taken with a larger area, I mean the hight and the width together!
The camera is probably getting the hole image, but cropping it according to the screen, landscape or portrait.
If i would like to get the full image that the camera is getting, how can i achieve that?
Any suggestions would be much appreciated, thanks!
Edit
After a long search that came out with nothing so far, even if someone knows about a way to display a landscape camera, in a portrait mode, that would help to.
What i mean is display a view were there is more to see on the left and right sids, hope i'm clear enough with my question..

Actually, the sensor has roughly the same proportions as the screen. Its aspect ration is around 1.33 (4/3) or maybe 1.5 (3/2), depends on the phone model. the only round thing in the camera is the lens that projects a circle of light around the sensor. When you rotate your phone the sensor is naturally rotated as well so you always get the full output in every shot.

Related

Know if picture is Selfie or Portrait

I'm coding an app where users can upload pictures and add some filters to it.
The problem is that when I apply filter on it, the picture is rotating, ONLY if the picture has been taken with back camera.
If it was a selfie the picture is not rotating
If the picture is in portrait mode, the picture is not rotating
The problem is that I don't know how I could get these information, in order to rotate the picture only when I need it.
You're thinking about this the wrong way. It may be the case that images taken with your phone's rear camera appear rotated after applying a filter, but you cannot make this assumption for all devices. Instead, you can read the imageOrientation property on UIImage to obtain information about whether the image has an unusual rotation.

How to set zoom level of camera using AVFoundation framework in IOS?

I am developing a custom camera in which the camera is set to the Image Capture mode. I need to increase the zoom level of camera preview according to the app requirements. The preview currently being displayed is perfect I just need to increase the zoom-out in current preview. I searched over internet but didn't find any solution. Please tell me how can I do this. I am attaching the example image for better understanding. first image is of my camera app and second image is of Scanner Pro app which shows view with more covered area while I focus both the apps for the same object on the same distance. My camera don't have any space but the Scanner camera has spacing all over the image. Both the camera are on the same distance from the paper.
i don't know whether you still need this answer. Probably not, but still for you and everyone else looking out:
When you set the Session Preset, try using SessionPresetPhotofor the device object. This should resolve the weird zoom issue.
Your preview view is probably spilling over the edge of the screen. Make sure it is a 4:3 aspect ratio and that it doesn’t overflow your screen edges. With that you should see more of your image.

How do you capture full screen camera photos on iOS?

On Snapchat, it allows you to take a full screen camera photo on iOS. The preview is full screen, and the image returned is full screen. There appears to be no cropping/stretching/etc... What you see is what you get.
Now I've looked all over the place, and I can't figure out how this is actually being done, seeing that the iPhone camera always returns an image with an aspect ratio of 4:3. Yes, you can use the camera view transform to have a full screen "preview", but the image returned is still 4:3 and needs to be cropped.
So my question is, how do you take a full screen camera photo on iOS without cropping? If your answer is that it can't be done, then how is Snapchat doing it (or appearing to do it)?
Snapchat isn't displaying everything the camera is picking up. By cropping a bit from the top/bottom or sides, they can create a 16:9 image from a 4:3 image. This is easy to verify.
Open up the snapchat and camera apps so it's easy to switch between them.
Place your phone on its side pointed at something with some marks for reference points.
Switch between the apps without moving the phone. There is content that you do not see on Snapchat.

determining ios camera aspect ratio

I was wondering if anyone knew of a way to get the aspect ratio of an iOS camera BEFORE a picture is taken. I've done some reading and it seems the a 4/3 aspect ratio is pretty common on the devices but was not sure if that was true for all devices or what the deal was. I know you can figure it out after taking a picture but I am looking for a way to determine it before doing that.
Thank you
EDIT:
Judging by the responses I've gotten so far I think I need to clarify my question. The aspect ratio of the iOS camera is a physical property of the camera that is independent of the orientation a picture is taken in. Does anyone know how to get this ratio before/without taking a picture.
As of iOS 7 you can get the dimensions of video/camera:
CGSize size = CMVideoFormatDescriptionGetPresentationDimensions(camera.activeFormat.formatDescription, YES, YES);
Where camera is the AVCaptureDevice* object for the camera.
There is also CMVideoFormatDescriptionGetDimensions(). Unfortunately, this doesn't seem to be the same as the camera images. On my iPhone 4S (iOS 7), ...GetDimensions() returns 1920x1080, which does not seem to be the same dimensions returned from AVCaptureStillImageOutput. However, the aspect ratio is correct.
If you are looking for the aspect ratio for the correct size for AVCaptureVideoPreviewLayer, you don't need to worry. Just set the frame to whatever frame you want to fit it in, and it will center the preview with the correct aspect ratio automatically. On iOS 7 it has a clear background, so it all just works.
for swift
let sizeCamera = CMVideoFormatDescriptionGetPresentationDimensions(backCamera.activeFormat.formatDescription, usePixelAspectRatio: true, useCleanAperture: true);
You could try fetching the last photo in the camera roll and see what its aspect ratio is.
This assumes:
1) your app has camera roll access
2) the last photo was actually taken on the current device

UIImagePickerController that allowsEditing incorrectly crops the image leaving a black bar across the top

I'm using UIImagePickerController in a popover on the iPad to take a picture with the front camera. I set allowsEditing to YES and get the awesome built in "Move and Scale" view after taking the picture. The crop rectangle in this view measures 320x267 on the screen despite the fact that the image is cropped to a 320x320 square (http://dl.dropbox.com/u/2246698/moveAndScale.png). If i accept the image as is without resizing or moving it, there is a ~25px high black bar across the top as if the crop rectangle has been positioned too high on the image (http://dl.dropbox.com/u/2246698/cropped.png). In fact, if i get that crop rectangle from the media info dictionary (via UIImagePickerControllerCropRect) it shows that the y origin of the crop rectangle is at -39. This seems broken that the image would be incorrectly cropped by default and usually when it seems broken it's because i did it wrong. Has anyone ever seen this or know of some setting to twiddle that will be good for my crops?
Many thanks.
I see the exact same behavior. It MUST be a bug, but if it is, I don't know why more people aren't complaining about it. Another problem with it is that you can't move the picture to the edges to crop to include that part--it always slides back to the middle.
If you zoom it, then you can move it, but you can never move it far enough to be able to include the left or right edges.
The thing is next to useless.

Resources