Saturday, April 17, 2010

Slow Motion Video with the Canon 7D (or 5D Mk II) for FREE.

Slow motion video from the new DSLRs like the Canon 7D and the Canon 5D MkII is possible using the cameras' 60fps mode to capture and then playing it back at either 24fps (film speed) or 30fps.

The problem for me, though, was find an inexpensive and simple way to do that conversion on my Mac. If possible, I didn't want to have to use After Effects or Final Cut Pro to do it. Unfortunately, nearly all the ways I found on the web involved use of these high-end apps...until I came across QT Sync.

QT Sync does a lot of other cool things with Quicktime .MOV files (the Canon 7D and 5D MkII write .MOV files with the H.264 video codec to encode the video stream). But I was interested in the fact that it can losslessly adjust the frame rate of a video clip. And doing so is trivially easy.

Here's a simple how-to on using QT Sync to convert that cool 60fps video you've captured into a high-quality, high-definition slow-mo clip ready for in you editing apps:


  • 1) Download QT Sync from their website: qtsync.com and install the app.



  • 2) Launch QT Sync and click "Open..." from the File menu to open your video to process.

  • 3) With the video opened, click "Change Movie Playback Speed..." from the Edit menu.

  • 4) From the dialog box that pops up, choose the new frame rate from the pop-op menu or type in a custom frame rate as desired and click "OK." Note that QT Sync does not do anything with/to the actual frames, it just changes the way other apps will see the frame rate. Hence, no loss in quality.

  • 5) Save your newly modified file as a self-contained movie.


That's it! Feel free to import the newly saved file into your favorite editor and it'll see it as though it were to be played back at the new rate. For a conversion of 60 frames per second to 24 fps, the clip is now running 2.5x slower (40% speed). For 30fps, it's now 2x slower (half speed). That's nice slow-motion without frame blending...all thanks to the cool Canon 7D and 5D MkII cameras and a little Mac OS X app. 

Here's an example. It's not a particularly spectacular video (from my son's pinewood derby districts), but it shows the idea (60fps --> 24fps):



Best of all, QT Sync is free.

Sure, for even more advanced slow-mo, there's always software like the Twixtor plug-in for Final Cut Pro or After Effects, and if you want that level of control you probably don't need this tip. But for those searching the web as I was for a quick-n-dirty solution, hopefully this will help.

--DCP

[Note: At the time of this post, I was using QT Sync v.0.3.3 on Mac OS X Snow Leopard 10.6.3 with no problems.]

UPDATE:

There's a problem with the above solution if you want to use the clip with Final Cut Pro. Even when run through the process above, when the clip is imported into FCP, the clip plays back as the original 60fps video.

So I've found an even more direct (and also free) solution: Apple's own Dumpster.app. Dumpster for Macintosh is a little app for editing Quicktime movie headers. Specifically, we can edit the headers to losslessly change the clip to a 24fps clip that will be recognized as such in Final Cut Pro.

Here's a step-by-step solution:

  • Download and launch Dumpster from Apple's developer website.
  • From Dumpster's File menu, open your movie clip from the 7D.
  • On the screen that appears, click on the "mvhd" field. The values we want to change here are 'preferredRate', 'timeScale', and 'duration'. Converting from 60fps to 24 fps, the values should be 2.5 for the preferredRate (2.5x slower), the timeScale should be changed from 60000 to 24000 (for 24fps), and the duration should be 2.5 times the current duration. In this example, my clip was 524524 so 2.5 x 524524 = 1311310, which is the new duration.
  • Now click on "mdhd" under the first "trak" field.
  • Again, change the timeScale from 60000 to 24000, and change duration to 2.5 times the current duration (e.g., 524524 becomes 1311310)
  • Example result:


  • Now "Save" the file. 
  • Voila! A file that will work in Final Cut Pro, too.

Labels:

Sunday, September 6, 2009

BMW Radar Detector Hardwire


Well, this post has nothing to do with photography (although that shot above is a shot I took of my new vehicle), but I thought I'd post some shots and description of how I hardwired a Cobra radar detector into my BMW 335i Coupe.

One of the problems with simply plugging a radar detector into most cars, and especially into the bimmer, is that it necessitates hanging some ugly cord across the dashboard and into a cigarette lighter socket. Such an installation creates several layers of hideousness: the inelegant cord, the obstruction of various controls and displays, and some compartment hanging open with a lighter plug protruding from it... not exactly what the car designers had in mind.

Hardwiring it in—while improving the aesthetics—creates its own challenges. I especially did not want to do any warranty-voiding mods on my new ride. Here's one solution, inspired by this guy's approach.

Conveniently, the 2009 BMW 335i Coupe (E92) has the fusebox right behind the glovebox. This is where we'll tap into an unused circuit. The back of the glovebox is held in place by two simple quarter-turn knobs and easily pops off to expose the fusebox. The only challenge now is to find an empty fuse slot that is powered when the cars is turned on, but not when the car is turned off (to avoid draining the battery, obviously).

Trial and error with a multitestor (volt-ohm meter) will identify an available circuit. In the case of my car, fuse slot #5 fit the bill. In case you're interested, there's a little fold-out diagram attached to the back of the glovebox panel that shows what each fuse is intended for.

Now comes the important part: to tap into the circuit, get ahold of a part known as an Add-A-Circuit. They come in both ATC (full size) and ATM (mini size), so for fuse #5 I bought the mini (ATM) version. I found mine at AutoZone for about $6. This little part plugs into the fusebox and has a slot for a fuse and a positive lead extending from it to which you can add any 12 volt device... in our case, the radar detector.My Add-A-Circuit is made by Bussman, but Littelfuse (yes, that's spelled correctly) also makes one. I added a 10 amp fuse since that's what I had on hand, but fewer amps would have been sufficient for a radar detector.

I didn't want to cut into my radar detector's cord either, so I ended up cannibalizing a lighter socket extension cord from RadioShack that I had on hand to create a lighter socket in the glovebox. FWIW, the positive lead is the tip of the socket and the ground is the ring of the socket.

For the ground connection, I crimped and soldered a ring connector to the negative lead from the lighter socket. For ease of attachment, I cut out part of the ring as shown in the photo so that I could just loosen the grounding screw rather than remove it completely. The grounding screw takes a #27 TORX bit (maybe a #30 Torx would work, too, but I didn't try it since the #27 was adequate).

With the Add-A-Circuit wired up, it was simply a matter of plugging in the Add-A-Circuit into fuse slot #5, screwing down the grounding bolt to the ring connector, and bringing the attached cigarette lighter socket forward into the glove box (see photo).

After that, I replaced the glovebox panel, plugged in the radar detector's power cable, and passed the cable out through the back of the glovebox toward the base of the right A-pillar.
The cord runs in the weather stripping around the door, over the right edge of the dash and is tucked into the gap where the windshield meets the dash board. The following pictures show it in place (along with a 20GB iPod, of course).

All in all, a very inexpensive project that requires minimal skills and minimal time and yet gives a much cleaner look to the passenger compartment: no cables dangling about and I can keep the front console's ashtray/cigarette lighter bay
closed.

Saturday, November 3, 2007

DIY Light Probes and Cheetah 3D

Well, I recently came across a terrific 3D app for Mac OS X called Cheetah 3D. I'm still playing with the demo mode, but I've long been intrigued with a rendering technique called image-based lighting, where a "light probe" image is used to render ultra-realistic lighting of a 3D model. Cheetah 3D supports image-based lighting with light probes so I thought I'd check it out.

A light probe is really nothing more than a mirrored sphere, since such a sphere is capable of capturing (nearly) 360 degrees of a scene both vertically and horizontally. But in order to be maximally useful, the probe image must capture the full dynamic range of the light in the scene (i.e., it must be a high dynamic range image or HDRI). Photoshop CS3 and CS2 have no problem merging multiple exposures of a photograph into a 32-bit HDRI, so this is the software I chose to use.

The source of the light probe couldn't be simpler or cheaper: a 7.5 inch diameter plastic giant Christmas ornament from Target for $2.50. And even though the geometry of the probe is somewhat iffy, it works absolutely beautifully. Here's a very quick How I Do It on making your own HDRI light probe images for use in 3D software such as Cheetah 3D and many others:

1) Mount the light probe on a stick and place it in the scene. Here I've simply duct taped it to a bamboo stake we had handy Being a giant Christmas ornament, it had a little nub on it for the tree hanging part. [My wife is standing in as my trusty model in our backyard earlier this evening.]:




2) Take a series of bracketed photos of the sphere to cover the whole dynamic range of lighting present. Tips: mount the camera on a tripod far from the ball and use a long telephoto lens to keep yourself as small in the reflection as possible so as to be almost invisible.




3) Merge the photos to an HDR image in your favorite HDR software (e.g., Photoshop CS2/3, Photomatix, etc.):




4) Keep the image as a 32-bit HDR file, but if you're gonna use it in Cheetah 3D, be sure to flip the photo horizontally to get accurate reflections.

5) Trim it down to a sphere with cropping tools and save it as a Radiance image (.hdr file extension):




6) Cheetah 3D can import native .hdr files like this in its HDRI render settings. Just be sure to set the image type to "probe" in the Cheetah 3D menu:



I won't go into all the details of using Cheetah 3D, but here's a quick demo movie of what can be done with these HDRI light probe images. Note the reflection of the probe droid in the rightmost sphere. The rightmost sphere is also rendered in Cheetah 3D and is strikingly similar to the actual photographed sphere in the scene:



Labels: , , ,

Wednesday, May 9, 2007

Data Recovery with (free) PhotoRec in OS X

Imagine my horror when I went to process the photos on my memory card only to find that they were gone. And these weren't just any photos, but rather a day's worth of before and after photos of patients (in my real life, I'm a facial plastic surgeon).

Now, "after" photos are one thing...patients could always come back for more picture-taking, even though many come from hours away. But "before" photos on patients treated later that same day can never be re-shot, of course. So due to what I suspect was corruption of the directory structure, only the previous day's images were on the card.

Now, since I had reviewed the photos on the camera back when I shot them, I suspected that the data was still there, just inaccessible through either the camera's interface or my computer's OS. So I started scrounging the web for memory card photo recovery utilities when I came across a little gem called "PhotoRec"..and it was freeware!

Sure, I found a freeware app called "EXIF Untrasher," but it only recovered JPEGs, and I shoot in RAW. And there were a few nice shareware and commercial apps like "PhotoRescue" ($29.00) and "CardRaider" ($19.95) that can recover RAW, but I wanted something FREE and PhotoRec fit the bill.

Now, granted, the pay apps have nice GUIs while PhotoRec runs in the UNIX shell in a text-based interface, but it requires little interaction and gets the job done. It also runs on just about any common OS platform from Mac OS X to Windows to Linux to Solaris, etc. Most importantly, it also recovered the entire card of RAW files including some I thought I'd gotten rid of ages ago.

Here are the simple steps to running this under Mac OS X (FWIW, photos on the card were shot in Canon RAW and camera's CF card was mounted via a card reader under Mac OS X 10.4.9):

(1) Download PhotoRec v6.6 here. Don't worry that it's also a download for an app called TestDisk, which I haven't played with (yet).

(2) Uncompress the file testdisk-6.6.darwin.tar.bz2

(3) Inside the folder that results, you will find a folder called "darwin" that contains the UNIX executable called (unsurprisingly) "photorec".

(4) Double-click photorec to launch it into the terminal and here's what you'll see:



(5) Select the volume that represents your memory card and hit return to Proceed. In this case, /dev/disk1, is what we want.

(6) At the next screen, which looks like this:



select the partition table, which should be fine at the default setting of "Apple partition map" and hit return to get to this screen:



(7) "Search" will be highlighted. Hit return to start file recovery and you'll see this:



(8) "Other" should be highlighted and should work just fine (or at least it does for me with my setup). This will take you to the last step where you select what directory to recover to, in which case the default folder should be fine. Just select "Y" at this screen:



It will then start processing your memory card and saving what it finds to a folder called "recup_dir.1"

(9) Sit back or go make a sandwich and come back to a folder full of recovered files (hopefully)...which in my case meant a dozen patients' photos perfectly pulled from the digital ashes.

Anyway, it ain't a pretty app and it's not for the faint of heart or those uncomfortable with the Terminal, but it worked beautifully for me (and my patients). Whew!...

Labels: , , , ,

Saturday, April 14, 2007

Better "Dark Frame" Subtraction in Photoshop

Night photography brings with it a number of unique challenges (not the least of which is tripping over your gear in the dark), but one such nuisance are so-called "hot pixels." Hot pixels are the bane of any long exposure digital photography, including night photography and astrophotography, and typically they appear as star-like bright specs in the image. From what I understand, they arise from "thermal noise" within the image sensor. Technological specifics aside, you'll generally find that the longer the exposure, the more likely you are to see these spots (they look a little like stars, but they never move).



The most common way to deal with them, though, involves shooting what's called a "dark frame" which can then be digitally subtracted from the original image to eliminate the hot pixels. A dark frame is made by shooting an image of equal duration (shutter speed) to the original shot, but with the lens cap on so that the frame is completely black ("dark") except for the sensor noise and hot pixels. Some cameras, in fact, do this automatically for exposures beyond a certain length. [Note: you don't put the lens cap on...the camera simply closes the shutter and exposes the equal exposure time dark frame which is then subtracted in-camera].



But there's a big problem with this simple approach: the subtraction turns the hot pixels into black holes or black spots (something minus the same something equals zero which equals black). Now, for astrophotography, this is not so much of an issue since a black spot against a black sky is basically invisible. But for those of us shooting night photography this can be a real pain when odd black specs appear on illuminated subjects. (see image below)



What we really need is a way to fill in the hot pixels with a blend of the surrounding pixels to better conceal their removal. But in a quick search of the web, I couldn't find a Mac OS X compatible program or Photoshop action that would do what I want. Sure, there are several apps out there for Mac (e.g., the very cool and uncrippled shareware, Keith's Image Stacker, for OS X) and for Windows, but all just do simple subtraction. The exception to this is a freeware app called BlackFrame NR but it only runs on Windows [grrrr...].

What follows is my own little method I devised. I've made it into a freeware Photoshop action which can be easily tweaked to your camera's specific behavior and should work under Windows and Mac OS X, but I've only tried it under Photoshop CS for Mac. You can download my Hot Pixel Remover here, but I'll explain it below since I don't provide any documentation (hey, it's free, so don't complain).

First, in Photoshop CS open the original image, hot pixels and all. It will occupy a layer called "Background". Next, open the dark frame image, select all (Cmd-A) of it, copy it (Cmd-C) and paste it into a new layer over the original image. The dark frame, now called "Layer 1" should thus be in perfect registration with the Background layer. Now simply run my Hot Pixel Remover action, wait a few seconds, and voila, no more hot pixels and no more black holes.

Here's what it's doing:

1) It starts by making a duplicate of the original layer and applying a median blur of about 5 pixels (Filter-->Noise-->Median...) which should average out the hot pixels, which is good. But it also averages out lots of image detail, which is bad. But here's where the magic comes in: we're going to use the dark frame as a transparency mask to only show through those areas of the blurred image that correspond to a hot pixel.

2) The dark frame layer is curves-adjusted (Image->Adjustments->Curves...) to clip the very darkest 15 levels so that we can enhance only the hot pixels.

3) The dark frame is then desaturated to grayscale (Image->Adjustments->Desaturate) and then an Auto Contrast (Image->Adjustments->Auto Contrast) is performed to punch up the hot pixels.

4) The hot pixels are then selected (Select->Color Range...) in such a way as to select based on closeness to black.

5) This selection is then applied as a transparency mask to the median-blurred layer by clicking on the "Add layer mask" button in the layers palette.

6) The dark frame is then turned off and the result is a nicely cleaned up photo.

Below is the final result (a closeup crop) which shows neither hot pixels nor black holes. Nice!



Remember, this is just a version 1.0 attempt at this, so there may be some bugs under certain circumstances. Please let me know if there are. Maybe this will inspire someone to come up with a better way. (But best of all for me is that it's quick, free, and works on my Mac!) Again, you can download "Faceman's Hot Pixel Remover.atn" here.

Labels: , , ,

Wednesday, March 14, 2007

Gel Mod for Quantaray MS-1 Slave Flash



I recently was given a couple of Quantaray MS-1 flash boosters. If you haven't seen them, they're basically simple, dirt-cheap, optically-triggered slaves. (See Steve's Digicams for a nice review of this item) Anyway, I wanted a simple way to add colored gel effects to these slaves without ruining the slaves in the process.

The colored gels were made by creating a PowerPoint presentation with blank slides filled with various solid colors and then having a local A/V presentation company create the slides for me. By making mounted slides out of them the gels are durable and easy to handle.

The clear plastic I chose was some left over Crystalite Polycarbonate (an acrylic similar to Plexiglas, but a bit stronger) from an unrelated project. It's 1/8th inch thick and comes in big inexpensive sheets at your local lumber superstore like Home Depot or Lowes. I could have used Lexan which is much more scratch resistant and about twice the price, but I didn't have any on hand.

This is the $19.95 Quantaray MS-1 slave flash. For twenty bucks it's nothing fancy: it trips on the first flash it sees, dumps a full flash output every time and is powered by two AAA batteries. (You can notice the battery hatch in the bottom left corner in this picture).



Here a piece of Crystalite Polycarbonate (better than Plexiglas, not as good as Lexan) has been cut to shape and the edges sanded for smoothness.



The clear plastic panel has been mounted to the unit with hot melt glue. Note the positioning: the plastic piece extends beyond the top of the slave flash unit by an amount equal to the width of the 35mm slide mount's top border.



Close-up detail of the hot melt glue used to attach the plastic.



A simple small binder clip, easily found in any office-supply store is used to clip a colored 35mm slide as a gel. Note that it exactly covers the flash's output window.



At twenty bucks a piece, why not make a couple of these? Here magenta and cyan gels have been placed.



Incidentally, I made the photo of the bottle of lidocaine at the top of this post by implementing Strobist's excellent $10 DIY Macro Studio setup as shown below. BTW, if you haven't been to the Strobist's site, make sure to stop by. It's absolutely packed with some of the best flash photography concepts and techniques you'll ever come across.



[Note: to avoid tripping these dumb slaves with your dSLR's pre-flash, make sure your main flash unit is in manual mode, not TTL. (In manual mode, most flashes—such as my Sigma EF-500 DG Super on my Digital Rebel—will not pre-flash.]

Labels: , , , ,