Formula for converting between f-number and numerical aperture

Artists use f-number (f#). Scientists use numerical aperture (NA). I use both.

f# = sqrt(1/NA^2 – 1)/2
NA = 1/sqrt(4f#^2  + 1)

Yeah!!!

For quick mental approximations, the following can also be used and is easier to remember:

f# ≈ 1/(2NA)
NA ≈ 1/(2f#)

It took me 3 years to reach this 10th post.

Growing with your photography: stepping out of auto mode

Thousands of photographs I have taken in the past are taken to simply "record information". A camera records light from a scene, so it is just natural. Events, places, people, even technical info and "evidence material", all sort of things I want to look back to someday, these are among the things I have recorded.
All is well and good until thee day, that I decided to create a Flickr account. I realized that most of my photos look so dull and boring! I'm just lucky to be in the right place and the right time for about 5.13% of my shots, so they are interesting enough to be shared.

Auto pilot

Technology has made it so easy to take photographs, that we got too dependent on it. Good cameras that are almost new are being sold second hand since people are finding out that phones are already good. We don't have too fiddle so much, and if we get it wrong, we know right away, and just take another shot. Even the most advanced cameras have shortcuts meant for the common consumers. Auto mode is too convenient and comfortable that a lot of us never grow out of it. And that's fine and acceptable for a lot of us. Democratization has a lot of benefits and the world today would be different if it is difficult for average people to capture and share their special moments.
For years, I already had a very capable Canon point & shoot. I considered myself as one of the average, casual occasional camera person so I had only used the scene modes and auto mode until just recently. What is Tv? Television? And is Av audiovideo?? When I dial into these modes, the picture just gets dark so what's the point? I just go back to Auto, if what I'm shooting does not fit in one of the scene categories, i.e. flower mode, face mode, mountain mode & running mode. Just go with what my friends always say, "just use auto".

When auto fails

With live view LCDs behind cameras, you can easily compare what has been shot and what is in the real world. And except for gently but brightly illuminated outdoor scenes and inside buildings where the lighting electric bill is not a concern, there is always something noticeably different in the photographs taken in auto mode. Some parts are either too dark or too bright. And if you're unlucky, the whole picture is either too dark or too bright. Fortunately, most interesting scenes happen when there is enough light.
Oh, another thing is that blown-out flash! The camera is smart enough to figure that there is little light on the scene, so it adds its own, with unpredictable results (or perhaps predictably rubbish). I don't get to see a lot of this in my collection as the results are so useless that they are immediately deleted after previewing.

Blurry and noisy

And just delete if it is also under or over exposed. Shooting in low light might be the holy grail for casual shooters. When it's dark, the camera just decides to use more time to take the picture so any small motion of my hands will motion blur the shot. Is that the moon? Or just some white odd oval? And what are all those speckles?
Even in good light, photographs can get blurry. I realized this when I handed my camera to another person to take pictures of me and set the camera in "portrait mode." So how can we avoid this mishaps? As it turned out for me, the answer was to know your camera more. A good start is to know what parameters in a camera can be changed and how the different shooting modes play with these parameters.

Knowing your camera more

Auto SPAM

It's jsut more memorable that way. The abbreviations of the modes actually differs between manufacturers. As I started with Canon, I have Tv and Av instead of S and A. You most likely know already what "Auto" does. Just to make more sense of these abbreviations, here is what they stand for:
  • S or Tv: Shutter or Time priority
  • P: Program mode.
  • A or Av: Aperture priority
  • M: Manual.
Switching to one of these modes allow the shutter speed (S) or aperture (A) or both (M) to be adjusted. Typically, there are buttons or dials in the camera that would allow the user to incrementally change the values of these, instead of letting the camera decide. My mistake before was to switch in one of these modes, then that's it, treating it as another scene mode, unaware that I have to do further fiddling when in these modes. I blamed the condition of whatever picture appeared in the screen to that mode instead of the settings of the mode. Now that I know more, the default settings for aperture and shutter speed when I just dialed to these modes, and which I did not change, are likely not the best for the scene. But what is shutter speed and aperture in the first place?

Shutter speed (or exposure time)

This controls the amount of time the camera is collecting light. If a scene is dark, a longer exposure time will help brighten up the photo like leaving a glass below a faucet for a longer time will collect more water. If something is moving while during the shutter's open time, motion blur would be captured. Fast shutter speeds help prevent this motion blur by not giving the subject enough time to move. There is also motion blur caused by shaky hands supporting the camera. To avoid the effect of shaky hands either use fast shutter speeds, or be more stable like using a tripod if slow shutter speeds are needed.

Aperture

This controls the amount of light that comes in per unit time. As the word suggests, aperture is an opening. Like curtains in a window, the less curtains are covering the window, the brighter the room gets. Unlike shutter speed, the words used to quantify aperture variations are lesser known. WTF are those F numbers?? For now it is enough to know that the LOWER f-numbers correspond to a BIGGER open window in your camera allowing MORE light to come in. Perhaps the tricky part here is getting accustomed with the bigger f-numbers allowing less light. Aperture actually does more than adjust the brightness, but that's a topic for another day, and the other effects are less pronounced with point and shoot or phone cameras (which AFAIK have unchangeable apertures).

ISO

Where did that came from?? I'm moving ahead but ISO is part of the holy trinity of photographic exposure that also includes shutter speed and aperture. The so called "exposure triangle". These trio is something you would always see with photos in Flickr (if the user decides to share it) so they're probably important. Despite being part of the triangle, cameras typically have a different approach for changing the ISO compared to shutter speed and aperture and it might be buried deep in the camera's setting menu system.
ISO controls how sensitive the camera would be. In dark conditions, higher ISO's help see things. However, a more sensitive camera is also more sensitive to noise. Just like a more sensitive microphone due to a higher input level will pickup more background noise (hiss) that we normally do not hear. This explains why pictures taken in the dark with automatic/semi-automatic modes can end up noisy. The scene may not look noisy to our eyes, but there is also noise in the camera itself!
ISO sensitivity can be tweaked independently of the SPAM modes. The ISO can be set to a fixed value or to automatic. If the ISO is in auto, the camera would figure it out for you, given the other settings you fix. Personally, I prefer to use the lowest ISO possible and compensate by being very steady with slower shutter speeds, especially if there's a tripod available or if I can rest the camera on some flat support like a fence, wall or furniture top.

All of these 3, shutter speed, aperture and ISO, will affect how much light is captured in the picture and have their respective trade-offs. It is up to the camera user to decide which to prioritize, whether to go for less hand shake motion blur or less noise. With these 3 quickly introduced, we may now go back to the less automatic camera modes.

Auto SPAM modes

Auto

The camera's brain takes over, deciding what aperture, shutter speed ans ISO should be. Some extra settings such as white balance and timer can still be tweaked. Manual focusing might also be disabled, making it a problem in difficult situations like in low light or abstract and empty scenes. Flash control might even be disabled. But if the flash is the type that mechanically pops up, you can just keep it down if you don't want it.
The rest of the SPAM modes allow custom focusing like manual or macro (for close objects). There are also special scene optimized modes which are aimed to be user friendly and which I had been using for years. These scene modes differ from camera to camera. Some camera intended for beginners only have automatic and the scene modes and no SPAM (hooray!).

Shutter priority (semi-automatic)

This camera mode lets you decide how long the exposure would be and the camera decides the settings for aperture and ISO (if automatic) to get what the camera thinks is the "good" exposure.

Program mode (semi-automatic)

Program mode is probably the next easiest mode to try after automatic. It's like automatic, but will respect your set ISO, allows you to change the focus and overall exposure (general "brightness" of photo). The camera decides the shutter speed and aperture to come up with a "good" exposure given the other things you tweaked. Some cameras even allow the user to adjust either aperture or shutter speed while in this mode then it will respectively adjust the other setting for you to still end up with the overall set exposure.

Aperture priority (semi-automatic)

This camera mode lets you decide how big the aperture would be and the camera decides the settings for aperture and ISO (if automatic) to get what the camera thinks is the "good" exposure.

Manual (yeeha)

You control the aperture and shutter speed. The ISO can actually still be automatic, so you might also decide to set a fixed value for this for greater control.

Moving forward

It will take some practice to tweak around these 3 settings to get the picture that you want. You might not get the combination right at first, but at least you are in control of both your failure and success and not blindly relying on the camera's decision making and getting disappointed when it fails. There are things in the camera that can help. There is an exposure gauge where you try to put the mark at the middle meaning that it is not under (left) or over (right) exposed. Some cameras have tone mapping feature wherein the live view screen updates to approximate what the final photo would look like. As aperture had little noticeable effect besides brightness in my camera or in the stuff that I shoot, I first delved into shutter priority and played around with long exposures. Unlike in the days of film, practice is easy and you're free to take photos around your home while experimenting with such settings. When practice is over, you can simply delete the test shots, unless something worth saving comes out of it.
These days, manual is now my default setting. It make me think artistically and it gives me the photos that look the way I want them. But when I don't want to think and fiddle around and just capture the damned moment as it happens, or when I'm just capturing to document "evidence" automatic and preset scene modes are still good. If I still need some control, but still don't want to be left behind by the fast pace of things, program mode is also cool.

Kingsoft Office FTW!

Some things are just so mind-blowingly awesome that you have to blog about them after along period of hiatus. So, the story begins when I upgraded my home laptop with an SSD and changed from a 32 to 64 bit Windows 7 (without reactivating online by using Advanced Tokens Manager). A lot of software had to be reinstalled. I decided to install the latest MS Office (2010) available from my workplace, but it is now using a network based activation (or atleast I have to install it while on the network? haven't tried yet). I manage a bit using Abiword for word processing, but it is far from MS Word. When I had to open Excel files, Gnumeric came to mind, but I also didn't quite like it as far as I remember. So I looked up at Wikipedia for free spreadsheeet alternatives, and that's when I found out about Kingsoft Office.

Why Kingsoft Office is different?

Kingsoft office stands out because it tries its best to not be different ... from MS Office. Anyone familiar with recent MS Office products would easily find their way through Kingsoft Office. This is unlike Openoffice (and all it's other forks, e.g. Libre) or Softmaker Freeoffice, Abiword or Gnumeric that are excellent software in their own respect, but disregard the fact that everyone else uses MS Office.
Kingsoft Writer showing a formatted document from some sciency journal. Things render pretty well. Notice the familiar interface. This is one of those cases when being a "ripoff" is actually a good thing.
Furthermore. if you're not familiar with all the ribbon interface of MS Office 2007, a "classic" GUI (i.e. MS Office 2003 or earlier) is also an option!

File compatibility

Between Softmaker and Kingsoft Office, Kingsoft handles MS Office files better. I had opened a 16MB thesis that made Softmaker crash. Tracked changes and vector graphics are also screwed up Softamker.
I haven't tried with Openoffice yet as I don't want to install it on my fresh new OS. It also seems I have to uninstall Softmaker in the end, as it doesn't provide a convincing advantage over Kingsoft.

Why Kingsoft Office is not the same?

Having explored the GUI similarity and document compatibility, Kingsoft Office is not totally the same either since they try to improve whereever possible, like the "tabbed browsing" interface for multiple documents. It also has free Android and iOS apps. I'm pretty sure I have heard about Kingsoft Office for tablets long way back, but I ignored it since there are a lot of tablet office suites that gets you can't decide (in the words of good old Alvin Toffler, "overchoice").

What is still lacking, needs fixes or is unknown to me?

  • A MAC/OSX version. It is weird that they have Linux and iOS but no OSX, also since their website shows a Macbook Pro running KSO (the "everything looks cool with Apple" effect). It is on the plans, nonetheless.
  • An equation editor similar to that of MS Office 2007 and above. The current equation editor is (very) similar to Equation Editor/Mathtype.
  • Minor things I noticed (not exhaustive):
    • The  English dictionary seems to miss a lot of words.
    • View new window opens another instance of another document in another tab.
    • Compatibility with MS Office's 3D/rotation effects  for shapes/drawings
  • I haven't explored yet
    • Integration with third party software, e.g. Mathtype equation editor or Mendeley reference manager.
    • If I wish to support or get the 60usd pro version, is whether purchasing a pro version has to be done each time a new version is released or whether it is a one time payment for all versions to come.

Conclusion

Kingsoft Office would probably now be my de facto recommendation for a free alternative MS Office. It simply stands out due to its GUI familiarity and MSO file compatibility.



Context adaptive numeric input for functions

When reusing functions coded long ago, I often ask myself "does my function take in numbers in this unit or that unit?" Different units can be used to express the quantities of the same type of object. And some pairs of numbers and units are easier to remember than other pairs for example:
  • half second vs 22050 samples (audio)
  • 10 seconds vs 300 frames  (video)
  • 220 instead of 1048576 (sizes that could be FFT'ed easier)
Most of the time the number will only make useful sense when it's associated with a particular unit. For example you would immediately know that 22050 seconds would be ridiculous in an audio application's context. Hence, I started to write "smart" functions that guess the proper unit based on the magnitude of the input and the normally used magnitudes and reasonable thresholds. For example:

function fftSomething(data, size)

if(size < 20)

       size = 2size

end if 

bla bla bla...

end function ffTSomething

Of course, I could have done a unit conversion before using the function. It would also be more difficult to use unusual numeric values. Things could go wrong if someone doesn't know that the function is doing this. But as for my personal programming, wherein I only deliver the results and not the code, where saving in thinking time is preferred over strictness and efficiency, where I know what typical values are used, this style works for me.

Misleading advertising is bad advertising

How many times have you (almost) downloaded crapware because you are mislead in what you thought was the download link to a file you're interested to? Whether it is actually crap or not, software that try to fool you to get themselves installed is annoying. The converse argument for "you get what you ask for" is that "you don't get what you don't ask for". And you shouldn't. Such strategy is almost like a trojan virus but using subtle social engineering/psychology tricks instead. For me, the worst part of this scheme is that they assume people are stupid. Whether or not they are offering a legitimate product, I don't care anymore and just blacklist them.
The same goes for software that gets side installed while you are installing something else. An example is Babylon toolbar, which goes further by modifying the homepage of your web browser. It turns out to be legit, even having a Wikipedia entry (well, they could have made that too). I suspect that it's relatively high Alexa rank (30 as of writing this) is just due to the infected browsers. This usually happens if you just keep clicking the default common sense options in installation programs, which is totally not your fault since that is perfectly fine in many cases. Now, you have to be more alert while installing software or browsing the web.
Look at the image of the supposed ad below. Can you tell what do they offer? (This ad appears in a wordpress.com blog, which puts ads on blogs if you're using a free account, whether or not you sign up for it. So you might as well sign up for it and at least get paid.)


Is that the download link powered by iliVid? NO! That wouldn't lead you to the file you want, but would instead give you a download link of their video software. After seeing a few of this before, I learned to avoid it. And finally blocked the website in my computer.