Sunday, February 22, 2009

Nikon D90 SDK hack and liveview image captures


So I downloaded Nikon's camera control SDK code, and built a sample program. Its pretty cool!

It allows one to set/reset pretty much all the menu items that one can do with the on camera menu system.

The one interesting test I did was to fetch liveview images off the camera by setting different zoom ratios in sequence.. so I was saving what would be shown on the rear LCD directly onto my computer. The results matched with earlier observations that the D90 firmware interpolates from a very low resolution buffer image when zooming in: to me that low res size seems to be 640x480 pixels. Here are the actual dumped files, in increasing zoom ratio, from 1X, 2X, 3.3X, 5X, 6.6X (max allowed on camera), and 10X (only allowed via SDK):

1X

2X

3.3X

5X

6.6X

10X



As can be seen, its a simple interpolation mechanism.. most probably a bilinear one.. that causes the zoomed in images to look jaggy upon zooming in. This is almost like a total digital zoom, with the source image being only 640x480 pixels. Imagine making 100 pixels (10x10) out of a single one in increments! So out of other things, one of the reasons for D300 being pricier than a D90 would be this: in D300, the zoomed in image in live view doesnt look so badly interpolated.

Here is a related thread if anyone is interested. I wonder if it does Nikon any good to have such poor interpolation scheme from a 640x480 buffer. For everything else, its such a fantastic camera. But then nothing is perfect in this world, is it? :-)

6 comments:

  1. Thanks for the great info Prash. I just downloaded the Nikon SDK, and I was wondering if I could get a quick code sample to help me get jump started (between work and family my hours are a bit limited, so any help in getting over the initial hump of setting up the C++ project area and compiling would help immensely)

    Thanks and Best Regards,

    Prashant Singh
    pksingh.d700@gmail.com

    ReplyDelete
  2. Hi Prash,

    I am looking for a similar code. I understand that the sample code for Nikon D90 has Live View Image but since the sample is CUI it does not have live image displaying capability. It will be a great help for me if you can share the code with me.

    Thanks and warm regards
    Tanmay Chakraborty
    2tanmaychakraborty@gmail.com

    ReplyDelete
  3. Hi Prash,

    I am a NEWBEE in this DSLR area.
    I looking for some source code for help me
    to start up.
    could you please share the code with me?

    Thanks.
    Chulkyu Shin
    schulkyu@gmail.com

    ReplyDelete
  4. i want to complete my final semester project, can any one help me to send NIKON SDK..?

    sa.gdagwadar@gmail.com

    ReplyDelete
  5. i Bought a digital camera Nikon Coolpix L840, but there is no any SDK available.
    i want to liveView from camera to PC, any one help me about SDK and Sample Code in vb.net

    or email me at sa.gdagwadar@gmail.com
    thank you.

    ReplyDelete

Thank you for leaving a comment on my blog. Please feel free to share any information you find relevant here.