29 December 2011

Casual Consumer Photography Musings

I am neither a professional nor an amateur photographer, but a common man who uses his phone cameras and point-and-shoots. Here are some of my musings related to photography, which are possibly meaningless or wrong.

Digital Zoom

Many point-and-shoot and phone cameras discourage digital zoom. For example, Android cameras set at max resolution don't allow digital zoom beyond that. The reason is that, the image can be cropped any time later during post-processing.
This is true for camera's that store images in lossless/RAW formats. Otherwise quite some detail is lost, when the image is compressed in camera, and then later when cropped and blown-up("digital zoomed") in a PC. If we digital zoom on the camera itself, before compressing the image, more details could be retained! I could see that digitally zoomed image on my point-and-shoot is better than zooming in later during post-processing.


Creating panoramic images was too hard long back, but not any more. My phone camera which has an accelerometer, but doesn't have a gyroscope is able to stitch and generate low-res panoramas in no time. Latest phones and cameras all have gyroscopes and do a better job with this.

I tried clicking panning few panoramas in my friends marriage hall with my phone.

And I feel that this format of very ultra-wide-angle is the best/must format for covering marriages! Hope wedding photographers/videographers would start adding panoramas to the mix. If you are planning to spend a lot on wedding photography, ask for panoramas/super-duper-ultra-wide-angle high-resolution shots.

180°/360° Panorama Videos

Awed by the panoramas from my phone. I wanted to shoot panorama videos i.e., videos with 180° or more FOV. Imagine placing/hanging a 360° Video camera in the center of the wedding hall.
One way to do it would be to create an circular array of cameras and stitch the videos together later. Another way could be to have a shining Christmas tree ball/convex hemispherical mirror and shoot a video of the image on it with a camera, and later post process it to do distortion correction. The same could be achieved by shooting on a camera with a fish-eye lens. Even better would be to use a circular fisheye lens and get a 360
° (on one axis) video. Or 2 or more such cameras to create the complete 360x360 video. I found few 360x360 stills, but no videos. Also found few uncorrected 360°(single axis) videos.

I am trying to shoot pics/video using all shiny balls, door handles now :) I also tried to shoot videos simultaneously with 3 cameras phones with limited FOV, and tried stitching them together. Even when they are stitched badly, it has a good effect.

Lens and focal length

All the photographic equipment manufacturers use focal length for lenses, even on those that are targeted at consumers. With variety of sensor sizes, it doesn't seem to make sense at all. How does it matter to me, what is the focal length? Why cant they just mention the FOV instead? Focal length is an implementation detail, I am not interested in.

Might be continued

Will be continued, if more thoughts on fast-frame rate cameras that help creating super slow motion videos(which can be another nicety in marriage coverage), Light field cameras, 3D cameras and dreams of combining these together like 360
°x360° Super slow motion 3D light field video will continue to occupy my mind...

30 January 2011

Real hackweek, protected hackweek and long hackweek

I have been using KVM a lot, but never took time to understand how kvm works. I used some time from this hackweek to get rid of that regret.

Virtual Machine eXtensions instructions allow trap-and-emulate virtualization. And KVM exposes VMX in a convenient way to userspace in Linux. Virtual Machine Monitors(VMM) like qemu-kvm use the KVM API exposed by linux to emulate virtualize software.

x86_64 processors boot in real-mode. In this mode it can use only 16-bit addresses, ie., upto 1MByte RAM. The execution would begin at physical address 0xFFFFFFF0. Then the software has to switch to protected mode where protection and paging is possible. Paging is optional, but almost all OSes use demand paging extensively. Now 4 GBytes of linear address space is used. And then CPU can be switched to long mode i.e., 64-bit mode. Paging should be disabled in 32-bit mode, before switching to long mode. There are also other modes of operation like virtual-8086 mode to allow executing legacy real-mode software from protected mode, SMM for OS transparent execution of OEM specific code.

I had limited time and very very limited skill at hand. So aiming for the sky was not an option. Hence wrote a very simple VMM that directly starts the guest at address 0H, in 32-bit protected mode with paging disabled. And supports only insb and outsb as the only form of interaction possible for the guest. The guest is a simple static linked 32-bit program that doesn't use any library, and linked to start from 0x0. The guest simply reads a byte using insb and sends byte+1 back via outsb. The guest would halt, when it gets the, "Answer to the Ultimate Question of Life, the Universe, and Everything". The VMM reads the byte value to pass to the guest from stdin and prints its response in stdout.

The KVM API is really very easy to understand and use. But some knowledge of the processor was required to make use of it. Intel manuals helped there. I don't have good understanding of things yet, but something is better than nothing.

I was occupied by quite a lot of things in life and work in the recent past. So I wasn't really planning to participate and make this a real hackweek. Also a National holiday for Republic day of India, bang in the middle of the week prevents this hackweek from being a long hackweek! But seeing videos of my colleagues from various parts of world having fun, I couldn't resist and decided to go for the virtual hackweek. I thank my employer for giving me this protected hackweek, and let me learn/do things protected from everyday work.