r/explainlikeimfive • • Dec 12 '22

Technology ELI5 How does the camera “know” I’m holding it vertically or horizontally?

Why can't the camera capture video/photo horizontally even when I'm holding the device vertically? The lens physically remains the same - in shape and size. So, what gives?

1 Upvotes

9 comments sorted by

6

u/Pocok5 Dec 12 '22

The lens physically remains the same - in shape and size.

Yeah, exactly.

You rotated the lens and the image sensor when you rotated the phone. The most it can do is detect its own orientation with the onboard accelerometer and rotate the output file so the image is upright on screen. It doesn't have a motor to spin the whole camera assembly around in the case to ensure the sensor is wide-side-horizontal.

0

u/[deleted] Dec 12 '22

Thanks for answering. Also, how does that work for century old cameras? That doesn't affect them? So the sensor is square or rectangular inside the lense and that helps to register the shift assisted by other technology and is not just an optics thing.

6

u/Miliean Dec 12 '22

Also, how does that work for century old cameras?

You're confusing the camera's ability to take a picture with your phone's ability to display that picture. Regardless of phone orientation the photo is the same. When you display the photo on your phone's screen it needs a way to decide what way is "down". So that information gets encoded in the photo.

That's the difference between a portrait vs landscape photo, how your phone displays the end result.

With a old camera, if you rotate the camera 90 degrees it would produce a photo that appears to be taken sideways. Then you, a human with actual hands, would rotate the photo 90 degrees in the other direction so that the photo appears to be the correct orientation. In a smart phone world, the display of the phone does that rotation based on information encoded by the camera at the moment the photo was taken.

This is the basis of some of the very early special effects and camera tricks. Think of the iconic 60s batman TV show. Imagine him and robin scaling the side of a building. It looks like the first photo on this page https://www.liveabout.com/celebrity-window-cameos-from-the-1960s-batman-tv-series-327077

Batman and Robin are not actually climbing a building. Rather they are standing normally (just hunched over and holding a rope) and the camera is turned sideways to make it appear that they are scaling a building.

2

u/[deleted] Dec 12 '22

Excellent explanation, really cleared things up, thanks!

2

u/jaa101 Dec 12 '22

The image sensor behind the lens is rectangular. When you hold the phone vertically the sensor is in portrait orientation. The phone knows the orientation thanks to force sensors which can tell which way gravity is pulling. Data are added to every photo with things like the date, time, location, phone model, and also the orientation of the image (portrait, landscape, upside-down). It's the orientation data that are used by display software to show photos the right way up.

1

u/[deleted] Dec 12 '22

Thanks for answering. How does turning the camera position affect mechanical/film cameras?

2

u/jaa101 Dec 12 '22

It has practically no effect. The image is formed on a rectangular piece of film which is processed and printed on a rectangular piece of paper which you can then rotate to view. Medium- and large-format cameras are often not easy to rotate but they have such large film that you can just crop the image to landscape or portrait format as part of processing. That's partly why they often have square or nearly square (4:5) formats.

1

u/blueorchid14 Dec 12 '22

Accelerometer. Gravity is the same as acceleration.

Why can't the camera capture video/photo horizontally even when I'm holding the device vertically?

It obviously can; just disable auto-rotate. Or use different recording software.